Header menu logo fable-electron-docs-api

Session Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ❌

Instance members

Instance member Description

this.addWordToSpellCheckerDictionary word

Full Usage: this.addWordToSpellCheckerDictionary word

Parameters:
    word : string

Returns: bool
Modifiers: inline

Whether the word was successfully written to the custom dictionary. This API will not work on non-persistent (in-memory) sessions.> [!NOTE] On macOS and Windows, this word will be written to the OS custom dictionary as well.

word : string
Returns: bool

this.allowNTLMCredentialsForDomains domains

Full Usage: this.allowNTLMCredentialsForDomains domains

Parameters:
    domains : string

Modifiers: inline

Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication.

domains : string

this.availableSpellCheckerLanguages

Full Usage: this.availableSpellCheckerLanguages

Returns: string[]

A string[] array which consists of all the known available spell checker languages. Providing a language code to the setSpellCheckerLanguages API that isn't in this array will result in an error.

Returns: string[]

this.clearAuthCache ()

Full Usage: this.clearAuthCache ()

Returns: Promise<unit>
Modifiers: inline

resolves when the session’s HTTP authentication cache has been cleared.

Returns: Promise<unit>

this.clearCache ()

Full Usage: this.clearCache ()

Returns: Promise<unit>
Modifiers: inline

resolves when the cache clear operation is complete.Clears the session’s HTTP cache.

Returns: Promise<unit>

this.clearCodeCaches ?urls

Full Usage: this.clearCodeCaches ?urls

Parameters:
    ?urls : string[]

Returns: Promise<unit>
Modifiers: inline

resolves when the code cache clear operation is complete.

?urls : string[]
Returns: Promise<unit>

this.clearData (?dataTypes, ?origins, ?excludeOrigins, ?avoidClosingConnections, ?originMatchingMode)

Full Usage: this.clearData (?dataTypes, ?origins, ?excludeOrigins, ?avoidClosingConnections, ?originMatchingMode)

Parameters:
    ?dataTypes : DataTypes[]
    ?origins : string[]
    ?excludeOrigins : string[]
    ?avoidClosingConnections : bool
    ?originMatchingMode : OriginMatchingMode

Returns: Promise<unit>
Modifiers: inline

resolves when all data has been cleared.Clears various different types of data.This method clears more types of data and is more thorough than the clearStorageData method.> [!NOTE] 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.> [!NOTE] 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, you may want to use the clearSharedDictionaryCache method.For more information, refer to Chromium's BrowsingDataRemover interface.

?dataTypes : DataTypes[]
?origins : string[]
?excludeOrigins : string[]
?avoidClosingConnections : bool
?originMatchingMode : OriginMatchingMode
Returns: Promise<unit>

this.clearHostResolverCache ()

Full Usage: this.clearHostResolverCache ()

Returns: Promise<unit>
Modifiers: inline

Resolves when the operation is complete.Clears the host resolver cache.

Returns: Promise<unit>

this.clearSharedDictionaryCache ()

Full Usage: this.clearSharedDictionaryCache ()

Returns: Promise<unit>
Modifiers: inline

resolves when the dictionary cache has been cleared, both in memory and on disk.

Returns: Promise<unit>

this.clearSharedDictionaryCacheForIsolationKey (frameOrigin, topFrameSite)

Full Usage: this.clearSharedDictionaryCacheForIsolationKey (frameOrigin, topFrameSite)

Parameters:
    frameOrigin : string
    topFrameSite : string

Returns: Promise<unit>
Modifiers: inline

resolves when the dictionary cache has been cleared for the specified isolation key, both in memory and on disk.

frameOrigin : string
topFrameSite : string
Returns: Promise<unit>

this.clearStorageData (?origin, ?storages, ?quotas)

Full Usage: this.clearStorageData (?origin, ?storages, ?quotas)

Parameters:
Returns: Promise<unit>
Modifiers: inline

resolves when the storage data has been cleared.

?origin : string
?storages : Storages[]
?quotas : Quotas[]
Returns: Promise<unit>

this.closeAllConnections ()

Full Usage: this.closeAllConnections ()

Returns: Promise<unit>
Modifiers: inline

Resolves when all connections are closed.> [!NOTE] It will terminate / fail all requests currently in flight.

Returns: Promise<unit>

this.cookies

Full Usage: this.cookies

Returns: Cookies

A Cookies object for this session.

Returns: Cookies

this.createInterruptedDownload (path, urlChain, ?mimeType, ?offset, ?length, ?lastModified, ?eTag, ?startTime)

Full Usage: this.createInterruptedDownload (path, urlChain, ?mimeType, ?offset, ?length, ?lastModified, ?eTag, ?startTime)

Parameters:
    path : string
    urlChain : string[]
    ?mimeType : string
    ?offset : int
    ?length : int
    ?lastModified : string
    ?eTag : string
    ?startTime : double

Modifiers: inline

Allows resuming cancelled or interrupted downloads from previous Session. The API will generate a DownloadItem that can be accessed with the will-download event. The DownloadItem will not have any WebContents associated with it and the initial state will be interrupted. The download will start only when the resume API is called on the DownloadItem.

path : string
urlChain : string[]
?mimeType : string
?offset : int
?length : int
?lastModified : string
?eTag : string
?startTime : double

this.disableNetworkEmulation ()

Full Usage: this.disableNetworkEmulation ()

Modifiers: inline

Disables any network emulation already active for the session. Resets to the original network configuration.

this.downloadURL (url, ?headers)

Full Usage: this.downloadURL (url, ?headers)

Parameters:
    url : string
    ?headers : Record<string, string>

Modifiers: inline

Initiates a download of the resource at url. The API will generate a DownloadItem that can be accessed with the will-download event.> [!NOTE] This does not perform any security checks that relate to a page's origin, unlike webContents.downloadURL.

url : string
?headers : Record<string, string>

this.enableNetworkEmulation (?offline, ?latency, ?downloadThroughput, ?uploadThroughput)

Full Usage: this.enableNetworkEmulation (?offline, ?latency, ?downloadThroughput, ?uploadThroughput)

Parameters:
    ?offline : bool
    ?latency : double
    ?downloadThroughput : double
    ?uploadThroughput : double

Modifiers: inline

Emulates network with the given configuration for the session.

?offline : bool
?latency : double
?downloadThroughput : double
?uploadThroughput : double

this.extensions

Full Usage: this.extensions

