new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · API · all subjects

session/methods

69 notes in this subject, read out of this brain and free to use. This is page 2 of 2.

session.loadExtension() example

const { app, session } = require('electron') const path = require('node:path') app.whenReady().then(async () => { await session.defaultSession.loadExtension( path.join(__dirname, 'react-devtools'), { allowFileAccess: true } ) })

session.removeExtension() deprecated

The removeExtension(extensionId) method is deprecated. It unloads an extension. It accepts extensionId as string - ID of extension to remove. This API cannot be called before the ready event of the app module is emitted. Use the new ses.extensions.removeExtension API instead.

session.getExtension() deprecated

The getExtension(extensionId) method is deprecated. It returns Extension | null - the loaded extension with the given ID, or null if not found. It accepts extensionId as string - ID of extension to query. This API cannot be called before the ready event of the app module is emitted. Use the new ses.extensions.getExtension API instead.

session.getAllExtensions() deprecated

The getAllExtensions() method is deprecated. It returns Extension[] - a list of all loaded extensions. This API cannot be called before the ready event of the app module is emitted. Use the new ses.extensions.getAllExtensions API instead.

session.getStoragePath()

The getStoragePath() method returns string | null - the absolute file system path where data for this session is persisted on disk. For in-memory sessions this returns null.

session.clearData() parameters

The clearData([options]) method accepts an optional options object with the following properties: dataTypes (string[], optional) - the types of data to clear; valid values are backgroundFetch, cache (includes cachestorage and shadercache), cookies, downloads, fileSystems, indexedDB, localStorage, serviceWorkers, webSQL; origins (string[], optional) - clear data for only these origins (cannot be used with excludeOrigins); excludeOrigins (string[], optional) - clear data for all origins except these ones (cannot be used with origins); avoidClosingConnections (boolean, optional, defaults to false) - skips deleting cookies that would close current network connections; originMatchingMode (string, optional) - the behavior for matching data to origins with values 'third-parties-included' (default) or 'origin-in-all-contexts'.

session.clearData() cookie behavior

Cookies are stored at a broader scope than origins. When removing cookies and filtering by origins (or excludeOrigins), the cookies will be removed at the registrable domain level. For example, clearing cookies for the origin https://really.specific.origin.example.com/ will end up clearing all cookies for example.com. Clearing cookies for the origin https://my.website.example.co.uk/ will end up clearing all cookies for example.co.uk.

session.clearData() shared dictionary cache behavior

Clearing cache data will also clear the shared dictionary cache. This means that any dictionaries used for compression may be reloaded after clearing the cache. If you wish to clear the shared dictionary cache but leave other cached data intact, use the clearSharedDictionaryCache method instead.

session.registerLocalAIHandler() experimental

The registerLocalAIHandler(handler) method is experimental. It registers a local AI handler UtilityProcess. It accepts handler as UtilityProcess | null. To clear the handler, call registerLocalAIHandler(null), which will disconnect any existing Prompt API sessions and destroy any LanguageModelUtility instances.

Give your agent this brain