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

security & sandboxing

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

app.enableSandbox() method

app.enableSandbox() enables full sandbox mode on the app, meaning all renderers will be launched sandboxed regardless of the sandbox flag in WebPreferences. Can only be called before app is ready.

app.isSecureKeyboardEntryEnabled() method

app.isSecureKeyboardEntryEnabled() is available on macOS. Returns boolean indicating whether Secure Keyboard Entry is enabled. By default returns false.

app.setSecureKeyboardEntryEnabled() method

app.setSecureKeyboardEntryEnabled(enabled) is available on macOS. Takes enabled boolean parameter. Enables or disables Secure Keyboard Entry in the application. Prevents sensitive information like passwords from being intercepted by other processes. Should only be enabled when needed and disabled when no longer needed.

app.setClientCertRequestPasswordHandler() method

app.setClientCertRequestPasswordHandler(handler) is available on Linux. handler is Function<Promise<string>> that receives clientCertRequestParams Object with: hostname string (hostname requiring client certificate), tokenName string (token or slot name of cryptographic device), isRetry boolean (whether there were previous failed attempts). Handler returns Promise<string> that resolves with the password. Called when password is needed to unlock client certificate for hostname.

app.setClientCertRequestPasswordHandler() example

Example of using app.setClientCertRequestPasswordHandler(): const { app } = require('electron'); async function passwordPromptUI (text) { return new Promise((resolve, reject) => { // display UI to prompt user for password resolve('the password') }) } app.setClientCertRequestPasswordHandler(async ({ hostname, tokenName, isRetry }) => { const text = `Please sign in to ${tokenName} to authenticate to ${hostname} with your certificate`; const password = await passwordPromptUI(text); return password; });

Give your agent this brain