Returns: Extensions

A Extensions object for this session.

Returns: Extensions

this.fetch (input, ?init)

Full Usage: this.fetch (input, ?init)

Parameters:
Returns: Promise<Response>
Modifiers: inline

see Response.Sends a request, similarly to how fetch() works in the renderer, using Chrome's network stack. This differs from Node's fetch(), which uses Node.js's HTTP stack.Example:See also net.fetch(), a convenience method which issues requests from the default session.See the MDN documentation for fetch() for more details.Limitations:* net.fetch() does not support the data: or blob: schemes.* The value of the integrity option is ignored.* The .type and .url values of the returned Response object are incorrect.By default, requests made with net.fetch can be made to custom protocols as well as file:, and will trigger webRequest handlers if present. When the non-standard bypassCustomProtocolHandlers option is set in RequestInit, custom protocol handlers will not be called for this request. This allows forwarding an intercepted request to the built-in handler. webRequest handlers will still be triggered when bypassing custom protocols.

input : U2<string, Request>
?init : RequestInit
Returns: Promise<Response>

this.flushStorageData ()

Full Usage: this.flushStorageData ()

Modifiers: inline

Writes any unwritten DOMStorage data to disk.

this.forceReloadProxyConfig ()

Full Usage: this.forceReloadProxyConfig ()

Returns: Promise<unit>
Modifiers: inline

Resolves when the all internal states of proxy service is reset and the latest proxy configuration is reapplied if it's already available. The pac script will be fetched from pacScript again if the proxy mode is pac_script.

Returns: Promise<unit>

this.getBlobData identifier

Full Usage: this.getBlobData identifier

Parameters:
    identifier : string

Returns: Promise<Buffer>
Modifiers: inline

resolves with blob data.

identifier : string
Returns: Promise<Buffer>

this.getCacheSize ()

Full Usage: this.getCacheSize ()

Returns: Promise<int>
Modifiers: inline

the session's current cache size, in bytes.

Returns: Promise<int>

this.getPreloadScripts ()

Full Usage: this.getPreloadScripts ()

Returns: PreloadScript[]
Modifiers: inline

An array of paths to preload scripts that have been registered.

Returns: PreloadScript[]

this.getSharedDictionaryInfo (frameOrigin, topFrameSite)

Full Usage: this.getSharedDictionaryInfo (frameOrigin, topFrameSite)

Parameters:
    frameOrigin : string
    topFrameSite : string

Returns: Promise<SharedDictionaryInfo[]>
Modifiers: inline

an array of shared dictionary information entries in Chromium's networking service's storage.To get information about all present shared dictionaries, call getSharedDictionaryUsageInfo().

frameOrigin : string
topFrameSite : string
Returns: Promise<SharedDictionaryInfo[]>

this.getSharedDictionaryUsageInfo ()

Full Usage: this.getSharedDictionaryUsageInfo ()

Returns: Promise<SharedDictionaryUsageInfo[]>
Modifiers: inline

an array of shared dictionary information entries in Chromium's networking service's storage.Shared dictionaries are used to power advanced compression of data sent over the wire, specifically with Brotli and ZStandard. You don't need to call any of the shared dictionary APIs in Electron to make use of this advanced web feature, but if you do, they allow deeper control and inspection of the shared dictionaries used during decompression.To get detailed information about a specific shared dictionary entry, call getSharedDictionaryInfo(options).

Returns: Promise<SharedDictionaryUsageInfo[]>

this.getSpellCheckerLanguages ()

Full Usage: this.getSpellCheckerLanguages ()

Returns: string[]
Modifiers: inline

An array of language codes the spellchecker is enabled for. If this list is empty the spellchecker will fallback to using en-US. By default on launch if this setting is an empty list Electron will try to populate this setting with the current OS locale. This setting is persisted across restarts.> [!NOTE] On macOS, the OS spellchecker is used and has its own list of languages. On macOS, this API will return whichever languages have been configured by the OS.

Returns: string[]

this.getStoragePath ()

Full Usage: this.getStoragePath ()

Returns: Option<string>
Modifiers: inline

The absolute file system path where data for this session is persisted on disk. For in memory sessions this returns null.

Returns: Option<string>

this.getUserAgent ()

Full Usage: this.getUserAgent ()

Returns: string
Modifiers: inline

The user agent for this session.

Returns: string

this.isPersistent ()

Full Usage: this.isPersistent ()

Returns: bool
Modifiers: inline

Whether or not this session is a persistent one. The default webContents session of a BrowserWindow is persistent. When creating a session from a partition, session prefixed with persist: will be persistent, while others will be temporary.

Returns: bool

this.isSpellCheckerEnabled ()

Full Usage: this.isSpellCheckerEnabled ()

Returns: bool
Modifiers: inline

Whether the builtin spell checker is enabled.

Returns: bool

this.listWordsInSpellCheckerDictionary ()

Full Usage: this.listWordsInSpellCheckerDictionary ()

Returns: Promise<string[]>
Modifiers: inline

An array of all words in app's custom dictionary. Resolves when the full dictionary is loaded from disk.

Returns: Promise<string[]>

this.netLog

Full Usage: this.netLog

Returns: netLog

A NetLog object for this session.

Returns: netLog

this.offExtensionLoaded handler

Full Usage: this.offExtensionLoaded handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded. This occurs whenever an extension is added to the "enabled" set of extensions. This includes:* Extensions being loaded from Session.loadExtension.* Extensions being reloaded: * from a crash. * if the extension requested it (chrome.runtime.reload()).

handler : IOnExtensionLoaded -> unit

this.offExtensionLoaded handler

Full Usage: this.offExtensionLoaded handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded. This occurs whenever an extension is added to the "enabled" set of extensions. This includes:* Extensions being loaded from Session.loadExtension.* Extensions being reloaded: * from a crash. * if the extension requested it (chrome.runtime.reload()).

handler : Event -> Extension -> unit

this.offExtensionReady handler

Full Usage: this.offExtensionReady handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page.

handler : IOnExtensionReady -> unit

this.offExtensionReady handler

Full Usage: this.offExtensionReady handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page.

handler : Event -> Extension -> unit

this.offExtensionUnloaded handler

Full Usage: this.offExtensionUnloaded handler

Parameters:
Modifiers: inline

Emitted after an extension is unloaded. This occurs when Session.removeExtension is called.

