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 · all subjects

extensions & debugging

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

ses.loadExtension() is deprecated, use ses.extensions.loadExtension

The ses.loadExtension(path[, options]) method is deprecated. It accepts path (string) - path to a directory containing an unpacked Chrome extension, and options (optional) with allowFileAccess (boolean) - whether to allow the extension to read local files over file:// protocol and inject content scripts into file:// pages (required for loading DevTools extensions on file:// URLs, defaults to false). Returns Promise<Extension> that resolves when the extension is loaded. This method raises an exception if the extension cannot be loaded. Warnings during installation are logged to console. Electron does not support the full range of Chrome extension APIs (see Supported Extensions APIs). Extensions are not remembered for future application runs; loadExtension must be called on every boot. This API does not support loading packed (.crx) extensions. Cannot be called before the ready event of the app module. Loading extensions into in-memory sessions is not supported. Use the new ses.extensions.loadExtension API instead.

ses.loadExtension() code example with React DevTools

const { app, session } = require('electron') const path = require('node:path') app.whenReady().then(async () => { await session.defaultSession.loadExtension( path.join(__dirname, 'react-devtools'), // allowFileAccess is required to load the DevTools extension on file:// URLs. { allowFileAccess: true } ) // Note that in order to use the React DevTools extension, you'll need to // download and unzip a copy of the extension. })

ses.removeExtension() unloads extension by ID

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

ses.getExtension() returns extension by ID

The ses.getExtension(extensionId) method is deprecated. It accepts extensionId (string) - ID of extension to query and returns Extension | null - the loaded extension with the given ID. Cannot be called before the ready event of the app module. Use the new ses.extensions.getExtension API instead.

ses.getAllExtensions() returns list of loaded extensions

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

ses.extensions property provides Extensions API for session

The ses.extensions property is readonly and provides an Extensions object for this session.

Give your agent this brain