Session 'will-download' event
Emitted when Electron is about to download an item in webContents. Returns event (Event), item (DownloadItem), webContents (WebContents). Calling event.preventDefault() cancels the download and item will not be available from next tick.
Session 'extension-loaded' event
Emitted after an extension is loaded and added to the enabled set of extensions. Returns event (Event), extension (Extension). This occurs when extensions are loaded from Session.loadExtension, reloaded from a crash, or reloaded when the extension requested it via chrome.runtime.reload().
Session 'extension-unloaded' event
Emitted after an extension is unloaded. Returns event (Event), extension (Extension). This occurs when Session.removeExtension is called.
Session 'extension-ready' event
Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page. Returns event (Event), extension (Extension).
Session 'file-system-access-restricted' event
Emitted when file system access is restricted. Returns event (Event), details (Object with origin string, isDirectory boolean, path string), callback (Function). The callback accepts action string: 'allow' (permits access despite restricted status), 'deny' (blocks access and triggers AbortError), or 'tryAgain' (opens file picker for another path).
Session 'preconnect' event
Emitted when a render process requests preconnection to a URL, generally due to resource hints. Returns event (Event), preconnectUrl (string), allowCredentials (boolean indicating if credentials are requested).
Session spellcheck dictionary events
The session emits four spellcheck dictionary events: 'spellcheck-dictionary-initialized' (when hunspell dictionary is initialized), 'spellcheck-dictionary-download-begin' (when download starts), 'spellcheck-dictionary-download-success' (when download completes), 'spellcheck-dictionary-download-failure' (when download fails). Each returns event (Event), languageCode (string).
Session 'select-hid-device' event
Emitted when a HID device needs to be selected during navigator.hid.requestDevice. Returns event (Event), details (Object with deviceList [HIDDevice[]], frame [WebFrameMain|null]), callback (Function taking deviceId string|null). Callback with no arguments cancels the request. Device permissioning can be managed with setPermissionCheckHandler and setDevicePermissionHandler.
Session 'hid-device-removed' event
Emitted after navigator.hid.requestDevice and select-hid-device fire if a device is removed before the select-hid-device callback is called. Returns event (Event), details (Object with device [HIDDevice], frame [WebFrameMain|null]). For use updating UI to remove the specified device.
Session 'hid-device-revoked' event
Emitted after HIDDevice.forget() is called. Returns event (Event), details (Object with device [HIDDevice], origin string optional). Can be used to maintain persistent storage of permissions when setDevicePermissionHandler is used.
Session 'select-serial-port' event
Emitted when a serial port needs to be selected during navigator.serial.requestPort. Returns event (Event), portList [SerialPort[]], webContents [WebContents], callback (Function taking portId string). Callback with empty string cancels the request. Device permissioning can be managed with setPermissionCheckHandler and setDevicePermissionHandler.
Session 'serial-port-added' event
Emitted after navigator.serial.requestPort and select-serial-port fire if a new serial port becomes available before the select-serial-port callback is called. Returns event (Event), port [SerialPort], webContents [WebContents]. For use updating UI with newly added ports.
Session 'serial-port-removed' event
Emitted after navigator.serial.requestPort and select-serial-port fire if a serial port is removed before the select-serial-port callback is called. Returns event (Event), port [SerialPort], webContents [WebContents]. For use updating UI to remove the specified port.
Session 'serial-port-revoked' event
Emitted after SerialPort.forget() is called. Returns event (Event), details (Object with port [SerialPort], frame [WebFrameMain|null], origin string). Can be used to maintain persistent storage of permissions when setDevicePermissionHandler is used.
Session 'select-usb-device' event
Emitted when a USB device needs to be selected during navigator.usb.requestDevice. Returns event (Event), details (Object with deviceList [USBDevice[]], frame [WebFrameMain|null]), callback (Function taking deviceId string optional). Callback with no arguments cancels the request. Device permissioning can be managed with setPermissionCheckHandler and setDevicePermissionHandler.
Session 'usb-device-added' event
Emitted after navigator.usb.requestDevice and select-usb-device fire if a new device becomes available before the select-usb-device callback is called. Returns event (Event), device [USBDevice], webContents [WebContents]. For use updating UI with newly added devices.
Session 'usb-device-removed' event
Emitted after navigator.usb.requestDevice and select-usb-device fire if a device is removed before the select-usb-device callback is called. Returns event (Event), device [USBDevice], webContents [WebContents]. For use updating UI to remove the specified device.
Session 'usb-device-revoked' event
Emitted after USBDevice.forget() is called. Returns event (Event), details (Object with device [USBDevice], origin string optional). Can be used to maintain persistent storage of permissions when setDevicePermissionHandler is used.
Session 'select-webauthn-authenticator' event (macOS only)
Emitted when both touchID and platformPasskeys are configured via app.configureWebAuthn and a WebAuthn request needs to choose which platform authenticator to use. Returns event (Event with relyingPartyId string, authenticators string[] with possible values 'touchID' and 'platformPasskeys', frame [WebFrameMain|null]), callback (Function taking authenticatorName string|null optional). Callback with no arguments or non-matching name cancels the request. If no listener is registered, platformPasskeys is used by default.
Session 'select-webauthn-account' event
Emitted when navigator.credentials.get() resolves multiple discoverable WebAuthn credentials and user must choose one. Returns event (Event), details (Object with relyingPartyId string, accounts [WebAuthnAccount[]], frame [WebFrameMain|null]), callback (Function taking credentialId string|null optional). Callback with no arguments or non-matching credentialId cancels the request. If no listener registered, multiple discoverable credentials are cancelled with NotAllowedError. On macOS, Touch ID platform authenticator surfaces accounts via this event once configured with app.configureWebAuthn.