handler : IOnExtensionUnloaded -> unit

this.offExtensionUnloaded handler

Full Usage: this.offExtensionUnloaded handler

Parameters:
Modifiers: inline

Emitted after an extension is unloaded. This occurs when Session.removeExtension is called.

handler : Event -> Extension -> unit

this.offFileSystemAccessRestricted handler

Full Usage: this.offFileSystemAccessRestricted handler

Parameters:
Modifiers: inline
handler : IOnFileSystemAccessRestricted -> unit

this.offFileSystemAccessRestricted handler

Full Usage: this.offFileSystemAccessRestricted handler

Parameters:
Modifiers: inline
handler : Event -> Details -> Action -> unit -> unit

this.offHidDeviceAdded handler

Full Usage: this.offHidDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a new device becomes available before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : IOnHidDeviceAdded -> unit

this.offHidDeviceAdded handler

Full Usage: this.offHidDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a new device becomes available before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : Event -> Details -> unit

this.offHidDeviceRemoved handler

Full Usage: this.offHidDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a device has been removed before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : IOnHidDeviceRemoved -> unit

this.offHidDeviceRemoved handler

Full Usage: this.offHidDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a device has been removed before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : Event -> Details -> unit

this.offHidDeviceRevoked handler

Full Usage: this.offHidDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after HIDDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnHidDeviceRevoked -> unit

this.offHidDeviceRevoked handler

Full Usage: this.offHidDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after HIDDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.offPreconnect handler

Full Usage: this.offPreconnect handler

Parameters:
Modifiers: inline

Emitted when a render process requests preconnection to a URL, generally due to a resource hint.

handler : IOnPreconnect -> unit

this.offPreconnect handler

Full Usage: this.offPreconnect handler

Parameters:
    handler : Event -> string -> bool -> unit

Modifiers: inline

Emitted when a render process requests preconnection to a URL, generally due to a resource hint.

handler : Event -> string -> bool -> unit

this.offSelectHidDevice handler

Full Usage: this.offSelectHidDevice handler

Parameters:
Modifiers: inline

Emitted when a HID device needs to be selected when a call to navigator.hid.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.hid can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : IOnSelectHidDevice -> unit

this.offSelectHidDevice handler

Full Usage: this.offSelectHidDevice handler

Parameters:
Modifiers: inline

Emitted when a HID device needs to be selected when a call to navigator.hid.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.hid can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : Event -> Details -> Option<Option<string>> -> unit -> unit

this.offSelectSerialPort handler

Full Usage: this.offSelectSerialPort handler

Parameters:
Modifiers: inline

Emitted when a serial port needs to be selected when a call to navigator.serial.requestPort is made. callback should be called with portId to be selected, passing an empty string to callback will cancel the request. Additionally, permissioning on navigator.serial can be managed by using ses.setPermissionCheckHandler(handler) with the serial permission.

handler : IOnSelectSerialPort -> unit

this.offSelectSerialPort handler

Full Usage: this.offSelectSerialPort handler

Parameters:
Modifiers: inline

Emitted when a serial port needs to be selected when a call to navigator.serial.requestPort is made. callback should be called with portId to be selected, passing an empty string to callback will cancel the request. Additionally, permissioning on navigator.serial can be managed by using ses.setPermissionCheckHandler(handler) with the serial permission.

handler : Event -> SerialPort[] -> WebContents -> string -> unit -> unit

this.offSelectUsbDevice handler

Full Usage: this.offSelectUsbDevice handler

Parameters:
Modifiers: inline

Emitted when a USB device needs to be selected when a call to navigator.usb.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.usb can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : IOnSelectUsbDevice -> unit

this.offSelectUsbDevice handler

Full Usage: this.offSelectUsbDevice handler

Parameters:
Modifiers: inline

Emitted when a USB device needs to be selected when a call to navigator.usb.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.usb can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : Event -> Details -> Option<string> -> unit -> unit

this.offSerialPortAdded handler

Full Usage: this.offSerialPortAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a new serial port becomes available before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated with the newly added port.

handler : IOnSerialPortAdded -> unit

this.offSerialPortAdded handler

Full Usage: this.offSerialPortAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a new serial port becomes available before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated with the newly added port.

handler : Event -> SerialPort -> WebContents -> unit

this.offSerialPortRemoved handler

Full Usage: this.offSerialPortRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a serial port has been removed before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated to remove the specified port.

handler : IOnSerialPortRemoved -> unit

this.offSerialPortRemoved handler

Full Usage: this.offSerialPortRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a serial port has been removed before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated to remove the specified port.

handler : Event -> SerialPort -> WebContents -> unit

this.offSerialPortRevoked handler

Full Usage: this.offSerialPortRevoked handler

Parameters:
Modifiers: inline

Emitted after SerialPort.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnSerialPortRevoked -> unit

this.offSerialPortRevoked handler

Full Usage: this.offSerialPortRevoked handler

Parameters:
Modifiers: inline

Emitted after SerialPort.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.offSpellcheckDictionaryDownloadBegin handler

Full Usage: this.offSpellcheckDictionaryDownloadBegin handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file starts downloading

handler : IOnSpellcheckDictionaryDownloadBegin -> unit

this.offSpellcheckDictionaryDownloadBegin handler

Full Usage: this.offSpellcheckDictionaryDownloadBegin handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file starts downloading

handler : Event -> string -> unit

this.offSpellcheckDictionaryDownloadFailure handler

Full Usage: this.offSpellcheckDictionaryDownloadFailure handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request.

handler : IOnSpellcheckDictionaryDownloadFailure -> unit

this.offSpellcheckDictionaryDownloadFailure handler

Full Usage: this.offSpellcheckDictionaryDownloadFailure handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request.

handler : Event -> string -> unit

this.offSpellcheckDictionaryDownloadSuccess handler

Full Usage: this.offSpellcheckDictionaryDownloadSuccess handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file has been successfully downloaded

handler : IOnSpellcheckDictionaryDownloadSuccess -> unit

this.offSpellcheckDictionaryDownloadSuccess handler

Full Usage: this.offSpellcheckDictionaryDownloadSuccess handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file has been successfully downloaded

handler : Event -> string -> unit

this.offSpellcheckDictionaryInitialized handler

Full Usage: this.offSpellcheckDictionaryInitialized handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file has been successfully initialized. This occurs after the file has been downloaded.

handler : IOnSpellcheckDictionaryInitialized -> unit

this.offSpellcheckDictionaryInitialized handler

Full Usage: this.offSpellcheckDictionaryInitialized handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file has been successfully initialized. This occurs after the file has been downloaded.

handler : Event -> string -> unit

this.offUsbDeviceAdded handler

Full Usage: this.offUsbDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a new device becomes available before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : IOnUsbDeviceAdded -> unit

this.offUsbDeviceAdded handler

Full Usage: this.offUsbDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a new device becomes available before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : Event -> USBDevice -> WebContents -> unit

this.offUsbDeviceRemoved handler

Full Usage: this.offUsbDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a device has been removed before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : IOnUsbDeviceRemoved -> unit

this.offUsbDeviceRemoved handler

Full Usage: this.offUsbDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a device has been removed before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : Event -> USBDevice -> WebContents -> unit

this.offUsbDeviceRevoked handler

Full Usage: this.offUsbDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after USBDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnUsbDeviceRevoked -> unit

this.offUsbDeviceRevoked handler

Full Usage: this.offUsbDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after USBDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.offWillDownload handler

Full Usage: this.offWillDownload handler

Parameters:
Modifiers: inline

Emitted when Electron is about to download item in webContents.Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.

handler : IOnWillDownload -> unit

this.offWillDownload handler

Full Usage: this.offWillDownload handler

Parameters:
Modifiers: inline

Emitted when Electron is about to download item in webContents.Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.

handler : Event -> DownloadItem -> WebContents -> unit

this.onExtensionLoaded handler

Full Usage: this.onExtensionLoaded handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded. This occurs whenever an extension is added to the "enabled" set of extensions. This includes:* Extensions being loaded from Session.loadExtension.* Extensions being reloaded: * from a crash. * if the extension requested it (chrome.runtime.reload()).

handler : IOnExtensionLoaded -> unit

this.onExtensionLoaded handler

Full Usage: this.onExtensionLoaded handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded. This occurs whenever an extension is added to the "enabled" set of extensions. This includes:* Extensions being loaded from Session.loadExtension.* Extensions being reloaded: * from a crash. * if the extension requested it (chrome.runtime.reload()).

handler : Event -> Extension -> unit

this.onExtensionReady handler

Full Usage: this.onExtensionReady handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page.

handler : IOnExtensionReady -> unit

this.onExtensionReady handler

Full Usage: this.onExtensionReady handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page.

handler : Event -> Extension -> unit

this.onExtensionUnloaded handler

Full Usage: this.onExtensionUnloaded handler

Parameters:
Modifiers: inline

Emitted after an extension is unloaded. This occurs when Session.removeExtension is called.

handler : IOnExtensionUnloaded -> unit

this.onExtensionUnloaded handler

Full Usage: this.onExtensionUnloaded handler

Parameters:
Modifiers: inline

Emitted after an extension is unloaded. This occurs when Session.removeExtension is called.

handler : Event -> Extension -> unit

this.onFileSystemAccessRestricted handler

Full Usage: this.onFileSystemAccessRestricted handler

Parameters:
Modifiers: inline
handler : IOnFileSystemAccessRestricted -> unit

this.onFileSystemAccessRestricted handler

Full Usage: this.onFileSystemAccessRestricted handler

Parameters:
Modifiers: inline
handler : Event -> Details -> Action -> unit -> unit

this.onHidDeviceAdded handler

Full Usage: this.onHidDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a new device becomes available before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : IOnHidDeviceAdded -> unit

this.onHidDeviceAdded handler

Full Usage: this.onHidDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a new device becomes available before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : Event -> Details -> unit

this.onHidDeviceRemoved handler

Full Usage: this.onHidDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a device has been removed before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : IOnHidDeviceRemoved -> unit

this.onHidDeviceRemoved handler

Full Usage: this.onHidDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a device has been removed before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : Event -> Details -> unit

this.onHidDeviceRevoked handler

Full Usage: this.onHidDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after HIDDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnHidDeviceRevoked -> unit

this.onHidDeviceRevoked handler

Full Usage: this.onHidDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after HIDDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.onPreconnect handler

Full Usage: this.onPreconnect handler

Parameters:
Modifiers: inline

Emitted when a render process requests preconnection to a URL, generally due to a resource hint.

handler : IOnPreconnect -> unit

this.onPreconnect handler

Full Usage: this.onPreconnect handler

Parameters:
    handler : Event -> string -> bool -> unit

Modifiers: inline

Emitted when a render process requests preconnection to a URL, generally due to a resource hint.

handler : Event -> string -> bool -> unit

this.onSelectHidDevice handler

Full Usage: this.onSelectHidDevice handler

Parameters:
Modifiers: inline

Emitted when a HID device needs to be selected when a call to navigator.hid.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.hid can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : IOnSelectHidDevice -> unit

this.onSelectHidDevice handler

Full Usage: this.onSelectHidDevice handler

Parameters:
Modifiers: inline

Emitted when a HID device needs to be selected when a call to navigator.hid.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.hid can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : Event -> Details -> Option<Option<string>> -> unit -> unit

this.onSelectSerialPort handler

Full Usage: this.onSelectSerialPort handler

Parameters:
Modifiers: inline

Emitted when a serial port needs to be selected when a call to navigator.serial.requestPort is made. callback should be called with portId to be selected, passing an empty string to callback will cancel the request. Additionally, permissioning on navigator.serial can be managed by using ses.setPermissionCheckHandler(handler) with the serial permission.

handler : IOnSelectSerialPort -> unit

this.onSelectSerialPort handler

Full Usage: this.onSelectSerialPort handler

Parameters:
Modifiers: inline

Emitted when a serial port needs to be selected when a call to navigator.serial.requestPort is made. callback should be called with portId to be selected, passing an empty string to callback will cancel the request. Additionally, permissioning on navigator.serial can be managed by using ses.setPermissionCheckHandler(handler) with the serial permission.

handler : Event -> SerialPort[] -> WebContents -> string -> unit -> unit

this.onSelectUsbDevice handler

Full Usage: this.onSelectUsbDevice handler

Parameters:
Modifiers: inline

Emitted when a USB device needs to be selected when a call to navigator.usb.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.usb can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : IOnSelectUsbDevice -> unit

this.onSelectUsbDevice handler

Full Usage: this.onSelectUsbDevice handler

Parameters:
Modifiers: inline

Emitted when a USB device needs to be selected when a call to navigator.usb.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.usb can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : Event -> Details -> Option<string> -> unit -> unit

this.onSerialPortAdded handler

Full Usage: this.onSerialPortAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a new serial port becomes available before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated with the newly added port.

handler : IOnSerialPortAdded -> unit

this.onSerialPortAdded handler

Full Usage: this.onSerialPortAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a new serial port becomes available before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated with the newly added port.

handler : Event -> SerialPort -> WebContents -> unit

this.onSerialPortRemoved handler

Full Usage: this.onSerialPortRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a serial port has been removed before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated to remove the specified port.

handler : IOnSerialPortRemoved -> unit

this.onSerialPortRemoved handler

Full Usage: this.onSerialPortRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a serial port has been removed before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated to remove the specified port.

handler : Event -> SerialPort -> WebContents -> unit

this.onSerialPortRevoked handler

Full Usage: this.onSerialPortRevoked handler

Parameters:
Modifiers: inline

Emitted after SerialPort.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnSerialPortRevoked -> unit

this.onSerialPortRevoked handler

Full Usage: this.onSerialPortRevoked handler

Parameters:
Modifiers: inline

Emitted after SerialPort.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.onSpellcheckDictionaryDownloadBegin handler

Full Usage: this.onSpellcheckDictionaryDownloadBegin handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file starts downloading

handler : IOnSpellcheckDictionaryDownloadBegin -> unit

this.onSpellcheckDictionaryDownloadBegin handler

Full Usage: this.onSpellcheckDictionaryDownloadBegin handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file starts downloading

handler : Event -> string -> unit

this.onSpellcheckDictionaryDownloadFailure handler

Full Usage: this.onSpellcheckDictionaryDownloadFailure handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request.

handler : IOnSpellcheckDictionaryDownloadFailure -> unit

this.onSpellcheckDictionaryDownloadFailure handler

Full Usage: this.onSpellcheckDictionaryDownloadFailure handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request.

handler : Event -> string -> unit

this.onSpellcheckDictionaryDownloadSuccess handler

Full Usage: this.onSpellcheckDictionaryDownloadSuccess handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file has been successfully downloaded

handler : IOnSpellcheckDictionaryDownloadSuccess -> unit

this.onSpellcheckDictionaryDownloadSuccess handler

Full Usage: this.onSpellcheckDictionaryDownloadSuccess handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file has been successfully downloaded

handler : Event -> string -> unit

this.onSpellcheckDictionaryInitialized handler

Full Usage: this.onSpellcheckDictionaryInitialized handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file has been successfully initialized. This occurs after the file has been downloaded.

handler : IOnSpellcheckDictionaryInitialized -> unit

this.onSpellcheckDictionaryInitialized handler

Full Usage: this.onSpellcheckDictionaryInitialized handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file has been successfully initialized. This occurs after the file has been downloaded.

handler : Event -> string -> unit

this.onUsbDeviceAdded handler

Full Usage: this.onUsbDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a new device becomes available before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : IOnUsbDeviceAdded -> unit

this.onUsbDeviceAdded handler

Full Usage: this.onUsbDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a new device becomes available before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : Event -> USBDevice -> WebContents -> unit

this.onUsbDeviceRemoved handler

Full Usage: this.onUsbDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a device has been removed before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : IOnUsbDeviceRemoved -> unit

this.onUsbDeviceRemoved handler

Full Usage: this.onUsbDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a device has been removed before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : Event -> USBDevice -> WebContents -> unit

this.onUsbDeviceRevoked handler

Full Usage: this.onUsbDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after USBDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnUsbDeviceRevoked -> unit

this.onUsbDeviceRevoked handler

Full Usage: this.onUsbDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after USBDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.onWillDownload handler

Full Usage: this.onWillDownload handler

Parameters:
Modifiers: inline

Emitted when Electron is about to download item in webContents.Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.

handler : IOnWillDownload -> unit

this.onWillDownload handler

Full Usage: this.onWillDownload handler

Parameters:
Modifiers: inline

Emitted when Electron is about to download item in webContents.Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.

handler : Event -> DownloadItem -> WebContents -> unit

this.onceExtensionLoaded handler

Full Usage: this.onceExtensionLoaded handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded. This occurs whenever an extension is added to the "enabled" set of extensions. This includes:* Extensions being loaded from Session.loadExtension.* Extensions being reloaded: * from a crash. * if the extension requested it (chrome.runtime.reload()).

handler : IOnExtensionLoaded -> unit

this.onceExtensionLoaded handler

Full Usage: this.onceExtensionLoaded handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded. This occurs whenever an extension is added to the "enabled" set of extensions. This includes:* Extensions being loaded from Session.loadExtension.* Extensions being reloaded: * from a crash. * if the extension requested it (chrome.runtime.reload()).

handler : Event -> Extension -> unit

this.onceExtensionReady handler

Full Usage: this.onceExtensionReady handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page.

handler : IOnExtensionReady -> unit

this.onceExtensionReady handler

Full Usage: this.onceExtensionReady handler

Parameters:
Modifiers: inline

Emitted after an extension is loaded and all necessary browser state is initialized to support the start of the extension's background page.

handler : Event -> Extension -> unit

this.onceExtensionUnloaded handler

Full Usage: this.onceExtensionUnloaded handler

Parameters:
Modifiers: inline

Emitted after an extension is unloaded. This occurs when Session.removeExtension is called.

handler : IOnExtensionUnloaded -> unit

this.onceExtensionUnloaded handler

Full Usage: this.onceExtensionUnloaded handler

Parameters:
Modifiers: inline

Emitted after an extension is unloaded. This occurs when Session.removeExtension is called.

handler : Event -> Extension -> unit

this.onceFileSystemAccessRestricted handler

Full Usage: this.onceFileSystemAccessRestricted handler

Parameters:
Modifiers: inline
handler : IOnFileSystemAccessRestricted -> unit

this.onceFileSystemAccessRestricted handler

Full Usage: this.onceFileSystemAccessRestricted handler

Parameters:
Modifiers: inline
handler : Event -> Details -> Action -> unit -> unit

this.onceHidDeviceAdded handler

Full Usage: this.onceHidDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a new device becomes available before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : IOnHidDeviceAdded -> unit

this.onceHidDeviceAdded handler

Full Usage: this.onceHidDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a new device becomes available before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : Event -> Details -> unit

this.onceHidDeviceRemoved handler

Full Usage: this.onceHidDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a device has been removed before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : IOnHidDeviceRemoved -> unit

this.onceHidDeviceRemoved handler

Full Usage: this.onceHidDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.hid.requestDevice has been called and select-hid-device has fired if a device has been removed before the callback from select-hid-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : Event -> Details -> unit

this.onceHidDeviceRevoked handler

Full Usage: this.onceHidDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after HIDDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnHidDeviceRevoked -> unit

this.onceHidDeviceRevoked handler

Full Usage: this.onceHidDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after HIDDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.oncePreconnect handler

Full Usage: this.oncePreconnect handler

Parameters:
Modifiers: inline

Emitted when a render process requests preconnection to a URL, generally due to a resource hint.

handler : IOnPreconnect -> unit

this.oncePreconnect handler

Full Usage: this.oncePreconnect handler

Parameters:
    handler : Event -> string -> bool -> unit

Modifiers: inline

Emitted when a render process requests preconnection to a URL, generally due to a resource hint.

handler : Event -> string -> bool -> unit

this.onceSelectHidDevice handler

Full Usage: this.onceSelectHidDevice handler

Parameters:
Modifiers: inline

Emitted when a HID device needs to be selected when a call to navigator.hid.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.hid can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : IOnSelectHidDevice -> unit

this.onceSelectHidDevice handler

Full Usage: this.onceSelectHidDevice handler

Parameters:
Modifiers: inline

Emitted when a HID device needs to be selected when a call to navigator.hid.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.hid can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : Event -> Details -> Option<Option<string>> -> unit -> unit

this.onceSelectSerialPort handler

Full Usage: this.onceSelectSerialPort handler

Parameters:
Modifiers: inline

Emitted when a serial port needs to be selected when a call to navigator.serial.requestPort is made. callback should be called with portId to be selected, passing an empty string to callback will cancel the request. Additionally, permissioning on navigator.serial can be managed by using ses.setPermissionCheckHandler(handler) with the serial permission.

handler : IOnSelectSerialPort -> unit

this.onceSelectSerialPort handler

Full Usage: this.onceSelectSerialPort handler

Parameters:
Modifiers: inline

Emitted when a serial port needs to be selected when a call to navigator.serial.requestPort is made. callback should be called with portId to be selected, passing an empty string to callback will cancel the request. Additionally, permissioning on navigator.serial can be managed by using ses.setPermissionCheckHandler(handler) with the serial permission.

handler : Event -> SerialPort[] -> WebContents -> string -> unit -> unit

this.onceSelectUsbDevice handler

Full Usage: this.onceSelectUsbDevice handler

Parameters:
Modifiers: inline

Emitted when a USB device needs to be selected when a call to navigator.usb.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.usb can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : IOnSelectUsbDevice -> unit

this.onceSelectUsbDevice handler

Full Usage: this.onceSelectUsbDevice handler

Parameters:
Modifiers: inline

Emitted when a USB device needs to be selected when a call to navigator.usb.requestDevice is made. callback should be called with deviceId to be selected; passing no arguments to callback will cancel the request. Additionally, permissioning on navigator.usb can be further managed by using ses.setPermissionCheckHandler(handler) and ses.setDevicePermissionHandler(handler).

handler : Event -> Details -> Option<string> -> unit -> unit

this.onceSerialPortAdded handler

Full Usage: this.onceSerialPortAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a new serial port becomes available before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated with the newly added port.

handler : IOnSerialPortAdded -> unit

this.onceSerialPortAdded handler

Full Usage: this.onceSerialPortAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a new serial port becomes available before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated with the newly added port.

handler : Event -> SerialPort -> WebContents -> unit

this.onceSerialPortRemoved handler

Full Usage: this.onceSerialPortRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a serial port has been removed before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated to remove the specified port.

handler : IOnSerialPortRemoved -> unit

this.onceSerialPortRemoved handler

Full Usage: this.onceSerialPortRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.serial.requestPort has been called and select-serial-port has fired if a serial port has been removed before the callback from select-serial-port is called. This event is intended for use when using a UI to ask users to pick a port so that the UI can be updated to remove the specified port.

handler : Event -> SerialPort -> WebContents -> unit

this.onceSerialPortRevoked handler

Full Usage: this.onceSerialPortRevoked handler

Parameters:
Modifiers: inline

Emitted after SerialPort.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnSerialPortRevoked -> unit

this.onceSerialPortRevoked handler

Full Usage: this.onceSerialPortRevoked handler

Parameters:
Modifiers: inline

Emitted after SerialPort.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.onceSpellcheckDictionaryDownloadBegin handler

Full Usage: this.onceSpellcheckDictionaryDownloadBegin handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file starts downloading

handler : IOnSpellcheckDictionaryDownloadBegin -> unit

this.onceSpellcheckDictionaryDownloadBegin handler

Full Usage: this.onceSpellcheckDictionaryDownloadBegin handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file starts downloading

handler : Event -> string -> unit

this.onceSpellcheckDictionaryDownloadFailure handler

Full Usage: this.onceSpellcheckDictionaryDownloadFailure handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request.

handler : IOnSpellcheckDictionaryDownloadFailure -> unit

this.onceSpellcheckDictionaryDownloadFailure handler

Full Usage: this.onceSpellcheckDictionaryDownloadFailure handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request.

handler : Event -> string -> unit

this.onceSpellcheckDictionaryDownloadSuccess handler

Full Usage: this.onceSpellcheckDictionaryDownloadSuccess handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file has been successfully downloaded

handler : IOnSpellcheckDictionaryDownloadSuccess -> unit

this.onceSpellcheckDictionaryDownloadSuccess handler

Full Usage: this.onceSpellcheckDictionaryDownloadSuccess handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file has been successfully downloaded

handler : Event -> string -> unit

this.onceSpellcheckDictionaryInitialized handler

Full Usage: this.onceSpellcheckDictionaryInitialized handler

Parameters:
Modifiers: inline

Emitted when a hunspell dictionary file has been successfully initialized. This occurs after the file has been downloaded.

handler : IOnSpellcheckDictionaryInitialized -> unit

this.onceSpellcheckDictionaryInitialized handler

Full Usage: this.onceSpellcheckDictionaryInitialized handler

Parameters:
    handler : Event -> string -> unit

Modifiers: inline

Emitted when a hunspell dictionary file has been successfully initialized. This occurs after the file has been downloaded.

handler : Event -> string -> unit

this.onceUsbDeviceAdded handler

Full Usage: this.onceUsbDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a new device becomes available before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : IOnUsbDeviceAdded -> unit

this.onceUsbDeviceAdded handler

Full Usage: this.onceUsbDeviceAdded handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a new device becomes available before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated with the newly added device.

handler : Event -> USBDevice -> WebContents -> unit

this.onceUsbDeviceRemoved handler

Full Usage: this.onceUsbDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a device has been removed before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : IOnUsbDeviceRemoved -> unit

this.onceUsbDeviceRemoved handler

Full Usage: this.onceUsbDeviceRemoved handler

Parameters:
Modifiers: inline

Emitted after navigator.usb.requestDevice has been called and select-usb-device has fired if a device has been removed before the callback from select-usb-device is called. This event is intended for use when using a UI to ask users to pick a device so that the UI can be updated to remove the specified device.

handler : Event -> USBDevice -> WebContents -> unit

this.onceUsbDeviceRevoked handler

Full Usage: this.onceUsbDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after USBDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : IOnUsbDeviceRevoked -> unit

this.onceUsbDeviceRevoked handler

Full Usage: this.onceUsbDeviceRevoked handler

Parameters:
Modifiers: inline

Emitted after USBDevice.forget() has been called. This event can be used to help maintain persistent storage of permissions when setDevicePermissionHandler is used.

handler : Event -> Details -> unit

this.onceWillDownload handler

Full Usage: this.onceWillDownload handler

Parameters:
Modifiers: inline

Emitted when Electron is about to download item in webContents.Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.

handler : IOnWillDownload -> unit

this.onceWillDownload handler

Full Usage: this.onceWillDownload handler

Parameters:
Modifiers: inline

Emitted when Electron is about to download item in webContents.Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.

handler : Event -> DownloadItem -> WebContents -> unit

this.preconnect (url, ?numSockets)

Full Usage: this.preconnect (url, ?numSockets)

Parameters:
    url : string
    ?numSockets : float

Modifiers: inline

Preconnects the given number of sockets to an origin.

url : string
?numSockets : float

this.protocol

Full Usage: this.protocol

Returns: protocol

A Protocol object for this session.

Returns: protocol

this.registerPreloadScript script

Full Usage: this.registerPreloadScript script

Parameters:
Returns: string
Modifiers: inline

Registers preload script that will be executed in its associated context type in this session. For frame contexts, this will run prior to any preload defined in the web preferences of a WebContents.The ID of the registered preload script.

script : PreloadScriptRegistration
Returns: string

this.removeWordFromSpellCheckerDictionary word

Full Usage: this.removeWordFromSpellCheckerDictionary word

Parameters:
    word : string

Returns: bool
Modifiers: inline

Whether the word was successfully removed from the custom dictionary. This API will not work on non-persistent (in-memory) sessions.> [!NOTE] On macOS and Windows, this word will be removed from the OS custom dictionary as well.

word : string
Returns: bool

this.resolveHost (host, ?queryType, ?source, ?cacheUsage, ?secureDnsPolicy)

Full Usage: this.resolveHost (host, ?queryType, ?source, ?cacheUsage, ?secureDnsPolicy)

Parameters:
Returns: Promise<ResolvedHost>
Modifiers: inline

Resolves with the resolved IP addresses for the host.

host : string
?queryType : QueryType
?source : Source
?cacheUsage : CacheUsage
?secureDnsPolicy : SecureDnsPolicy
Returns: Promise<ResolvedHost>

this.resolveProxy url

Full Usage: this.resolveProxy url

Parameters:
Returns: Promise<string>
Modifiers: inline

Resolves with the proxy information for url.

url : URL
Returns: Promise<string>

this.serviceWorkers

Full Usage: this.serviceWorkers

Returns: ServiceWorkers

A ServiceWorkers object for this session.

Returns: ServiceWorkers

this.setBluetoothPairingHandler handler

Full Usage: this.setBluetoothPairingHandler handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ✔ | MAS ❌

Sets a handler to respond to Bluetooth pairing requests. This handler allows developers to handle devices that require additional validation before pairing. When a handler is not defined, any pairing on Linux or Windows that requires additional validation will be automatically cancelled. macOS does not require a handler because macOS handles the pairing automatically. To clear the handler, call setBluetoothPairingHandler(null).

handler : Option<(Details * Response -> unit -> unit)>

this.setCertificateVerifyProc proc

Full Usage: this.setCertificateVerifyProc proc

Parameters:
Modifiers: inline

Sets the certificate verify proc for session, the proc will be called with proc(request, callback) whenever a server certificate verification is requested. Calling callback(0) accepts the certificate, calling callback(-2) rejects it.Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc.> NOTE: The result of this procedure is cached by the network service.

proc : Option<(Request * int -> unit -> unit)>

this.setCodeCachePath path

Full Usage: this.setCodeCachePath path

Parameters:
    path : string

Modifiers: inline

Sets the directory to store the generated JS code cache for this session. The directory is not required to be created by the user before this call, the runtime will create if it does not exist otherwise will use the existing directory. If directory cannot be created, then code cache will not be used and all operations related to code cache will fail silently inside the runtime. By default, the directory will be Code Cache under the respective user data folder.Note that by default code cache is only enabled for http(s) URLs, to enable code cache for custom protocols, codeCache: true and standard: true must be specified when registering the protocol.

path : string

this.setDevicePermissionHandler handler

Full Usage: this.setDevicePermissionHandler handler

Parameters:
Modifiers: inline

Sets the handler which can be used to respond to device permission checks for the session. Returning true will allow the device to be permitted and false will reject it. To clear the handler, call setDevicePermissionHandler(null). This handler can be used to provide default permissioning to devices without first calling for permission to devices (eg via navigator.hid.requestDevice). If this handler is not defined, the default device permissions as granted through device selection (eg via navigator.hid.requestDevice) will be used. Additionally, the default behavior of Electron is to store granted device permission in memory. If longer term storage is needed, a developer can store granted device permissions (eg when handling the select-hid-device event) and then read from that storage with setDevicePermissionHandler.

handler : Option<(Details -> bool)>

this.setDisplayMediaRequestHandler (handler, ?opts)

Full Usage: this.setDisplayMediaRequestHandler (handler, ?opts)

Parameters:
Modifiers: inline

This handler will be called when web content requests access to display media via the navigator.mediaDevices.getDisplayMedia API. Use the desktopCapturer API to choose which stream(s) to grant access to.useSystemPicker allows an application to use the system picker instead of providing a specific video source from getSources. This option is experimental, and currently available for MacOS 15+ only. If the system picker is available and useSystemPicker is set to true, the handler will not be invoked.Passing a WebFrameMain object as a video or audio stream will capture the video or audio stream from that frame.Passing null instead of a function resets the handler to its default state.

handler : Option<(Request * Streams -> unit -> unit)>
?opts : Opts

this.setDownloadPath path

Full Usage: this.setDownloadPath path

Parameters:
    path : string

Modifiers: inline

Sets download saving directory. By default, the download directory will be the Downloads under the respective app folder.

path : string

this.setPermissionCheckHandler handler

Full Usage: this.setPermissionCheckHandler handler

Parameters:
Modifiers: inline

Sets the handler which can be used to respond to permission checks for the session. Returning true will allow the permission and false will reject it. Please note that you must also implement setPermissionRequestHandler to get complete permission handling. Most web APIs do a permission check and then make a permission request if the check is denied. To clear the handler, call setPermissionCheckHandler(null).> [!NOTE] isMainFrame will always be false for a fileSystem request as a result of Chromium limitations.

handler : Option<(Option<WebContents> * Permission * string * Details -> bool)>

this.setPermissionRequestHandler handler

Full Usage: this.setPermissionRequestHandler handler

Parameters:
Modifiers: inline

Sets the handler which can be used to respond to permission requests for the session. Calling callback(true) will allow the permission and callback(false) will reject it. To clear the handler, call setPermissionRequestHandler(null). Please note that you must also implement setPermissionCheckHandler to get complete permission handling. Most web APIs do a permission check and then make a permission request if the check is denied.

handler : Option<(WebContents * Permission * bool -> unit * U4<PermissionRequest, FilesystemPermissionRequest, MediaAccessPermissionRequest, OpenExternalPermissionRequest> -> unit)>

this.setProxy config

Full Usage: this.setProxy config

Parameters:
Returns: Promise<unit>
Modifiers: inline

Resolves when the proxy setting process is complete.Sets the proxy settings.You may need ses.closeAllConnections to close currently in flight connections to prevent pooled sockets using previous proxy from being reused by future requests.

config : ProxyConfig
Returns: Promise<unit>

this.setSSLConfig (?minVersion, ?maxVersion, ?disabledCipherSuites)

Full Usage: this.setSSLConfig (?minVersion, ?maxVersion, ?disabledCipherSuites)

Parameters:
Modifiers: inline

Sets the SSL configuration for the session. All subsequent network requests will use the new configuration. Existing network connections (such as WebSocket connections) will not be terminated, but old sockets in the pool will not be reused for new connections.

?minVersion : MinVersion
?maxVersion : MaxVersion
?disabledCipherSuites : int[]

this.setSpellCheckerDictionaryDownloadURL url

Full Usage: this.setSpellCheckerDictionaryDownloadURL url

Parameters:
    url : string

Modifiers: inline

By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell dictionaries. We publish a hunspell_dictionaries.zip file with each release which contains the files you need to host here.The file server must be case insensitive. If you cannot do this, you must upload each file twice: once with the case it has in the ZIP file and once with the filename as all lowercase.If the files present in hunspell_dictionaries.zip are available at https://example.com/dictionaries/language-code.bdic then you should call this api with ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/'). Please note the trailing slash. The URL to the dictionaries is formed as \({url}\){filename}.> [!NOTE] On macOS, the OS spellchecker is used and therefore we do not download any dictionary files. This API is a no-op on macOS.

url : string

this.setSpellCheckerEnabled enable

Full Usage: this.setSpellCheckerEnabled enable

Parameters:
    enable : bool

Modifiers: inline

Sets whether to enable the builtin spell checker.

enable : bool

this.setSpellCheckerLanguages languages

Full Usage: this.setSpellCheckerLanguages languages

Parameters:
    languages : string[]

Modifiers: inline

The built in spellchecker does not automatically detect what language a user is typing in. In order for the spell checker to correctly check their words you must call this API with an array of language codes. You can get the list of supported language codes with the ses.availableSpellCheckerLanguages property.> [!NOTE] On macOS, the OS spellchecker is used and will detect your language automatically. This API is a no-op on macOS.

languages : string[]

this.setUSBProtectedClassesHandler handler

Full Usage: this.setUSBProtectedClassesHandler handler

Parameters:
Modifiers: inline

Sets the handler which can be used to override which USB classes are protected. The return value for the handler is a string array of USB classes which should be considered protected (eg not available in the renderer). Valid values for the array are:* audio* audio-video* hid* mass-storage* smart-card* video* wirelessReturning an empty string array from the handler will allow all USB classes; returning the passed in array will maintain the default list of protected USB classes (this is also the default behavior if a handler is not defined). To clear the handler, call setUSBProtectedClassesHandler(null).

handler : Option<(Details -> string[])>

this.setUserAgent (userAgent, ?acceptLanguages)

Full Usage: this.setUserAgent (userAgent, ?acceptLanguages)

Parameters:
    userAgent : string
    ?acceptLanguages : string

Modifiers: inline

Overrides the userAgent and acceptLanguages for this session.The acceptLanguages must a comma separated ordered list of language codes, for example "en-US,fr,de,ko,zh-CN,ja".This doesn't affect existing WebContents, and each WebContents can use webContents.setUserAgent to override the session-wide user agent.

userAgent : string
?acceptLanguages : string

this.spellCheckerEnabled

Full Usage: this.spellCheckerEnabled

A boolean indicating whether builtin spell checker is enabled.

this.storagePath

Full Usage: this.storagePath

Returns: Option<string>

A string | null indicating the absolute file system path where data for this session is persisted on disk. For in memory sessions this returns null.

Returns: Option<string>

this.unregisterPreloadScript id

Full Usage: this.unregisterPreloadScript id

Parameters:
    id : string

Modifiers: inline

Unregisters script.

id : string

this.webRequest

Full Usage: this.webRequest

Returns: WebRequest

A WebRequest object for this session.

Returns: WebRequest

Type something to start searching.