[
{
"name": "app",
"description": "> Control your application's event lifecycle.\n\nProcess: Main\n\nThe following example shows how to quit the application when the last window is closed:",
"slug": "app",
"websiteUrl": "https://electronjs.org/docs/api/app",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/app.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "quit",
"signature": "()",
"description": "Try to close all windows. The `before-quit` event will be emitted first. If all windows are successfully closed, the `will-quit` event will be emitted and by default the application will terminate.\n\nThis method guarantees that all `beforeunload` and `unload` event handlers are correctly executed. It is possible that a window cancels the quitting by returning `false` in the `beforeunload` event handler.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#appquit"
},
{
"name": "exit",
"signature": "([exitCode])",
"description": "Exits immediately with `exitCode`. `exitCode` defaults to 0.\n\nAll windows will be closed immediately without asking the user, and the `before-quit` and `will-quit` events will not be emitted.",
"parameters": [
{
"name": "exitCode",
"description": "",
"required": false,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#appexitexitcode"
},
{
"name": "relaunch",
"signature": "([options])",
"description": "Relaunches the app when current instance exits.\n\nBy default, the new instance will use the same working directory and command line arguments with current instance. When `args` is specified, the `args` will be passed as command line arguments instead. When `execPath` is specified, the `execPath` will be executed for relaunch instead of current app.\n\nNote that this method does not quit the app when executed, you have to call `app.quit` or `app.exit` after calling `app.relaunch` to make the app restart.\n\nWhen `app.relaunch` is called for multiple times, multiple instances will be started after current instance exited.\n\nAn example of restarting current instance immediately and adding a new command line argument to the new instance:",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "args",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "execPath",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#apprelaunchoptions"
},
{
"name": "isReady",
"signature": "()",
"description": "`true` if Electron has finished initializing, `false` otherwise. See also `app.whenReady()`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#appisready"
},
{
"name": "whenReady",
"signature": "()",
"description": "fulfilled when Electron is initialized. May be used as a convenient alternative to checking `app.isReady()` and subscribing to the `ready` event if the app is not ready yet.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#appwhenready"
},
{
"name": "focus",
"signature": "([options])",
"description": "On Linux, focuses on the first visible window. On macOS, makes the application the active app. On Windows, focuses on the application's first window.\n\nYou should seek to use the `steal` option as sparingly as possible.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "steal",
"description": "Make the receiver the active app even if another app is currently active.",
"required": true,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#appfocusoptions"
},
{
"name": "hide",
"signature": "()",
"description": "Hides all application windows without minimizing them.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#apphide-macos"
},
{
"name": "show",
"signature": "()",
"description": "Shows application windows after they were hidden. Does not automatically focus them.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appshow-macos"
},
{
"name": "setAppLogsPath",
"signature": "([path])",
"description": "Sets or creates a directory your app's logs which can then be manipulated with `app.getPath()` or `app.setPath(pathName, newPath)`.\n\nCalling `app.setAppLogsPath()` without a `path` parameter will result in this directory being set to `~/Library/Logs/YourAppName` on _macOS_, and inside the `userData` directory on _Linux_ and _Windows_.",
"parameters": [
{
"name": "path",
"description": "A custom path for your logs. Must be absolute.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#appsetapplogspathpath"
},
{
"name": "getAppPath",
"signature": "()",
"description": "The current application directory.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetapppath"
},
{
"name": "getPath",
"signature": "(name)",
"description": "A path to a special directory or file associated with `name`. On failure, an `Error` is thrown.\n\nIf `app.getPath('logs')` is called without called `app.setAppLogsPath()` being called first, a default log directory will be created equivalent to calling `app.setAppLogsPath()` without a `path` parameter.",
"parameters": [
{
"name": "name",
"description": "You can request the following paths by the name:",
"required": true,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "home",
"description": ""
},
{
"value": "appData",
"description": "user application data directory, which by default points to:"
},
{
"value": "userData",
"description": ""
},
{
"value": "cache",
"description": ""
},
{
"value": "temp",
"description": ""
},
{
"value": "exe",
"description": ""
},
{
"value": "module",
"description": ""
},
{
"value": "desktop",
"description": ""
},
{
"value": "documents",
"description": ""
},
{
"value": "downloads",
"description": ""
},
{
"value": "music",
"description": ""
},
{
"value": "pictures",
"description": ""
},
{
"value": "videos",
"description": ""
},
{
"value": "recent",
"description": ""
},
{
"value": "logs",
"description": ""
},
{
"value": "crashDumps",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetpathname"
},
{
"name": "getFileIcon",
"signature": "(path[, options])",
"description": "fulfilled with the app's icon, which is a NativeImage.\n\nFetches a path's associated icon.\n\nOn _Windows_, there a 2 kinds of icons:\n\n* Icons associated with certain file extensions, like `.mp3`, `.png`, etc.\n* Icons inside the file itself, like `.exe`, `.dll`, `.ico`.\n\nOn _Linux_ and _macOS_, icons depend on the application associated with file mime type.",
"parameters": [
{
"name": "path",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "size",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "small",
"description": "16x16"
},
{
"value": "normal",
"description": "32x32"
},
{
"value": "large",
"description": "48x48 on _Linux_, 32x32 on _Windows_, unsupported on _macOS_."
}
]
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "NativeImage"
}
]
},
"additionalTags": [],
"urlFragment": "#appgetfileiconpath-options"
},
{
"name": "setPath",
"signature": "(name, path)",
"description": "Overrides the `path` to a special directory or file associated with `name`. If the path specifies a directory that does not exist, an `Error` is thrown. In that case, the directory should be created with `fs.mkdirSync` or similar.\n\nYou can only override paths of a `name` defined in `app.getPath`.\n\nBy default, web pages' cookies and caches will be stored under the `userData` directory. If you want to change this location, you have to override the `userData` path before the `ready` event of the `app` module is emitted.",
"parameters": [
{
"name": "name",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#appsetpathname-path"
},
{
"name": "getVersion",
"signature": "()",
"description": "The version of the loaded application. If no version is found in the application's `package.json` file, the version of the current bundle or executable is returned.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetversion"
},
{
"name": "getName",
"signature": "()",
"description": "The current application's name, which is the name in the application's `package.json` file.\n\nUsually the `name` field of `package.json` is a short lowercase name, according to the npm modules spec. You should usually also specify a `productName` field, which is your application's full capitalized name, and which will be preferred over `name` by Electron.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetname"
},
{
"name": "setName",
"signature": "(name)",
"description": "Overrides the current application's name.\n\n**Note:** This function overrides the name used internally by Electron; it does not affect the name that the OS uses.",
"parameters": [
{
"name": "name",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#appsetnamename"
},
{
"name": "getLocale",
"signature": "()",
"description": "The current application locale. Possible return values are documented here.\n\nTo set the locale, you'll want to use a command line switch at app startup, which may be found here.\n\n**Note:** When distributing your packaged app, you have to also ship the `locales` folder.\n\n**Note:** On Windows, you have to call it after the `ready` events gets emitted.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetlocale"
},
{
"name": "getLocaleCountryCode",
"signature": "()",
"description": "User operating system's locale two-letter ISO 3166 country code. The value is taken from native OS APIs.\n\n**Note:** When unable to detect locale country code, it returns empty string.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetlocalecountrycode"
},
{
"name": "addRecentDocument",
"signature": "(path)",
"description": "Adds `path` to the recent documents list.\n\nThis list is managed by the OS. On Windows, you can visit the list from the task bar, and on macOS, you can visit it from dock menu.",
"parameters": [
{
"name": "path",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appaddrecentdocumentpath-macos-windows"
},
{
"name": "clearRecentDocuments",
"signature": "()",
"description": "Clears the recent documents list.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appclearrecentdocuments-macos-windows"
},
{
"name": "setAsDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"description": "Whether the call succeeded.\n\nSets the current executable as the default handler for a protocol (aka URI scheme). It allows you to integrate your app deeper into the operating system. Once registered, all links with `your-protocol://` will be opened with the current executable. The whole link, including protocol, will be passed to your application as a parameter.\n\n**Note:** On macOS, you can only register protocols that have been added to your app's `info.plist`, which cannot be modified at runtime. However, you can change the file during build time via Electron Forge, Electron Packager, or by editing `info.plist` with a text editor. Please refer to Apple's documentation for details.\n\n**Note:** In a Windows Store environment (when packaged as an `appx`) this API will return `true` for all calls but the registry key it sets won't be accessible by other applications. In order to register your Windows Store application as a default protocol handler you must declare the protocol in your manifest.\n\nThe API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.",
"parameters": [
{
"name": "protocol",
"description": "The name of your protocol, without `://`. For example, if you want your app to handle `electron://` links, call this method with `electron` as the parameter.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "The path to the Electron executable. Defaults to `process.execPath`",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "args",
"description": "Arguments passed to the executable. Defaults to an empty array",
"required": false,
"collection": true,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#appsetasdefaultprotocolclientprotocol-path-args"
},
{
"name": "removeAsDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"description": "Whether the call succeeded.\n\nThis method checks if the current executable as the default handler for a protocol (aka URI scheme). If so, it will remove the app as the default handler.",
"parameters": [
{
"name": "protocol",
"description": "The name of your protocol, without `://`.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "Defaults to `process.execPath`",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "args",
"description": "Defaults to an empty array",
"required": false,
"collection": true,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appremoveasdefaultprotocolclientprotocol-path-args-macos-windows"
},
{
"name": "isDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"description": "Whether the current executable is the default handler for a protocol (aka URI scheme).\n\n**Note:** On macOS, you can use this method to check if the app has been registered as the default protocol handler for a protocol. You can also verify this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the macOS machine. Please refer to Apple's documentation for details.\n\nThe API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.",
"parameters": [
{
"name": "protocol",
"description": "The name of your protocol, without `://`.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "Defaults to `process.execPath`",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "args",
"description": "Defaults to an empty array",
"required": false,
"collection": true,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#appisdefaultprotocolclientprotocol-path-args"
},
{
"name": "getApplicationNameForProtocol",
"signature": "(url)",
"description": "Name of the application handling the protocol, or an empty string if there is no handler. For instance, if Electron is the default handler of the URL, this could be `Electron` on Windows and Mac. However, don't rely on the precise format which is not guaranteed to remain unchanged. Expect a different format on Linux, possibly with a `.desktop` suffix.\n\nThis method returns the application name of the default handler for the protocol (aka URI scheme) of a URL.",
"parameters": [
{
"name": "url",
"description": "a URL with the protocol name to check. Unlike the other methods in this family, this accepts an entire URL, including `://` at a minimum (e.g. `https://`).",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#appgetapplicationnameforprotocolurl"
},
{
"name": "getApplicationInfoForProtocol",
"signature": "(url)",
"description": "Resolve with an object containing the following:\n\n* `icon` NativeImage - the display icon of the app handling the protocol.\n* `path` String - installation path of the app handling the protocol.\n* `name` String - display name of the app handling the protocol.\n\nThis method returns a promise that contains the application name, icon and path of the default handler for the protocol (aka URI scheme) of a URL.",
"parameters": [
{
"name": "url",
"description": "a URL with the protocol name to check. Unlike the other methods in this family, this accepts an entire URL, including `://` at a minimum (e.g. `https://`).",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "Object",
"properties": [
{
"name": "icon",
"description": "the display icon of the app handling the protocol.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "NativeImage"
},
{
"name": "path",
"description": "installation path of the app handling the protocol.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "name",
"description": "display name of the app handling the protocol.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
]
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appgetapplicationinfoforprotocolurl-macos-windows"
},
{
"name": "setUserTasks",
"signature": "(tasks)",
"description": "Adds `tasks` to the Tasks category of the Jump List on Windows.\n\n`tasks` is an array of `Task` objects.\n\nWhether the call succeeded.\n\n**Note:** If you'd like to customize the Jump List even more use `app.setJumpList(categories)` instead.",
"parameters": [
{
"name": "tasks",
"description": "Array of `Task` objects",
"required": true,
"collection": true,
"type": "Task"
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_windows"
],
"urlFragment": "#appsetusertaskstasks-windows"
},
{
"name": "getJumpListSettings",
"signature": "()",
"description": "* `minItems` Integer - The minimum number of items that will be shown in the Jump List (for a more detailed description of this value see the MSDN docs).\n* `removedItems` JumpListItem[] - Array of `JumpListItem` objects that correspond to items that the user has explicitly removed from custom categories in the Jump List. These items must not be re-added to the Jump List in the **next** call to `app.setJumpList()`, Windows will not display any custom category that contains any of the removed items.",
"parameters": [],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "minItems",
"description": "The minimum number of items that will be shown in the Jump List (for a more detailed description of this value see the MSDN docs).",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "removedItems",
"description": "Array of `JumpListItem` objects that correspond to items that the user has explicitly removed from custom categories in the Jump List. These items must not be re-added to the Jump List in the **next** call to `app.setJumpList()`, Windows will not display any custom category that contains any of the removed items.",
"required": true,
"additionalTags": [],
"collection": true,
"type": "JumpListItem"
}
]
},
"additionalTags": [
"os_windows"
],
"urlFragment": "#appgetjumplistsettings-windows"
},
{
"name": "setJumpList",
"signature": "(categories)",
"description": "Sets or removes a custom Jump List for the application, and returns one of the following strings:\n\n* `ok` - Nothing went wrong.\n* `error` - One or more errors occurred, enable runtime logging to figure out the likely cause.\n* `invalidSeparatorError` - An attempt was made to add a separator to a custom category in the Jump List. Separators are only allowed in the standard `Tasks` category.\n* `fileTypeRegistrationError` - An attempt was made to add a file link to the Jump List for a file type the app isn't registered to handle.\n* `customCategoryAccessDeniedError` - Custom categories can't be added to the Jump List due to user privacy or group policy settings.\n\nIf `categories` is `null` the previously set custom Jump List (if any) will be replaced by the standard Jump List for the app (managed by Windows).\n\n**Note:** If a `JumpListCategory` object has neither the `type` nor the `name` property set then its `type` is assumed to be `tasks`. If the `name` property is set but the `type` property is omitted then the `type` is assumed to be `custom`.\n\n**Note:** Users can remove items from custom categories, and Windows will not allow a removed item to be added back into a custom category until **after** the next successful call to `app.setJumpList(categories)`. Any attempt to re-add a removed item to a custom category earlier than that will result in the entire custom category being omitted from the Jump List. The list of removed items can be obtained using `app.getJumpListSettings()`.\n\nHere's a very simple example of creating a custom Jump List:",
"parameters": [
{
"name": "categories",
"description": "Array of `JumpListCategory` objects.",
"required": true,
"collection": false,
"type": [
{
"collection": true,
"type": "JumpListCategory"
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#appsetjumplistcategories-windows"
},
{
"name": "requestSingleInstanceLock",
"signature": "()",
"description": "The return value of this method indicates whether or not this instance of your application successfully obtained the lock. If it failed to obtain the lock, you can assume that another instance of your application is already running with the lock and exit immediately.\n\nI.e. This method returns `true` if your process is the primary instance of your application and your app should continue loading. It returns `false` if your process should immediately quit as it has sent its parameters to another instance that has already acquired the lock.\n\nOn macOS, the system enforces single instance automatically when users try to open a second instance of your app in Finder, and the `open-file` and `open-url` events will be emitted for that. However when users start your app in command line, the system's single instance mechanism will be bypassed, and you have to use this method to ensure single instance.\n\nAn example of activating the window of primary instance when a second instance starts:",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#apprequestsingleinstancelock"
},
{
"name": "hasSingleInstanceLock",
"signature": "()",
"description": "This method returns whether or not this instance of your app is currently holding the single instance lock. You can request the lock with `app.requestSingleInstanceLock()` and release with `app.releaseSingleInstanceLock()`",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#apphassingleinstancelock"
},
{
"name": "releaseSingleInstanceLock",
"signature": "()",
"description": "Releases all locks that were created by `requestSingleInstanceLock`. This will allow multiple instances of the application to once again run side by side.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#appreleasesingleinstancelock"
},
{
"name": "setUserActivity",
"signature": "(type, userInfo[, webpageURL])",
"description": "Creates an `NSUserActivity` and sets it as the current activity. The activity is eligible for Handoff to another device afterward.",
"parameters": [
{
"name": "type",
"description": "Uniquely identifies the activity. Maps to `NSUserActivity.activityType`.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "userInfo",
"description": "App-specific state to store for use by another device.",
"required": true,
"collection": false,
"type": "any"
},
{
"name": "webpageURL",
"description": "The webpage to load in a browser if no suitable app is installed on the resuming device. The scheme must be `http` or `https`.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appsetuseractivitytype-userinfo-webpageurl-macos"
},
{
"name": "getCurrentActivityType",
"signature": "()",
"description": "The type of the currently running activity.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#appgetcurrentactivitytype-macos"
},
{
"name": "invalidateCurrentActivity",
"signature": "()",
"description": "Invalidates the current Handoff user activity.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appinvalidatecurrentactivity-macos"
},
{
"name": "resignCurrentActivity",
"signature": "()",
"description": "Marks the current Handoff user activity as inactive without invalidating it.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appresigncurrentactivity-macos"
},
{
"name": "updateCurrentActivity",
"signature": "(type, userInfo)",
"description": "Updates the current activity if its type matches `type`, merging the entries from `userInfo` into its current `userInfo` dictionary.",
"parameters": [
{
"name": "type",
"description": "Uniquely identifies the activity. Maps to `NSUserActivity.activityType`.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "userInfo",
"description": "App-specific state to store for use by another device.",
"required": true,
"collection": false,
"type": "any"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appupdatecurrentactivitytype-userinfo-macos"
},
{
"name": "setAppUserModelId",
"signature": "(id)",
"description": "Changes the Application User Model ID to `id`.",
"parameters": [
{
"name": "id",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#appsetappusermodelidid-windows"
},
{
"name": "setActivationPolicy",
"signature": "(policy)",
"description": "Sets the activation policy for a given app.\n\nActivation policy types:\n\n* 'regular' - The application is an ordinary app that appears in the Dock and may have a user interface.\n* 'accessory' - The application doesn’t appear in the Dock and doesn’t have a menu bar, but it may be activated programmatically or by clicking on one of its windows.\n* 'prohibited' - The application doesn’t appear in the Dock and may not create windows or be activated.",
"parameters": [
{
"name": "policy",
"description": "Can be 'regular', 'accessory', or 'prohibited'.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "regular",
"description": ""
},
{
"value": "accessory",
"description": ""
},
{
"value": "prohibited",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appsetactivationpolicypolicy-macos"
},
{
"name": "importCertificate",
"signature": "(options, callback)",
"description": "Imports the certificate in pkcs12 format into the platform certificate store. `callback` is called with the `result` of import operation, a value of `0` indicates success while any other value indicates failure according to Chromium net_error_list.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "certificate",
"description": "Path for the pkcs12 file.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "password",
"description": "Passphrase for the certificate.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "callback",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "result",
"description": "Result of import.",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [
"os_linux"
],
"urlFragment": "#appimportcertificateoptions-callback-linux"
},
{
"name": "disableHardwareAcceleration",
"signature": "()",
"description": "Disables hardware acceleration for current app.\n\nThis method can only be called before app is ready.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#appdisablehardwareacceleration"
},
{
"name": "disableDomainBlockingFor3DAPIs",
"signature": "()",
"description": "By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per domain basis if the GPU processes crashes too frequently. This function disables that behavior.\n\nThis method can only be called before app is ready.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#appdisabledomainblockingfor3dapis"
},
{
"name": "getAppMetrics",
"signature": "()",
"description": "Array of `ProcessMetric` objects that correspond to memory and CPU usage statistics of all the processes associated with the app.",
"parameters": [],
"returns": {
"collection": true,
"type": "ProcessMetric"
},
"additionalTags": [],
"urlFragment": "#appgetappmetrics"
},
{
"name": "getGPUFeatureStatus",
"signature": "()",
"description": "The Graphics Feature Status from `chrome://gpu/`.\n\n**Note:** This information is only usable after the `gpu-info-update` event is emitted.",
"parameters": [],
"returns": {
"collection": false,
"type": "GPUFeatureStatus"
},
"additionalTags": [],
"urlFragment": "#appgetgpufeaturestatus"
},
{
"name": "getGPUInfo",
"signature": "(infoType)",
"description": "For `infoType` equal to `complete`: Promise is fulfilled with `Object` containing all the GPU Information as in chromium's GPUInfo object. This includes the version and driver information that's shown on `chrome://gpu` page.\n\nFor `infoType` equal to `basic`: Promise is fulfilled with `Object` containing fewer attributes than when requested with `complete`. Here's an example of basic response:\n\nUsing `basic` should be preferred if only basic information like `vendorId` or `driverId` is needed.",
"parameters": [
{
"name": "infoType",
"description": "Can be `basic` or `complete`.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "basic",
"description": ""
},
{
"value": "complete",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "unknown"
}
]
},
"additionalTags": [],
"urlFragment": "#appgetgpuinfoinfotype"
},
{
"name": "setBadgeCount",
"signature": "(count)",
"description": "Whether the call succeeded.\n\nSets the counter badge for current app. Setting the count to `0` will hide the badge.\n\nOn macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.\n\n**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read Desktop Environment Integration.",
"parameters": [
{
"name": "count",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_linux",
"os_macos"
],
"urlFragment": "#appsetbadgecountcount-linux-macos"
},
{
"name": "getBadgeCount",
"signature": "()",
"description": "The current value displayed in the counter badge.",
"parameters": [],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [
"os_linux",
"os_macos"
],
"urlFragment": "#appgetbadgecount-linux-macos"
},
{
"name": "isUnityRunning",
"signature": "()",
"description": "Whether the current desktop environment is Unity launcher.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_linux"
],
"urlFragment": "#appisunityrunning-linux"
},
{
"name": "getLoginItemSettings",
"signature": "([options])",
"description": "If you provided `path` and `args` options to `app.setLoginItemSettings`, then you need to pass the same arguments here for `openAtLogin` to be set correctly.\n\n\n* `openAtLogin` Boolean - `true` if the app is set to open at login.\n* `openAsHidden` Boolean _macOS_ - `true` if the app is set to open as hidden at login. This setting is not available on MAS builds.\n* `wasOpenedAtLogin` Boolean _macOS_ - `true` if the app was opened at login automatically. This setting is not available on MAS builds.\n* `wasOpenedAsHidden` Boolean _macOS_ - `true` if the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on MAS builds.\n* `restoreState` Boolean _macOS_ - `true` if the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on MAS builds.\n* `executableWillLaunchAtLogin` Boolean _Windows_ - `true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.\n* `launchItems` Object[] _Windows_\n * `name` String _Windows_ - name value of a registry entry.\n * `path` String _Windows_ - The executable to an app that corresponds to a registry entry.\n * `args` String[] _Windows_ - the command-line arguments to pass to the executable.\n * `scope` String _Windows_ - one of `user` or `machine`. Indicates whether the registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.\n * `enabled` Boolean _Windows_ - `true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "path",
"description": "The executable path to compare against. Defaults to `process.execPath`.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "args",
"description": "The command-line arguments to compare against. Defaults to an empty array.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": true,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "openAtLogin",
"description": "`true` if the app is set to open at login.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "openAsHidden",
"description": "`true` if the app is set to open as hidden at login. This setting is not available on MAS builds.",
"required": true,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "wasOpenedAtLogin",
"description": "`true` if the app was opened at login automatically. This setting is not available on MAS builds.",
"required": true,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "wasOpenedAsHidden",
"description": "`true` if the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on MAS builds.",
"required": true,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "restoreState",
"description": "`true` if the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on MAS builds.",
"required": true,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "executableWillLaunchAtLogin",
"description": "`true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "Boolean"
},
{
"name": "launchItems",
"description": "",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": true,
"type": "Object",
"properties": [
{
"name": "name",
"description": "name value of a registry entry.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "The executable to an app that corresponds to a registry entry.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "args",
"description": "the command-line arguments to pass to the executable.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "scope",
"description": "one of `user` or `machine`. Indicates whether the registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "enabled",
"description": "`true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "Boolean"
}
]
}
]
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appgetloginitemsettingsoptions-macos-windows"
},
{
"name": "setLoginItemSettings",
"signature": "(settings)",
"description": "To work with Electron's `autoUpdater` on Windows, which uses Squirrel, you'll want to set the launch path to Update.exe, and pass arguments that specify your application name. For example:",
"parameters": [
{
"name": "settings",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "openAtLogin",
"description": "`true` to open the app at login, `false` to remove the app as a login item. Defaults to `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "openAsHidden",
"description": "`true` to open the app as hidden. Defaults to `false`. The user can edit this setting from the System Preferences so `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is opened to know the current value. This setting is not available on MAS builds.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "path",
"description": "The executable to launch at login. Defaults to `process.execPath`.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "args",
"description": "The command-line arguments to pass to the executable. Defaults to an empty array. Take care to wrap paths in quotes.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "enabled",
"description": "`true` will change the startup approved registry key and `enable / disable` the App in Task Manager and Windows Settings. Defaults to `true`.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "Boolean"
},
{
"name": "name",
"description": "value name to write into registry. Defaults to the app's AppUserModelId(). Set the app's login item settings.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appsetloginitemsettingssettings-macos-windows"
},
{
"name": "isAccessibilitySupportEnabled",
"signature": "()",
"description": "`true` if Chrome's accessibility support is enabled, `false` otherwise. This API will return `true` if the use of assistive technologies, such as screen readers, has been detected. See https://www.chromium.org/developers/design-documents/accessibility for more details.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appisaccessibilitysupportenabled-macos-windows"
},
{
"name": "setAccessibilitySupportEnabled",
"signature": "(enabled)",
"description": "Manually enables Chrome's accessibility support, allowing to expose accessibility switch to users in application settings. See Chromium's accessibility docs for more details. Disabled by default.\n\nThis API must be called after the `ready` event is emitted.\n\n**Note:** Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.",
"parameters": [
{
"name": "enabled",
"description": "Enable or disable accessibility tree rendering",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appsetaccessibilitysupportenabledenabled-macos-windows"
},
{
"name": "showAboutPanel",
"signature": "()",
"description": "Show the app's about panel options. These options can be overridden with `app.setAboutPanelOptions(options)`.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#appshowaboutpanel"
},
{
"name": "setAboutPanelOptions",
"signature": "(options)",
"description": "Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the Apple docs for more details. On Linux, values must be set in order to be shown; there are no defaults.\n\nIf you do not set `credits` but still wish to surface them in your app, AppKit will look for a file named \"Credits.html\", \"Credits.rtf\", and \"Credits.rtfd\", in that order, in the bundle returned by the NSBundle class method main. The first file found is used, and if none is found, the info area is left blank. See Apple documentation for more information.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "applicationName",
"description": "The app's name.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "applicationVersion",
"description": "The app's version.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "copyright",
"description": "Copyright information.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "version",
"description": "The app's build version number.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "credits",
"description": "Credit information.",
"required": false,
"additionalTags": [
"os_macos",
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "authors",
"description": "List of app authors.",
"required": false,
"additionalTags": [
"os_linux"
],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "website",
"description": "The app's website.",
"required": false,
"additionalTags": [
"os_linux"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "iconPath",
"description": "Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.",
"required": false,
"additionalTags": [
"os_linux",
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#appsetaboutpaneloptionsoptions"
},
{
"name": "isEmojiPanelSupported",
"signature": "()",
"description": "whether or not the current OS version allows for native emoji pickers.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#appisemojipanelsupported"
},
{
"name": "showEmojiPanel",
"signature": "()",
"description": "Show the platform's native emoji picker.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appshowemojipanel-macos-windows"
},
{
"name": "startAccessingSecurityScopedResource",
"signature": "(bookmarkData)",
"description": "This function **must** be called once you have finished accessing the security scoped file. If you do not remember to stop accessing the bookmark, kernel resources will be leaked and your app will lose its ability to reach outside the sandbox completely, until your app is restarted.\n\nStart accessing a security scoped resource. With this method Electron applications that are packaged for the Mac App Store may reach outside their sandbox to access files chosen by the user. See Apple's documentation for a description of how this system works.",
"parameters": [
{
"name": "bookmarkData",
"description": "The base64 encoded security scoped bookmark data returned by the `dialog.showOpenDialog` or `dialog.showSaveDialog` methods.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
},
"additionalTags": [
"os_mas"
],
"urlFragment": "#appstartaccessingsecurityscopedresourcebookmarkdata-mas"
},
{
"name": "enableSandbox",
"signature": "()",
"description": "Enables full sandbox mode on the app. This means that all renderers will be launched sandboxed, regardless of the value of the `sandbox` flag in WebPreferences.\n\nThis method can only be called before app is ready.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#appenablesandbox"
},
{
"name": "isInApplicationsFolder",
"signature": "()",
"description": "Whether the application is currently running from the systems Application folder. Use in combination with `app.moveToApplicationsFolder()`",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#appisinapplicationsfolder-macos"
},
{
"name": "moveToApplicationsFolder",
"signature": "([options])",
"description": "Whether the move was successful. Please note that if the move is successful, your application will quit and relaunch.\n\nNo confirmation dialog will be presented by default. If you wish to allow the user to confirm the operation, you may do so using the `dialog` API.\n\n**NOTE:** This method throws errors if anything other than the user causes the move to fail. For instance if the user cancels the authorization dialog, this method returns false. If we fail to perform the copy, then this method will throw an error. The message in the error should be informative and tell you exactly what went wrong.\n\nBy default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.\n\nFor example:\n\nWould mean that if an app already exists in the user directory, if the user chooses to 'Continue Move' then the function would continue with its default behavior and the existing app will be trashed and the active app moved into its place.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "conflictHandler",
"description": "A handler for potential conflict in move failure.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Function",
"parameters": [
{
"name": "conflictType",
"description": "The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "exists",
"description": ""
},
{
"value": "existsAndRunning",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "Boolean"
}
}
]
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#appmovetoapplicationsfolderoptions-macos"
},
{
"name": "isSecureKeyboardEntryEnabled",
"signature": "()",
"description": "whether `Secure Keyboard Entry` is enabled.\n\nBy default this API will return `false`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#appissecurekeyboardentryenabled-macos"
},
{
"name": "setSecureKeyboardEntryEnabled",
"signature": "(enabled)",
"description": "Set the `Secure Keyboard Entry` is enabled in your application.\n\nBy using this API, important information such as password and other sensitive information can be prevented from being intercepted by other processes.\n\nSee Apple's documentation for more details.\n\n**Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it when it is no longer needed.",
"parameters": [
{
"name": "enabled",
"description": "Enable or disable `Secure Keyboard Entry`",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#appsetsecurekeyboardentryenabledenabled-macos"
}
],
"properties": [
{
"name": "accessibilitySupportEnabled",
"description": "A `Boolean` property that's `true` if Chrome's accessibility support is enabled, `false` otherwise. This property will be `true` if the use of assistive technologies, such as screen readers, has been detected. Setting this property to `true` manually enables Chrome's accessibility support, allowing developers to expose accessibility switch to users in application settings.\n\nSee Chromium's accessibility docs for more details. Disabled by default.\n\nThis API must be called after the `ready` event is emitted.\n\n**Note:** Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.",
"required": true,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#appaccessibilitysupportenabled-macos-windows",
"collection": false,
"type": "Boolean"
},
{
"name": "applicationMenu",
"description": "A `Menu | null` property that returns `Menu` if one has been set and `null` otherwise. Users can pass a Menu to set this property.",
"required": true,
"additionalTags": [],
"urlFragment": "#appapplicationmenu",
"collection": false,
"type": [
{
"collection": false,
"type": "Menu"
},
{
"type": "null",
"collection": false
}
]
},
{
"name": "badgeCount",
"description": "An `Integer` property that returns the badge count for current app. Setting the count to `0` will hide the badge.\n\nOn macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher.\n\n**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read Desktop Environment Integration.\n\n**Note:** On macOS, you need to ensure that your application has the permission to display notifications for this property to take effect.",
"required": true,
"additionalTags": [
"os_linux",
"os_macos"
],
"urlFragment": "#appbadgecount-linux-macos",
"collection": false,
"type": "Integer"
},
{
"name": "commandLine",
"description": "A `CommandLine` object that allows you to read and manipulate the command line arguments that Chromium uses.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#appcommandline-readonly",
"collection": false,
"type": "CommandLine"
},
{
"name": "dock",
"description": "A `Dock` `| undefined` object that allows you to perform actions on your app icon in the user's dock on macOS.",
"required": true,
"additionalTags": [
"os_macos",
"availability_readonly"
],
"urlFragment": "#appdock-macos-readonly",
"collection": false,
"type": "Dock"
},
{
"name": "isPackaged",
"description": "A `Boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#appispackaged-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "name",
"description": "A `String` property that indicates the current application's name, which is the name in the application's `package.json` file.\n\nUsually the `name` field of `package.json` is a short lowercase name, according to the npm modules spec. You should usually also specify a `productName` field, which is your application's full capitalized name, and which will be preferred over `name` by Electron.",
"required": true,
"additionalTags": [],
"urlFragment": "#appname",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "userAgentFallback",
"description": "A `String` which is the user agent string Electron will use as a global fallback.\n\nThis is the user agent that will be used when no user agent is set at the `webContents` or `session` level. It is useful for ensuring that your entire app has the same user agent. Set to a custom value as early as possible in your app's initialization to ensure that your overridden value is used.",
"required": true,
"additionalTags": [],
"urlFragment": "#appuseragentfallback",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "allowRendererProcessReuse",
"description": "A `Boolean` which when `true` disables the overrides that Electron has in place to ensure renderer processes are restarted on every navigation. The current default value for this property is `true`.\n\nThe intention is for these overrides to become disabled by default and then at some point in the future this property will be removed. This property impacts which native modules you can use in the renderer process. For more information on the direction Electron is going with renderer process restarts and usage of native modules in the renderer process please check out this Tracking Issue.",
"required": true,
"additionalTags": [],
"urlFragment": "#appallowrendererprocessreuse",
"collection": false,
"type": "Boolean"
},
{
"name": "runningUnderRosettaTranslation",
"description": "A `Boolean` which when `true` indicates that the app is currently running under the Rosetta Translator Environment.\n\nYou can use this property to prompt users to download the arm64 version of your application when they are running the x64 version under Rosetta incorrectly.",
"required": true,
"additionalTags": [
"os_macos",
"availability_readonly"
],
"urlFragment": "#apprunningunderrosettatranslation-macos-readonly",
"collection": false,
"type": "Boolean"
}
],
"events": [
{
"name": "will-finish-launching",
"description": "Emitted when the application has finished basic startup. On Windows and Linux, the `will-finish-launching` event is the same as the `ready` event; on macOS, this event represents the `applicationWillFinishLaunching` notification of `NSApplication`. You would usually set up listeners for the `open-file` and `open-url` events here, and start the crash reporter and auto updater.\n\nIn most cases, you should do everything in the `ready` event handler.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-will-finish-launching"
},
{
"name": "ready",
"description": "Emitted once, when Electron has finished initializing. On macOS, `launchInfo` holds the `userInfo` of the `NSUserNotification` or information from `UNNotificationResponse` that was used to open the application, if it was launched from Notification Center. You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()` to get a Promise that is fulfilled when Electron is initialized.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "launchInfo",
"description": "",
"collection": false,
"type": [
{
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "string"
},
{
"collection": false,
"type": "any"
}
]
},
{
"collection": false,
"type": "NotificationResponse"
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-ready"
},
{
"name": "window-all-closed",
"description": "Emitted when all windows have been closed.\n\nIf you do not subscribe to this event and all windows are closed, the default behavior is to quit the app; however, if you subscribe, you control whether the app quits or not. If the user pressed `Cmd + Q`, or the developer called `app.quit()`, Electron will first try to close all the windows and then emit the `will-quit` event, and in this case the `window-all-closed` event would not be emitted.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-window-all-closed"
},
{
"name": "before-quit",
"description": "Emitted before the application starts closing its windows. Calling `event.preventDefault()` will prevent the default behavior, which is terminating the application.\n\n**Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`, then `before-quit` is emitted *after* emitting `close` event on all windows and closing them.\n\n**Note:** On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-before-quit"
},
{
"name": "will-quit",
"description": "Emitted when all windows have been closed and the application will quit. Calling `event.preventDefault()` will prevent the default behavior, which is terminating the application.\n\nSee the description of the `window-all-closed` event for the differences between the `will-quit` and `window-all-closed` events.\n\n**Note:** On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-will-quit"
},
{
"name": "quit",
"description": "Emitted when the application is quitting.\n\n**Note:** On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "exitCode",
"description": "",
"collection": false,
"type": "Integer",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-quit"
},
{
"name": "open-file",
"description": "Emitted when the user wants to open a file with the application. The `open-file` event is usually emitted when the application is already open and the OS wants to reuse the application to open the file. `open-file` is also emitted when a file is dropped onto the dock and the application is not yet running. Make sure to listen for the `open-file` event very early in your application startup to handle this case (even before the `ready` event is emitted).\n\nYou should call `event.preventDefault()` if you want to handle this event.\n\nOn Windows, you have to parse `process.argv` (in the main process) to get the filepath.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "path",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-open-file-macos"
},
{
"name": "open-url",
"description": "Emitted when the user wants to open a URL with the application. Your application's `Info.plist` file must define the URL scheme within the `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.\n\nYou should call `event.preventDefault()` if you want to handle this event.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "url",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-open-url-macos"
},
{
"name": "activate",
"description": "Emitted when the application is activated. Various actions can trigger this event, such as launching the application for the first time, attempting to re-launch the application when it's already running, or clicking on the application's dock or taskbar icon.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "hasVisibleWindows",
"description": "",
"collection": false,
"type": "Boolean",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-activate-macos"
},
{
"name": "did-become-active",
"description": "Emitted when mac application become active. Difference from `activate` event is that `did-become-active` is emitted every time the app becomes active, not only when Dock icon is clicked or application is re-launched.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-did-become-active-macos"
},
{
"name": "continue-activity",
"description": "Emitted during Handoff when an activity from a different device wants to be resumed. You should call `event.preventDefault()` if you want to handle this event.\n\nA user activity can be continued only in an app that has the same developer Team ID as the activity's source app and that supports the activity's type. Supported activity types are specified in the app's `Info.plist` under the `NSUserActivityTypes` key.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "type",
"description": "A string identifying the activity. Maps to `NSUserActivity.activityType`.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "userInfo",
"description": "Contains app-specific state stored by the activity on another device.",
"collection": false,
"type": "unknown",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-continue-activity-macos"
},
{
"name": "will-continue-activity",
"description": "Emitted during Handoff before an activity from a different device wants to be resumed. You should call `event.preventDefault()` if you want to handle this event.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "type",
"description": "A string identifying the activity. Maps to `NSUserActivity.activityType`.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-will-continue-activity-macos"
},
{
"name": "continue-activity-error",
"description": "Emitted during Handoff when an activity from a different device fails to be resumed.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "type",
"description": "A string identifying the activity. Maps to `NSUserActivity.activityType`.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "error",
"description": "A string with the error's localized description.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-continue-activity-error-macos"
},
{
"name": "activity-was-continued",
"description": "Emitted during Handoff after an activity from this device was successfully resumed on another one.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "type",
"description": "A string identifying the activity. Maps to `NSUserActivity.activityType`.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "userInfo",
"description": "Contains app-specific state stored by the activity.",
"collection": false,
"type": "unknown",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-activity-was-continued-macos"
},
{
"name": "update-activity-state",
"description": "Emitted when Handoff is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "type",
"description": "A string identifying the activity. Maps to `NSUserActivity.activityType`.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "userInfo",
"description": "Contains app-specific state stored by the activity.",
"collection": false,
"type": "unknown",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-update-activity-state-macos"
},
{
"name": "new-window-for-tab",
"description": "Emitted when the user clicks the native macOS new tab button. The new tab button is only visible if the current `BrowserWindow` has a `tabbingIdentifier`",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-new-window-for-tab-macos"
},
{
"name": "browser-window-blur",
"description": "Emitted when a browserWindow gets blurred.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "window",
"description": "",
"collection": false,
"type": "BrowserWindow",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-browser-window-blur"
},
{
"name": "browser-window-focus",
"description": "Emitted when a browserWindow gets focused.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "window",
"description": "",
"collection": false,
"type": "BrowserWindow",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-browser-window-focus"
},
{
"name": "browser-window-created",
"description": "Emitted when a new browserWindow is created.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "window",
"description": "",
"collection": false,
"type": "BrowserWindow",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-browser-window-created"
},
{
"name": "web-contents-created",
"description": "Emitted when a new webContents is created.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-web-contents-created"
},
{
"name": "certificate-error",
"description": "Emitted when failed to verify the `certificate` for `url`, to trust the certificate you should prevent the default behavior with `event.preventDefault()` and call `callback(true)`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "url",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "error",
"description": "The error code",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "certificate",
"description": "",
"collection": false,
"type": "Certificate",
"required": true
},
{
"name": "callback",
"description": "",
"collection": false,
"type": "Function",
"parameters": [
{
"name": "isTrusted",
"description": "Whether to consider the certificate as trusted",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-certificate-error"
},
{
"name": "select-client-certificate",
"description": "Emitted when a client certificate is requested.\n\nThe `url` corresponds to the navigation entry requesting the client certificate and `callback` can be called with an entry filtered from the list. Using `event.preventDefault()` prevents the application from using the first certificate from the store.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "url",
"description": "",
"collection": false,
"type": "URL",
"required": true
},
{
"name": "certificateList",
"description": "",
"collection": true,
"type": "Certificate",
"required": true
},
{
"name": "callback",
"description": "",
"collection": false,
"type": "Function",
"parameters": [
{
"name": "certificate",
"description": "",
"required": false,
"collection": false,
"type": "Certificate"
}
],
"returns": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-select-client-certificate"
},
{
"name": "login",
"description": "Emitted when `webContents` wants to do basic auth.\n\nThe default behavior is to cancel all authentications. To override this you should prevent the default behavior with `event.preventDefault()` and call `callback(username, password)` with the credentials.\n\nIf `callback` is called without a username or password, the authentication request will be cancelled and the authentication error will be returned to the page.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "authenticationResponseDetails",
"description": "",
"collection": false,
"type": "Object",
"properties": [
{
"name": "url",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "URL"
}
],
"required": true
},
{
"name": "authInfo",
"description": "",
"collection": false,
"type": "Object",
"properties": [
{
"name": "isProxy",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "scheme",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "host",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "port",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "realm",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
],
"required": true
},
{
"name": "callback",
"description": "",
"collection": false,
"type": "Function",
"parameters": [
{
"name": "username",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "password",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-login"
},
{
"name": "gpu-info-update",
"description": "Emitted whenever there is a GPU info update.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-gpu-info-update"
},
{
"name": "gpu-process-crashed",
"description": "Emitted when the GPU process crashes or is killed.\n\n**Deprecated:** This event is superceded by the `child-process-gone` event which contains more information about why the child process disappeared. It isn't always because it crashed. The `killed` boolean can be replaced by checking `reason === 'killed'` when you switch to that event.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "killed",
"description": "",
"collection": false,
"type": "Boolean",
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-gpu-process-crashed-deprecated"
},
{
"name": "renderer-process-crashed",
"description": "",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "killed",
"description": "",
"collection": false,
"type": "Boolean",
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-renderer-process-crashed-deprecated"
},
{
"name": "render-process-gone",
"description": "Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "details",
"description": "",
"collection": false,
"type": "Object",
"properties": [
{
"name": "reason",
"description": "The reason the render process is gone. Possible values:",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "clean-exit",
"description": "Process exited with an exit code of zero"
},
{
"value": "abnormal-exit",
"description": "Process exited with a non-zero exit code"
},
{
"value": "killed",
"description": "Process was sent a SIGTERM or otherwise killed externally"
},
{
"value": "crashed",
"description": "Process crashed"
},
{
"value": "oom",
"description": "Process ran out of memory"
},
{
"value": "launch-failed",
"description": "Process never successfully launched"
},
{
"value": "integrity-failure",
"description": "Windows code integrity checks failed"
}
]
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-render-process-gone"
},
{
"name": "child-process-gone",
"description": "Emitted when the child process unexpectedly disappears. This is normally because it was crashed or killed. It does not include renderer processes.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "details",
"description": "",
"collection": false,
"type": "Object",
"properties": [
{
"name": "type",
"description": "Process type. One of the following values:",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "Utility",
"description": ""
},
{
"value": "Zygote",
"description": ""
},
{
"value": "Sandbox helper",
"description": ""
},
{
"value": "GPU",
"description": ""
},
{
"value": "Pepper Plugin",
"description": ""
},
{
"value": "Pepper Plugin Broker",
"description": ""
},
{
"value": "Unknown",
"description": ""
}
]
},
{
"name": "reason",
"description": "The reason the child process is gone. Possible values:",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "clean-exit",
"description": "Process exited with an exit code of zero"
},
{
"value": "abnormal-exit",
"description": "Process exited with a non-zero exit code"
},
{
"value": "killed",
"description": "Process was sent a SIGTERM or otherwise killed externally"
},
{
"value": "crashed",
"description": "Process crashed"
},
{
"value": "oom",
"description": "Process ran out of memory"
},
{
"value": "launch-failed",
"description": "Process never successfully launched"
},
{
"value": "integrity-failure",
"description": "Windows code integrity checks failed"
}
]
},
{
"name": "exitCode",
"description": "The exit code for the process (e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows).",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "serviceName",
"description": "The non-localized name of the process.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "name",
"description": "The name of the process. Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-child-process-gone"
},
{
"name": "accessibility-support-changed",
"description": "Emitted when Chrome's accessibility support changes. This event fires when assistive technologies, such as screen readers, are enabled or disabled. See https://www.chromium.org/developers/design-documents/accessibility for more details.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "accessibilitySupportEnabled",
"description": "`true` when Chrome's accessibility support is enabled, `false` otherwise.",
"collection": false,
"type": "Boolean",
"required": true
}
],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-accessibility-support-changed-macos-windows"
},
{
"name": "session-created",
"description": "Emitted when Electron has created a new `session`.",
"parameters": [
{
"name": "session",
"description": "",
"collection": false,
"type": "Session",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-session-created"
},
{
"name": "second-instance",
"description": "This event will be emitted inside the primary instance of your application when a second instance has been executed and calls `app.requestSingleInstanceLock()`.\n\n`argv` is an Array of the second instance's command line arguments, and `workingDirectory` is its current working directory. Usually applications respond to this by making their primary window focused and non-minimized.\n\n**Note:** If the second instance is started by a different user than the first, the `argv` array will not include the arguments.\n\nThis event is guaranteed to be emitted after the `ready` event of `app` gets emitted.\n\n**Note:** Extra command line arguments might be added by Chromium, such as `--original-process-start-time`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "argv",
"description": "An array of the second instance's command line arguments",
"collection": true,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "workingDirectory",
"description": "The second instance's working directory",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-second-instance"
},
{
"name": "desktop-capturer-get-sources",
"description": "Emitted when `desktopCapturer.getSources()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will make it return empty sources.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-desktop-capturer-get-sources"
},
{
"name": "remote-require",
"description": "Emitted when `remote.require()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the module from being returned. Custom value can be returned by setting `event.returnValue`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "moduleName",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-remote-require-deprecated"
},
{
"name": "remote-get-global",
"description": "Emitted when `remote.getGlobal()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the global from being returned. Custom value can be returned by setting `event.returnValue`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "globalName",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-remote-get-global-deprecated"
},
{
"name": "remote-get-builtin",
"description": "Emitted when `remote.getBuiltin()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the module from being returned. Custom value can be returned by setting `event.returnValue`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
},
{
"name": "moduleName",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-remote-get-builtin-deprecated"
},
{
"name": "remote-get-current-window",
"description": "Emitted when `remote.getCurrentWindow()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Custom value can be returned by setting `event.returnValue`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-remote-get-current-window-deprecated"
},
{
"name": "remote-get-current-web-contents",
"description": "Emitted when `remote.getCurrentWebContents()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Custom value can be returned by setting `event.returnValue`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "webContents",
"description": "",
"collection": false,
"type": "WebContents",
"required": true
}
],
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#event-remote-get-current-web-contents-deprecated"
}
],
"exportedClasses": []
},
{
"name": "autoUpdater",
"description": "> Enable apps to automatically update themselves.\n\nProcess: Main\n\n**See also: A detailed guide about how to implement updates in your application.**\n\n`autoUpdater` is an EventEmitter.\n\n### Platform Notices\n\nCurrently, only macOS and Windows are supported. There is no built-in support for auto-updater on Linux, so it is recommended to use the distribution's package manager to update your app.\n\nIn addition, there are some subtle differences on each platform:\n\n### macOS\n\nOn macOS, the `autoUpdater` module is built upon Squirrel.Mac, meaning you don't need any special setup to make it work. For server-side requirements, you can read Server Support. Note that App Transport Security (ATS) applies to all requests made as part of the update process. Apps that need to disable ATS can add the `NSAllowsArbitraryLoads` key to their app's plist.\n\n**Note:** Your application must be signed for automatic updates on macOS. This is a requirement of `Squirrel.Mac`.\n\n### Windows\n\nOn Windows, you have to install your app into a user's machine before you can use the `autoUpdater`, so it is recommended that you use the electron-winstaller, electron-forge or the grunt-electron-installer package to generate a Windows installer.\n\nWhen using electron-winstaller or electron-forge make sure you do not try to update your app the first time it runs (Also see this issue for more info). It's also recommended to use electron-squirrel-startup to get desktop shortcuts for your app.\n\nThe installer generated with Squirrel will create a shortcut icon with an Application User Model ID in the format of `com.squirrel.PACKAGE_ID.YOUR_EXE_WITHOUT_DOT_EXE`, examples are `com.squirrel.slack.Slack` and `com.squirrel.code.Code`. You have to use the same ID for your app with `app.setAppUserModelId` API, otherwise Windows will not be able to pin your app properly in task bar.\n\nUnlike Squirrel.Mac, Windows can host updates on S3 or any other static file host. You can read the documents of Squirrel.Windows to get more details about how Squirrel.Windows works.",
"slug": "auto-updater",
"websiteUrl": "https://electronjs.org/docs/api/auto-updater",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/auto-updater.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "setFeedURL",
"signature": "(options)",
"description": "Sets the `url` and initialize the auto updater.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "url",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "headers",
"description": "HTTP request headers.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "serverType",
"description": "Can be `json` or `default`, see the Squirrel.Mac README for more information.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "json",
"description": ""
},
{
"value": "default",
"description": ""
}
]
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#autoupdatersetfeedurloptions"
},
{
"name": "getFeedURL",
"signature": "()",
"description": "The current update feed URL.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#autoupdatergetfeedurl"
},
{
"name": "checkForUpdates",
"signature": "()",
"description": "Asks the server whether there is an update. You must call `setFeedURL` before using this API.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#autoupdatercheckforupdates"
},
{
"name": "quitAndInstall",
"signature": "()",
"description": "Restarts the app and installs the update after it has been downloaded. It should only be called after `update-downloaded` has been emitted.\n\nUnder the hood calling `autoUpdater.quitAndInstall()` will close all application windows first, and automatically call `app.quit()` after all windows have been closed.\n\n**Note:** It is not strictly necessary to call this function to apply an update, as a successfully downloaded update will always be applied the next time the application starts.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#autoupdaterquitandinstall"
}
],
"properties": [],
"events": [
{
"name": "error",
"description": "Emitted when there is an error while updating.",
"parameters": [
{
"name": "error",
"description": "",
"collection": false,
"type": "Error",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-error"
},
{
"name": "checking-for-update",
"description": "Emitted when checking if an update has started.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-checking-for-update"
},
{
"name": "update-available",
"description": "Emitted when there is an available update. The update is downloaded automatically.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-update-available"
},
{
"name": "update-not-available",
"description": "Emitted when there is no available update.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-update-not-available"
},
{
"name": "update-downloaded",
"description": "Emitted when an update has been downloaded.\n\nOn Windows only `releaseName` is available.\n\n**Note:** It is not strictly necessary to handle this event. A successfully downloaded update will still be applied the next time the application starts.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "releaseNotes",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "releaseName",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "releaseDate",
"description": "",
"collection": false,
"type": "Date",
"required": true
},
{
"name": "updateURL",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-update-downloaded"
},
{
"name": "before-quit-for-update",
"description": "This event is emitted after a user calls `quitAndInstall()`.\n\nWhen this API is called, the `before-quit` event is not emitted before all windows are closed. As a result you should listen to this event if you wish to perform actions before the windows are closed while a process is quitting, as well as listening to `before-quit`.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-before-quit-for-update"
}
],
"exportedClasses": []
},
{
"name": "BrowserView",
"description": "> Create and control views.\n\nProcess: Main\n\nA `BrowserView` can be used to embed additional web content into a `BrowserWindow`. It is like a child window, except that it is positioned relative to its owning window. It is meant to be an alternative to the `webview` tag.\n\n### Example\n\n```\n// In the main process.\nconst { BrowserView, BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow({ width: 800, height: 600 })\n\nconst view = new BrowserView()\nwin.setBrowserView(view)\nview.setBounds({ x: 0, y: 0, width: 300, height: 300 })\nview.webContents.loadURL('https://electronjs.org')\n```",
"slug": "browser-view",
"websiteUrl": "https://electronjs.org/docs/api/browser-view",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/browser-view.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": {
"signature": "([options])",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "webPreferences",
"description": "See BrowserWindow.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Object",
"properties": []
}
]
}
]
},
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "setAutoResize",
"signature": "(options)",
"description": "",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "width",
"description": "If `true`, the view's width will grow and shrink together with the window. `false` by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "height",
"description": "If `true`, the view's height will grow and shrink together with the window. `false` by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "horizontal",
"description": "If `true`, the view's x position and width will grow and shrink proportionally with the window. `false` by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "vertical",
"description": "If `true`, the view's y position and height will grow and shrink proportionally with the window. `false` by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#viewsetautoresizeoptions-experimental"
},
{
"name": "setBounds",
"signature": "(bounds)",
"description": "Resizes and moves the view to the supplied bounds relative to the window.",
"parameters": [
{
"name": "bounds",
"description": "",
"required": true,
"collection": false,
"type": "Rectangle"
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#viewsetboundsbounds-experimental"
},
{
"name": "getBounds",
"signature": "()",
"description": "The `bounds` of this BrowserView instance as `Object`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Rectangle"
},
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#viewgetbounds-experimental"
},
{
"name": "setBackgroundColor",
"signature": "(color)",
"description": "",
"parameters": [
{
"name": "color",
"description": "Color in `#aarrggbb` or `#argb` form. The alpha channel is optional.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#viewsetbackgroundcolorcolor-experimental"
}
],
"instanceProperties": [
{
"name": "webContents",
"description": "A `WebContents` object owned by this view.",
"required": true,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#viewwebcontents-experimental",
"collection": false,
"type": "WebContents"
}
],
"instanceEvents": [],
"instanceName": "view"
},
{
"name": "BrowserWindowProxy",
"description": "",
"slug": "browser-window-proxy",
"websiteUrl": "https://electronjs.org/docs/api/browser-window-proxy",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/browser-window-proxy.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": false,
"renderer": true
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "blur",
"signature": "()",
"description": "Removes focus from the child window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winblur"
},
{
"name": "close",
"signature": "()",
"description": "Forcefully closes the child window without calling its unload event.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winclose"
},
{
"name": "eval",
"signature": "(code)",
"description": "Evaluates the code in the child window.",
"parameters": [
{
"name": "code",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winevalcode"
},
{
"name": "focus",
"signature": "()",
"description": "Focuses the child window (brings the window to front).",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winfocus"
},
{
"name": "print",
"signature": "()",
"description": "Invokes the print dialog on the child window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winprint"
},
{
"name": "postMessage",
"signature": "(message, targetOrigin)",
"description": "Sends a message to the child window with the specified origin or `*` for no origin preference.\n\nIn addition to these methods, the child window implements `window.opener` object with no properties and a single method.",
"parameters": [
{
"name": "message",
"description": "",
"required": true,
"collection": false,
"type": "any"
},
{
"name": "targetOrigin",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winpostmessagemessage-targetorigin"
}
],
"instanceProperties": [
{
"name": "closed",
"description": "A `Boolean` that is set to true after the child window gets closed.",
"required": true,
"additionalTags": [],
"urlFragment": "#winclosed",
"collection": false,
"type": "Boolean"
}
],
"instanceEvents": [],
"instanceName": "win"
},
{
"name": "BrowserWindow",
"description": "> Create and control browser windows.\n\nProcess: Main\n\n### Frameless window\n\nTo create a window without chrome, or a transparent window in arbitrary shape, you can use the Frameless Window API.\n\n### Showing window gracefully\n\nWhen loading a page in the window directly, users may see the page load incrementally, which is not a good experience for a native app. To make the window display without visual flash, there are two solutions for different situations.\n\n### Using `ready-to-show` event\n\nWhile loading the page, the `ready-to-show` event will be emitted when the renderer process has rendered the page for the first time if the window has not been shown yet. Showing the window after this event will have no visual flash:\n\n```\nconst { BrowserWindow } = require('electron')\nconst win = new BrowserWindow({ show: false })\nwin.once('ready-to-show', () => {\n win.show()\n})\n```\n\nThis event is usually emitted after the `did-finish-load` event, but for pages with many remote resources, it may be emitted before the `did-finish-load` event.\n\nPlease note that using this event implies that the renderer will be considered \"visible\" and paint even though `show` is false. This event will never fire if you use `paintWhenInitiallyHidden: false`\n\n### Setting `backgroundColor`\n\nFor a complex app, the `ready-to-show` event could be emitted too late, making the app feel slow. In this case, it is recommended to show the window immediately, and use a `backgroundColor` close to your app's background:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow({ backgroundColor: '#2e2c29' })\nwin.loadURL('https://github.com')\n```\n\nNote that even for apps that use `ready-to-show` event, it is still recommended to set `backgroundColor` to make app feel more native.\n\n### Parent and child windows\n\nBy using `parent` option, you can create child windows:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst top = new BrowserWindow()\nconst child = new BrowserWindow({ parent: top })\nchild.show()\ntop.show()\n```\n\nThe `child` window will always show on top of the `top` window.\n\n### Modal windows\n\nA modal window is a child window that disables parent window, to create a modal window, you have to set both `parent` and `modal` options:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst child = new BrowserWindow({ parent: top, modal: true, show: false })\nchild.loadURL('https://github.com')\nchild.once('ready-to-show', () => {\n child.show()\n})\n```\n\n### Page visibility\n\nThe Page Visibility API works as follows:\n\n* On all platforms, the visibility state tracks whether the window is hidden/minimized or not.\n* Additionally, on macOS, the visibility state also tracks the window occlusion state. If the window is occluded (i.e. fully covered) by another window, the visibility state will be `hidden`. On other platforms, the visibility state will be `hidden` only when the window is minimized or explicitly hidden with `win.hide()`.\n* If a `BrowserWindow` is created with `show: false`, the initial visibility state will be `visible` despite the window actually being hidden.\n* If `backgroundThrottling` is disabled, the visibility state will remain `visible` even if the window is minimized, occluded, or hidden.\n\nIt is recommended that you pause expensive operations when the visibility state is `hidden` in order to minimize power consumption.\n\n### Platform notices\n\n* On macOS modal windows will be displayed as sheets attached to the parent window.\n* On macOS the child windows will keep the relative position to parent window when parent window moves, while on Windows and Linux child windows will not move.\n* On Linux the type of modal windows will be changed to `dialog`.\n* On Linux many desktop environments do not support hiding a modal window.\n\n### Class: BrowserWindow\n\n> Create and control browser windows.\n\nProcess: Main\n\n`BrowserWindow` is an EventEmitter.\n\nIt creates a new `BrowserWindow` with native properties as set by the `options`.",
"slug": "browser-window",
"websiteUrl": "https://electronjs.org/docs/api/browser-window",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/browser-window.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": {
"signature": "([options])",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "width",
"description": "Window's width in pixels. Default is `800`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "Window's height in pixels. Default is `600`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "x",
"description": "(**required** if y is used) Window's left offset from screen. Default is to center the window.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "y",
"description": "(**required** if x is used) Window's top offset from screen. Default is to center the window.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "useContentSize",
"description": "The `width` and `height` would be used as web page's size, which means the actual window's size will include window frame's size and be slightly larger. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "center",
"description": "Show window in the center of the screen.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "minWidth",
"description": "Window's minimum width. Default is `0`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "minHeight",
"description": "Window's minimum height. Default is `0`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "maxWidth",
"description": "Window's maximum width. Default is no limit.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "maxHeight",
"description": "Window's maximum height. Default is no limit.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "resizable",
"description": "Whether window is resizable. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "movable",
"description": "Whether window is movable. This is not implemented on Linux. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "minimizable",
"description": "Whether window is minimizable. This is not implemented on Linux. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "maximizable",
"description": "Whether window is maximizable. This is not implemented on Linux. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "closable",
"description": "Whether window is closable. This is not implemented on Linux. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "focusable",
"description": "Whether the window can be focused. Default is `true`. On Windows setting `focusable: false` also implies setting `skipTaskbar: true`. On Linux setting `focusable: false` makes the window stop interacting with wm, so the window will always stay on top in all workspaces.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "alwaysOnTop",
"description": "Whether the window should always stay on top of other windows. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "fullscreen",
"description": "Whether the window should show in fullscreen. When explicitly set to `false` the fullscreen button will be hidden or disabled on macOS. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "fullscreenable",
"description": "Whether the window can be put into fullscreen mode. On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "simpleFullscreen",
"description": "Use pre-Lion fullscreen on macOS. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "skipTaskbar",
"description": "Whether to show the window in taskbar. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "kiosk",
"description": "Whether the window is in kiosk mode. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "title",
"description": "Default window title. Default is `\"Electron\"`. If the HTML tag `
` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "icon",
"description": "The window icon. On Windows it is recommended to use `ICO` icons to get best visual effects, you can also leave it undefined so the executable's icon will be used.",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "show",
"description": "Whether window should be shown when created. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "paintWhenInitiallyHidden",
"description": "Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "frame",
"description": "Specify `false` to create a Frameless Window. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "parent",
"description": "Specify parent window. Default is `null`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "BrowserWindow"
},
{
"name": "modal",
"description": "Whether this is a modal window. This only works when the window is a child window. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "acceptFirstMouse",
"description": "Whether the web view accepts a single mouse-down event that simultaneously activates the window. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "disableAutoHideCursor",
"description": "Whether to hide cursor when typing. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "autoHideMenuBar",
"description": "Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "enableLargerThanScreen",
"description": "Enable the window to be resized larger than screen. Only relevant for macOS, as other OSes allow larger-than-screen windows by default. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "backgroundColor",
"description": "Window's background color as a hexadecimal value, like `#66CD00` or `#FFF` or `#80FFFFFF` (alpha in #AARRGGBB format is supported if `transparent` is set to `true`). Default is `#FFF` (white).",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "hasShadow",
"description": "Whether window should have a shadow. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "opacity",
"description": "Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "darkTheme",
"description": "Forces using dark theme for the window, only works on some GTK+3 desktop environments. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "transparent",
"description": "Makes the window transparent. Default is `false`. On Windows, does not work unless the window is frameless.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "type",
"description": "The type of window, default is normal window. See more about this below.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "visualEffectState",
"description": "Specify how the material appearance should reflect window activity state on macOS. Must be used with the `vibrancy` property. Possible values are:",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "followWindow",
"description": "The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default."
},
{
"value": "active",
"description": "The backdrop should always appear active."
},
{
"value": "inactive",
"description": "The backdrop should always appear inactive."
}
]
},
{
"name": "titleBarStyle",
"description": "The style of window title bar. Default is `default`. Possible values are:",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "default",
"description": "Results in the standard gray opaque Mac title bar."
},
{
"value": "hidden",
"description": "Results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls (\"traffic lights\") in the top left."
},
{
"value": "hiddenInset",
"description": "Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge."
},
{
"value": "customButtonsOnHover",
"description": "Draw custom close, and minimize buttons on macOS frameless windows. These buttons will not display unless hovered over in the top left of the window. These custom buttons prevent issues with mouse events that occur with the standard window toolbar buttons. **Note:** This option is currently experimental."
}
]
},
{
"name": "trafficLightPosition",
"description": "Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Point"
},
{
"name": "fullscreenWindowTitle",
"description": "Shows the title in the title bar in full screen mode on macOS for all `titleBarStyle` options. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "thickFrame",
"description": "Use `WS_THICKFRAME` style for frameless windows on Windows, which adds standard window frame. Setting it to `false` will remove window shadow and window animations. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "vibrancy",
"description": "Add a type of vibrancy effect to the window, only on macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that using `frame: false` in combination with a vibrancy value requires that you use a non-default `titleBarStyle` as well. Also note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "appearance-based",
"description": ""
},
{
"value": "light",
"description": ""
},
{
"value": "dark",
"description": ""
},
{
"value": "titlebar",
"description": ""
},
{
"value": "selection",
"description": ""
},
{
"value": "menu",
"description": ""
},
{
"value": "popover",
"description": ""
},
{
"value": "sidebar",
"description": ""
},
{
"value": "medium-light",
"description": ""
},
{
"value": "ultra-dark",
"description": ""
},
{
"value": "header",
"description": ""
},
{
"value": "sheet",
"description": ""
},
{
"value": "window",
"description": ""
},
{
"value": "hud",
"description": ""
},
{
"value": "fullscreen-ui",
"description": ""
},
{
"value": "tooltip",
"description": ""
},
{
"value": "content",
"description": ""
},
{
"value": "under-window",
"description": ""
},
{
"value": "under-page",
"description": ""
}
]
},
{
"name": "zoomToPageWidth",
"description": "Controls the behavior on macOS when option-clicking the green stoplight button on the toolbar or by clicking the Window > Zoom menu item. If `true`, the window will grow to the preferred width of the web page when zoomed, `false` will cause it to zoom to the width of the screen. This will also affect the behavior when calling `maximize()` directly. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "tabbingIdentifier",
"description": "Tab group name, allows opening the window as a native tab on macOS 10.12+. Windows with the same tabbing identifier will be grouped together. This also adds a native new tab button to your window's tab bar and allows your `app` and window to receive the `new-window-for-tab` event.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "webPreferences",
"description": "Settings of web page's features.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Object",
"properties": [
{
"name": "devTools",
"description": "Whether to enable DevTools. If it is set to `false`, can not use `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "nodeIntegration",
"description": "Whether node integration is enabled. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "nodeIntegrationInWorker",
"description": "Whether node integration is enabled in web workers. Default is `false`. More about this can be found in Multithreading.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "nodeIntegrationInSubFrames",
"description": "Experimental option for enabling Node.js support in sub-frames such as iframes and child windows. All your preloads will load for every iframe, you can use `process.isMainFrame` to determine if you are in the main frame or not.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "preload",
"description": "Specifies a script that will be loaded before other scripts run in the page. This script will always have access to node APIs no matter whether node integration is turned on or off. The value should be the absolute file path to the script. When node integration is turned off, the preload script can reintroduce Node global symbols back to the global scope. See example here.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "sandbox",
"description": "If set, this will sandbox the renderer associated with the window, making it compatible with the Chromium OS-level sandbox and disabling the Node.js engine. This is not the same as the `nodeIntegration` option and the APIs available to the preload script are more limited. Read more about the option here.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "enableRemoteModule",
"description": "Whether to enable the `remote` module. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "session",
"description": "Sets the session used by the page. Instead of passing the Session object directly, you can also choose to use the `partition` option instead, which accepts a partition string. When both `session` and `partition` are provided, `session` will be preferred. Default is the default session.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Session"
},
{
"name": "partition",
"description": "Sets the session used by the page according to the session's partition string. If `partition` starts with `persist:`, the page will use a persistent session available to all pages in the app with the same `partition`. If there is no `persist:` prefix, the page will use an in-memory session. By assigning the same `partition`, multiple pages can share the same session. Default is the default session.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "affinity",
"description": "When specified, web pages with the same `affinity` will run in the same renderer process. Note that due to reusing the renderer process, certain `webPreferences` options will also be shared between the web pages even when you specified different values for them, including but not limited to `preload`, `sandbox` and `nodeIntegration`. So it is suggested to use exact same `webPreferences` for web pages with the same `affinity`. _Deprecated_",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "zoomFactor",
"description": "The default zoom factor of the page, `3.0` represents `300%`. Default is `1.0`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "javascript",
"description": "Enables JavaScript support. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "webSecurity",
"description": "When `false`, it will disable the same-origin policy (usually using testing websites by people), and set `allowRunningInsecureContent` to `true` if this options has not been set by user. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "allowRunningInsecureContent",
"description": "Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "images",
"description": "Enables image support. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "textAreasAreResizable",
"description": "Make TextArea elements resizable. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "webgl",
"description": "Enables WebGL support. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "plugins",
"description": "Whether plugins should be enabled. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "experimentalFeatures",
"description": "Enables Chromium's experimental features. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "scrollBounce",
"description": "Enables scroll bounce (rubber banding) effect on macOS. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "enableBlinkFeatures",
"description": "A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey` to enable. The full list of supported feature strings can be found in the RuntimeEnabledFeatures.json5 file.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "disableBlinkFeatures",
"description": "A list of feature strings separated by `,`, like `CSSVariables,KeyboardEventKey` to disable. The full list of supported feature strings can be found in the RuntimeEnabledFeatures.json5 file.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "defaultFontFamily",
"description": "Sets the default font for the font-family.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Object",
"properties": [
{
"name": "standard",
"description": "Defaults to `Times New Roman`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "serif",
"description": "Defaults to `Times New Roman`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "sansSerif",
"description": "Defaults to `Arial`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "monospace",
"description": "Defaults to `Courier New`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "cursive",
"description": "Defaults to `Script`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "fantasy",
"description": "Defaults to `Impact`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "defaultFontSize",
"description": "Defaults to `16`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "defaultMonospaceFontSize",
"description": "Defaults to `13`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "minimumFontSize",
"description": "Defaults to `0`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "defaultEncoding",
"description": "Defaults to `ISO-8859-1`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "backgroundThrottling",
"description": "Whether to throttle animations and timers when the page becomes background. This also affects the Page Visibility API. Defaults to `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "offscreen",
"description": "Whether to enable offscreen rendering for the browser window. Defaults to `false`. See the offscreen rendering tutorial for more details.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "contextIsolation",
"description": "Whether to run Electron APIs and the specified `preload` script in a separate JavaScript context. Defaults to `false`. The context that the `preload` script runs in will only have access to its own dedicated `document` and `window` globals, as well as its own set of JavaScript builtins (`Array`, `Object`, `JSON`, etc.), which are all invisible to the loaded content. The Electron API will only be available in the `preload` script and not the loaded page. This option should be used when loading potentially untrusted remote content to ensure the loaded content cannot tamper with the `preload` script and any Electron APIs being used. This option uses the same technique used by Chrome Content Scripts. You can access this context in the dev tools by selecting the 'Electron Isolated Context' entry in the combo box at the top of the Console tab.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "worldSafeExecuteJavaScript",
"description": "If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values can't unsafely cross between worlds when using `contextIsolation`. The default is `false`. In Electron 12, the default will be changed to `true`. _Deprecated_",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "nativeWindowOpen",
"description": "Whether to use native `window.open()`. Defaults to `false`. Child windows will always have node integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently experimental.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "webviewTag",
"description": "Whether to enable the `` tag. Defaults to `false`. **Note:** The `preload` script configured for the `` will have node integration enabled when it is executed so you should ensure remote/untrusted content is not able to create a `` tag with a possibly malicious `preload` script. You can use the `will-attach-webview` event on webContents to strip away the `preload` script and to validate or alter the ``'s initial settings.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "additionalArguments",
"description": "A list of strings that will be appended to `process.argv` in the renderer process of this app. Useful for passing small bits of data down to renderer process preload scripts.",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "safeDialogs",
"description": "Whether to enable browser style consecutive dialog protection. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "safeDialogsMessage",
"description": "The message to display when consecutive dialog protection is triggered. If not defined the default message would be used, note that currently the default message is in English and not localized.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "disableDialogs",
"description": "Whether to disable dialogs completely. Overrides `safeDialogs`. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "navigateOnDragDrop",
"description": "Whether dragging and dropping a file or link onto the page causes a navigation. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "autoplayPolicy",
"description": "Autoplay policy to apply to content in the window, can be `no-user-gesture-required`, `user-gesture-required`, `document-user-activation-required`. Defaults to `no-user-gesture-required`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "no-user-gesture-required",
"description": ""
},
{
"value": "user-gesture-required",
"description": ""
},
{
"value": "document-user-activation-required",
"description": ""
}
]
},
{
"name": "disableHtmlFullscreenWindowResize",
"description": "Whether to prevent the window from resizing when entering HTML Fullscreen. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "accessibleTitle",
"description": "An alternative title string provided only to accessibility tools such as screen readers. This string is not directly visible to users.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "spellcheck",
"description": "Whether to enable the builtin spellchecker. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "enableWebSQL",
"description": "Whether to enable the WebSQL api. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "v8CacheOptions",
"description": "Enforces the v8 code caching policy used by blink. Accepted values are",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "none",
"description": "Disables code caching"
},
{
"value": "code",
"description": "Heuristic based code caching"
},
{
"value": "bypassHeatCheck",
"description": "Bypass code caching heuristics but with lazy compilation"
},
{
"value": "bypassHeatCheckAndEagerCompile",
"description": "Same as above except compilation is eager. Default policy is `code`."
}
]
},
{
"name": "enablePreferredSizeMode",
"description": "Whether to enable preferred size mode. The preferred size is the minimum size needed to contain the layout of the document—without requiring scrolling. Enabling this will cause the `preferred-size-changed` event to be emitted on the `WebContents` when the preferred size changes. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
]
}
]
},
"staticMethods": [
{
"name": "getAllWindows",
"signature": "()",
"description": "An array of all opened browser windows.",
"parameters": [],
"returns": {
"collection": true,
"type": "BrowserWindow"
},
"additionalTags": [],
"urlFragment": "#browserwindowgetallwindows"
},
{
"name": "getFocusedWindow",
"signature": "()",
"description": "The window that is focused in this application, otherwise returns `null`.",
"parameters": [],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserWindow"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#browserwindowgetfocusedwindow"
},
{
"name": "fromWebContents",
"signature": "(webContents)",
"description": "The window that owns the given `webContents` or `null` if the contents are not owned by a window.",
"parameters": [
{
"name": "webContents",
"description": "",
"required": true,
"collection": false,
"type": "WebContents"
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserWindow"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#browserwindowfromwebcontentswebcontents"
},
{
"name": "fromBrowserView",
"signature": "(browserView)",
"description": "The window that owns the given `browserView`. If the given view is not attached to any window, returns `null`.",
"parameters": [
{
"name": "browserView",
"description": "",
"required": true,
"collection": false,
"type": "BrowserView"
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserWindow"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#browserwindowfrombrowserviewbrowserview"
},
{
"name": "fromId",
"signature": "(id)",
"description": "The window with the given `id`.",
"parameters": [
{
"name": "id",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserWindow"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#browserwindowfromidid"
},
{
"name": "addExtension",
"signature": "(path)",
"description": "Adds Chrome extension located at `path`, and returns extension's name.\n\nThe method will also not return if the extension's manifest is missing or incomplete.\n\n**Note:** This API cannot be called before the `ready` event of the `app` module is emitted.\n\n**Note:** This method is deprecated. Instead, use `ses.loadExtension(path)`.",
"parameters": [
{
"name": "path",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#browserwindowaddextensionpath-deprecated"
},
{
"name": "removeExtension",
"signature": "(name)",
"description": "Remove a Chrome extension by name.\n\n**Note:** This API cannot be called before the `ready` event of the `app` module is emitted.\n\n**Note:** This method is deprecated. Instead, use `ses.removeExtension(extension_id)`.",
"parameters": [
{
"name": "name",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#browserwindowremoveextensionname-deprecated"
},
{
"name": "getExtensions",
"signature": "()",
"description": "The keys are the extension names and each value is an Object containing `name` and `version` properties.\n\n**Note:** This API cannot be called before the `ready` event of the `app` module is emitted.\n\n**Note:** This method is deprecated. Instead, use `ses.getAllExtensions()`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "ExtensionInfo"
}
]
},
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#browserwindowgetextensions-deprecated"
},
{
"name": "addDevToolsExtension",
"signature": "(path)",
"description": "Adds DevTools extension located at `path`, and returns extension's name.\n\nThe extension will be remembered so you only need to call this API once, this API is not for programming use. If you try to add an extension that has already been loaded, this method will not return and instead log a warning to the console.\n\nThe method will also not return if the extension's manifest is missing or incomplete.\n\n**Note:** This API cannot be called before the `ready` event of the `app` module is emitted.\n\n**Note:** This method is deprecated. Instead, use `ses.loadExtension(path)`.",
"parameters": [
{
"name": "path",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#browserwindowadddevtoolsextensionpath-deprecated"
},
{
"name": "removeDevToolsExtension",
"signature": "(name)",
"description": "Remove a DevTools extension by name.\n\n**Note:** This API cannot be called before the `ready` event of the `app` module is emitted.\n\n**Note:** This method is deprecated. Instead, use `ses.removeExtension(extension_id)`.",
"parameters": [
{
"name": "name",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#browserwindowremovedevtoolsextensionname-deprecated"
},
{
"name": "getDevToolsExtensions",
"signature": "()",
"description": "The keys are the extension names and each value is an Object containing `name` and `version` properties.\n\nTo check if a DevTools extension is installed you can run the following:\n\n**Note:** This API cannot be called before the `ready` event of the `app` module is emitted.\n\n**Note:** This method is deprecated. Instead, use `ses.getAllExtensions()`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "string"
},
{
"collection": false,
"type": "ExtensionInfo"
}
]
},
"additionalTags": [
"stability_deprecated"
],
"urlFragment": "#browserwindowgetdevtoolsextensions-deprecated"
}
],
"staticProperties": [],
"instanceMethods": [
{
"name": "destroy",
"signature": "()",
"description": "Force closing the window, the `unload` and `beforeunload` event won't be emitted for the web page, and `close` event will also not be emitted for this window, but it guarantees the `closed` event will be emitted.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#windestroy"
},
{
"name": "close",
"signature": "()",
"description": "Try to close the window. This has the same effect as a user manually clicking the close button of the window. The web page may cancel the close though. See the close event.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winclose"
},
{
"name": "focus",
"signature": "()",
"description": "Focuses on the window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winfocus"
},
{
"name": "blur",
"signature": "()",
"description": "Removes focus from the window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winblur"
},
{
"name": "isFocused",
"signature": "()",
"description": "Whether the window is focused.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisfocused"
},
{
"name": "isDestroyed",
"signature": "()",
"description": "Whether the window is destroyed.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisdestroyed"
},
{
"name": "show",
"signature": "()",
"description": "Shows and gives focus to the window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winshow"
},
{
"name": "showInactive",
"signature": "()",
"description": "Shows the window but doesn't focus on it.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winshowinactive"
},
{
"name": "hide",
"signature": "()",
"description": "Hides the window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winhide"
},
{
"name": "isVisible",
"signature": "()",
"description": "Whether the window is visible to the user.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisvisible"
},
{
"name": "isModal",
"signature": "()",
"description": "Whether current window is a modal window.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winismodal"
},
{
"name": "maximize",
"signature": "()",
"description": "Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winmaximize"
},
{
"name": "unmaximize",
"signature": "()",
"description": "Unmaximizes the window.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winunmaximize"
},
{
"name": "isMaximized",
"signature": "()",
"description": "Whether the window is maximized.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winismaximized"
},
{
"name": "minimize",
"signature": "()",
"description": "Minimizes the window. On some platforms the minimized window will be shown in the Dock.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winminimize"
},
{
"name": "restore",
"signature": "()",
"description": "Restores the window from minimized state to its previous state.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winrestore"
},
{
"name": "isMinimized",
"signature": "()",
"description": "Whether the window is minimized.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisminimized"
},
{
"name": "setFullScreen",
"signature": "(flag)",
"description": "Sets whether the window should be in fullscreen mode.",
"parameters": [
{
"name": "flag",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetfullscreenflag"
},
{
"name": "isFullScreen",
"signature": "()",
"description": "Whether the window is in fullscreen mode.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisfullscreen"
},
{
"name": "setSimpleFullScreen",
"signature": "(flag)",
"description": "Enters or leaves simple fullscreen mode.\n\nSimple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).",
"parameters": [
{
"name": "flag",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetsimplefullscreenflag-macos"
},
{
"name": "isSimpleFullScreen",
"signature": "()",
"description": "Whether the window is in simple (pre-Lion) fullscreen mode.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#winissimplefullscreen-macos"
},
{
"name": "isNormal",
"signature": "()",
"description": "Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisnormal"
},
{
"name": "setAspectRatio",
"signature": "(aspectRatio[, extraSize])",
"description": "This will make a window maintain an aspect ratio. The extra size allows a developer to have space, specified in pixels, not included within the aspect ratio calculations. This API already takes into account the difference between a window's size and its content size.\n\nConsider a normal window with an HD video player and associated controls. Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and { width: 40, height: 50 }. The second argument doesn't care where the extra width and height are within the content view--only that they exist. Sum any extra width and height areas you have within the overall content view.",
"parameters": [
{
"name": "aspectRatio",
"description": "The aspect ratio to maintain for some portion of the content view.",
"required": true,
"collection": false,
"type": "Float"
},
{
"name": "extraSize",
"description": "The extra size not to be included while maintaining the aspect ratio.",
"required": false,
"collection": false,
"type": "Size"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_linux"
],
"urlFragment": "#winsetaspectratioaspectratio-extrasize-macos-linux"
},
{
"name": "setBackgroundColor",
"signature": "(backgroundColor)",
"description": "Sets the background color of the window. See Setting `backgroundColor`.",
"parameters": [
{
"name": "backgroundColor",
"description": "Window's background color as a hexadecimal value, like `#66CD00` or `#FFF` or `#80FFFFFF` (alpha is supported if `transparent` is `true`). Default is `#FFF` (white).",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetbackgroundcolorbackgroundcolor"
},
{
"name": "previewFile",
"signature": "(path[, displayName])",
"description": "Uses Quick Look to preview a file at a given path.",
"parameters": [
{
"name": "path",
"description": "The absolute path to the file to preview with QuickLook. This is important as Quick Look uses the file name and file extension on the path to determine the content type of the file to open.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "displayName",
"description": "The name of the file to display on the Quick Look modal view. This is purely visual and does not affect the content type of the file. Defaults to `path`.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winpreviewfilepath-displayname-macos"
},
{
"name": "closeFilePreview",
"signature": "()",
"description": "Closes the currently open Quick Look panel.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winclosefilepreview-macos"
},
{
"name": "setBounds",
"signature": "(bounds[, animate])",
"description": "Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.",
"parameters": [
{
"name": "bounds",
"description": "",
"required": true,
"collection": false,
"type": "Partial",
"innerTypes": [
{
"collection": false,
"type": "Rectangle"
}
]
},
{
"name": "animate",
"description": "",
"required": false,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetboundsbounds-animate"
},
{
"name": "getBounds",
"signature": "()",
"description": "The `bounds` of the window as `Object`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Rectangle"
},
"additionalTags": [],
"urlFragment": "#wingetbounds"
},
{
"name": "getBackgroundColor",
"signature": "()",
"description": "Gets the background color of the window. See Setting `backgroundColor`.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#wingetbackgroundcolor"
},
{
"name": "setContentBounds",
"signature": "(bounds[, animate])",
"description": "Resizes and moves the window's client area (e.g. the web page) to the supplied bounds.",
"parameters": [
{
"name": "bounds",
"description": "",
"required": true,
"collection": false,
"type": "Rectangle"
},
{
"name": "animate",
"description": "",
"required": false,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetcontentboundsbounds-animate"
},
{
"name": "getContentBounds",
"signature": "()",
"description": "The `bounds` of the window's client area as `Object`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Rectangle"
},
"additionalTags": [],
"urlFragment": "#wingetcontentbounds"
},
{
"name": "getNormalBounds",
"signature": "()",
"description": "Contains the window bounds of the normal state\n\n**Note:** whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same `Rectangle`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Rectangle"
},
"additionalTags": [],
"urlFragment": "#wingetnormalbounds"
},
{
"name": "setEnabled",
"signature": "(enable)",
"description": "Disable or enable the window.",
"parameters": [
{
"name": "enable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetenabledenable"
},
{
"name": "isEnabled",
"signature": "()",
"description": "whether the window is enabled.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisenabled"
},
{
"name": "setSize",
"signature": "(width, height[, animate])",
"description": "Resizes the window to `width` and `height`. If `width` or `height` are below any set minimum size constraints the window will snap to its minimum size.",
"parameters": [
{
"name": "width",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "animate",
"description": "",
"required": false,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetsizewidth-height-animate"
},
{
"name": "getSize",
"signature": "()",
"description": "Contains the window's width and height.",
"parameters": [],
"returns": {
"collection": true,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#wingetsize"
},
{
"name": "setContentSize",
"signature": "(width, height[, animate])",
"description": "Resizes the window's client area (e.g. the web page) to `width` and `height`.",
"parameters": [
{
"name": "width",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "animate",
"description": "",
"required": false,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetcontentsizewidth-height-animate"
},
{
"name": "getContentSize",
"signature": "()",
"description": "Contains the window's client area's width and height.",
"parameters": [],
"returns": {
"collection": true,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#wingetcontentsize"
},
{
"name": "setMinimumSize",
"signature": "(width, height)",
"description": "Sets the minimum size of window to `width` and `height`.",
"parameters": [
{
"name": "width",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetminimumsizewidth-height"
},
{
"name": "getMinimumSize",
"signature": "()",
"description": "Contains the window's minimum width and height.",
"parameters": [],
"returns": {
"collection": true,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#wingetminimumsize"
},
{
"name": "setMaximumSize",
"signature": "(width, height)",
"description": "Sets the maximum size of window to `width` and `height`.",
"parameters": [
{
"name": "width",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetmaximumsizewidth-height"
},
{
"name": "getMaximumSize",
"signature": "()",
"description": "Contains the window's maximum width and height.",
"parameters": [],
"returns": {
"collection": true,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#wingetmaximumsize"
},
{
"name": "setResizable",
"signature": "(resizable)",
"description": "Sets whether the window can be manually resized by the user.",
"parameters": [
{
"name": "resizable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetresizableresizable"
},
{
"name": "isResizable",
"signature": "()",
"description": "Whether the window can be manually resized by the user.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisresizable"
},
{
"name": "setMovable",
"signature": "(movable)",
"description": "Sets whether the window can be moved by user. On Linux does nothing.",
"parameters": [
{
"name": "movable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winsetmovablemovable-macos-windows"
},
{
"name": "isMovable",
"signature": "()",
"description": "Whether the window can be moved by user.\n\nOn Linux always returns `true`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winismovable-macos-windows"
},
{
"name": "setMinimizable",
"signature": "(minimizable)",
"description": "Sets whether the window can be manually minimized by user. On Linux does nothing.",
"parameters": [
{
"name": "minimizable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winsetminimizableminimizable-macos-windows"
},
{
"name": "isMinimizable",
"signature": "()",
"description": "Whether the window can be manually minimized by the user.\n\nOn Linux always returns `true`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winisminimizable-macos-windows"
},
{
"name": "setMaximizable",
"signature": "(maximizable)",
"description": "Sets whether the window can be manually maximized by user. On Linux does nothing.",
"parameters": [
{
"name": "maximizable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winsetmaximizablemaximizable-macos-windows"
},
{
"name": "isMaximizable",
"signature": "()",
"description": "Whether the window can be manually maximized by user.\n\nOn Linux always returns `true`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winismaximizable-macos-windows"
},
{
"name": "setFullScreenable",
"signature": "(fullscreenable)",
"description": "Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.",
"parameters": [
{
"name": "fullscreenable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetfullscreenablefullscreenable"
},
{
"name": "isFullScreenable",
"signature": "()",
"description": "Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisfullscreenable"
},
{
"name": "setClosable",
"signature": "(closable)",
"description": "Sets whether the window can be manually closed by user. On Linux does nothing.",
"parameters": [
{
"name": "closable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winsetclosableclosable-macos-windows"
},
{
"name": "isClosable",
"signature": "()",
"description": "Whether the window can be manually closed by user.\n\nOn Linux always returns `true`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winisclosable-macos-windows"
},
{
"name": "setAlwaysOnTop",
"signature": "(flag[, level][, relativeLevel])",
"description": "Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.",
"parameters": [
{
"name": "flag",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
},
{
"name": "level",
"description": "Values include `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, `screen-saver`, and ~~`dock`~~ (Deprecated). The default is `floating` when `flag` is true. The `level` is reset to `normal` when the flag is false. Note that from `floating` to `status` included, the window is placed below the Dock on macOS and below the taskbar on Windows. From `pop-up-menu` to a higher it is shown above the Dock on macOS and above the taskbar on Windows. See the macOS docs for more details.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "normal",
"description": ""
},
{
"value": "floating",
"description": ""
},
{
"value": "torn-off-menu",
"description": ""
},
{
"value": "modal-panel",
"description": ""
},
{
"value": "main-menu",
"description": ""
},
{
"value": "status",
"description": ""
},
{
"value": "pop-up-menu",
"description": ""
},
{
"value": "screen-saver",
"description": ""
}
]
},
{
"name": "relativeLevel",
"description": "The number of layers higher to set this window relative to the given `level`. The default is `0`. Note that Apple discourages setting levels higher than 1 above `screen-saver`.",
"required": false,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetalwaysontopflag-level-relativelevel"
},
{
"name": "isAlwaysOnTop",
"signature": "()",
"description": "Whether the window is always on top of other windows.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisalwaysontop"
},
{
"name": "moveAbove",
"signature": "(mediaSourceId)",
"description": "Moves window above the source window in the sense of z-order. If the `mediaSourceId` is not of type window or if the window does not exist then this method throws an error.",
"parameters": [
{
"name": "mediaSourceId",
"description": "Window id in the format of DesktopCapturerSource's id. For example \"window:1869:0\".",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winmoveabovemediasourceid"
},
{
"name": "moveTop",
"signature": "()",
"description": "Moves window to top(z-order) regardless of focus",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winmovetop"
},
{
"name": "center",
"signature": "()",
"description": "Moves window to the center of the screen.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#wincenter"
},
{
"name": "setPosition",
"signature": "(x, y[, animate])",
"description": "Moves window to `x` and `y`.",
"parameters": [
{
"name": "x",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "y",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "animate",
"description": "",
"required": false,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetpositionx-y-animate"
},
{
"name": "getPosition",
"signature": "()",
"description": "Contains the window's current position.",
"parameters": [],
"returns": {
"collection": true,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#wingetposition"
},
{
"name": "setTitle",
"signature": "(title)",
"description": "Changes the title of native window to `title`.",
"parameters": [
{
"name": "title",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsettitletitle"
},
{
"name": "getTitle",
"signature": "()",
"description": "The title of the native window.\n\n**Note:** The title of the web page can be different from the title of the native window.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#wingettitle"
},
{
"name": "setSheetOffset",
"signature": "(offsetY[, offsetX])",
"description": "Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. For example:",
"parameters": [
{
"name": "offsetY",
"description": "",
"required": true,
"collection": false,
"type": "Float"
},
{
"name": "offsetX",
"description": "",
"required": false,
"collection": false,
"type": "Float"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetsheetoffsetoffsety-offsetx-macos"
},
{
"name": "flashFrame",
"signature": "(flag)",
"description": "Starts or stops flashing the window to attract user's attention.",
"parameters": [
{
"name": "flag",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winflashframeflag"
},
{
"name": "setSkipTaskbar",
"signature": "(skip)",
"description": "Makes the window not show in the taskbar.",
"parameters": [
{
"name": "skip",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetskiptaskbarskip"
},
{
"name": "setKiosk",
"signature": "(flag)",
"description": "Enters or leaves kiosk mode.",
"parameters": [
{
"name": "flag",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetkioskflag"
},
{
"name": "isKiosk",
"signature": "()",
"description": "Whether the window is in kiosk mode.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winiskiosk"
},
{
"name": "isTabletMode",
"signature": "()",
"description": "Whether the window is in Windows 10 tablet mode.\n\nSince Windows 10 users can use their PC as tablet, under this mode apps can choose to optimize their UI for tablets, such as enlarging the titlebar and hiding titlebar buttons.\n\nThis API returns whether the window is in tablet mode, and the `resize` event can be be used to listen to changes to tablet mode.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_windows"
],
"urlFragment": "#winistabletmode-windows"
},
{
"name": "getMediaSourceId",
"signature": "()",
"description": "Window id in the format of DesktopCapturerSource's id. For example \"window:1234:0\".\n\nMore precisely the format is `window:id:other_id` where `id` is `HWND` on Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on Linux. `other_id` is used to identify web contents (tabs) so within the same top level window.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#wingetmediasourceid"
},
{
"name": "getNativeWindowHandle",
"signature": "()",
"description": "The platform-specific handle of the window.\n\nThe native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Window` (`unsigned long`) on Linux.",
"parameters": [],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [],
"urlFragment": "#wingetnativewindowhandle"
},
{
"name": "hookWindowMessage",
"signature": "(message, callback)",
"description": "Hooks a windows message. The `callback` is called when the message is received in the WndProc.",
"parameters": [
{
"name": "message",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "callback",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winhookwindowmessagemessage-callback-windows"
},
{
"name": "isWindowMessageHooked",
"signature": "(message)",
"description": "`true` or `false` depending on whether the message is hooked.",
"parameters": [
{
"name": "message",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_windows"
],
"urlFragment": "#winiswindowmessagehookedmessage-windows"
},
{
"name": "unhookWindowMessage",
"signature": "(message)",
"description": "Unhook the window message.",
"parameters": [
{
"name": "message",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winunhookwindowmessagemessage-windows"
},
{
"name": "unhookAllWindowMessages",
"signature": "()",
"description": "Unhooks all of the window messages.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winunhookallwindowmessages-windows"
},
{
"name": "setRepresentedFilename",
"signature": "(filename)",
"description": "Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar.",
"parameters": [
{
"name": "filename",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetrepresentedfilenamefilename-macos"
},
{
"name": "getRepresentedFilename",
"signature": "()",
"description": "The pathname of the file the window represents.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#wingetrepresentedfilename-macos"
},
{
"name": "setDocumentEdited",
"signature": "(edited)",
"description": "Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to `true`.",
"parameters": [
{
"name": "edited",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetdocumenteditededited-macos"
},
{
"name": "isDocumentEdited",
"signature": "()",
"description": "Whether the window's document has been edited.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#winisdocumentedited-macos"
},
{
"name": "focusOnWebView",
"signature": "()",
"description": "",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winfocusonwebview"
},
{
"name": "blurWebView",
"signature": "()",
"description": "",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winblurwebview"
},
{
"name": "capturePage",
"signature": "([rect])",
"description": "Resolves with a NativeImage\n\nCaptures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page.",
"parameters": [
{
"name": "rect",
"description": "The bounds to capture",
"required": false,
"collection": false,
"type": "Rectangle"
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "NativeImage"
}
]
},
"additionalTags": [],
"urlFragment": "#wincapturepagerect"
},
{
"name": "loadURL",
"signature": "(url[, options])",
"description": "the promise will resolve when the page has finished loading (see `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).\n\nSame as `webContents.loadURL(url[, options])`.\n\nThe `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol.\n\nTo ensure that file URLs are properly formatted, it is recommended to use Node's `url.format` method:\n\nYou can load a URL using a `POST` request with URL-encoded data by doing the following:",
"parameters": [
{
"name": "url",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "httpReferrer",
"description": "An HTTP Referrer URL.",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "Referrer"
}
]
},
{
"name": "userAgent",
"description": "A user agent originating the request.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "extraHeaders",
"description": "Extra headers separated by \"\\n\"",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "postData",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": true,
"type": "UploadRawData"
},
{
"collection": true,
"type": "UploadFile"
}
]
},
{
"name": "baseURLForDataURL",
"description": "Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#winloadurlurl-options"
},
{
"name": "loadFile",
"signature": "(filePath[, options])",
"description": "the promise will resolve when the page has finished loading (see `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).\n\nSame as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information.",
"parameters": [
{
"name": "filePath",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "query",
"description": "Passed to `url.format()`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "search",
"description": "Passed to `url.format()`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "hash",
"description": "Passed to `url.format()`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#winloadfilefilepath-options"
},
{
"name": "reload",
"signature": "()",
"description": "Same as `webContents.reload`.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#winreload"
},
{
"name": "setMenu",
"signature": "(menu)",
"description": "Sets the `menu` as the window's menu bar.",
"parameters": [
{
"name": "menu",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "Menu"
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [
"os_linux",
"os_windows"
],
"urlFragment": "#winsetmenumenu-linux-windows"
},
{
"name": "removeMenu",
"signature": "()",
"description": "Remove the window's menu bar.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_linux",
"os_windows"
],
"urlFragment": "#winremovemenu-linux-windows"
},
{
"name": "setProgressBar",
"signature": "(progress[, options])",
"description": "Sets progress value in progress bar. Valid range is [0, 1.0].\n\nRemove progress bar when progress < 0; Change to indeterminate mode when progress > 1.\n\nOn Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`.\n\nOn Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed.",
"parameters": [
{
"name": "progress",
"description": "",
"required": true,
"collection": false,
"type": "Double"
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "mode",
"description": "Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`.",
"required": true,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "none",
"description": ""
},
{
"value": "normal",
"description": ""
},
{
"value": "indeterminate",
"description": ""
},
{
"value": "error",
"description": ""
},
{
"value": "paused",
"description": ""
}
]
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetprogressbarprogress-options"
},
{
"name": "setOverlayIcon",
"signature": "(overlay, description)",
"description": "Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user.",
"parameters": [
{
"name": "overlay",
"description": "the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"type": "null",
"collection": false
}
]
},
{
"name": "description",
"description": "a description that will be provided to Accessibility screen readers",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winsetoverlayiconoverlay-description-windows"
},
{
"name": "setHasShadow",
"signature": "(hasShadow)",
"description": "Sets whether the window should have a shadow.",
"parameters": [
{
"name": "hasShadow",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsethasshadowhasshadow"
},
{
"name": "hasShadow",
"signature": "()",
"description": "Whether the window has a shadow.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winhasshadow"
},
{
"name": "setOpacity",
"signature": "(opacity)",
"description": "Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range.",
"parameters": [
{
"name": "opacity",
"description": "between 0.0 (fully transparent) and 1.0 (fully opaque)",
"required": true,
"collection": false,
"type": "Number"
}
],
"returns": null,
"additionalTags": [
"os_windows",
"os_macos"
],
"urlFragment": "#winsetopacityopacity-windows-macos"
},
{
"name": "getOpacity",
"signature": "()",
"description": "between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1.",
"parameters": [],
"returns": {
"collection": false,
"type": "Number"
},
"additionalTags": [],
"urlFragment": "#wingetopacity"
},
{
"name": "setShape",
"signature": "(rects)",
"description": "Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window.",
"parameters": [
{
"name": "rects",
"description": "Sets a shape on the window. Passing an empty list reverts the window to being rectangular.",
"required": true,
"collection": true,
"type": "Rectangle"
}
],
"returns": null,
"additionalTags": [
"os_windows",
"os_linux",
"stability_experimental"
],
"urlFragment": "#winsetshaperects-windows-linux-experimental"
},
{
"name": "setThumbarButtons",
"signature": "(buttons)",
"description": "Whether the buttons were added successfully\n\nAdd a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `Boolean` object indicates whether the thumbnail has been added successfully.\n\nThe number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons.\n\nThe `buttons` is an array of `Button` objects:\n\n* `Button` Object\n * `icon` NativeImage - The icon showing in thumbnail toolbar.\n * `click` Function\n * `tooltip` String (optional) - The text of the button's tooltip.\n * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`.\n\nThe `flags` is an array that can include following `String`s:\n\n* `enabled` - The button is active and available to the user.\n* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action.\n* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately.\n* `nobackground` - Do not draw a button border, use only the image.\n* `hidden` - The button is not shown to the user.\n* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification.",
"parameters": [
{
"name": "buttons",
"description": "",
"required": true,
"collection": true,
"type": "ThumbarButton"
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_windows"
],
"urlFragment": "#winsetthumbarbuttonsbuttons-windows"
},
{
"name": "setThumbnailClip",
"signature": "(region)",
"description": "Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`.",
"parameters": [
{
"name": "region",
"description": "Region of the window",
"required": true,
"collection": false,
"type": "Rectangle"
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winsetthumbnailclipregion-windows"
},
{
"name": "setThumbnailToolTip",
"signature": "(toolTip)",
"description": "Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar.",
"parameters": [
{
"name": "toolTip",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winsetthumbnailtooltiptooltip-windows"
},
{
"name": "setAppDetails",
"signature": "(options)",
"description": "Sets the properties for the window's taskbar button.\n\n**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "appId",
"description": "Window's App User Model ID. It has to be set, otherwise the other options will have no effect.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "appIconPath",
"description": "Window's Relaunch Icon.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "appIconIndex",
"description": "Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. Default is `0`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "relaunchCommand",
"description": "Window's Relaunch Command.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "relaunchDisplayName",
"description": "Window's Relaunch Display Name.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [
"os_windows"
],
"urlFragment": "#winsetappdetailsoptions-windows"
},
{
"name": "showDefinitionForSelection",
"signature": "()",
"description": "Same as `webContents.showDefinitionForSelection()`.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winshowdefinitionforselection-macos"
},
{
"name": "setIcon",
"signature": "(icon)",
"description": "Changes window icon.",
"parameters": [
{
"name": "icon",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [
"os_windows",
"os_linux"
],
"urlFragment": "#winseticonicon-windows-linux"
},
{
"name": "setWindowButtonVisibility",
"signature": "(visible)",
"description": "Sets whether the window traffic light buttons should be visible.\n\nThis cannot be called when `titleBarStyle` is set to `customButtonsOnHover`.",
"parameters": [
{
"name": "visible",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetwindowbuttonvisibilityvisible-macos"
},
{
"name": "setAutoHideMenuBar",
"signature": "(hide)",
"description": "Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single `Alt` key.\n\nIf the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately.",
"parameters": [
{
"name": "hide",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetautohidemenubarhide"
},
{
"name": "isMenuBarAutoHide",
"signature": "()",
"description": "Whether menu bar automatically hides itself.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winismenubarautohide"
},
{
"name": "setMenuBarVisibility",
"signature": "(visible)",
"description": "Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.",
"parameters": [
{
"name": "visible",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_windows",
"os_linux"
],
"urlFragment": "#winsetmenubarvisibilityvisible-windows-linux"
},
{
"name": "isMenuBarVisible",
"signature": "()",
"description": "Whether the menu bar is visible.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winismenubarvisible"
},
{
"name": "setVisibleOnAllWorkspaces",
"signature": "(visible[, options])",
"description": "Sets whether the window should be visible on all workspaces.\n\n**Note:** This API does nothing on Windows.",
"parameters": [
{
"name": "visible",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "visibleOnFullScreen",
"description": "Sets whether the window should be visible above fullscreen windows",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetvisibleonallworkspacesvisible-options"
},
{
"name": "isVisibleOnAllWorkspaces",
"signature": "()",
"description": "Whether the window is visible on all workspaces.\n\n**Note:** This API always returns false on Windows.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#winisvisibleonallworkspaces"
},
{
"name": "setIgnoreMouseEvents",
"signature": "(ignore[, options])",
"description": "Makes the window ignore all mouse events.\n\nAll mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events.",
"parameters": [
{
"name": "ignore",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "forward",
"description": "If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value.",
"required": false,
"additionalTags": [
"os_macos",
"os_windows"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetignoremouseeventsignore-options"
},
{
"name": "setContentProtection",
"signature": "(enable)",
"description": "Prevents the window contents from being captured by other apps.\n\nOn macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.",
"parameters": [
{
"name": "enable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winsetcontentprotectionenable-macos-windows"
},
{
"name": "setFocusable",
"signature": "(focusable)",
"description": "Changes whether the window can be focused.\n\nOn macOS it does not remove the focus from the window.",
"parameters": [
{
"name": "focusable",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#winsetfocusablefocusable-macos-windows"
},
{
"name": "setParentWindow",
"signature": "(parent)",
"description": "Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window.",
"parameters": [
{
"name": "parent",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserWindow"
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#winsetparentwindowparent"
},
{
"name": "getParentWindow",
"signature": "()",
"description": "The parent window.",
"parameters": [],
"returns": {
"collection": false,
"type": "BrowserWindow"
},
"additionalTags": [],
"urlFragment": "#wingetparentwindow"
},
{
"name": "getChildWindows",
"signature": "()",
"description": "All child windows.",
"parameters": [],
"returns": {
"collection": true,
"type": "BrowserWindow"
},
"additionalTags": [],
"urlFragment": "#wingetchildwindows"
},
{
"name": "setAutoHideCursor",
"signature": "(autoHide)",
"description": "Controls whether to hide cursor when typing.",
"parameters": [
{
"name": "autoHide",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetautohidecursorautohide-macos"
},
{
"name": "selectPreviousTab",
"signature": "()",
"description": "Selects the previous tab when native tabs are enabled and there are other tabs in the window.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winselectprevioustab-macos"
},
{
"name": "selectNextTab",
"signature": "()",
"description": "Selects the next tab when native tabs are enabled and there are other tabs in the window.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winselectnexttab-macos"
},
{
"name": "mergeAllWindows",
"signature": "()",
"description": "Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winmergeallwindows-macos"
},
{
"name": "moveTabToNewWindow",
"signature": "()",
"description": "Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winmovetabtonewwindow-macos"
},
{
"name": "toggleTabBar",
"signature": "()",
"description": "Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#wintoggletabbar-macos"
},
{
"name": "addTabbedWindow",
"signature": "(browserWindow)",
"description": "Adds a window as a tab on this window, after the tab for the window instance.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": true,
"collection": false,
"type": "BrowserWindow"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winaddtabbedwindowbrowserwindow-macos"
},
{
"name": "setVibrancy",
"signature": "(type)",
"description": "Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window.\n\nNote that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS.",
"parameters": [
{
"name": "type",
"description": "Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the macOS documentation for more details.",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "appearance-based",
"description": ""
},
{
"value": "light",
"description": ""
},
{
"value": "dark",
"description": ""
},
{
"value": "titlebar",
"description": ""
},
{
"value": "selection",
"description": ""
},
{
"value": "menu",
"description": ""
},
{
"value": "popover",
"description": ""
},
{
"value": "sidebar",
"description": ""
},
{
"value": "medium-light",
"description": ""
},
{
"value": "ultra-dark",
"description": ""
},
{
"value": "header",
"description": ""
},
{
"value": "sheet",
"description": ""
},
{
"value": "window",
"description": ""
},
{
"value": "hud",
"description": ""
},
{
"value": "fullscreen-ui",
"description": ""
},
{
"value": "tooltip",
"description": ""
},
{
"value": "content",
"description": ""
},
{
"value": "under-window",
"description": ""
},
{
"value": "under-page",
"description": ""
}
]
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsetvibrancytype-macos"
},
{
"name": "setTrafficLightPosition",
"signature": "(position)",
"description": "Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`.",
"parameters": [
{
"name": "position",
"description": "",
"required": true,
"collection": false,
"type": "Point"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsettrafficlightpositionposition-macos"
},
{
"name": "getTrafficLightPosition",
"signature": "()",
"description": "The current position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Point"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#wingettrafficlightposition-macos"
},
{
"name": "setTouchBar",
"signature": "(touchBar)",
"description": "Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar and is running on macOS 10.12.1+.\n\n**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases.",
"parameters": [
{
"name": "touchBar",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "TouchBar"
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winsettouchbartouchbar-macos"
},
{
"name": "setBrowserView",
"signature": "(browserView)",
"description": "",
"parameters": [
{
"name": "browserView",
"description": "Attach `browserView` to `win`. If there are other `BrowserView`s attached, they will be removed from this window.",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserView"
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#winsetbrowserviewbrowserview-experimental"
},
{
"name": "getBrowserView",
"signature": "()",
"description": "The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached.",
"parameters": [],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserView"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#wingetbrowserview-experimental"
},
{
"name": "addBrowserView",
"signature": "(browserView)",
"description": "Replacement API for setBrowserView supporting work with multi browser views.",
"parameters": [
{
"name": "browserView",
"description": "",
"required": true,
"collection": false,
"type": "BrowserView"
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#winaddbrowserviewbrowserview-experimental"
},
{
"name": "removeBrowserView",
"signature": "(browserView)",
"description": "",
"parameters": [
{
"name": "browserView",
"description": "",
"required": true,
"collection": false,
"type": "BrowserView"
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#winremovebrowserviewbrowserview-experimental"
},
{
"name": "getBrowserViews",
"signature": "()",
"description": "an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`.\n\n**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases.",
"parameters": [],
"returns": {
"collection": true,
"type": "BrowserView"
},
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#wingetbrowserviews-experimental"
}
],
"instanceProperties": [
{
"name": "webContents",
"description": "A `WebContents` object this window owns. All web page related events and operations will be done via it.\n\nSee the `webContents` documentation for its methods and events.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#winwebcontents-readonly",
"collection": false,
"type": "WebContents"
},
{
"name": "id",
"description": "A `Integer` property representing the unique ID of the window. Each ID is unique among all `BrowserWindow` instances of the entire Electron application.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#winid-readonly",
"collection": false,
"type": "Integer"
},
{
"name": "autoHideMenuBar",
"description": "A `Boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.\n\nIf the menu bar is already visible, setting this property to `true` won't hide it immediately.",
"required": true,
"additionalTags": [],
"urlFragment": "#winautohidemenubar",
"collection": false,
"type": "Boolean"
},
{
"name": "simpleFullScreen",
"description": "A `Boolean` property that determines whether the window is in simple (pre-Lion) fullscreen mode.",
"required": true,
"additionalTags": [],
"urlFragment": "#winsimplefullscreen",
"collection": false,
"type": "Boolean"
},
{
"name": "fullScreen",
"description": "A `Boolean` property that determines whether the window is in fullscreen mode.",
"required": true,
"additionalTags": [],
"urlFragment": "#winfullscreen",
"collection": false,
"type": "Boolean"
},
{
"name": "visibleOnAllWorkspaces",
"description": "A `Boolean` property that determines whether the window is visible on all workspaces.\n\n**Note:** Always returns false on Windows.",
"required": true,
"additionalTags": [],
"urlFragment": "#winvisibleonallworkspaces",
"collection": false,
"type": "Boolean"
},
{
"name": "shadow",
"description": "A `Boolean` property that determines whether the window has a shadow.",
"required": true,
"additionalTags": [],
"urlFragment": "#winshadow",
"collection": false,
"type": "Boolean"
},
{
"name": "menuBarVisible",
"description": "A `Boolean` property that determines whether the menu bar should be visible.\n\n**Note:** If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.",
"required": true,
"additionalTags": [
"os_windows",
"os_linux"
],
"urlFragment": "#winmenubarvisible-windows-linux",
"collection": false,
"type": "Boolean"
},
{
"name": "kiosk",
"description": "A `Boolean` property that determines whether the window is in kiosk mode.",
"required": true,
"additionalTags": [],
"urlFragment": "#winkiosk",
"collection": false,
"type": "Boolean"
},
{
"name": "documentEdited",
"description": "A `Boolean` property that specifies whether the window’s document has been edited.\n\nThe icon in title bar will become gray when set to `true`.",
"required": true,
"additionalTags": [
"os_macos"
],
"urlFragment": "#windocumentedited-macos",
"collection": false,
"type": "Boolean"
},
{
"name": "representedFilename",
"description": "A `String` property that determines the pathname of the file the window represents, and the icon of the file will show in window's title bar.",
"required": true,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winrepresentedfilename-macos",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "title",
"description": "A `String` property that determines the title of the native window.\n\n**Note:** The title of the web page can be different from the title of the native window.",
"required": true,
"additionalTags": [],
"urlFragment": "#wintitle",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "minimizable",
"description": "A `Boolean` property that determines whether the window can be manually minimized by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.",
"required": true,
"additionalTags": [],
"urlFragment": "#winminimizable",
"collection": false,
"type": "Boolean"
},
{
"name": "maximizable",
"description": "A `Boolean` property that determines whether the window can be manually maximized by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.",
"required": true,
"additionalTags": [],
"urlFragment": "#winmaximizable",
"collection": false,
"type": "Boolean"
},
{
"name": "fullScreenable",
"description": "A `Boolean` property that determines whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.",
"required": true,
"additionalTags": [],
"urlFragment": "#winfullscreenable",
"collection": false,
"type": "Boolean"
},
{
"name": "resizable",
"description": "A `Boolean` property that determines whether the window can be manually resized by user.",
"required": true,
"additionalTags": [],
"urlFragment": "#winresizable",
"collection": false,
"type": "Boolean"
},
{
"name": "closable",
"description": "A `Boolean` property that determines whether the window can be manually closed by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.",
"required": true,
"additionalTags": [],
"urlFragment": "#winclosable",
"collection": false,
"type": "Boolean"
},
{
"name": "movable",
"description": "A `Boolean` property that determines Whether the window can be moved by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.",
"required": true,
"additionalTags": [],
"urlFragment": "#winmovable",
"collection": false,
"type": "Boolean"
},
{
"name": "excludedFromShownWindowsMenu",
"description": "A `Boolean` property that determines whether the window is excluded from the application’s Windows menu. `false` by default.",
"required": true,
"additionalTags": [
"os_macos"
],
"urlFragment": "#winexcludedfromshownwindowsmenu-macos",
"collection": false,
"type": "Boolean"
},
{
"name": "accessibleTitle",
"description": "A `String` property that defines an alternative title provided only to accessibility tools such as screen readers. This string is not directly visible to users.",
"required": true,
"additionalTags": [],
"urlFragment": "#winaccessibletitle",
"collection": false,
"type": "String",
"possibleValues": null
}
],
"instanceEvents": [
{
"name": "page-title-updated",
"description": "Emitted when the document changed its title, calling `event.preventDefault()` will prevent the native window's title from changing. `explicitSet` is false when title is synthesized from file URL.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "title",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "explicitSet",
"description": "",
"collection": false,
"type": "Boolean",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-page-title-updated"
},
{
"name": "close",
"description": "Emitted when the window is going to be closed. It's emitted before the `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()` will cancel the close.\n\nUsually you would want to use the `beforeunload` handler to decide whether the window should be closed, which will also be called when the window is reloaded. In Electron, returning any value other than `undefined` would cancel the close. For example:\n\n_**Note**: There is a subtle difference between the behaviors of `window.onbeforeunload = handler` and `window.addEventListener('beforeunload', handler)`. It is recommended to always set the `event.returnValue` explicitly, instead of only returning a value, as the former works more consistently within Electron._",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-close"
},
{
"name": "closed",
"description": "Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-closed"
},
{
"name": "session-end",
"description": "Emitted when window session is going to end due to force shutdown or machine restart or session log off.",
"parameters": [],
"additionalTags": [
"os_windows"
],
"urlFragment": "#event-session-end-windows"
},
{
"name": "unresponsive",
"description": "Emitted when the web page becomes unresponsive.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-unresponsive"
},
{
"name": "responsive",
"description": "Emitted when the unresponsive web page becomes responsive again.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-responsive"
},
{
"name": "blur",
"description": "Emitted when the window loses focus.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-blur"
},
{
"name": "focus",
"description": "Emitted when the window gains focus.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-focus"
},
{
"name": "show",
"description": "Emitted when the window is shown.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-show"
},
{
"name": "hide",
"description": "Emitted when the window is hidden.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-hide"
},
{
"name": "ready-to-show",
"description": "Emitted when the web page has been rendered (while not being shown) and window can be displayed without a visual flash.\n\nPlease note that using this event implies that the renderer will be considered \"visible\" and paint even though `show` is false. This event will never fire if you use `paintWhenInitiallyHidden: false`",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-ready-to-show"
},
{
"name": "maximize",
"description": "Emitted when window is maximized.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-maximize"
},
{
"name": "unmaximize",
"description": "Emitted when the window exits from a maximized state.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-unmaximize"
},
{
"name": "minimize",
"description": "Emitted when the window is minimized.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-minimize"
},
{
"name": "restore",
"description": "Emitted when the window is restored from a minimized state.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-restore"
},
{
"name": "will-resize",
"description": "Emitted before the window is resized. Calling `event.preventDefault()` will prevent the window from being resized.\n\nNote that this is only emitted when the window is being resized manually. Resizing the window with `setBounds`/`setSize` will not emit this event.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "newBounds",
"description": "Size the window is being resized to.",
"collection": false,
"type": "Rectangle",
"required": true
}
],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-will-resize-macos-windows"
},
{
"name": "resize",
"description": "Emitted after the window has been resized.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-resize"
},
{
"name": "resized",
"description": "Emitted once when the window has finished being resized.\n\nThis is usually emitted when the window has been resized manually. On macOS, resizing the window with `setBounds`/`setSize` and setting the `animate` parameter to `true` will also emit this event once resizing has finished.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-resized-macos-windows"
},
{
"name": "will-move",
"description": "Emitted before the window is moved. On Windows, calling `event.preventDefault()` will prevent the window from being moved.\n\nNote that this is only emitted when the window is being resized manually. Resizing the window with `setBounds`/`setSize` will not emit this event.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "newBounds",
"description": "Location the window is being moved to.",
"collection": false,
"type": "Rectangle",
"required": true
}
],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-will-move-macos-windows"
},
{
"name": "move",
"description": "Emitted when the window is being moved to a new position.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-move"
},
{
"name": "moved",
"description": "Emitted once when the window is moved to a new position.\n\n__Note__: On macOS this event is an alias of `move`.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-moved-macos-windows"
},
{
"name": "enter-full-screen",
"description": "Emitted when the window enters a full-screen state.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-enter-full-screen"
},
{
"name": "leave-full-screen",
"description": "Emitted when the window leaves a full-screen state.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-leave-full-screen"
},
{
"name": "enter-html-full-screen",
"description": "Emitted when the window enters a full-screen state triggered by HTML API.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-enter-html-full-screen"
},
{
"name": "leave-html-full-screen",
"description": "Emitted when the window leaves a full-screen state triggered by HTML API.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-leave-html-full-screen"
},
{
"name": "always-on-top-changed",
"description": "Emitted when the window is set or unset to show always on top of other windows.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "isAlwaysOnTop",
"description": "",
"collection": false,
"type": "Boolean",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-always-on-top-changed"
},
{
"name": "app-command",
"description": "Emitted when an App Command is invoked. These are typically related to keyboard media keys or browser commands, as well as the \"Back\" button built into some mice on Windows.\n\nCommands are lowercased, underscores are replaced with hyphens, and the `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.\n\nThe following app commands are explicitly supported on Linux:\n\n* `browser-backward`\n* `browser-forward`",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "command",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_windows",
"os_linux"
],
"urlFragment": "#event-app-command-windows-linux"
},
{
"name": "scroll-touch-begin",
"description": "Emitted when scroll wheel event phase has begun.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-scroll-touch-begin-macos"
},
{
"name": "scroll-touch-end",
"description": "Emitted when scroll wheel event phase has ended.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-scroll-touch-end-macos"
},
{
"name": "scroll-touch-edge",
"description": "Emitted when scroll wheel event phase filed upon reaching the edge of element.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-scroll-touch-edge-macos"
},
{
"name": "swipe",
"description": "Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`, `left`.\n\nThe method underlying this event is built to handle older macOS-style trackpad swiping, where the content on the screen doesn't move with the swipe. Most macOS trackpads are not configured to allow this kind of swiping anymore, so in order for it to emit properly the 'Swipe between pages' preference in `System Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three fingers'.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "direction",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-swipe-macos"
},
{
"name": "rotate-gesture",
"description": "Emitted on trackpad rotation gesture. Continually emitted until rotation gesture is ended. The `rotation` value on each emission is the angle in degrees rotated since the last emission. The last emitted event upon a rotation gesture will always be of value `0`. Counter-clockwise rotation values are positive, while clockwise ones are negative.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "rotation",
"description": "",
"collection": false,
"type": "Float",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-rotate-gesture-macos"
},
{
"name": "sheet-begin",
"description": "Emitted when the window opens a sheet.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-sheet-begin-macos"
},
{
"name": "sheet-end",
"description": "Emitted when the window has closed a sheet.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-sheet-end-macos"
},
{
"name": "new-window-for-tab",
"description": "Emitted when the native new tab button is clicked.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-new-window-for-tab-macos"
},
{
"name": "system-context-menu",
"description": "Emitted when the system context menu is triggered on the window, this is normally only triggered when the user right clicks on the non-client area of your window. This is the window titlebar or any area you have declared as `-webkit-app-region: drag` in a frameless window.\n\nCalling `event.preventDefault()` will prevent the menu from being displayed.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "point",
"description": "The screen coordinates the context menu was triggered at",
"collection": false,
"type": "Point",
"required": true
}
],
"additionalTags": [
"os_windows"
],
"urlFragment": "#event-system-context-menu-windows"
}
],
"instanceName": "browserWindow"
},
{
"name": "ClientRequest",
"description": "> Make HTTP/HTTPS requests.\n\nProcess: Main\n\n`ClientRequest` implements the Writable Stream interface and is therefore an EventEmitter.",
"slug": "client-request",
"websiteUrl": "https://electronjs.org/docs/api/client-request",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/client-request.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"description": "If `options` is a String, it is interpreted as the request URL. If it is an object, it is expected to fully specify an HTTP request via the following properties:",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "Object",
"properties": [
{
"name": "method",
"description": "The HTTP request method. Defaults to the GET method.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "url",
"description": "The request URL. Must be provided in the absolute form with the protocol scheme specified as http or https.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "session",
"description": "The `Session` instance with which the request is associated.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Session"
},
{
"name": "partition",
"description": "The name of the `partition` with which the request is associated. Defaults to the empty string. The `session` option supersedes `partition`. Thus if a `session` is explicitly specified, `partition` is ignored.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "credentials",
"description": "Can be `include` or `omit`. Whether to send credentials with this request. If set to `include`, credentials from the session associated with the request will be used. If set to `omit`, credentials will not be sent with the request (and the `'login'` event will not be triggered in the event of a 401). This matches the behavior of the fetch option of the same name. If this option is not specified, authentication data from the session will be sent, and cookies will not be sent (unless `useSessionCookies` is set).",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "include",
"description": ""
},
{
"value": "omit",
"description": ""
}
]
},
{
"name": "useSessionCookies",
"description": "Whether to send cookies with this request from the provided session. If `credentials` is specified, this option has no effect. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "protocol",
"description": "Can be `http:` or `https:`. The protocol scheme in the form 'scheme:'. Defaults to 'http:'.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "host",
"description": "The server host provided as a concatenation of the hostname and the port number 'hostname:port'.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "hostname",
"description": "The server host name.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "port",
"description": "The server's listening port number.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "path",
"description": "The path part of the request URL.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "redirect",
"description": "Can be `follow`, `error` or `manual`. The redirect mode for this request. When mode is `error`, any redirection will be aborted. When mode is `manual` the redirection will be cancelled unless `request.followRedirect` is invoked synchronously during the `redirect` event. Defaults to `follow`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "follow",
"description": ""
},
{
"value": "error",
"description": ""
},
{
"value": "manual",
"description": ""
}
]
},
{
"name": "origin",
"description": "The origin URL of the request.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
]
},
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "setHeader",
"signature": "(name, value)",
"description": "Adds an extra HTTP header. The header name will be issued as-is without lowercasing. It can be called only before first write. Calling this method after the first write will throw an error. If the passed value is not a `String`, its `toString()` method will be called to obtain the final value.\n\nCertain headers are restricted from being set by apps. These headers are listed below. More information on restricted headers can be found in Chromium's header utils.\n\n* `Content-Length`\n* `Host`\n* `Trailer` or `Te`\n* `Upgrade`\n* `Cookie2`\n* `Keep-Alive`\n* `Transfer-Encoding`\n\nAdditionally, setting the `Connection` header to the value `upgrade` is also disallowed.",
"parameters": [
{
"name": "name",
"description": "An extra HTTP header name.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "value",
"description": "An extra HTTP header value.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#requestsetheadername-value"
},
{
"name": "getHeader",
"signature": "(name)",
"description": "The value of a previously set extra header name.",
"parameters": [
{
"name": "name",
"description": "Specify an extra header name.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#requestgetheadername"
},
{
"name": "removeHeader",
"signature": "(name)",
"description": "Removes a previously set extra header name. This method can be called only before first write. Trying to call it after the first write will throw an error.",
"parameters": [
{
"name": "name",
"description": "Specify an extra header name.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#requestremoveheadername"
},
{
"name": "write",
"signature": "(chunk[, encoding][, callback])",
"description": "`callback` is essentially a dummy function introduced in the purpose of keeping similarity with the Node.js API. It is called asynchronously in the next tick after `chunk` content have been delivered to the Chromium networking layer. Contrary to the Node.js implementation, it is not guaranteed that `chunk` content have been flushed on the wire before `callback` is called.\n\nAdds a chunk of data to the request body. The first write operation may cause the request headers to be issued on the wire. After the first write operation, it is not allowed to add or remove a custom header.",
"parameters": [
{
"name": "chunk",
"description": "A chunk of the request body's data. If it is a string, it is converted into a Buffer using the specified encoding.",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "Buffer"
}
]
},
{
"name": "encoding",
"description": "Used to convert string chunks into Buffer objects. Defaults to 'utf-8'.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "callback",
"description": "Called after the write operation ends.",
"required": false,
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#requestwritechunk-encoding-callback"
},
{
"name": "end",
"signature": "([chunk][, encoding][, callback])",
"description": "Sends the last chunk of the request data. Subsequent write or end operations will not be allowed. The `finish` event is emitted just after the end operation.",
"parameters": [
{
"name": "chunk",
"description": "",
"required": false,
"collection": false,
"type": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "Buffer"
}
]
},
{
"name": "encoding",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "callback",
"description": "",
"required": false,
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#requestendchunk-encoding-callback"
},
{
"name": "abort",
"signature": "()",
"description": "Cancels an ongoing HTTP transaction. If the request has already emitted the `close` event, the abort operation will have no effect. Otherwise an ongoing event will emit `abort` and `close` events. Additionally, if there is an ongoing response object,it will emit the `aborted` event.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#requestabort"
},
{
"name": "followRedirect",
"signature": "()",
"description": "Continues any pending redirection. Can only be called during a `'redirect'` event.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#requestfollowredirect"
},
{
"name": "getUploadProgress",
"signature": "()",
"description": "* `active` Boolean - Whether the request is currently active. If this is false no other properties will be set\n* `started` Boolean - Whether the upload has started. If this is false both `current` and `total` will be set to 0.\n* `current` Integer - The number of bytes that have been uploaded so far\n* `total` Integer - The number of bytes that will be uploaded this request\n\nYou can use this method in conjunction with `POST` requests to get the progress of a file upload or other data transfer.",
"parameters": [],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "active",
"description": "Whether the request is currently active. If this is false no other properties will be set",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "started",
"description": "Whether the upload has started. If this is false both `current` and `total` will be set to 0.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "current",
"description": "The number of bytes that have been uploaded so far",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "total",
"description": "The number of bytes that will be uploaded this request",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
}
]
},
"additionalTags": [],
"urlFragment": "#requestgetuploadprogress"
}
],
"instanceProperties": [
{
"name": "chunkedEncoding",
"description": "A `Boolean` specifying whether the request will use HTTP chunked transfer encoding or not. Defaults to false. The property is readable and writable, however it can be set only before the first write operation as the HTTP headers are not yet put on the wire. Trying to set the `chunkedEncoding` property after the first write will throw an error.\n\nUsing chunked encoding is strongly recommended if you need to send a large request body as data will be streamed in small chunks instead of being internally buffered inside Electron process memory.",
"required": true,
"additionalTags": [],
"urlFragment": "#requestchunkedencoding",
"collection": false,
"type": "Boolean"
}
],
"instanceEvents": [
{
"name": "response",
"description": "",
"parameters": [
{
"name": "response",
"description": "An object representing the HTTP response message.",
"collection": false,
"type": "IncomingMessage",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-response"
},
{
"name": "login",
"description": "Emitted when an authenticating proxy is asking for user credentials.\n\nThe `callback` function is expected to be called back with user credentials:\n\n* `username` String\n* `password` String\n\nProviding empty credentials will cancel the request and report an authentication error on the response object:",
"parameters": [
{
"name": "authInfo",
"description": "",
"collection": false,
"type": "Object",
"properties": [
{
"name": "isProxy",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "scheme",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "host",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "port",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "realm",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
],
"required": true
},
{
"name": "callback",
"description": "",
"collection": false,
"type": "Function",
"parameters": [
{
"name": "username",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "password",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-login"
},
{
"name": "finish",
"description": "Emitted just after the last chunk of the `request`'s data has been written into the `request` object.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-finish"
},
{
"name": "abort",
"description": "Emitted when the `request` is aborted. The `abort` event will not be fired if the `request` is already closed.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-abort"
},
{
"name": "error",
"description": "Emitted when the `net` module fails to issue a network request. Typically when the `request` object emits an `error` event, a `close` event will subsequently follow and no response object will be provided.",
"parameters": [
{
"name": "error",
"description": "an error object providing some information about the failure.",
"collection": false,
"type": "Error",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-error"
},
{
"name": "close",
"description": "Emitted as the last event in the HTTP request-response transaction. The `close` event indicates that no more events will be emitted on either the `request` or `response` objects.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-close"
},
{
"name": "redirect",
"description": "Emitted when the server returns a redirect response (e.g. 301 Moved Permanently). Calling `request.followRedirect` will continue with the redirection. If this event is handled, `request.followRedirect` must be called **synchronously**, otherwise the request will be cancelled.",
"parameters": [
{
"name": "statusCode",
"description": "",
"collection": false,
"type": "Integer",
"required": true
},
{
"name": "method",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "redirectUrl",
"description": "",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "responseHeaders",
"description": "",
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": true,
"type": "String",
"possibleValues": null
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-redirect"
}
],
"instanceName": "clientRequest"
},
{
"name": "clipboard",
"description": "> Perform copy and paste operations on the system clipboard.\n\nProcess: Main, Renderer\n\nOn Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method:",
"slug": "clipboard",
"websiteUrl": "https://electronjs.org/docs/api/clipboard",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/clipboard.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": true
},
"methods": [
{
"name": "readText",
"signature": "([type])",
"description": "The content in the clipboard as plain text.",
"parameters": [
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#clipboardreadtexttype"
},
{
"name": "writeText",
"signature": "(text[, type])",
"description": "Writes the `text` into the clipboard as plain text.",
"parameters": [
{
"name": "text",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#clipboardwritetexttext-type"
},
{
"name": "readHTML",
"signature": "([type])",
"description": "The content in the clipboard as markup.",
"parameters": [
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#clipboardreadhtmltype"
},
{
"name": "writeHTML",
"signature": "(markup[, type])",
"description": "Writes `markup` to the clipboard.",
"parameters": [
{
"name": "markup",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#clipboardwritehtmlmarkup-type"
},
{
"name": "readImage",
"signature": "([type])",
"description": "The image content in the clipboard.",
"parameters": [
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#clipboardreadimagetype"
},
{
"name": "writeImage",
"signature": "(image[, type])",
"description": "Writes `image` to the clipboard.",
"parameters": [
{
"name": "image",
"description": "",
"required": true,
"collection": false,
"type": "NativeImage"
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#clipboardwriteimageimage-type"
},
{
"name": "readRTF",
"signature": "([type])",
"description": "The content in the clipboard as RTF.",
"parameters": [
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#clipboardreadrtftype"
},
{
"name": "writeRTF",
"signature": "(text[, type])",
"description": "Writes the `text` into the clipboard in RTF.",
"parameters": [
{
"name": "text",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#clipboardwritertftext-type"
},
{
"name": "readBookmark",
"signature": "()",
"description": "* `title` String\n* `url` String\n\nReturns an Object containing `title` and `url` keys representing the bookmark in the clipboard. The `title` and `url` values will be empty strings when the bookmark is unavailable.",
"parameters": [],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "title",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "url",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#clipboardreadbookmark-macos-windows"
},
{
"name": "writeBookmark",
"signature": "(title, url[, type])",
"description": "Writes the `title` and `url` into the clipboard as a bookmark.\n\n**Note:** Most apps on Windows don't support pasting bookmarks into them so you can use `clipboard.write` to write both a bookmark and fallback text to the clipboard.",
"parameters": [
{
"name": "title",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "url",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#clipboardwritebookmarktitle-url-type-macos-windows"
},
{
"name": "readFindText",
"signature": "()",
"description": "The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active application’s find panel.\n\nThis method uses synchronous IPC when called from the renderer process. The cached value is reread from the find pasteboard whenever the application is activated.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#clipboardreadfindtext-macos"
},
{
"name": "writeFindText",
"signature": "(text)",
"description": "Writes the `text` into the find pasteboard (the pasteboard that holds information about the current state of the active application’s find panel) as plain text. This method uses synchronous IPC when called from the renderer process.",
"parameters": [
{
"name": "text",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#clipboardwritefindtexttext-macos"
},
{
"name": "clear",
"signature": "([type])",
"description": "Clears the clipboard content.",
"parameters": [
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#clipboardcleartype"
},
{
"name": "availableFormats",
"signature": "([type])",
"description": "An array of supported formats for the clipboard `type`.",
"parameters": [
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": {
"collection": true,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#clipboardavailableformatstype"
},
{
"name": "has",
"signature": "(format[, type])",
"description": "Whether the clipboard supports the specified `format`.",
"parameters": [
{
"name": "format",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#clipboardhasformat-type-experimental"
},
{
"name": "read",
"signature": "(format)",
"description": "Reads `format` type from the clipboard.",
"parameters": [
{
"name": "format",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#clipboardreadformat-experimental"
},
{
"name": "readBuffer",
"signature": "(format)",
"description": "Reads `format` type from the clipboard.",
"parameters": [
{
"name": "format",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#clipboardreadbufferformat-experimental"
},
{
"name": "writeBuffer",
"signature": "(format, buffer[, type])",
"description": "Writes the `buffer` into the clipboard as `format`.",
"parameters": [
{
"name": "format",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buffer",
"description": "",
"required": true,
"collection": false,
"type": "Buffer"
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#clipboardwritebufferformat-buffer-type-experimental"
},
{
"name": "write",
"signature": "(data[, type])",
"description": "Writes `data` to the clipboard.",
"parameters": [
{
"name": "data",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "text",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "html",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "image",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "NativeImage"
},
{
"name": "rtf",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "bookmark",
"description": "The title of the URL at `text`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "type",
"description": "Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "selection",
"description": ""
},
{
"value": "clipboard",
"description": ""
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#clipboardwritedata-type"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "CommandLine",
"description": "",
"slug": "command-line",
"websiteUrl": "https://electronjs.org/docs/api/command-line",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/command-line.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "appendSwitch",
"signature": "(switch[, value])",
"description": "Append a switch (with optional `value`) to Chromium's command line.\n\n**Note:** This will not affect `process.argv`. The intended usage of this function is to control Chromium's behavior.",
"parameters": [
{
"name": "switch",
"description": "A command-line switch, without the leading `--`",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "value",
"description": "A value for the given switch",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#commandlineappendswitchswitch-value"
},
{
"name": "appendArgument",
"signature": "(value)",
"description": "Append an argument to Chromium's command line. The argument will be quoted correctly. Switches will precede arguments regardless of appending order.\n\nIf you're appending an argument like `--switch=value`, consider using `appendSwitch('switch', 'value')` instead.\n\n**Note:** This will not affect `process.argv`. The intended usage of this function is to control Chromium's behavior.",
"parameters": [
{
"name": "value",
"description": "The argument to append to the command line",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#commandlineappendargumentvalue"
},
{
"name": "hasSwitch",
"signature": "(switch)",
"description": "Whether the command-line switch is present.",
"parameters": [
{
"name": "switch",
"description": "A command-line switch",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#commandlinehasswitchswitch"
},
{
"name": "getSwitchValue",
"signature": "(switch)",
"description": "The command-line switch value.\n\n**Note:** When the switch is not present or has no value, it returns empty string.",
"parameters": [
{
"name": "switch",
"description": "A command-line switch",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#commandlinegetswitchvalueswitch"
}
],
"instanceProperties": [],
"instanceEvents": [],
"instanceName": "commandLine"
},
{
"name": "contentTracing",
"description": "> Collect tracing data from Chromium to find performance bottlenecks and slow operations.\n\nProcess: Main\n\nThis module does not include a web interface. To view recorded traces, use trace viewer, available at `chrome://tracing` in Chrome.\n\n**Note:** You should not use this module until the `ready` event of the app module is emitted.",
"slug": "content-tracing",
"websiteUrl": "https://electronjs.org/docs/api/content-tracing",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/content-tracing.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "getCategories",
"signature": "()",
"description": "resolves with an array of category groups once all child processes have acknowledged the `getCategories` request\n\nGet a set of category groups. The category groups can change as new code paths are reached. See also the list of built-in tracing categories.\n\n> **NOTE:** Electron adds a non-default tracing category called `\"electron\"`. This category can be used to capture Electron-specific tracing events.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": true,
"type": "String",
"possibleValues": null
}
]
},
"additionalTags": [],
"urlFragment": "#contenttracinggetcategories"
},
{
"name": "startRecording",
"signature": "(options)",
"description": "resolved once all child processes have acknowledged the `startRecording` request.\n\nStart recording on all processes.\n\nRecording begins immediately locally and asynchronously on child processes as soon as they receive the EnableRecording request.\n\nIf a recording is already running, the promise will be immediately resolved, as only one trace operation can be in progress at a time.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "TraceConfig"
},
{
"collection": false,
"type": "TraceCategoriesAndOptions"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#contenttracingstartrecordingoptions"
},
{
"name": "stopRecording",
"signature": "([resultFilePath])",
"description": "resolves with a path to a file that contains the traced data once all child processes have acknowledged the `stopRecording` request\n\nStop recording on all processes.\n\nChild processes typically cache trace data and only rarely flush and send trace data back to the main process. This helps to minimize the runtime overhead of tracing since sending trace data over IPC can be an expensive operation. So, to end tracing, Chromium asynchronously asks all child processes to flush any pending trace data.\n\nTrace data will be written into `resultFilePath`. If `resultFilePath` is empty or not provided, trace data will be written to a temporary file, and the path will be returned in the promise.",
"parameters": [
{
"name": "resultFilePath",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
"additionalTags": [],
"urlFragment": "#contenttracingstoprecordingresultfilepath"
},
{
"name": "getTraceBufferUsage",
"signature": "()",
"description": "Resolves with an object containing the `value` and `percentage` of trace buffer maximum usage\n\n* `value` Number\n* `percentage` Number\n\nGet the maximum usage across processes of trace buffer as a percentage of the full state.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "Object",
"properties": [
{
"name": "value",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "percentage",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Number"
}
]
}
]
},
"additionalTags": [],
"urlFragment": "#contenttracinggettracebufferusage"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "contextBridge",
"description": "> Create a safe, bi-directional, synchronous bridge across isolated contexts\n\nProcess: Renderer\n\nAn example of exposing an API to a renderer from an isolated preload script is given below:\n\n```\n// Preload (Isolated World)\nconst { contextBridge, ipcRenderer } = require('electron')\n\ncontextBridge.exposeInMainWorld(\n 'electron',\n {\n doThing: () => ipcRenderer.send('do-a-thing')\n }\n)\n```\n\n### Glossary\n\n\n\n### Main World\n\nThe \"Main World\" is the JavaScript context that your main renderer code runs in. By default, the page you load in your renderer executes code in this world.\n\n### Isolated World\n\nWhen `contextIsolation` is enabled in your `webPreferences`, your `preload` scripts run in an \"Isolated World\". You can read more about context isolation and what it affects in the security docs.",
"slug": "context-bridge",
"websiteUrl": "https://electronjs.org/docs/api/context-bridge",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/context-bridge.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": false,
"renderer": true
},
"methods": [
{
"name": "exposeInMainWorld",
"signature": "(apiKey, api)",
"description": "",
"parameters": [
{
"name": "apiKey",
"description": "The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "api",
"description": "Your API object, more information on what this API can be and how it works is available below.",
"required": true,
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "any"
}
]
}
],
"returns": null,
"additionalTags": [
"stability_experimental"
],
"urlFragment": "#contextbridgeexposeinmainworldapikey-api-experimental"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "Cookies",
"description": "",
"slug": "cookies",
"websiteUrl": "https://electronjs.org/docs/api/cookies",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/cookies.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "get",
"signature": "(filter)",
"description": "A promise which resolves an array of cookie objects.\n\nSends a request to get all cookies matching `filter`, and resolves a promise with the response.",
"parameters": [
{
"name": "filter",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "url",
"description": "Retrieves cookies which are associated with `url`. Empty implies retrieving cookies of all URLs.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "name",
"description": "Filters cookies by name.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "domain",
"description": "Retrieves cookies whose domains match or are subdomains of `domains`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "Retrieves cookies whose path matches `path`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "secure",
"description": "Filters cookies by their Secure property.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "session",
"description": "Filters out session or persistent cookies.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": true,
"type": "Cookie"
}
]
},
"additionalTags": [],
"urlFragment": "#cookiesgetfilter"
},
{
"name": "set",
"signature": "(details)",
"description": "A promise which resolves when the cookie has been set\n\nSets a cookie with `details`.",
"parameters": [
{
"name": "details",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "url",
"description": "The URL to associate the cookie with. The promise will be rejected if the URL is invalid.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "name",
"description": "The name of the cookie. Empty by default if omitted.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "value",
"description": "The value of the cookie. Empty by default if omitted.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "domain",
"description": "The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "path",
"description": "The path of the cookie. Empty by default if omitted.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "secure",
"description": "Whether the cookie should be marked as Secure. Defaults to false.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "httpOnly",
"description": "Whether the cookie should be marked as HTTP only. Defaults to false.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "expirationDate",
"description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted then the cookie becomes a session cookie and will not be retained between sessions.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
},
{
"name": "sameSite",
"description": "The Same Site policy to apply to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`. Default is `no_restriction`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "unspecified",
"description": ""
},
{
"value": "no_restriction",
"description": ""
},
{
"value": "lax",
"description": ""
},
{
"value": "strict",
"description": ""
}
]
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#cookiessetdetails"
},
{
"name": "remove",
"signature": "(url, name)",
"description": "A promise which resolves when the cookie has been removed\n\nRemoves the cookies matching `url` and `name`",
"parameters": [
{
"name": "url",
"description": "The URL associated with the cookie.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "name",
"description": "The name of cookie to remove.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#cookiesremoveurl-name"
},
{
"name": "flushStore",
"signature": "()",
"description": "A promise which resolves when the cookie store has been flushed\n\nWrites any unwritten cookies data to disk.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#cookiesflushstore"
}
],
"instanceProperties": [],
"instanceEvents": [
{
"name": "changed",
"description": "Emitted when a cookie is changed because it was added, edited, removed, or expired.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-changed"
}
],
"instanceName": "cookies"
},
{
"name": "crashReporter",
"description": "> Submit crash reports to a remote server.\n\nProcess: Main, Renderer\n\nThe following is an example of setting up Electron to automatically submit crash reports to a remote server:\n\n```\nconst { crashReporter } = require('electron')\n\ncrashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })\n```\n\nFor setting up a server to accept and process crash reports, you can use following projects:\n\n* socorro\n* mini-breakpad-server\n\nOr use a 3rd party hosted solution:\n\n* Backtrace\n* Sentry\n* BugSplat\n\nCrash reports are stored temporarily before being uploaded in a directory underneath the app's user data directory (called 'Crashpad' on Windows and Mac, or 'Crash Reports' on Linux). You can override this directory by calling `app.setPath('crashDumps', '/path/to/crashes')` before starting the crash reporter.\n\nOn Windows and macOS, Electron uses crashpad to monitor and report crashes. On Linux, Electron uses breakpad. This is an implementation detail driven by Chromium, and it may change in future. In particular, crashpad is newer and will likely eventually replace breakpad on all platforms.\n\n### Note about Node child processes on Linux\n\nIf you are using the Node.js `child_process` module and want to report crashes from those processes on Linux, there is an extra step you will need to take to properly initialize the crash reporter in the child process. This is not necessary on Mac or Windows, as those platforms use Crashpad, which automatically monitors child processes.\n\nSince `require('electron')` is not available in Node child processes, the following APIs are available on the `process` object in Node child processes. Note that, on Linux, each Node child process has its own separate instance of the breakpad crash reporter. This is dissimilar to renderer child processes, which have a \"stub\" breakpad reporter which returns information to the main process for reporting.\n\n### `process.crashReporter.start(options)`\n\nSee `crashReporter.start()`.\n\n### `process.crashReporter.getParameters()`\n\nSee `crashReporter.getParameters()`.\n\n### `process.crashReporter.addExtraParameter(key, value)`\n\nSee `crashReporter.addExtraParameter(key, value)`.\n\n### `process.crashReporter.removeExtraParameter(key)`\n\nSee `crashReporter.removeExtraParameter(key)`.",
"slug": "crash-reporter",
"websiteUrl": "https://electronjs.org/docs/api/crash-reporter",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/crash-reporter.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": true
},
"methods": [
{
"name": "start",
"signature": "(options)",
"description": "This method must be called before using any other `crashReporter` APIs. Once initialized this way, the crashpad handler collects crashes from all subsequently created processes. The crash reporter cannot be disabled once started.\n\nThis method should be called as early as possible in app startup, preferably before `app.on('ready')`. If the crash reporter is not initialized at the time a renderer process is created, then that renderer process will not be monitored by the crash reporter.\n\n**Note:** You can test out the crash reporter by generating a crash using `process.crash()`.\n\n**Note:** If you need to send additional/updated `extra` parameters after your first call `start` you can call `addExtraParameter`.\n\n**Note:** Parameters passed in `extra`, `globalExtra` or set with `addExtraParameter` have limits on the length of the keys and values. Key names must be at most 39 bytes long, and values must be no longer than 127 bytes. Keys with names longer than the maximum will be silently ignored. Key values longer than the maximum length will be truncated.\n\n**Note:** This method is only available in the main process.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "submitURL",
"description": "URL that crash reports will be sent to as POST.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "productName",
"description": "Defaults to `app.name`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "companyName",
"description": "Deprecated alias for `{ globalExtra: { _companyName: ... } }`.",
"required": false,
"additionalTags": [
"stability_deprecated"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "uploadToServer",
"description": "Whether crash reports should be sent to the server. If false, crash reports will be collected and stored in the crashes directory, but not uploaded. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "ignoreSystemCrashHandler",
"description": "If true, crashes generated in the main process will not be forwarded to the system crash handler. Default is `false`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "rateLimit",
"description": "If true, limit the number of crashes uploaded to 1/hour. Default is `false`.",
"required": false,
"additionalTags": [
"os_macos",
"os_windows"
],
"collection": false,
"type": "Boolean"
},
{
"name": "compress",
"description": "If true, crash reports will be compressed and uploaded with `Content-Encoding: gzip`. Default is `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "extra",
"description": "Extra string key/value annotations that will be sent along with crash reports that are generated in the main process. Only string values are supported. Crashes generated in child processes will not contain these extra parameters to crash reports generated from child processes, call `addExtraParameter` from the child process.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "globalExtra",
"description": "Extra string key/value annotations that will be sent along with any crash reports generated in any process. These annotations cannot be changed once the crash reporter has been started. If a key is present in both the global extra parameters and the process-specific extra parameters, then the global one will take precedence. By default, `productName` and the app version are included, as well as the Electron version.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#crashreporterstartoptions"
},
{
"name": "getLastCrashReport",
"signature": "()",
"description": "The date and ID of the last crash report. Only crash reports that have been uploaded will be returned; even if a crash report is present on disk it will not be returned until it is uploaded. In the case that there are no uploaded reports, `null` is returned.\n\n**Note:** This method is only available in the main process.",
"parameters": [],
"returns": {
"collection": false,
"type": "CrashReport"
},
"additionalTags": [],
"urlFragment": "#crashreportergetlastcrashreport"
},
{
"name": "getUploadedReports",
"signature": "()",
"description": "Returns all uploaded crash reports. Each report contains the date and uploaded ID.\n\n**Note:** This method is only available in the main process.",
"parameters": [],
"returns": {
"collection": true,
"type": "CrashReport"
},
"additionalTags": [],
"urlFragment": "#crashreportergetuploadedreports"
},
{
"name": "getUploadToServer",
"signature": "()",
"description": "Whether reports should be submitted to the server. Set through the `start` method or `setUploadToServer`.\n\n**Note:** This method is only available in the main process.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#crashreportergetuploadtoserver"
},
{
"name": "setUploadToServer",
"signature": "(uploadToServer)",
"description": "This would normally be controlled by user preferences. This has no effect if called before `start` is called.\n\n**Note:** This method is only available in the main process.",
"parameters": [
{
"name": "uploadToServer",
"description": "Whether reports should be submitted to the server.",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#crashreportersetuploadtoserveruploadtoserver"
},
{
"name": "addExtraParameter",
"signature": "(key, value)",
"description": "Set an extra parameter to be sent with the crash report. The values specified here will be sent in addition to any values set via the `extra` option when `start` was called.\n\nParameters added in this fashion (or via the `extra` parameter to `crashReporter.start`) are specific to the calling process. Adding extra parameters in the main process will not cause those parameters to be sent along with crashes from renderer or other child processes. Similarly, adding extra parameters in a renderer process will not result in those parameters being sent with crashes that occur in other renderer processes or in the main process.\n\n**Note:** Parameters have limits on the length of the keys and values. Key names must be no longer than 39 bytes, and values must be no longer than 20320 bytes. Keys with names longer than the maximum will be silently ignored. Key values longer than the maximum length will be truncated.\n\n**Note:** On linux values that are longer than 127 bytes will be chunked into multiple keys, each 127 bytes in length. E.g. `addExtraParameter('foo', 'a'.repeat(130))` will result in two chunked keys `foo__1` and `foo__2`, the first will contain the first 127 bytes and the second will contain the remaining 3 bytes. On your crash reporting backend you should stitch together keys in this format.",
"parameters": [
{
"name": "key",
"description": "Parameter key, must be no longer than 39 bytes.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "value",
"description": "Parameter value, must be no longer than 127 bytes.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#crashreporteraddextraparameterkey-value"
},
{
"name": "removeExtraParameter",
"signature": "(key)",
"description": "Remove an extra parameter from the current set of parameters. Future crashes will not include this parameter.",
"parameters": [
{
"name": "key",
"description": "Parameter key, must be no longer than 39 bytes.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#crashreporterremoveextraparameterkey"
},
{
"name": "getParameters",
"signature": "()",
"description": "The current 'extra' parameters of the crash reporter.",
"parameters": [],
"returns": {
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
"additionalTags": [],
"urlFragment": "#crashreportergetparameters"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "Debugger",
"description": "",
"slug": "debugger",
"websiteUrl": "https://electronjs.org/docs/api/debugger",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/debugger.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "attach",
"signature": "([protocolVersion])",
"description": "Attaches the debugger to the `webContents`.",
"parameters": [
{
"name": "protocolVersion",
"description": "Requested debugging protocol version.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#debuggerattachprotocolversion"
},
{
"name": "isAttached",
"signature": "()",
"description": "Whether a debugger is attached to the `webContents`.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#debuggerisattached"
},
{
"name": "detach",
"signature": "()",
"description": "Detaches the debugger from the `webContents`.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#debuggerdetach"
},
{
"name": "sendCommand",
"signature": "(method[, commandParams, sessionId])",
"description": "A promise that resolves with the response defined by the 'returns' attribute of the command description in the remote debugging protocol or is rejected indicating the failure of the command.\n\nSend given command to the debugging target.",
"parameters": [
{
"name": "method",
"description": "Method name, should be one of the methods defined by the remote debugging protocol.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "commandParams",
"description": "JSON object with request parameters.",
"required": false,
"collection": false,
"type": "any"
},
{
"name": "sessionId",
"description": "send command to the target with associated debugging session id. The initial value can be obtained by sending Target.attachToTarget message.",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "any"
}
]
},
"additionalTags": [],
"urlFragment": "#debuggersendcommandmethod-commandparams-sessionid"
}
],
"instanceProperties": [],
"instanceEvents": [
{
"name": "detach",
"description": "Emitted when the debugging session is terminated. This happens either when `webContents` is closed or devtools is invoked for the attached `webContents`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "reason",
"description": "Reason for detaching debugger.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-detach"
},
{
"name": "message",
"description": "Emitted whenever the debugging target issues an instrumentation event.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "method",
"description": "Method name.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
},
{
"name": "params",
"description": "Event parameters defined by the 'parameters' attribute in the remote debugging protocol.",
"collection": false,
"type": "any",
"required": true
},
{
"name": "sessionId",
"description": "Unique identifier of attached debugging session, will match the value sent from `debugger.sendCommand`.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-message"
}
],
"instanceName": "debugger"
},
{
"name": "desktopCapturer",
"description": "> Access information about media sources that can be used to capture audio and video from the desktop using the `navigator.mediaDevices.getUserMedia` API.\n\nProcess: Main, Renderer\n\nThe following example shows how to capture video from a desktop window whose title is `Electron`:\n\n```\n// In the renderer process.\nconst { desktopCapturer } = require('electron')\n\ndesktopCapturer.getSources({ types: ['window', 'screen'] }).then(async sources => {\n for (const source of sources) {\n if (source.name === 'Electron') {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n mandatory: {\n chromeMediaSource: 'desktop',\n chromeMediaSourceId: source.id,\n minWidth: 1280,\n maxWidth: 1280,\n minHeight: 720,\n maxHeight: 720\n }\n }\n })\n handleStream(stream)\n } catch (e) {\n handleError(e)\n }\n return\n }\n }\n})\n\nfunction handleStream (stream) {\n const video = document.querySelector('video')\n video.srcObject = stream\n video.onloadedmetadata = (e) => video.play()\n}\n\nfunction handleError (e) {\n console.log(e)\n}\n```\n\nTo capture video from a source provided by `desktopCapturer` the constraints passed to `navigator.mediaDevices.getUserMedia` must include `chromeMediaSource: 'desktop'`, and `audio: false`.\n\nTo capture both audio and video from the entire desktop the constraints passed to `navigator.mediaDevices.getUserMedia` must include `chromeMediaSource: 'desktop'`, for both `audio` and `video`, but should not include a `chromeMediaSourceId` constraint.",
"slug": "desktop-capturer",
"websiteUrl": "https://electronjs.org/docs/api/desktop-capturer",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/desktop-capturer.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": true
},
"methods": [
{
"name": "getSources",
"signature": "(options)",
"description": "Resolves with an array of `DesktopCapturerSource` objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured.\n\n**Note** Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher, which can detected by `systemPreferences.getMediaAccessStatus`.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "types",
"description": "An array of Strings that lists the types of desktop sources to be captured, available types are `screen` and `window`.",
"required": true,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "thumbnailSize",
"description": "The size that the media source thumbnail should be scaled to. Default is `150` x `150`. Set width or height to 0 when you do not need the thumbnails. This will save the processing time required for capturing the content of each window and screen.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Size"
},
{
"name": "fetchWindowIcons",
"description": "Set to true to enable fetching window icons. The default value is false. When false the appIcon property of the sources return null. Same if a source has the type screen.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": true,
"type": "DesktopCapturerSource"
}
]
},
"additionalTags": [],
"urlFragment": "#desktopcapturergetsourcesoptions"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "dialog",
"description": "> Display native system dialogs for opening and saving files, alerting, etc.\n\nProcess: Main\n\nAn example of showing a dialog to select multiple files:",
"slug": "dialog",
"websiteUrl": "https://electronjs.org/docs/api/dialog",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/dialog.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "showOpenDialogSync",
"signature": "([browserWindow, ]options)",
"description": "the file paths chosen by the user; if the dialog is cancelled it returns `undefined`.\n\nThe `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.\n\nThe `filters` specifies an array of file types that can be displayed or selected when you want to limit the user to a specific type. For example:\n\nThe `extensions` array should contain extensions without wildcards or dots (e.g. `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the `'*'` wildcard (no other wildcard is supported).\n\n**Note:** On Windows and Linux an open dialog can not be both a file selector and a directory selector, so if you set `properties` to `['openFile', 'openDirectory']` on these platforms, a directory selector will be shown.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "title",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "defaultPath",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buttonLabel",
"description": "Custom label for the confirmation button, when left empty the default label will be used.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "filters",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "FileFilter"
},
{
"name": "properties",
"description": "Contains which features the dialog should use. The following values are supported:",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": [
{
"value": "openFile",
"description": "Allow files to be selected."
},
{
"value": "openDirectory",
"description": "Allow directories to be selected."
},
{
"value": "multiSelections",
"description": "Allow multiple paths to be selected."
},
{
"value": "showHiddenFiles",
"description": "Show hidden files in dialog."
},
{
"value": "createDirectory",
"description": "Allow creating new directories from dialog."
},
{
"value": "promptToCreate",
"description": "Prompt for creation if the file path entered in the dialog does not exist. This does not actually create the file at the path but allows non-existent paths to be returned that should be created by the application."
},
{
"value": "noResolveAliases",
"description": "Disable the automatic alias (symlink) path resolution. Selected aliases will now return the alias path instead of their target path."
},
{
"value": "treatPackageAsDirectory",
"description": "Treat packages, such as `.app` folders, as a directory instead of a file."
},
{
"value": "dontAddToRecent",
"description": "Do not add the item being opened to the recent documents list."
}
]
},
{
"name": "message",
"description": "Message to display above input boxes.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "securityScopedBookmarks",
"description": "Create security scoped bookmarks when packaged for the Mac App Store.",
"required": false,
"additionalTags": [
"os_macos",
"os_mas"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": [
{
"collection": true,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "undefined"
}
]
},
"additionalTags": [],
"urlFragment": "#dialogshowopendialogsyncbrowserwindow-options"
},
{
"name": "showOpenDialog",
"signature": "([browserWindow, ]options)",
"description": "Resolve with an object containing the following:\n\n* `canceled` Boolean - whether or not the dialog was canceled.\n* `filePaths` String[] - An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.\n* `bookmarks` String[] (optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see table here.)\n\nThe `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.\n\nThe `filters` specifies an array of file types that can be displayed or selected when you want to limit the user to a specific type. For example:\n\nThe `extensions` array should contain extensions without wildcards or dots (e.g. `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the `'*'` wildcard (no other wildcard is supported).\n\n**Note:** On Windows and Linux an open dialog can not be both a file selector and a directory selector, so if you set `properties` to `['openFile', 'openDirectory']` on these platforms, a directory selector will be shown.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "title",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "defaultPath",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buttonLabel",
"description": "Custom label for the confirmation button, when left empty the default label will be used.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "filters",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "FileFilter"
},
{
"name": "properties",
"description": "Contains which features the dialog should use. The following values are supported:",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": [
{
"value": "openFile",
"description": "Allow files to be selected."
},
{
"value": "openDirectory",
"description": "Allow directories to be selected."
},
{
"value": "multiSelections",
"description": "Allow multiple paths to be selected."
},
{
"value": "showHiddenFiles",
"description": "Show hidden files in dialog."
},
{
"value": "createDirectory",
"description": "Allow creating new directories from dialog."
},
{
"value": "promptToCreate",
"description": "Prompt for creation if the file path entered in the dialog does not exist. This does not actually create the file at the path but allows non-existent paths to be returned that should be created by the application."
},
{
"value": "noResolveAliases",
"description": "Disable the automatic alias (symlink) path resolution. Selected aliases will now return the alias path instead of their target path."
},
{
"value": "treatPackageAsDirectory",
"description": "Treat packages, such as `.app` folders, as a directory instead of a file."
},
{
"value": "dontAddToRecent",
"description": "Do not add the item being opened to the recent documents list."
}
]
},
{
"name": "message",
"description": "Message to display above input boxes.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "securityScopedBookmarks",
"description": "Create security scoped bookmarks when packaged for the Mac App Store.",
"required": false,
"additionalTags": [
"os_macos",
"os_mas"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "Object",
"properties": [
{
"name": "canceled",
"description": "whether or not the dialog was canceled.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "filePaths",
"description": "An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.",
"required": true,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "bookmarks",
"description": "An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see table here.)",
"required": false,
"additionalTags": [
"os_macos",
"os_mas"
],
"collection": true,
"type": "String",
"possibleValues": null
}
]
}
]
},
"additionalTags": [],
"urlFragment": "#dialogshowopendialogbrowserwindow-options"
},
{
"name": "showSaveDialogSync",
"signature": "([browserWindow, ]options)",
"description": "the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.\n\nThe `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.\n\nThe `filters` specifies an array of file types that can be displayed, see `dialog.showOpenDialog` for an example.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "title",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "defaultPath",
"description": "Absolute directory path, absolute file path, or file name to use by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buttonLabel",
"description": "Custom label for the confirmation button, when left empty the default label will be used.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "filters",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "FileFilter"
},
{
"name": "message",
"description": "Message to display above text fields.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "nameFieldLabel",
"description": "Custom label for the text displayed in front of the filename text field.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "showsTagField",
"description": "Show the tags input box, defaults to `true`.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "properties",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": [
{
"value": "showHiddenFiles",
"description": "Show hidden files in dialog."
},
{
"value": "createDirectory",
"description": "Allow creating new directories from dialog."
},
{
"value": "treatPackageAsDirectory",
"description": "Treat packages, such as `.app` folders, as a directory instead of a file."
},
{
"value": "showOverwriteConfirmation",
"description": "Sets whether the user will be presented a confirmation dialog if the user types a file name that already exists."
},
{
"value": "dontAddToRecent",
"description": "Do not add the item being saved to the recent documents list."
}
]
},
{
"name": "securityScopedBookmarks",
"description": "Create a security scoped bookmark when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.",
"required": false,
"additionalTags": [
"os_macos",
"os_mas"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "undefined"
}
]
},
"additionalTags": [],
"urlFragment": "#dialogshowsavedialogsyncbrowserwindow-options"
},
{
"name": "showSaveDialog",
"signature": "([browserWindow, ]options)",
"description": "Resolve with an object containing the following:\n\n* `canceled` Boolean - whether or not the dialog was canceled.\n* `filePath` String (optional) - If the dialog is canceled, this will be `undefined`.\n* `bookmark` String (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see table here.)\n\nThe `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.\n\nThe `filters` specifies an array of file types that can be displayed, see `dialog.showOpenDialog` for an example.\n\n**Note:** On macOS, using the asynchronous version is recommended to avoid issues when expanding and collapsing the dialog.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "title",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "defaultPath",
"description": "Absolute directory path, absolute file path, or file name to use by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buttonLabel",
"description": "Custom label for the confirmation button, when left empty the default label will be used.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "filters",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "FileFilter"
},
{
"name": "message",
"description": "Message to display above text fields.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "nameFieldLabel",
"description": "Custom label for the text displayed in front of the filename text field.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "showsTagField",
"description": "Show the tags input box, defaults to `true`.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "properties",
"description": "",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": [
{
"value": "showHiddenFiles",
"description": "Show hidden files in dialog."
},
{
"value": "createDirectory",
"description": "Allow creating new directories from dialog."
},
{
"value": "treatPackageAsDirectory",
"description": "Treat packages, such as `.app` folders, as a directory instead of a file."
},
{
"value": "showOverwriteConfirmation",
"description": "Sets whether the user will be presented a confirmation dialog if the user types a file name that already exists."
},
{
"value": "dontAddToRecent",
"description": "Do not add the item being saved to the recent documents list."
}
]
},
{
"name": "securityScopedBookmarks",
"description": "Create a security scoped bookmark when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.",
"required": false,
"additionalTags": [
"os_macos",
"os_mas"
],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "Object",
"properties": [
{
"name": "canceled",
"description": "whether or not the dialog was canceled.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "filePath",
"description": "If the dialog is canceled, this will be `undefined`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "bookmark",
"description": "Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see table here.)",
"required": false,
"additionalTags": [
"os_macos",
"os_mas"
],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
]
},
"additionalTags": [],
"urlFragment": "#dialogshowsavedialogbrowserwindow-options"
},
{
"name": "showMessageBoxSync",
"signature": "([browserWindow, ]options)",
"description": "the index of the clicked button.\n\nShows a message box, it will block the process until the message box is closed. It returns the index of the clicked button.\n\nThe `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal. If `browserWindow` is not shown dialog will not be attached to it. In such case it will be displayed as an independent window.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "message",
"description": "Content of the message box.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `\"none\"`, `\"info\"`, `\"error\"`, `\"question\"` or `\"warning\"`. On Windows, `\"question\"` displays the same icon as `\"info\"`, unless you set an icon using the `\"icon\"` option. On macOS, both `\"warning\"` and `\"error\"` display the same warning icon.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buttons",
"description": "Array of texts for buttons. On Windows, an empty array will result in one button labeled \"OK\".",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "defaultId",
"description": "Index of the button in the buttons array which will be selected by default when the message box opens.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "title",
"description": "Title of the message box, some platforms will not show it.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "detail",
"description": "Extra information of the message.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "checkboxLabel",
"description": "If provided, the message box will include a checkbox with the given label.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "checkboxChecked",
"description": "Initial checked state of the checkbox. `false` by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "icon",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "cancelId",
"description": "The index of the button to be used to cancel the dialog, via the `Esc` key. By default this is assigned to the first button with \"cancel\" or \"no\" as the label. If no such labeled buttons exist and this option is not set, `0` will be used as the return value.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "noLink",
"description": "On Windows Electron will try to figure out which one of the `buttons` are common buttons (like \"Cancel\" or \"Yes\"), and show the others as command links in the dialog. This can make the dialog appear in the style of modern Windows apps. If you don't like this behavior, you can set `noLink` to `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "normalizeAccessKeys",
"description": "Normalize the keyboard access keys across platforms. Default is `false`. Enabling this assumes `&` is used in the button labels for the placement of the keyboard shortcut access key and labels will be converted so they work correctly on each platform, `&` characters are removed on macOS, converted to `_` on Linux, and left untouched on Windows. For example, a button label of `Vie&w` will be converted to `Vie_w` on Linux and `View` on macOS and can be selected via `Alt-W` on Windows and Linux.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#dialogshowmessageboxsyncbrowserwindow-options"
},
{
"name": "showMessageBox",
"signature": "([browserWindow, ]options)",
"description": "resolves with a promise containing the following properties:\n\n* `response` Number - The index of the clicked button.\n* `checkboxChecked` Boolean - The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.\n\nShows a message box.\n\nThe `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "message",
"description": "Content of the message box.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "type",
"description": "Can be `\"none\"`, `\"info\"`, `\"error\"`, `\"question\"` or `\"warning\"`. On Windows, `\"question\"` displays the same icon as `\"info\"`, unless you set an icon using the `\"icon\"` option. On macOS, both `\"warning\"` and `\"error\"` display the same warning icon.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "buttons",
"description": "Array of texts for buttons. On Windows, an empty array will result in one button labeled \"OK\".",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "defaultId",
"description": "Index of the button in the buttons array which will be selected by default when the message box opens.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "title",
"description": "Title of the message box, some platforms will not show it.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "detail",
"description": "Extra information of the message.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "checkboxLabel",
"description": "If provided, the message box will include a checkbox with the given label.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "checkboxChecked",
"description": "Initial checked state of the checkbox. `false` by default.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "icon",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "NativeImage"
},
{
"name": "cancelId",
"description": "The index of the button to be used to cancel the dialog, via the `Esc` key. By default this is assigned to the first button with \"cancel\" or \"no\" as the label. If no such labeled buttons exist and this option is not set, `0` will be used as the return value.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "noLink",
"description": "On Windows Electron will try to figure out which one of the `buttons` are common buttons (like \"Cancel\" or \"Yes\"), and show the others as command links in the dialog. This can make the dialog appear in the style of modern Windows apps. If you don't like this behavior, you can set `noLink` to `true`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "normalizeAccessKeys",
"description": "Normalize the keyboard access keys across platforms. Default is `false`. Enabling this assumes `&` is used in the button labels for the placement of the keyboard shortcut access key and labels will be converted so they work correctly on each platform, `&` characters are removed on macOS, converted to `_` on Linux, and left untouched on Windows. For example, a button label of `Vie&w` will be converted to `Vie_w` on Linux and `View` on macOS and can be selected via `Alt-W` on Windows and Linux.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "Object",
"properties": [
{
"name": "response",
"description": "The index of the clicked button.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "checkboxChecked",
"description": "The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
}
]
},
"additionalTags": [],
"urlFragment": "#dialogshowmessageboxbrowserwindow-options"
},
{
"name": "showErrorBox",
"signature": "(title, content)",
"description": "Displays a modal dialog that shows an error message.\n\nThis API can be called safely before the `ready` event the `app` module emits, it is usually used to report errors in early stage of startup. If called before the app `ready`event on Linux, the message will be emitted to stderr, and no GUI dialog will appear.",
"parameters": [
{
"name": "title",
"description": "The title to display in the error box.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "content",
"description": "The text content to display in the error box.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#dialogshowerrorboxtitle-content"
},
{
"name": "showCertificateTrustDialog",
"signature": "([browserWindow, ]options)",
"description": "resolves when the certificate trust dialog is shown.\n\nOn macOS, this displays a modal dialog that shows a message and certificate information, and gives the user the option of trusting/importing the certificate. If you provide a `browserWindow` argument the dialog will be attached to the parent window, making it modal.\n\nOn Windows the options are more limited, due to the Win32 APIs used:\n\n* The `message` argument is not used, as the OS provides its own confirmation dialog.\n* The `browserWindow` argument is ignored since it is not possible to make this confirmation dialog modal.",
"parameters": [
{
"name": "browserWindow",
"description": "",
"required": false,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "certificate",
"description": "The certificate to trust/import.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Certificate"
},
{
"name": "message",
"description": "The message to display to the user.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#dialogshowcertificatetrustdialogbrowserwindow-options-macos-windows"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "Dock",
"description": "",
"slug": "dock",
"websiteUrl": "https://electronjs.org/docs/api/dock",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/dock.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "bounce",
"signature": "([type])",
"description": "an ID representing the request.\n\nWhen `critical` is passed, the dock icon will bounce until either the application becomes active or the request is canceled.\n\nWhen `informational` is passed, the dock icon will bounce for one second. However, the request remains active until either the application becomes active or the request is canceled.\n\n**Nota Bene:** This method can only be used while the app is not focused; when the app is focused it will return -1.",
"parameters": [
{
"name": "type",
"description": "Can be `critical` or `informational`. The default is `informational`",
"required": false,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "critical",
"description": ""
},
{
"value": "informational",
"description": ""
}
]
}
],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockbouncetype-macos"
},
{
"name": "cancelBounce",
"signature": "(id)",
"description": "Cancel the bounce of `id`.",
"parameters": [
{
"name": "id",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockcancelbounceid-macos"
},
{
"name": "downloadFinished",
"signature": "(filePath)",
"description": "Bounces the Downloads stack if the filePath is inside the Downloads folder.",
"parameters": [
{
"name": "filePath",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockdownloadfinishedfilepath-macos"
},
{
"name": "setBadge",
"signature": "(text)",
"description": "Sets the string to be displayed in the dock’s badging area.",
"parameters": [
{
"name": "text",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#docksetbadgetext-macos"
},
{
"name": "getBadge",
"signature": "()",
"description": "The badge string of the dock.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockgetbadge-macos"
},
{
"name": "hide",
"signature": "()",
"description": "Hides the dock icon.",
"parameters": [],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockhide-macos"
},
{
"name": "show",
"signature": "()",
"description": "Resolves when the dock icon is shown.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockshow-macos"
},
{
"name": "isVisible",
"signature": "()",
"description": "Whether the dock icon is visible.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockisvisible-macos"
},
{
"name": "setMenu",
"signature": "(menu)",
"description": "Sets the application's [dock menu][dock-menu].",
"parameters": [
{
"name": "menu",
"description": "",
"required": true,
"collection": false,
"type": "Menu"
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#docksetmenumenu-macos"
},
{
"name": "getMenu",
"signature": "()",
"description": "The application's [dock menu][dock-menu].",
"parameters": [],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "Menu"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockgetmenu-macos"
},
{
"name": "setIcon",
"signature": "(image)",
"description": "Sets the `image` associated with this dock icon.",
"parameters": [
{
"name": "image",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#dockseticonimage-macos"
}
],
"instanceProperties": [],
"instanceEvents": [],
"instanceName": "dock"
},
{
"name": "DownloadItem",
"description": "",
"slug": "download-item",
"websiteUrl": "https://electronjs.org/docs/api/download-item",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/download-item.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "setSavePath",
"signature": "(path)",
"description": "The API is only available in session's `will-download` callback function. If `path` doesn't exist, Electron will try to make the directory recursively. If user doesn't set the save path via the API, Electron will use the original routine to determine the save path; this usually prompts a save dialog.",
"parameters": [
{
"name": "path",
"description": "Set the save file path of the download item.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#downloaditemsetsavepathpath"
},
{
"name": "getSavePath",
"signature": "()",
"description": "The save path of the download item. This will be either the path set via `downloadItem.setSavePath(path)` or the path selected from the shown save dialog.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgetsavepath"
},
{
"name": "setSaveDialogOptions",
"signature": "(options)",
"description": "This API allows the user to set custom options for the save dialog that opens for the download item by default. The API is only available in session's `will-download` callback function.",
"parameters": [
{
"name": "options",
"description": "Set the save file dialog options. This object has the same properties as the `options` parameter of `dialog.showSaveDialog()`.",
"required": true,
"collection": false,
"type": "SaveDialogOptions"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#downloaditemsetsavedialogoptionsoptions"
},
{
"name": "getSaveDialogOptions",
"signature": "()",
"description": "Returns the object previously set by `downloadItem.setSaveDialogOptions(options)`.",
"parameters": [],
"returns": {
"collection": false,
"type": "SaveDialogOptions"
},
"additionalTags": [],
"urlFragment": "#downloaditemgetsavedialogoptions"
},
{
"name": "pause",
"signature": "()",
"description": "Pauses the download.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#downloaditempause"
},
{
"name": "isPaused",
"signature": "()",
"description": "Whether the download is paused.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#downloaditemispaused"
},
{
"name": "resume",
"signature": "()",
"description": "Resumes the download that has been paused.\n\n**Note:** To enable resumable downloads the server you are downloading from must support range requests and provide both `Last-Modified` and `ETag` header values. Otherwise `resume()` will dismiss previously received bytes and restart the download from the beginning.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#downloaditemresume"
},
{
"name": "canResume",
"signature": "()",
"description": "Whether the download can resume.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#downloaditemcanresume"
},
{
"name": "cancel",
"signature": "()",
"description": "Cancels the download operation.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#downloaditemcancel"
},
{
"name": "getURL",
"signature": "()",
"description": "The origin URL where the item is downloaded from.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgeturl"
},
{
"name": "getMimeType",
"signature": "()",
"description": "The files mime type.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgetmimetype"
},
{
"name": "hasUserGesture",
"signature": "()",
"description": "Whether the download has user gesture.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#downloaditemhasusergesture"
},
{
"name": "getFilename",
"signature": "()",
"description": "The file name of the download item.\n\n**Note:** The file name is not always the same as the actual one saved in local disk. If user changes the file name in a prompted download saving dialog, the actual name of saved file will be different.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgetfilename"
},
{
"name": "getTotalBytes",
"signature": "()",
"description": "The total size in bytes of the download item.\n\nIf the size is unknown, it returns 0.",
"parameters": [],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#downloaditemgettotalbytes"
},
{
"name": "getReceivedBytes",
"signature": "()",
"description": "The received bytes of the download item.",
"parameters": [],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#downloaditemgetreceivedbytes"
},
{
"name": "getContentDisposition",
"signature": "()",
"description": "The Content-Disposition field from the response header.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgetcontentdisposition"
},
{
"name": "getState",
"signature": "()",
"description": "The current state. Can be `progressing`, `completed`, `cancelled` or `interrupted`.\n\n**Note:** The following methods are useful specifically to resume a `cancelled` item when session is restarted.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "progressing",
"description": ""
},
{
"value": "completed",
"description": ""
},
{
"value": "cancelled",
"description": ""
},
{
"value": "interrupted",
"description": ""
}
]
},
"additionalTags": [],
"urlFragment": "#downloaditemgetstate"
},
{
"name": "getURLChain",
"signature": "()",
"description": "The complete URL chain of the item including any redirects.",
"parameters": [],
"returns": {
"collection": true,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgeturlchain"
},
{
"name": "getLastModifiedTime",
"signature": "()",
"description": "Last-Modified header value.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgetlastmodifiedtime"
},
{
"name": "getETag",
"signature": "()",
"description": "ETag header value.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#downloaditemgetetag"
},
{
"name": "getStartTime",
"signature": "()",
"description": "Number of seconds since the UNIX epoch when the download was started.",
"parameters": [],
"returns": {
"collection": false,
"type": "Double"
},
"additionalTags": [],
"urlFragment": "#downloaditemgetstarttime"
}
],
"instanceProperties": [
{
"name": "savePath",
"description": "A `String` property that determines the save file path of the download item.\n\nThe property is only available in session's `will-download` callback function. If user doesn't set the save path via the property, Electron will use the original routine to determine the save path; this usually prompts a save dialog.",
"required": true,
"additionalTags": [],
"urlFragment": "#downloaditemsavepath",
"collection": false,
"type": "String",
"possibleValues": null
}
],
"instanceEvents": [
{
"name": "updated",
"description": "Emitted when the download has been updated and is not done.\n\nThe `state` can be one of following:\n\n* `progressing` - The download is in-progress.\n* `interrupted` - The download has interrupted and can be resumed.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "state",
"description": "Can be `progressing` or `interrupted`.",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "progressing",
"description": ""
},
{
"value": "interrupted",
"description": ""
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-updated"
},
{
"name": "done",
"description": "Emitted when the download is in a terminal state. This includes a completed download, a cancelled download (via `downloadItem.cancel()`), and interrupted download that can't be resumed.\n\nThe `state` can be one of following:\n\n* `completed` - The download completed successfully.\n* `cancelled` - The download has been cancelled.\n* `interrupted` - The download has interrupted and can not resume.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "state",
"description": "Can be `completed`, `cancelled` or `interrupted`.",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "completed",
"description": ""
},
{
"value": "cancelled",
"description": ""
},
{
"value": "interrupted",
"description": ""
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-done"
}
],
"instanceName": "downloadItem"
},
{
"name": "globalShortcut",
"description": "> Detect keyboard events when the application does not have keyboard focus.\n\nProcess: Main\n\nThe `globalShortcut` module can register/unregister a global keyboard shortcut with the operating system so that you can customize the operations for various shortcuts.\n\n**Note:** The shortcut is global; it will work even if the app does not have the keyboard focus. This module cannot be used before the `ready` event of the app module is emitted.",
"slug": "global-shortcut",
"websiteUrl": "https://electronjs.org/docs/api/global-shortcut",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/global-shortcut.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "register",
"signature": "(accelerator, callback)",
"description": "Whether or not the shortcut was registered successfully.\n\nRegisters a global shortcut of `accelerator`. The `callback` is called when the registered shortcut is pressed by the user.\n\nWhen the accelerator is already taken by other applications, this call will silently fail. This behavior is intended by operating systems, since they don't want applications to fight for global shortcuts.\n\nThe following accelerators will not be registered successfully on macOS 10.14 Mojave unless the app has been authorized as a trusted accessibility client:\n\n* \"Media Play/Pause\"\n* \"Media Next Track\"\n* \"Media Previous Track\"\n* \"Media Stop\"",
"parameters": [
{
"name": "accelerator",
"description": "",
"required": true,
"collection": false,
"type": "Accelerator"
},
{
"name": "callback",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#globalshortcutregisteraccelerator-callback"
},
{
"name": "registerAll",
"signature": "(accelerators, callback)",
"description": "Registers a global shortcut of all `accelerator` items in `accelerators`. The `callback` is called when any of the registered shortcuts are pressed by the user.\n\nWhen a given accelerator is already taken by other applications, this call will silently fail. This behavior is intended by operating systems, since they don't want applications to fight for global shortcuts.\n\nThe following accelerators will not be registered successfully on macOS 10.14 Mojave unless the app has been authorized as a trusted accessibility client:\n\n* \"Media Play/Pause\"\n* \"Media Next Track\"\n* \"Media Previous Track\"\n* \"Media Stop\"",
"parameters": [
{
"name": "accelerators",
"description": "an array of Accelerators.",
"required": true,
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "callback",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#globalshortcutregisterallaccelerators-callback"
},
{
"name": "isRegistered",
"signature": "(accelerator)",
"description": "Whether this application has registered `accelerator`.\n\nWhen the accelerator is already taken by other applications, this call will still return `false`. This behavior is intended by operating systems, since they don't want applications to fight for global shortcuts.",
"parameters": [
{
"name": "accelerator",
"description": "",
"required": true,
"collection": false,
"type": "Accelerator"
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#globalshortcutisregisteredaccelerator"
},
{
"name": "unregister",
"signature": "(accelerator)",
"description": "Unregisters the global shortcut of `accelerator`.",
"parameters": [
{
"name": "accelerator",
"description": "",
"required": true,
"collection": false,
"type": "Accelerator"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#globalshortcutunregisteraccelerator"
},
{
"name": "unregisterAll",
"signature": "()",
"description": "Unregisters all of the global shortcuts.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#globalshortcutunregisterall"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "inAppPurchase",
"description": "> In-app purchases on Mac App Store.\n\nProcess: Main",
"slug": "in-app-purchase",
"websiteUrl": "https://electronjs.org/docs/api/in-app-purchase",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/in-app-purchase.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "purchaseProduct",
"signature": "(productID[, quantity])",
"description": "Returns `true` if the product is valid and added to the payment queue.\n\nYou should listen for the `transactions-updated` event as soon as possible and certainly before you call `purchaseProduct`.",
"parameters": [
{
"name": "productID",
"description": "The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`).",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "quantity",
"description": "The number of items the user wants to purchase.",
"required": false,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "Boolean"
}
]
},
"additionalTags": [],
"urlFragment": "#inapppurchasepurchaseproductproductid-quantity"
},
{
"name": "getProducts",
"signature": "(productIDs)",
"description": "Resolves with an array of `Product` objects.\n\nRetrieves the product descriptions.",
"parameters": [
{
"name": "productIDs",
"description": "The identifiers of the products to get.",
"required": true,
"collection": true,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": true,
"type": "Product"
}
]
},
"additionalTags": [],
"urlFragment": "#inapppurchasegetproductsproductids"
},
{
"name": "canMakePayments",
"signature": "()",
"description": "whether a user can make a payment.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#inapppurchasecanmakepayments"
},
{
"name": "restoreCompletedTransactions",
"signature": "()",
"description": "Restores finished transactions. This method can be called either to install purchases on additional devices, or to restore purchases for an application that the user deleted and reinstalled.\n\nThe payment queue delivers a new transaction for each previously completed transaction that can be restored. Each transaction includes a copy of the original transaction.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#inapppurchaserestorecompletedtransactions"
},
{
"name": "getReceiptURL",
"signature": "()",
"description": "the path to the receipt.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#inapppurchasegetreceipturl"
},
{
"name": "finishAllTransactions",
"signature": "()",
"description": "Completes all pending transactions.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#inapppurchasefinishalltransactions"
},
{
"name": "finishTransactionByDate",
"signature": "(date)",
"description": "Completes the pending transactions corresponding to the date.",
"parameters": [
{
"name": "date",
"description": "The ISO formatted date of the transaction to finish.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#inapppurchasefinishtransactionbydatedate"
}
],
"properties": [],
"events": [
{
"name": "transactions-updated",
"description": "",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-transactions-updated"
}
],
"exportedClasses": []
},
{
"name": "IncomingMessage",
"description": "",
"slug": "incoming-message",
"websiteUrl": "https://electronjs.org/docs/api/incoming-message",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/incoming-message.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [],
"instanceProperties": [
{
"name": "statusCode",
"description": "An `Integer` indicating the HTTP response status code.",
"required": true,
"additionalTags": [],
"urlFragment": "#responsestatuscode",
"collection": false,
"type": "Integer"
},
{
"name": "statusMessage",
"description": "A `String` representing the HTTP status message.",
"required": true,
"additionalTags": [],
"urlFragment": "#responsestatusmessage",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "headers",
"description": "A `Record` representing the HTTP response headers. The `headers` object is formatted as follows:\n\n* All header names are lowercased.\n* Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded.\n* `set-cookie` is always an array. Duplicates are added to the array.\n* For duplicate `cookie` headers, the values are joined together with '; '.\n* For all other headers, the values are joined together with ', '.",
"required": true,
"additionalTags": [],
"urlFragment": "#responseheaders",
"collection": false,
"type": "Record",
"innerTypes": [
{
"collection": false,
"type": "string"
},
{
"collection": false,
"type": [
{
"collection": false,
"type": "string"
},
{
"collection": true,
"type": "string"
}
]
}
]
},
{
"name": "httpVersion",
"description": "A `String` indicating the HTTP protocol version number. Typical values are '1.0' or '1.1'. Additionally `httpVersionMajor` and `httpVersionMinor` are two Integer-valued readable properties that return respectively the HTTP major and minor version numbers.",
"required": true,
"additionalTags": [],
"urlFragment": "#responsehttpversion",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "httpVersionMajor",
"description": "An `Integer` indicating the HTTP protocol major version number.",
"required": true,
"additionalTags": [],
"urlFragment": "#responsehttpversionmajor",
"collection": false,
"type": "Integer"
},
{
"name": "httpVersionMinor",
"description": "An `Integer` indicating the HTTP protocol minor version number.",
"required": true,
"additionalTags": [],
"urlFragment": "#responsehttpversionminor",
"collection": false,
"type": "Integer"
}
],
"instanceEvents": [
{
"name": "data",
"description": "The `data` event is the usual method of transferring response data into applicative code.",
"parameters": [
{
"name": "chunk",
"description": "A chunk of response body's data.",
"collection": false,
"type": "Buffer",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-data"
},
{
"name": "end",
"description": "Indicates that response body has ended. Must be placed before 'data' event.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-end"
},
{
"name": "aborted",
"description": "Emitted when a request has been canceled during an ongoing HTTP transaction.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-aborted"
},
{
"name": "error",
"description": "Returns:\n\n`error` Error - Typically holds an error string identifying failure root cause.\n\nEmitted when an error was encountered while streaming response data events. For instance, if the server closes the underlying while the response is still streaming, an `error` event will be emitted on the response object and a `close` event will subsequently follow on the request object.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-error"
}
],
"instanceName": "incomingMessage"
},
{
"name": "ipcMain",
"description": "> Communicate asynchronously from the main process to renderer processes.\n\nProcess: Main\n\nThe `ipcMain` module is an Event Emitter. When used in the main process, it handles asynchronous and synchronous messages sent from a renderer process (web page). Messages sent from a renderer will be emitted to this module.\n\n### Sending Messages\n\nIt is also possible to send messages from the main process to the renderer process, see webContents.send for more information.\n\n* When sending a message, the event name is the `channel`.\n* To reply to a synchronous message, you need to set `event.returnValue`.\n* To send an asynchronous message back to the sender, you can use `event.reply(...)`. This helper method will automatically handle messages coming from frames that aren't the main frame (e.g. iframes) whereas `event.sender.send(...)` will always send to the main frame.\n\nAn example of sending and handling messages between the render and main processes:\n\n```\n// In main process.\nconst { ipcMain } = require('electron')\nipcMain.on('asynchronous-message', (event, arg) => {\n console.log(arg) // prints \"ping\"\n event.reply('asynchronous-reply', 'pong')\n})\n\nipcMain.on('synchronous-message', (event, arg) => {\n console.log(arg) // prints \"ping\"\n event.returnValue = 'pong'\n})\n```\n\n```\n// In renderer process (web page).\nconst { ipcRenderer } = require('electron')\nconsole.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints \"pong\"\n\nipcRenderer.on('asynchronous-reply', (event, arg) => {\n console.log(arg) // prints \"pong\"\n})\nipcRenderer.send('asynchronous-message', 'ping')\n```",
"slug": "ipc-main",
"websiteUrl": "https://electronjs.org/docs/api/ipc-main",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/ipc-main.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "on",
"signature": "(channel, listener)",
"description": "Listens to `channel`, when a new message arrives `listener` would be called with `listener(event, args...)`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "IpcMainEvent"
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainonchannel-listener"
},
{
"name": "once",
"signature": "(channel, listener)",
"description": "Adds a one time `listener` function for the event. This `listener` is invoked only the next time a message is sent to `channel`, after which it is removed.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "IpcMainEvent"
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainoncechannel-listener"
},
{
"name": "removeListener",
"signature": "(channel, listener)",
"description": "Removes the specified `listener` from the listener array for the specified `channel`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainremovelistenerchannel-listener"
},
{
"name": "removeAllListeners",
"signature": "([channel])",
"description": "Removes listeners of the specified `channel`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": false,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainremovealllistenerschannel"
},
{
"name": "handle",
"signature": "(channel, listener)",
"description": "Adds a handler for an `invoke`able IPC. This handler will be called whenever a renderer calls `ipcRenderer.invoke(channel, ...args)`.\n\nIf `listener` returns a Promise, the eventual result of the promise will be returned as a reply to the remote caller. Otherwise, the return value of the listener will be used as the value of the reply.\n\nThe `event` that is passed as the first argument to the handler is the same as that passed to a regular event listener. It includes information about which WebContents is the source of the invoke request.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "IpcMainInvokeEvent"
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
{
"collection": false,
"type": "any"
}
]
}
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainhandlechannel-listener"
},
{
"name": "handleOnce",
"signature": "(channel, listener)",
"description": "Handles a single `invoke`able IPC message, then removes the listener. See `ipcMain.handle(channel, listener)`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "IpcMainInvokeEvent"
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
{
"collection": false,
"type": "any"
}
]
}
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainhandleoncechannel-listener"
},
{
"name": "removeHandler",
"signature": "(channel)",
"description": "Removes any handler for `channel`, if present.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcmainremovehandlerchannel"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "ipcRenderer",
"description": "> Communicate asynchronously from a renderer process to the main process.\n\nProcess: Renderer\n\nThe `ipcRenderer` module is an EventEmitter. It provides a few methods so you can send synchronous and asynchronous messages from the render process (web page) to the main process. You can also receive replies from the main process.\n\nSee ipcMain for code examples.",
"slug": "ipc-renderer",
"websiteUrl": "https://electronjs.org/docs/api/ipc-renderer",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/ipc-renderer.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": false,
"renderer": true
},
"methods": [
{
"name": "on",
"signature": "(channel, listener)",
"description": "Listens to `channel`, when a new message arrives `listener` would be called with `listener(event, args...)`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "IpcRendererEvent"
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrendereronchannel-listener"
},
{
"name": "once",
"signature": "(channel, listener)",
"description": "Adds a one time `listener` function for the event. This `listener` is invoked only the next time a message is sent to `channel`, after which it is removed.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "IpcRendererEvent"
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrendereroncechannel-listener"
},
{
"name": "removeListener",
"signature": "(channel, listener)",
"description": "Removes the specified `listener` from the listener array for the specified `channel`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "listener",
"description": "",
"required": true,
"collection": false,
"type": "Function",
"parameters": [
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrendererremovelistenerchannel-listener"
},
{
"name": "removeAllListeners",
"signature": "(channel)",
"description": "Removes all listeners, or those of the specified `channel`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrendererremovealllistenerschannel"
},
{
"name": "send",
"signature": "(channel, ...args)",
"description": "Send an asynchronous message to the main process via `channel`, along with arguments. Arguments will be serialized with the Structured Clone Algorithm, just like `window.postMessage`, so prototype chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.\n\n> **NOTE:** Sending non-standard JavaScript types such as DOM objects or special Electron objects is deprecated, and will begin throwing an exception starting with Electron 9.\n\n> **NOTE:** Since the main process does not have support for DOM objects such as `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over Electron's IPC to the main process, as the main process would have no way to decode them. Attempting to send such objects over IPC will result in an error.\n\nThe main process handles it by listening for `channel` with the `ipcMain` module.\n\nIf you need to transfer a `MessagePort` to the main process, use `ipcRenderer.postMessage`.\n\nIf you want to receive a single response from the main process, like the result of a method call, consider using `ipcRenderer.invoke`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrenderersendchannel-args"
},
{
"name": "invoke",
"signature": "(channel, ...args)",
"description": "Resolves with the response from the main process.\n\nSend a message to the main process via `channel` and expect a result asynchronously. Arguments will be serialized with the Structured Clone Algorithm, just like `window.postMessage`, so prototype chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.\n\n> **NOTE**: Sending non-standard JavaScript types such as DOM objects or special Electron objects is deprecated, and will begin throwing an exception starting with Electron 9.\n\n> **NOTE:** Since the main process does not have support for DOM objects such as `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over Electron's IPC to the main process, as the main process would have no way to decode them. Attempting to send such objects over IPC will result in an error.\n\nThe main process should listen for `channel` with `ipcMain.handle()`.\n\nFor example:\n\nIf you need to transfer a `MessagePort` to the main process, use `ipcRenderer.postMessage`.\n\nIf you do not need a response to the message, consider using `ipcRenderer.send`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "any"
}
]
},
"additionalTags": [],
"urlFragment": "#ipcrendererinvokechannel-args"
},
{
"name": "sendSync",
"signature": "(channel, ...args)",
"description": "The value sent back by the `ipcMain` handler.\n\nSend a message to the main process via `channel` and expect a result synchronously. Arguments will be serialized with the Structured Clone Algorithm, just like `window.postMessage`, so prototype chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.\n\n> **NOTE**: Sending non-standard JavaScript types such as DOM objects or special Electron objects is deprecated, and will begin throwing an exception starting with Electron 9.\n\n> **NOTE:** Since the main process does not have support for DOM objects such as `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over Electron's IPC to the main process, as the main process would have no way to decode them. Attempting to send such objects over IPC will result in an error.\n\nThe main process handles it by listening for `channel` with `ipcMain` module, and replies by setting `event.returnValue`.\n\n> :warning: **WARNING**: Sending a synchronous message will block the whole renderer process until the reply is received, so use this method only as a last resort. It's much better to use the asynchronous version, `invoke()`.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": {
"collection": false,
"type": "any"
},
"additionalTags": [],
"urlFragment": "#ipcrenderersendsyncchannel-args"
},
{
"name": "postMessage",
"signature": "(channel, message, [transfer])",
"description": "Send a message to the main process, optionally transferring ownership of zero or more `MessagePort` objects.\n\nThe transferred `MessagePort` objects will be available in the main process as `MessagePortMain` objects by accessing the `ports` property of the emitted event.\n\nFor example:\n\nFor more information on using `MessagePort` and `MessageChannel`, see the MDN documentation.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "message",
"description": "",
"required": true,
"collection": false,
"type": "any"
},
{
"name": "transfer",
"description": "",
"required": false,
"collection": true,
"type": "MessagePort"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrendererpostmessagechannel-message-transfer"
},
{
"name": "sendTo",
"signature": "(webContentsId, channel, ...args)",
"description": "Sends a message to a window with `webContentsId` via `channel`.",
"parameters": [
{
"name": "webContentsId",
"description": "",
"required": true,
"collection": false,
"type": "Number"
},
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrenderersendtowebcontentsid-channel-args"
},
{
"name": "sendToHost",
"signature": "(channel, ...args)",
"description": "Like `ipcRenderer.send` but the event will be sent to the `` element in the host page instead of the main process.",
"parameters": [
{
"name": "channel",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "...args",
"description": "",
"required": true,
"collection": true,
"type": "any"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#ipcrenderersendtohostchannel-args"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "MenuItem",
"description": "> Add items to native application menus and context menus.\n\nProcess: Main\n\nSee `Menu` for examples.",
"slug": "menu-item",
"websiteUrl": "https://electronjs.org/docs/api/menu-item",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/menu-item.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "click",
"description": "Will be called with `click(menuItem, browserWindow, event)` when the menu item is clicked.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Function",
"parameters": [
{
"name": "menuItem",
"description": "",
"required": true,
"collection": false,
"type": "MenuItem"
},
{
"name": "browserWindow",
"description": "This will not be defined if no window is open.",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "BrowserWindow"
},
{
"collection": false,
"type": "undefined"
}
]
},
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "KeyboardEvent"
}
],
"returns": null
},
{
"name": "role",
"description": "Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. See roles.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "undo",
"description": ""
},
{
"value": "redo",
"description": ""
},
{
"value": "cut",
"description": ""
},
{
"value": "copy",
"description": ""
},
{
"value": "paste",
"description": ""
},
{
"value": "pasteAndMatchStyle",
"description": ""
},
{
"value": "delete",
"description": ""
},
{
"value": "selectAll",
"description": ""
},
{
"value": "reload",
"description": ""
},
{
"value": "forceReload",
"description": ""
},
{
"value": "toggleDevTools",
"description": ""
},
{
"value": "resetZoom",
"description": ""
},
{
"value": "zoomIn",
"description": ""
},
{
"value": "zoomOut",
"description": ""
},
{
"value": "togglefullscreen",
"description": ""
},
{
"value": "window",
"description": ""
},
{
"value": "minimize",
"description": ""
},
{
"value": "close",
"description": ""
},
{
"value": "help",
"description": ""
},
{
"value": "about",
"description": ""
},
{
"value": "services",
"description": ""
},
{
"value": "hide",
"description": ""
},
{
"value": "hideOthers",
"description": ""
},
{
"value": "unhide",
"description": ""
},
{
"value": "quit",
"description": ""
},
{
"value": "startSpeaking",
"description": ""
},
{
"value": "stopSpeaking",
"description": ""
},
{
"value": "zoom",
"description": ""
},
{
"value": "front",
"description": ""
},
{
"value": "appMenu",
"description": ""
},
{
"value": "fileMenu",
"description": ""
},
{
"value": "editMenu",
"description": ""
},
{
"value": "viewMenu",
"description": ""
},
{
"value": "shareMenu",
"description": ""
},
{
"value": "recentDocuments",
"description": ""
},
{
"value": "toggleTabBar",
"description": ""
},
{
"value": "selectNextTab",
"description": ""
},
{
"value": "selectPreviousTab",
"description": ""
},
{
"value": "mergeAllWindows",
"description": ""
},
{
"value": "clearRecentDocuments",
"description": ""
},
{
"value": "moveTabToNewWindow",
"description": ""
},
{
"value": "windowMenu",
"description": ""
}
]
},
{
"name": "type",
"description": "Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "normal",
"description": ""
},
{
"value": "separator",
"description": ""
},
{
"value": "submenu",
"description": ""
},
{
"value": "checkbox",
"description": ""
},
{
"value": "radio",
"description": ""
}
]
},
{
"name": "label",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "sublabel",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "toolTip",
"description": "Hover text for this menu item.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "accelerator",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Accelerator"
},
{
"name": "icon",
"description": "",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "enabled",
"description": "If false, the menu item will be greyed out and unclickable.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "acceleratorWorksWhenHidden",
"description": "default is `true`, and when `false` will prevent the accelerator from triggering the item if the item is not visible`.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "visible",
"description": "If false, the menu item will be entirely hidden.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "checked",
"description": "Should only be specified for `checkbox` or `radio` type menu items.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "registerAccelerator",
"description": "If false, the accelerator won't be registered with the system, but it will still be displayed. Defaults to true.",
"required": false,
"additionalTags": [
"os_linux",
"os_windows"
],
"collection": false,
"type": "Boolean"
},
{
"name": "sharingItem",
"description": "The item to share when the `role` is `shareMenu`.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "SharingItem"
},
{
"name": "submenu",
"description": "Should be specified for `submenu` type menu items. If `submenu` is specified, the `type: 'submenu'` can be omitted. If the value is not a `Menu` then it will be automatically converted to one using `Menu.buildFromTemplate`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": true,
"type": "MenuItemConstructorOptions"
},
{
"collection": false,
"type": "Menu"
}
]
},
{
"name": "id",
"description": "Unique within a single menu. If defined then it can be used as a reference to this item by the position attribute.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "before",
"description": "Inserts this item before the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu. Also implies that the menu item in question should be placed in the same “group” as the item.",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "after",
"description": "Inserts this item after the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu.",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "beforeGroupContaining",
"description": "Provides a means for a single context menu to declare the placement of their containing group before the containing group of the item with the specified label.",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
},
{
"name": "afterGroupContaining",
"description": "Provides a means for a single context menu to declare the placement of their containing group after the containing group of the item with the specified label.",
"required": false,
"additionalTags": [],
"collection": true,
"type": "String",
"possibleValues": null
}
]
}
]
},
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [],
"instanceProperties": [
{
"name": "id",
"description": "A `String` indicating the item's unique id, this property can be dynamically changed.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemid",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "label",
"description": "A `String` indicating the item's visible label.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemlabel",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "click",
"description": "A `Function` that is fired when the MenuItem receives a click event. It can be called with `menuItem.click(event, focusedWindow, focusedWebContents)`.\n\n* `event` KeyboardEvent\n* `focusedWindow` BrowserWindow\n* `focusedWebContents` WebContents",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemclick",
"collection": false,
"type": "Function",
"parameters": [
{
"name": "event",
"description": "",
"required": true,
"collection": false,
"type": "KeyboardEvent"
},
{
"name": "focusedWindow",
"description": "",
"required": true,
"collection": false,
"type": "BrowserWindow"
},
{
"name": "focusedWebContents",
"description": "",
"required": true,
"collection": false,
"type": "WebContents"
}
],
"returns": null
},
{
"name": "submenu",
"description": "A `Menu` (optional) containing the menu item's submenu, if present.",
"required": false,
"additionalTags": [],
"urlFragment": "#menuitemsubmenu",
"collection": false,
"type": "Menu"
},
{
"name": "type",
"description": "A `String` indicating the type of the item. Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemtype",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "normal",
"description": ""
},
{
"value": "separator",
"description": ""
},
{
"value": "submenu",
"description": ""
},
{
"value": "checkbox",
"description": ""
},
{
"value": "radio",
"description": ""
}
]
},
{
"name": "role",
"description": "A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`",
"required": false,
"additionalTags": [],
"urlFragment": "#menuitemrole",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "undo",
"description": ""
},
{
"value": "redo",
"description": ""
},
{
"value": "cut",
"description": ""
},
{
"value": "copy",
"description": ""
},
{
"value": "paste",
"description": ""
},
{
"value": "pasteAndMatchStyle",
"description": ""
},
{
"value": "delete",
"description": ""
},
{
"value": "selectAll",
"description": ""
},
{
"value": "reload",
"description": ""
},
{
"value": "forceReload",
"description": ""
},
{
"value": "toggleDevTools",
"description": ""
},
{
"value": "resetZoom",
"description": ""
},
{
"value": "zoomIn",
"description": ""
},
{
"value": "zoomOut",
"description": ""
},
{
"value": "togglefullscreen",
"description": ""
},
{
"value": "window",
"description": ""
},
{
"value": "minimize",
"description": ""
},
{
"value": "close",
"description": ""
},
{
"value": "help",
"description": ""
},
{
"value": "about",
"description": ""
},
{
"value": "services",
"description": ""
},
{
"value": "hide",
"description": ""
},
{
"value": "hideOthers",
"description": ""
},
{
"value": "unhide",
"description": ""
},
{
"value": "quit",
"description": ""
},
{
"value": "startSpeaking",
"description": ""
},
{
"value": "stopSpeaking",
"description": ""
},
{
"value": "zoom",
"description": ""
},
{
"value": "front",
"description": ""
},
{
"value": "appMenu",
"description": ""
},
{
"value": "fileMenu",
"description": ""
},
{
"value": "editMenu",
"description": ""
},
{
"value": "viewMenu",
"description": ""
},
{
"value": "recentDocuments",
"description": ""
},
{
"value": "toggleTabBar",
"description": ""
},
{
"value": "selectNextTab",
"description": ""
},
{
"value": "selectPreviousTab",
"description": ""
},
{
"value": "mergeAllWindows",
"description": ""
},
{
"value": "clearRecentDocuments",
"description": ""
},
{
"value": "moveTabToNewWindow",
"description": ""
},
{
"value": "windowMenu",
"description": ""
}
]
},
{
"name": "accelerator",
"description": "A `Accelerator` (optional) indicating the item's accelerator, if set.",
"required": false,
"additionalTags": [],
"urlFragment": "#menuitemaccelerator",
"collection": false,
"type": "Accelerator"
},
{
"name": "icon",
"description": "A `NativeImage | String` (optional) indicating the item's icon, if set.",
"required": false,
"additionalTags": [],
"urlFragment": "#menuitemicon",
"collection": false,
"type": [
{
"collection": false,
"type": "NativeImage"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
},
{
"name": "sublabel",
"description": "A `String` indicating the item's sublabel.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemsublabel",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "toolTip",
"description": "A `String` indicating the item's hover text.",
"required": true,
"additionalTags": [
"os_macos"
],
"urlFragment": "#menuitemtooltip-macos",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "enabled",
"description": "A `Boolean` indicating whether the item is enabled, this property can be dynamically changed.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemenabled",
"collection": false,
"type": "Boolean"
},
{
"name": "visible",
"description": "A `Boolean` indicating whether the item is visible, this property can be dynamically changed.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemvisible",
"collection": false,
"type": "Boolean"
},
{
"name": "checked",
"description": "A `Boolean` indicating whether the item is checked, this property can be dynamically changed.\n\nA `checkbox` menu item will toggle the `checked` property on and off when selected.\n\nA `radio` menu item will turn on its `checked` property when clicked, and will turn off that property for all adjacent items in the same menu.\n\nYou can add a `click` function for additional behavior.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemchecked",
"collection": false,
"type": "Boolean"
},
{
"name": "registerAccelerator",
"description": "A `Boolean` indicating if the accelerator should be registered with the system or just displayed.\n\nThis property can be dynamically changed.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemregisteraccelerator",
"collection": false,
"type": "Boolean"
},
{
"name": "sharingItem",
"description": "A `SharingItem` indicating the item to share when the `role` is `shareMenu`.\n\nThis property can be dynamically changed.",
"required": true,
"additionalTags": [
"os_macos"
],
"urlFragment": "#menuitemsharingitem-macos",
"collection": false,
"type": "SharingItem"
},
{
"name": "commandId",
"description": "A `Number` indicating an item's sequential unique id.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemcommandid",
"collection": false,
"type": "Number"
},
{
"name": "menu",
"description": "A `Menu` that the item is a part of.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitemmenu",
"collection": false,
"type": "Menu"
}
],
"instanceEvents": [],
"instanceName": "menuItem"
},
{
"name": "Menu",
"description": "> Create native application menus and context menus.\n\nProcess: Main",
"slug": "menu",
"websiteUrl": "https://electronjs.org/docs/api/menu",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/menu.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": {
"signature": "()",
"parameters": []
},
"staticMethods": [
{
"name": "setApplicationMenu",
"signature": "(menu)",
"description": "Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu` will be set as each window's top menu.\n\nAlso on Windows and Linux, you can use a `&` in the top-level item name to indicate which letter should get a generated accelerator. For example, using `&File` for the file menu would result in a generated `Alt-F` accelerator that opens the associated menu. The indicated character in the button label gets an underline. The `&` character is not displayed on the button label.\n\nPassing `null` will suppress the default menu. On Windows and Linux, this has the additional effect of removing the menu bar from the window.\n\n**Note:** The default menu will be created automatically if the app does not set one. It contains standard items such as `File`, `Edit`, `View`, `Window` and `Help`.",
"parameters": [
{
"name": "menu",
"description": "",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "Menu"
},
{
"type": "null",
"collection": false
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#menusetapplicationmenumenu"
},
{
"name": "getApplicationMenu",
"signature": "()",
"description": "The application menu, if set, or `null`, if not set.\n\n**Note:** The returned `Menu` instance doesn't support dynamic addition or removal of menu items. Instance properties can still be dynamically modified.",
"parameters": [],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "Menu"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#menugetapplicationmenu"
},
{
"name": "sendActionToFirstResponder",
"signature": "(action)",
"description": "Sends the `action` to the first responder of application. This is used for emulating default macOS menu behaviors. Usually you would use the `role` property of a `MenuItem`.\n\nSee the macOS Cocoa Event Handling Guide for more information on macOS' native actions.",
"parameters": [
{
"name": "action",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": null,
"additionalTags": [
"os_macos"
],
"urlFragment": "#menusendactiontofirstresponderaction-macos"
},
{
"name": "buildFromTemplate",
"signature": "(template)",
"description": "Generally, the `template` is an array of `options` for constructing a MenuItem. The usage can be referenced above.\n\nYou can also attach other fields to the element of the `template` and they will become properties of the constructed menu items.",
"parameters": [
{
"name": "template",
"description": "",
"required": true,
"collection": true,
"type": [
{
"collection": false,
"type": "MenuItemConstructorOptions"
},
{
"collection": false,
"type": "MenuItem"
}
]
}
],
"returns": {
"collection": false,
"type": "Menu"
},
"additionalTags": [],
"urlFragment": "#menubuildfromtemplatetemplate"
}
],
"staticProperties": [],
"instanceMethods": [
{
"name": "popup",
"signature": "([options])",
"description": "Pops up this menu as a context menu in the `BrowserWindow`.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "window",
"description": "Default is the focused window.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "BrowserWindow"
},
{
"name": "x",
"description": "Default is the current mouse cursor position. Must be declared if `y` is declared.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "y",
"description": "Default is the current mouse cursor position. Must be declared if `x` is declared.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Number"
},
{
"name": "positioningItem",
"description": "The index of the menu item to be positioned under the mouse cursor at the specified coordinates. Default is -1.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Number"
},
{
"name": "callback",
"description": "Called when menu is closed.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Function",
"parameters": [],
"returns": null
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#menupopupoptions"
},
{
"name": "closePopup",
"signature": "([browserWindow])",
"description": "Closes the context menu in the `browserWindow`.",
"parameters": [
{
"name": "browserWindow",
"description": "Default is the focused window.",
"required": false,
"collection": false,
"type": "BrowserWindow"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#menuclosepopupbrowserwindow"
},
{
"name": "append",
"signature": "(menuItem)",
"description": "Appends the `menuItem` to the menu.",
"parameters": [
{
"name": "menuItem",
"description": "",
"required": true,
"collection": false,
"type": "MenuItem"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#menuappendmenuitem"
},
{
"name": "getMenuItemById",
"signature": "(id)",
"description": "the item with the specified `id`",
"parameters": [
{
"name": "id",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "MenuItem"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#menugetmenuitembyidid"
},
{
"name": "insert",
"signature": "(pos, menuItem)",
"description": "Inserts the `menuItem` to the `pos` position of the menu.",
"parameters": [
{
"name": "pos",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
},
{
"name": "menuItem",
"description": "",
"required": true,
"collection": false,
"type": "MenuItem"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#menuinsertpos-menuitem"
}
],
"instanceProperties": [
{
"name": "items",
"description": "A `MenuItem[]` array containing the menu's items.\n\nEach `Menu` consists of multiple `MenuItem`s and each `MenuItem` can have a submenu.",
"required": true,
"additionalTags": [],
"urlFragment": "#menuitems",
"collection": true,
"type": "MenuItem"
}
],
"instanceEvents": [
{
"name": "menu-will-show",
"description": "Emitted when `menu.popup()` is called.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-menu-will-show"
},
{
"name": "menu-will-close",
"description": "Emitted when a popup is closed either manually or with `menu.closePopup()`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-menu-will-close"
}
],
"instanceName": "Menu"
},
{
"name": "MessageChannelMain",
"description": "",
"slug": "message-channel-main",
"websiteUrl": "https://electronjs.org/docs/api/message-channel-main",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/message-channel-main.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [],
"instanceProperties": [
{
"name": "port1",
"description": "A `MessagePortMain` property.",
"required": true,
"additionalTags": [],
"urlFragment": "#channelport1",
"collection": false,
"type": "MessagePortMain"
},
{
"name": "port2",
"description": "A `MessagePortMain` property.",
"required": true,
"additionalTags": [],
"urlFragment": "#channelport2",
"collection": false,
"type": "MessagePortMain"
}
],
"instanceEvents": [],
"instanceName": "channel"
},
{
"name": "MessagePortMain",
"description": "",
"slug": "message-port-main",
"websiteUrl": "https://electronjs.org/docs/api/message-port-main",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/message-port-main.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "postMessage",
"signature": "(message, [transfer])",
"description": "Sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.",
"parameters": [
{
"name": "message",
"description": "",
"required": true,
"collection": false,
"type": "any"
},
{
"name": "transfer",
"description": "",
"required": false,
"collection": true,
"type": "MessagePortMain"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#portpostmessagemessage-transfer"
},
{
"name": "start",
"signature": "()",
"description": "Starts the sending of messages queued on the port. Messages will be queued until this method is called.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#portstart"
},
{
"name": "close",
"signature": "()",
"description": "Disconnects the port, so it is no longer active.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#portclose"
}
],
"instanceProperties": [],
"instanceEvents": [
{
"name": "message",
"description": "Emitted when a MessagePortMain object receives a message.",
"parameters": [
{
"name": "messageEvent",
"description": "",
"collection": false,
"type": "Object",
"properties": [
{
"name": "data",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "any"
},
{
"name": "ports",
"description": "",
"required": true,
"additionalTags": [],
"collection": true,
"type": "MessagePortMain"
}
],
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-message"
},
{
"name": "close",
"description": "Emitted when the remote end of a MessagePortMain object becomes disconnected.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-close"
}
],
"instanceName": "port"
},
{
"name": "nativeImage",
"description": "> Create tray, dock, and application icons using PNG or JPG files.\n\nProcess: Main, Renderer\n\nIn Electron, for the APIs that take images, you can pass either file paths or `NativeImage` instances. An empty image will be used when `null` is passed.\n\nFor example, when creating a tray or setting a window's icon, you can pass an image file path as a `String`:\n\n```\nconst { BrowserWindow, Tray } = require('electron')\n\nconst appIcon = new Tray('/Users/somebody/images/icon.png')\nconst win = new BrowserWindow({ icon: '/Users/somebody/images/window.png' })\nconsole.log(appIcon, win)\n```\n\nOr read the image from the clipboard, which returns a `NativeImage`:\n\n### Supported Formats\n\nCurrently `PNG` and `JPEG` image formats are supported. `PNG` is recommended because of its support for transparency and lossless compression.\n\nOn Windows, you can also load `ICO` icons from file paths. For best visual quality, it is recommended to include at least the following sizes in the:\n\n* Small icon\n * 16x16 (100% DPI scale)\n * 20x20 (125% DPI scale)\n * 24x24 (150% DPI scale)\n * 32x32 (200% DPI scale)\n* Large icon\n * 32x32 (100% DPI scale)\n * 40x40 (125% DPI scale)\n * 48x48 (150% DPI scale)\n * 64x64 (200% DPI scale)\n * 256x256\n\nCheck the *Size requirements* section in this article.\n\n### High Resolution Image\n\nOn platforms that have high-DPI support such as Apple Retina displays, you can append `@2x` after image's base filename to mark it as a high resolution image.\n\nFor example, if `icon.png` is a normal image that has standard resolution, then `icon@2x.png` will be treated as a high resolution image that has double DPI density.\n\nIf you want to support displays with different DPI densities at the same time, you can put images with different sizes in the same folder and use the filename without DPI suffixes. For example:\n\n```\nimages/\n├── icon.png\n├── icon@2x.png\n└── icon@3x.png\n```\n\n```\nconst { Tray } = require('electron')\nconst appIcon = new Tray('/Users/somebody/images/icon.png')\nconsole.log(appIcon)\n```\n\nThe following suffixes for DPI are also supported:\n\n* `@1x`\n* `@1.25x`\n* `@1.33x`\n* `@1.4x`\n* `@1.5x`\n* `@1.8x`\n* `@2x`\n* `@2.5x`\n* `@3x`\n* `@4x`\n* `@5x`\n\n### Template Image\n\nTemplate images consist of black and an alpha channel. Template images are not intended to be used as standalone images and are usually mixed with other content to create the desired final appearance.\n\nThe most common case is to use template images for a menu bar icon, so it can adapt to both light and dark menu bars.\n\n**Note:** Template image is only supported on macOS.\n\nTo mark an image as a template image, its filename should end with the word `Template`. For example:\n\n* `xxxTemplate.png`\n* `xxxTemplate@2x.png`",
"slug": "native-image",
"websiteUrl": "https://electronjs.org/docs/api/native-image",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/native-image.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": true
},
"methods": [
{
"name": "createEmpty",
"signature": "()",
"description": "Creates an empty `NativeImage` instance.",
"parameters": [],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#nativeimagecreateempty"
},
{
"name": "createThumbnailFromPath",
"signature": "(path, maxSize)",
"description": "fulfilled with the file's thumbnail preview image, which is a NativeImage.",
"parameters": [
{
"name": "path",
"description": "path to a file that we intend to construct a thumbnail out of.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "maxSize",
"description": "the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.",
"required": true,
"collection": false,
"type": "Size"
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "NativeImage"
}
]
},
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#nativeimagecreatethumbnailfrompathpath-maxsize-macos-windows"
},
{
"name": "createFromPath",
"signature": "(path)",
"description": "Creates a new `NativeImage` instance from a file located at `path`. This method returns an empty image if the `path` does not exist, cannot be read, or is not a valid image.",
"parameters": [
{
"name": "path",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#nativeimagecreatefrompathpath"
},
{
"name": "createFromBitmap",
"signature": "(buffer, options)",
"description": "Creates a new `NativeImage` instance from `buffer` that contains the raw bitmap pixel data returned by `toBitmap()`. The specific format is platform-dependent.",
"parameters": [
{
"name": "buffer",
"description": "",
"required": true,
"collection": false,
"type": "Buffer"
},
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "width",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
}
]
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#nativeimagecreatefrombitmapbuffer-options"
},
{
"name": "createFromBuffer",
"signature": "(buffer[, options])",
"description": "Creates a new `NativeImage` instance from `buffer`. Tries to decode as PNG or JPEG first.",
"parameters": [
{
"name": "buffer",
"description": "",
"required": true,
"collection": false,
"type": "Buffer"
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "width",
"description": "Required for bitmap buffers.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "Required for bitmap buffers.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
}
]
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#nativeimagecreatefrombufferbuffer-options"
},
{
"name": "createFromDataURL",
"signature": "(dataURL)",
"description": "Creates a new `NativeImage` instance from `dataURL`.",
"parameters": [
{
"name": "dataURL",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#nativeimagecreatefromdataurldataurl"
},
{
"name": "createFromNamedImage",
"signature": "(imageName[, hslShift])",
"description": "Creates a new `NativeImage` instance from the NSImage that maps to the given image name. See `System Icons` for a list of possible values.\n\nThe `hslShift` is applied to the image with the following rules:\n\n* `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0 and 360 on the hue color wheel (red).\n* `hsl_shift[1]` (saturation): A saturation shift for the image, with the following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully saturate the image.\n* `hsl_shift[2]` (lightness): A lightness shift for the image, with the following key values: 0 = remove all lightness (make all pixels black). 0.5 = leave unchanged. 1 = full lightness (make all pixels white).\n\nThis means that `[-1, 0, 1]` will make the image completely white and `[-1, 1, 0]` will make the image completely black.\n\nIn some cases, the `NSImageName` doesn't match its string representation; one example of this is `NSFolderImageName`, whose string representation would actually be `NSFolder`. Therefore, you'll need to determine the correct string representation for your image before passing it in. This can be done with the following:\n\n`echo -e '#import \\nint main() { NSLog(@\"%@\", SYSTEM_IMAGE_NAME); }' | clang -otest -x objective-c -framework Cocoa - && ./test`\n\nwhere `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.",
"parameters": [
{
"name": "imageName",
"description": "",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "hslShift",
"description": "",
"required": false,
"collection": true,
"type": "Number"
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#nativeimagecreatefromnamedimageimagename-hslshift-macos"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "NativeImage",
"description": "",
"slug": "native-image",
"websiteUrl": "https://electronjs.org/docs/api/native-image",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/native-image.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": true
},
"constructorMethod": null,
"staticMethods": [],
"staticProperties": [],
"instanceMethods": [
{
"name": "toPNG",
"signature": "([options])",
"description": "A Buffer that contains the image's `PNG` encoded data.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
}
]
}
],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [],
"urlFragment": "#imagetopngoptions"
},
{
"name": "toJPEG",
"signature": "(quality)",
"description": "A Buffer that contains the image's `JPEG` encoded data.",
"parameters": [
{
"name": "quality",
"description": "Between 0 - 100.",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [],
"urlFragment": "#imagetojpegquality"
},
{
"name": "toBitmap",
"signature": "([options])",
"description": "A Buffer that contains a copy of the image's raw bitmap pixel data.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
}
]
}
],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [],
"urlFragment": "#imagetobitmapoptions"
},
{
"name": "toDataURL",
"signature": "([options])",
"description": "The data URL of the image.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
}
]
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#imagetodataurloptions"
},
{
"name": "getBitmap",
"signature": "([options])",
"description": "A Buffer that contains the image's raw bitmap pixel data.\n\nThe difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does not copy the bitmap data, so you have to use the returned Buffer immediately in current event loop tick; otherwise the data might be changed or destroyed.",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Double"
}
]
}
],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [],
"urlFragment": "#imagegetbitmapoptions"
},
{
"name": "getNativeHandle",
"signature": "()",
"description": "A Buffer that stores C pointer to underlying native handle of the image. On macOS, a pointer to `NSImage` instance would be returned.\n\nNotice that the returned pointer is a weak pointer to the underlying native image instead of a copy, so you _must_ ensure that the associated `nativeImage` instance is kept around.",
"parameters": [],
"returns": {
"collection": false,
"type": "Buffer"
},
"additionalTags": [
"os_macos"
],
"urlFragment": "#imagegetnativehandle-macos"
},
{
"name": "isEmpty",
"signature": "()",
"description": "Whether the image is empty.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#imageisempty"
},
{
"name": "getSize",
"signature": "([scaleFactor])",
"description": "If `scaleFactor` is passed, this will return the size corresponding to the image representation most closely matching the passed value.",
"parameters": [
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"collection": false,
"type": "Double"
}
],
"returns": {
"collection": false,
"type": "Size"
},
"additionalTags": [],
"urlFragment": "#imagegetsizescalefactor"
},
{
"name": "setTemplateImage",
"signature": "(option)",
"description": "Marks the image as a template image.",
"parameters": [
{
"name": "option",
"description": "",
"required": true,
"collection": false,
"type": "Boolean"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#imagesettemplateimageoption"
},
{
"name": "isTemplateImage",
"signature": "()",
"description": "Whether the image is a template image.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#imageistemplateimage"
},
{
"name": "crop",
"signature": "(rect)",
"description": "The cropped image.",
"parameters": [
{
"name": "rect",
"description": "The area of the image to crop.",
"required": true,
"collection": false,
"type": "Rectangle"
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#imagecroprect"
},
{
"name": "resize",
"signature": "(options)",
"description": "The resized image.\n\nIf only the `height` or the `width` are specified then the current aspect ratio will be preserved in the resized image.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "width",
"description": "Defaults to the image's width.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "Defaults to the image's height.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "quality",
"description": "The desired quality of the resize image. Possible values are `good`, `better`, or `best`. The default is `best`. These values express a desired quality/speed tradeoff. They are translated into an algorithm-specific method that depends on the capabilities (CPU, GPU) of the underlying platform. It is possible for all three methods to be mapped to the same algorithm on a given platform.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": {
"collection": false,
"type": "NativeImage"
},
"additionalTags": [],
"urlFragment": "#imageresizeoptions"
},
{
"name": "getAspectRatio",
"signature": "([scaleFactor])",
"description": "The image's aspect ratio.\n\nIf `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.",
"parameters": [
{
"name": "scaleFactor",
"description": "Defaults to 1.0.",
"required": false,
"collection": false,
"type": "Double"
}
],
"returns": {
"collection": false,
"type": "Float"
},
"additionalTags": [],
"urlFragment": "#imagegetaspectratioscalefactor"
},
{
"name": "getScaleFactors",
"signature": "()",
"description": "An array of all scale factors corresponding to representations for a given nativeImage.",
"parameters": [],
"returns": {
"collection": true,
"type": "Float"
},
"additionalTags": [],
"urlFragment": "#imagegetscalefactors"
},
{
"name": "addRepresentation",
"signature": "(options)",
"description": "Add an image representation for a specific scale factor. This can be used to explicitly add different scale factor representations to an image. This can be called on empty images.",
"parameters": [
{
"name": "options",
"description": "",
"required": true,
"collection": false,
"type": "Object",
"properties": [
{
"name": "scaleFactor",
"description": "The scale factor to add the image representation for.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Double"
},
{
"name": "width",
"description": "Defaults to 0. Required if a bitmap buffer is specified as `buffer`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "height",
"description": "Defaults to 0. Required if a bitmap buffer is specified as `buffer`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "buffer",
"description": "The buffer containing the raw image data.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Buffer"
},
{
"name": "dataURL",
"description": "The data URL containing either a base 64 encoded PNG or JPEG image.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#imageaddrepresentationoptions"
}
],
"instanceProperties": [
{
"name": "isMacTemplateImage",
"description": "A `Boolean` property that determines whether the image is considered a template image.\n\nPlease note that this property only has an effect on macOS.",
"required": true,
"additionalTags": [
"os_macos"
],
"urlFragment": "#nativeimageismactemplateimage-macos",
"collection": false,
"type": "Boolean"
}
],
"instanceEvents": [],
"instanceName": "image"
},
{
"name": "nativeTheme",
"description": "> Read and respond to changes in Chromium's native color theme.\n\nProcess: Main",
"slug": "native-theme",
"websiteUrl": "https://electronjs.org/docs/api/native-theme",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/native-theme.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [],
"properties": [
{
"name": "shouldUseDarkColors",
"description": "A `Boolean` for if the OS / Chromium currently has a dark mode enabled or is being instructed to show a dark-style UI. If you want to modify this value you should use `themeSource` below.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#nativethemeshouldusedarkcolors-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "themeSource",
"description": "A `String` property that can be `system`, `light` or `dark`. It is used to override and supersede the value that Chromium has chosen to use internally.\n\nSetting this property to `system` will remove the override and everything will be reset to the OS default. By default `themeSource` is `system`.\n\nSettings this property to `dark` will have the following effects:\n\n* `nativeTheme.shouldUseDarkColors` will be `true` when accessed\n* Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the dark UI.\n* Any UI the OS renders on macOS including menus, window frames, etc. will use the dark UI.\n* The `prefers-color-scheme` CSS query will match `dark` mode.\n* The `updated` event will be emitted\n\nSettings this property to `light` will have the following effects:\n\n* `nativeTheme.shouldUseDarkColors` will be `false` when accessed\n* Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the light UI.\n* Any UI the OS renders on macOS including menus, window frames, etc. will use the light UI.\n* The `prefers-color-scheme` CSS query will match `light` mode.\n* The `updated` event will be emitted\n\nThe usage of this property should align with a classic \"dark mode\" state machine in your application where the user has three options.\n\n* `Follow OS` --> `themeSource = 'system'`\n* `Dark Mode` --> `themeSource = 'dark'`\n* `Light Mode` --> `themeSource = 'light'`\n\nYour application should then always use `shouldUseDarkColors` to determine what CSS to apply.",
"required": true,
"additionalTags": [],
"urlFragment": "#nativethemethemesource",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "system",
"description": ""
},
{
"value": "light",
"description": ""
},
{
"value": "dark",
"description": ""
}
]
},
{
"name": "shouldUseHighContrastColors",
"description": "A `Boolean` for if the OS / Chromium currently has high-contrast mode enabled or is being instructed to show a high-contrast UI.",
"required": true,
"additionalTags": [
"os_macos",
"os_windows",
"availability_readonly"
],
"urlFragment": "#nativethemeshouldusehighcontrastcolors-macos-windows-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "shouldUseInvertedColorScheme",
"description": "A `Boolean` for if the OS / Chromium currently has an inverted color scheme or is being instructed to use an inverted color scheme.",
"required": true,
"additionalTags": [
"os_macos",
"os_windows",
"availability_readonly"
],
"urlFragment": "#nativethemeshoulduseinvertedcolorscheme-macos-windows-readonly",
"collection": false,
"type": "Boolean"
}
],
"events": [
{
"name": "updated",
"description": "Emitted when something in the underlying NativeTheme has changed. This normally means that either the value of `shouldUseDarkColors`, `shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed. You will have to check them to determine which one has changed.",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-updated"
}
],
"exportedClasses": []
},
{
"name": "netLog",
"description": "> Logging network events for a session.\n\nProcess: Main\n\n```\nconst { netLog } = require('electron')\n\napp.whenReady().then(async () => {\n await netLog.startLogging('/path/to/net-log')\n // After some network events\n const path = await netLog.stopLogging()\n console.log('Net-logs written to', path)\n})\n```\n\nSee `--log-net-log` to log network events throughout the app's lifecycle.\n\n**Note:** All methods unless specified can only be used after the `ready` event of the `app` module gets emitted.",
"slug": "net-log",
"websiteUrl": "https://electronjs.org/docs/api/net-log",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/net-log.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "startLogging",
"signature": "(path[, options])",
"description": "resolves when the net log has begun recording.\n\nStarts recording network events to `path`.",
"parameters": [
{
"name": "path",
"description": "File path to record network logs.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "captureMode",
"description": "What kinds of data should be captured. By default, only metadata about requests will be captured. Setting this to `includeSensitive` will include cookies and authentication data. Setting it to `everything` will include all bytes transferred on sockets. Can be `default`, `includeSensitive` or `everything`.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "default",
"description": ""
},
{
"value": "includeSensitive",
"description": ""
},
{
"value": "everything",
"description": ""
}
]
},
{
"name": "maxFileSize",
"description": "When the log grows beyond this size, logging will automatically stop. Defaults to unlimited.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Number"
}
]
}
],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#netlogstartloggingpath-options"
},
{
"name": "stopLogging",
"signature": "()",
"description": "resolves when the net log has been flushed to disk.\n\nStops recording network events. If not called, net logging will automatically end when app quits.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "void"
}
]
},
"additionalTags": [],
"urlFragment": "#netlogstoplogging"
}
],
"properties": [
{
"name": "currentlyLogging",
"description": "A `Boolean` property that indicates whether network logs are currently being recorded.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#netlogcurrentlylogging-readonly",
"collection": false,
"type": "Boolean"
}
],
"events": [],
"exportedClasses": []
},
{
"name": "net",
"description": "> Issue HTTP/HTTPS requests using Chromium's native networking library\n\nProcess: Main\n\nThe `net` module is a client-side API for issuing HTTP(S) requests. It is similar to the HTTP and HTTPS modules of Node.js but uses Chromium's native networking library instead of the Node.js implementation, offering better support for web proxies. It also supports checking network status.\n\nThe following is a non-exhaustive list of why you may consider using the `net` module instead of the native Node.js modules:\n\n* Automatic management of system proxy configuration, support of the wpad protocol and proxy pac configuration files.\n* Automatic tunneling of HTTPS requests.\n* Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate authentication schemes.\n* Support for traffic monitoring proxies: Fiddler-like proxies used for access control and monitoring.\n\nThe API components (including classes, methods, properties and event names) are similar to those used in Node.js.\n\nExample usage:\n\n```\nconst { app } = require('electron')\napp.whenReady().then(() => {\n const { net } = require('electron')\n const request = net.request('https://github.com')\n request.on('response', (response) => {\n console.log(`STATUS: ${response.statusCode}`)\n console.log(`HEADERS: ${JSON.stringify(response.headers)}`)\n response.on('data', (chunk) => {\n console.log(`BODY: ${chunk}`)\n })\n response.on('end', () => {\n console.log('No more data in response.')\n })\n })\n request.end()\n})\n```\n\nThe `net` API can be used only after the application emits the `ready` event. Trying to use the module before the `ready` event will throw an error.",
"slug": "net",
"websiteUrl": "https://electronjs.org/docs/api/net",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/net.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "request",
"signature": "(options)",
"description": "Creates a `ClientRequest` instance using the provided `options` which are directly forwarded to the `ClientRequest` constructor. The `net.request` method would be used to issue both secure and insecure HTTP requests according to the specified protocol scheme in the `options` object.",
"parameters": [
{
"name": "options",
"description": "The `ClientRequest` constructor options.",
"required": true,
"collection": false,
"type": [
{
"collection": false,
"type": "ClientRequestConstructorOptions"
},
{
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
],
"returns": {
"collection": false,
"type": "ClientRequest"
},
"additionalTags": [],
"urlFragment": "#netrequestoptions"
},
{
"name": "isOnline",
"signature": "()",
"description": "Whether there is currently internet connection.\n\nA return value of `false` is a pretty strong indicator that the user won't be able to connect to remote sites. However, a return value of `true` is inconclusive; even if some link is up, it is uncertain whether a particular connection attempt to a particular remote site will be successful.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#netisonline"
}
],
"properties": [
{
"name": "online",
"description": "A `Boolean` property. Whether there is currently internet connection.\n\nA return value of `false` is a pretty strong indicator that the user won't be able to connect to remote sites. However, a return value of `true` is inconclusive; even if some link is up, it is uncertain whether a particular connection attempt to a particular remote site will be successful.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#netonline-readonly",
"collection": false,
"type": "Boolean"
}
],
"events": [],
"exportedClasses": []
},
{
"name": "Notification",
"description": "> Create OS desktop notifications\n\nProcess: Main\n\n### Using in the renderer process\n\nIf you want to show Notifications from a renderer process you should use the HTML5 Notification API\n\n### Class: Notification\n\n> Create OS desktop notifications\n\nProcess: Main\n\n`Notification` is an EventEmitter.\n\nIt creates a new `Notification` with native properties as set by the `options`.\n\n### Static Methods\n\nThe `Notification` class has the following static methods:\n\n### `Notification.isSupported()`\n\nReturns `Boolean` - Whether or not desktop notifications are supported on the current system",
"slug": "notification",
"websiteUrl": "https://electronjs.org/docs/api/notification",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/notification.md",
"version": "12.0.0-beta.12",
"type": "Class",
"process": {
"main": true,
"renderer": false
},
"constructorMethod": {
"signature": "([options])",
"parameters": [
{
"name": "options",
"description": "",
"required": false,
"collection": false,
"type": "Object",
"properties": [
{
"name": "title",
"description": "A title for the notification, which will be shown at the top of the notification window when it is shown.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "subtitle",
"description": "A subtitle for the notification, which will be displayed below the title.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "body",
"description": "The body text of the notification, which will be displayed below the title or subtitle.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "silent",
"description": "Whether or not to emit an OS notification noise when showing the notification.",
"required": false,
"additionalTags": [],
"collection": false,
"type": "Boolean"
},
{
"name": "icon",
"description": "An icon to use in the notification.",
"required": false,
"additionalTags": [],
"collection": false,
"type": [
{
"collection": false,
"type": "String",
"possibleValues": null
},
{
"collection": false,
"type": "NativeImage"
}
]
},
{
"name": "hasReply",
"description": "Whether or not to add an inline reply option to the notification.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "Boolean"
},
{
"name": "timeoutType",
"description": "The timeout duration of the notification. Can be 'default' or 'never'.",
"required": false,
"additionalTags": [
"os_linux",
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "default",
"description": ""
},
{
"value": "never",
"description": ""
}
]
},
{
"name": "replyPlaceholder",
"description": "The placeholder to write in the inline reply input field.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "sound",
"description": "The name of the sound file to play when the notification is shown.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "urgency",
"description": "The urgency level of the notification. Can be 'normal', 'critical', or 'low'.",
"required": false,
"additionalTags": [
"os_linux"
],
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "normal",
"description": ""
},
{
"value": "critical",
"description": ""
},
{
"value": "low",
"description": ""
}
]
},
{
"name": "actions",
"description": "Actions to add to the notification. Please read the available actions and limitations in the `NotificationAction` documentation.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": true,
"type": "NotificationAction"
},
{
"name": "closeButtonText",
"description": "A custom title for the close button of an alert. An empty string will cause the default localized text to be used.",
"required": false,
"additionalTags": [
"os_macos"
],
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "toastXml",
"description": "A custom description of the Notification on Windows superseding all properties above. Provides full customization of design and behavior of the notification.",
"required": false,
"additionalTags": [
"os_windows"
],
"collection": false,
"type": "String",
"possibleValues": null
}
]
}
]
},
"staticMethods": [
{
"name": "isSupported",
"signature": "()",
"description": "Whether or not desktop notifications are supported on the current system",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#notificationissupported"
}
],
"staticProperties": [],
"instanceMethods": [
{
"name": "show",
"signature": "()",
"description": "Immediately shows the notification to the user, please note this means unlike the HTML5 Notification implementation, instantiating a `new Notification` does not immediately show it to the user, you need to call this method before the OS will display it.\n\nIf the notification has been shown before, this method will dismiss the previously shown notification and create a new one with identical properties.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#notificationshow"
},
{
"name": "close",
"signature": "()",
"description": "Dismisses the notification.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#notificationclose"
}
],
"instanceProperties": [
{
"name": "title",
"description": "A `String` property representing the title of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationtitle",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "subtitle",
"description": "A `String` property representing the subtitle of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationsubtitle",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "body",
"description": "A `String` property representing the body of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationbody",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "replyPlaceholder",
"description": "A `String` property representing the reply placeholder of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationreplyplaceholder",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "sound",
"description": "A `String` property representing the sound of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationsound",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "closeButtonText",
"description": "A `String` property representing the close button text of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationclosebuttontext",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "silent",
"description": "A `Boolean` property representing whether the notification is silent.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationsilent",
"collection": false,
"type": "Boolean"
},
{
"name": "hasReply",
"description": "A `Boolean` property representing whether the notification has a reply action.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationhasreply",
"collection": false,
"type": "Boolean"
},
{
"name": "urgency",
"description": "A `String` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.\n\nDefault is 'low' - see NotifyUrgency for more information.",
"required": true,
"additionalTags": [
"os_linux"
],
"urlFragment": "#notificationurgency-linux",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "normal",
"description": ""
},
{
"value": "critical",
"description": ""
},
{
"value": "low",
"description": ""
}
]
},
{
"name": "timeoutType",
"description": "A `String` property representing the type of timeout duration for the notification. Can be 'default' or 'never'.\n\nIf `timeoutType` is set to 'never', the notification never expires. It stays open until closed by the calling API or the user.",
"required": true,
"additionalTags": [
"os_linux",
"os_windows"
],
"urlFragment": "#notificationtimeouttype-linux-windows",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "default",
"description": ""
},
{
"value": "never",
"description": ""
}
]
},
{
"name": "actions",
"description": "A `NotificationAction[]` property representing the actions of the notification.",
"required": true,
"additionalTags": [],
"urlFragment": "#notificationactions",
"collection": true,
"type": "NotificationAction"
},
{
"name": "toastXml",
"description": "A `String` property representing the custom Toast XML of the notification.",
"required": true,
"additionalTags": [
"os_windows"
],
"urlFragment": "#notificationtoastxml-windows",
"collection": false,
"type": "String",
"possibleValues": null
}
],
"instanceEvents": [
{
"name": "show",
"description": "Emitted when the notification is shown to the user, note this could be fired multiple times as a notification can be shown multiple times through the `show()` method.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-show"
},
{
"name": "click",
"description": "Emitted when the notification is clicked by the user.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-click"
},
{
"name": "close",
"description": "Emitted when the notification is closed by manual intervention from the user.\n\nThis event is not guaranteed to be emitted in all cases where the notification is closed.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
}
],
"additionalTags": [],
"urlFragment": "#event-close"
},
{
"name": "reply",
"description": "Emitted when the user clicks the \"Reply\" button on a notification with `hasReply: true`.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "reply",
"description": "The string the user entered into the inline reply field.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-reply-macos"
},
{
"name": "action",
"description": "",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "index",
"description": "The index of the action that was activated.",
"collection": false,
"type": "Number",
"required": true
}
],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-action-macos"
},
{
"name": "failed",
"description": "Emitted when an error is encountered while creating and showing the native notification.",
"parameters": [
{
"name": "event",
"description": "",
"collection": false,
"type": "Event",
"required": true
},
{
"name": "error",
"description": "The error encountered during execution of the `show()` method.",
"collection": false,
"type": "String",
"possibleValues": null,
"required": true
}
],
"additionalTags": [
"os_windows"
],
"urlFragment": "#event-failed-windows"
}
],
"instanceName": "Notification"
},
{
"name": "powerMonitor",
"description": "> Monitor power state changes.\n\nProcess: Main",
"slug": "power-monitor",
"websiteUrl": "https://electronjs.org/docs/api/power-monitor",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/power-monitor.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "getSystemIdleState",
"signature": "(idleThreshold)",
"description": "The system's current state. Can be `active`, `idle`, `locked` or `unknown`.\n\nCalculate the system idle state. `idleThreshold` is the amount of time (in seconds) before considered idle. `locked` is available on supported systems only.",
"parameters": [
{
"name": "idleThreshold",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "active",
"description": ""
},
{
"value": "idle",
"description": ""
},
{
"value": "locked",
"description": ""
},
{
"value": "unknown",
"description": ""
}
]
},
"additionalTags": [],
"urlFragment": "#powermonitorgetsystemidlestateidlethreshold"
},
{
"name": "getSystemIdleTime",
"signature": "()",
"description": "Idle time in seconds\n\nCalculate system idle time in seconds.",
"parameters": [],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#powermonitorgetsystemidletime"
},
{
"name": "isOnBatteryPower",
"signature": "()",
"description": "Whether the system is on battery power.\n\nTo monitor for changes in this property, use the `on-battery` and `on-ac` events.",
"parameters": [],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#powermonitorisonbatterypower"
}
],
"properties": [
{
"name": "onBatteryPower",
"description": "A `Boolean` property. True if the system is on battery power.\n\nSee `powerMonitor.isOnBatteryPower()`.",
"required": true,
"additionalTags": [],
"urlFragment": "#powermonitoronbatterypower",
"collection": false,
"type": "Boolean"
}
],
"events": [
{
"name": "suspend",
"description": "Emitted when the system is suspending.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-suspend-macos-windows"
},
{
"name": "resume",
"description": "Emitted when system is resuming.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-resume-macos-windows"
},
{
"name": "on-ac",
"description": "Emitted when the system changes to AC power.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-on-ac-macos-windows"
},
{
"name": "on-battery",
"description": "Emitted when system changes to battery power.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-on-battery-macos--windows"
},
{
"name": "shutdown",
"description": "Emitted when the system is about to reboot or shut down. If the event handler invokes `e.preventDefault()`, Electron will attempt to delay system shutdown in order for the app to exit cleanly. If `e.preventDefault()` is called, the app should exit as soon as possible by calling something like `app.quit()`.",
"parameters": [],
"additionalTags": [
"os_linux",
"os_macos"
],
"urlFragment": "#event-shutdown-linux-macos"
},
{
"name": "lock-screen",
"description": "Emitted when the system is about to lock the screen.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-lock-screen-macos-windows"
},
{
"name": "unlock-screen",
"description": "Emitted as soon as the systems screen is unlocked.",
"parameters": [],
"additionalTags": [
"os_macos",
"os_windows"
],
"urlFragment": "#event-unlock-screen-macos-windows"
},
{
"name": "user-did-become-active",
"description": "Emitted when a login session is activated. See documentation for more information.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-user-did-become-active-macos"
},
{
"name": "user-did-resign-active",
"description": "Emitted when a login session is deactivated. See documentation for more information.",
"parameters": [],
"additionalTags": [
"os_macos"
],
"urlFragment": "#event-user-did-resign-active-macos"
}
],
"exportedClasses": []
},
{
"name": "powerSaveBlocker",
"description": "> Block the system from entering low-power (sleep) mode.\n\nProcess: Main\n\nFor example:",
"slug": "power-save-blocker",
"websiteUrl": "https://electronjs.org/docs/api/power-save-blocker",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/power-save-blocker.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "start",
"signature": "(type)",
"description": "The blocker ID that is assigned to this power blocker.\n\nStarts preventing the system from entering lower-power mode. Returns an integer identifying the power save blocker.\n\n**Note:** `prevent-display-sleep` has higher precedence over `prevent-app-suspension`. Only the highest precedence type takes effect. In other words, `prevent-display-sleep` always takes precedence over `prevent-app-suspension`.\n\nFor example, an API calling A requests for `prevent-app-suspension`, and another calling B requests for `prevent-display-sleep`. `prevent-display-sleep` will be used until B stops its request. After that, `prevent-app-suspension` is used.",
"parameters": [
{
"name": "type",
"description": "Power save blocker type.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "prevent-app-suspension",
"description": "Prevent the application from being suspended. Keeps system active but allows screen to be turned off. Example use cases: downloading a file or playing audio."
},
{
"value": "prevent-display-sleep",
"description": "Prevent the display from going to sleep. Keeps system and screen active. Example use case: playing video."
}
]
}
],
"returns": {
"collection": false,
"type": "Integer"
},
"additionalTags": [],
"urlFragment": "#powersaveblockerstarttype"
},
{
"name": "stop",
"signature": "(id)",
"description": "Stops the specified power save blocker.",
"parameters": [
{
"name": "id",
"description": "The power save blocker id returned by `powerSaveBlocker.start`.",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [],
"urlFragment": "#powersaveblockerstopid"
},
{
"name": "isStarted",
"signature": "(id)",
"description": "Whether the corresponding `powerSaveBlocker` has started.",
"parameters": [
{
"name": "id",
"description": "The power save blocker id returned by `powerSaveBlocker.start`.",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#powersaveblockerisstartedid"
}
],
"properties": [],
"events": [],
"exportedClasses": []
},
{
"name": "process",
"description": "> Extensions to process object.\n\nProcess: Main, Renderer\n\nElectron's `process` object is extended from the Node.js `process` object. It adds the following events, properties, and methods:\n\n### Sandbox\n\nIn sandboxed renderers the `process` object contains only a subset of the APIs:\n\n* `crash()`\n* `hang()`\n* `getCreationTime()`\n* `getHeapStatistics()`\n* `getBlinkMemoryInfo()`\n* `getProcessMemoryInfo()`\n* `getSystemMemoryInfo()`\n* `getSystemVersion()`\n* `getCPUUsage()`\n* `getIOCounters()`\n* `argv`\n* `execPath`\n* `env`\n* `pid`\n* `arch`\n* `platform`\n* `sandboxed`\n* `type`\n* `version`\n* `versions`\n* `mas`\n* `windowsStore`",
"slug": "process",
"websiteUrl": "https://electronjs.org/docs/api/process",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/process.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": true
},
"methods": [
{
"name": "crash",
"signature": "()",
"description": "Causes the main thread of the current process crash.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#processcrash"
},
{
"name": "getCreationTime",
"signature": "()",
"description": "The number of milliseconds since epoch, or `null` if the information is unavailable\n\nIndicates the creation time of the application. The time is represented as number of milliseconds since epoch. It returns null if it is unable to get the process creation time.",
"parameters": [],
"returns": {
"collection": false,
"type": [
{
"collection": false,
"type": "Number"
},
{
"type": "null",
"collection": false
}
]
},
"additionalTags": [],
"urlFragment": "#processgetcreationtime"
},
{
"name": "getCPUUsage",
"signature": "()",
"description": "",
"parameters": [],
"returns": {
"collection": false,
"type": "CPUUsage"
},
"additionalTags": [],
"urlFragment": "#processgetcpuusage"
},
{
"name": "getIOCounters",
"signature": "()",
"description": "",
"parameters": [],
"returns": {
"collection": false,
"type": "IOCounters"
},
"additionalTags": [
"os_windows",
"os_linux"
],
"urlFragment": "#processgetiocounters-windows-linux"
},
{
"name": "getHeapStatistics",
"signature": "()",
"description": "* `totalHeapSize` Integer\n* `totalHeapSizeExecutable` Integer\n* `totalPhysicalSize` Integer\n* `totalAvailableSize` Integer\n* `usedHeapSize` Integer\n* `heapSizeLimit` Integer\n* `mallocedMemory` Integer\n* `peakMallocedMemory` Integer\n* `doesZapGarbage` Boolean\n\nReturns an object with V8 heap statistics. Note that all statistics are reported in Kilobytes.",
"parameters": [],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "totalHeapSize",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "totalHeapSizeExecutable",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "totalPhysicalSize",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "totalAvailableSize",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "usedHeapSize",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "heapSizeLimit",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "mallocedMemory",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "peakMallocedMemory",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "doesZapGarbage",
"description": "",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Boolean"
}
]
},
"additionalTags": [],
"urlFragment": "#processgetheapstatistics"
},
{
"name": "getBlinkMemoryInfo",
"signature": "()",
"description": "* `allocated` Integer - Size of all allocated objects in Kilobytes.\n* `marked` Integer - Size of all marked objects in Kilobytes.\n* `total` Integer - Total allocated space in Kilobytes.\n\nReturns an object with Blink memory information. It can be useful for debugging rendering / DOM related memory issues. Note that all values are reported in Kilobytes.",
"parameters": [],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "allocated",
"description": "Size of all allocated objects in Kilobytes.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "marked",
"description": "Size of all marked objects in Kilobytes.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "total",
"description": "Total allocated space in Kilobytes.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
}
]
},
"additionalTags": [],
"urlFragment": "#processgetblinkmemoryinfo"
},
{
"name": "getProcessMemoryInfo",
"signature": "()",
"description": "Resolves with a ProcessMemoryInfo\n\nReturns an object giving memory usage statistics about the current process. Note that all statistics are reported in Kilobytes. This api should be called after app ready.\n\nChromium does not provide `residentSet` value for macOS. This is because macOS performs in-memory compression of pages that haven't been recently used. As a result the resident set size value is not what one would expect. `private` memory is more representative of the actual pre-compression memory usage of the process on macOS.",
"parameters": [],
"returns": {
"collection": false,
"type": "Promise",
"innerTypes": [
{
"collection": false,
"type": "ProcessMemoryInfo"
}
]
},
"additionalTags": [],
"urlFragment": "#processgetprocessmemoryinfo"
},
{
"name": "getSystemMemoryInfo",
"signature": "()",
"description": "* `total` Integer - The total amount of physical memory in Kilobytes available to the system.\n* `free` Integer - The total amount of memory not being used by applications or disk cache.\n* `swapTotal` Integer _Windows_ _Linux_ - The total amount of swap memory in Kilobytes available to the system.\n* `swapFree` Integer _Windows_ _Linux_ - The free amount of swap memory in Kilobytes available to the system.\n\nReturns an object giving memory usage statistics about the entire system. Note that all statistics are reported in Kilobytes.",
"parameters": [],
"returns": {
"collection": false,
"type": "Object",
"properties": [
{
"name": "total",
"description": "The total amount of physical memory in Kilobytes available to the system.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "free",
"description": "The total amount of memory not being used by applications or disk cache.",
"required": true,
"additionalTags": [],
"collection": false,
"type": "Integer"
},
{
"name": "swapTotal",
"description": "The total amount of swap memory in Kilobytes available to the system.",
"required": true,
"additionalTags": [
"os_windows",
"os_linux"
],
"collection": false,
"type": "Integer"
},
{
"name": "swapFree",
"description": "The free amount of swap memory in Kilobytes available to the system.",
"required": true,
"additionalTags": [
"os_windows",
"os_linux"
],
"collection": false,
"type": "Integer"
}
]
},
"additionalTags": [],
"urlFragment": "#processgetsystemmemoryinfo"
},
{
"name": "getSystemVersion",
"signature": "()",
"description": "The version of the host operating system.\n\nExample:\n\n**Note:** It returns the actual operating system version instead of kernel version on macOS unlike `os.release()`.",
"parameters": [],
"returns": {
"collection": false,
"type": "String",
"possibleValues": null
},
"additionalTags": [],
"urlFragment": "#processgetsystemversion"
},
{
"name": "takeHeapSnapshot",
"signature": "(filePath)",
"description": "Indicates whether the snapshot has been created successfully.\n\nTakes a V8 heap snapshot and saves it to `filePath`.",
"parameters": [
{
"name": "filePath",
"description": "Path to the output file.",
"required": true,
"collection": false,
"type": "String",
"possibleValues": null
}
],
"returns": {
"collection": false,
"type": "Boolean"
},
"additionalTags": [],
"urlFragment": "#processtakeheapsnapshotfilepath"
},
{
"name": "hang",
"signature": "()",
"description": "Causes the main thread of the current process hang.",
"parameters": [],
"returns": null,
"additionalTags": [],
"urlFragment": "#processhang"
},
{
"name": "setFdLimit",
"signature": "(maxDescriptors)",
"description": "Sets the file descriptor soft limit to `maxDescriptors` or the OS hard limit, whichever is lower for the current process.",
"parameters": [
{
"name": "maxDescriptors",
"description": "",
"required": true,
"collection": false,
"type": "Integer"
}
],
"returns": null,
"additionalTags": [
"os_macos",
"os_linux"
],
"urlFragment": "#processsetfdlimitmaxdescriptors-macos-linux"
}
],
"properties": [
{
"name": "defaultApp",
"description": "A `Boolean`. When app is started by being passed as parameter to the default app, this property is `true` in the main process, otherwise it is `undefined`.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processdefaultapp-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "isMainFrame",
"description": "A `Boolean`, `true` when the current renderer context is the \"main\" renderer frame. If you want the ID of the current frame you should use `webFrame.routingId`.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processismainframe-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "mas",
"description": "A `Boolean`. For Mac App Store build, this property is `true`, for other builds it is `undefined`.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processmas-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "noAsar",
"description": "A `Boolean` that controls ASAR support inside your application. Setting this to `true` will disable the support for `asar` archives in Node's built-in modules.",
"required": true,
"additionalTags": [],
"urlFragment": "#processnoasar",
"collection": false,
"type": "Boolean"
},
{
"name": "noDeprecation",
"description": "A `Boolean` that controls whether or not deprecation warnings are printed to `stderr`. Setting this to `true` will silence deprecation warnings. This property is used instead of the `--no-deprecation` command line flag.",
"required": true,
"additionalTags": [],
"urlFragment": "#processnodeprecation",
"collection": false,
"type": "Boolean"
},
{
"name": "resourcesPath",
"description": "A `String` representing the path to the resources directory.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processresourcespath-readonly",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "sandboxed",
"description": "A `Boolean`. When the renderer process is sandboxed, this property is `true`, otherwise it is `undefined`.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processsandboxed-readonly",
"collection": false,
"type": "Boolean"
},
{
"name": "throwDeprecation",
"description": "A `Boolean` that controls whether or not deprecation warnings will be thrown as exceptions. Setting this to `true` will throw errors for deprecations. This property is used instead of the `--throw-deprecation` command line flag.",
"required": true,
"additionalTags": [],
"urlFragment": "#processthrowdeprecation",
"collection": false,
"type": "Boolean"
},
{
"name": "traceDeprecation",
"description": "A `Boolean` that controls whether or not deprecations printed to `stderr` include their stack trace. Setting this to `true` will print stack traces for deprecations. This property is instead of the `--trace-deprecation` command line flag.",
"required": true,
"additionalTags": [],
"urlFragment": "#processtracedeprecation",
"collection": false,
"type": "Boolean"
},
{
"name": "traceProcessWarnings",
"description": "A `Boolean` that controls whether or not process warnings printed to `stderr` include their stack trace. Setting this to `true` will print stack traces for process warnings (including deprecations). This property is instead of the `--trace-warnings` command line flag.",
"required": true,
"additionalTags": [],
"urlFragment": "#processtraceprocesswarnings",
"collection": false,
"type": "Boolean"
},
{
"name": "type",
"description": "A `String` representing the current process's type, can be:\n\n* `browser` - The main process\n* `renderer` - A renderer process\n* `worker` - In a web worker",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processtype-readonly",
"collection": false,
"type": "String",
"possibleValues": [
{
"value": "browser",
"description": "The main process"
},
{
"value": "renderer",
"description": "A renderer process"
},
{
"value": "worker",
"description": "In a web worker"
}
]
},
{
"name": "chrome",
"description": "A `String` representing Chrome's version string.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processversionschrome-readonly",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "electron",
"description": "A `String` representing Electron's version string.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processversionselectron-readonly",
"collection": false,
"type": "String",
"possibleValues": null
},
{
"name": "windowsStore",
"description": "A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`, for otherwise it is `undefined`.",
"required": true,
"additionalTags": [
"availability_readonly"
],
"urlFragment": "#processwindowsstore-readonly",
"collection": false,
"type": "Boolean"
}
],
"events": [
{
"name": "loaded",
"description": "Emitted when Electron has loaded its internal initialization script and is beginning to load the web page or the main script.\n\nIt can be used by the preload script to add removed Node global symbols back to the global scope when node integration is turned off:",
"parameters": [],
"additionalTags": [],
"urlFragment": "#event-loaded"
}
],
"exportedClasses": []
},
{
"name": "protocol",
"description": "> Register a custom protocol and intercept existing protocol requests.\n\nProcess: Main\n\nAn example of implementing a protocol that has the same effect as the `file://` protocol:\n\n```\nconst { app, protocol } = require('electron')\nconst path = require('path')\n\napp.whenReady().then(() => {\n protocol.registerFileProtocol('atom', (request, callback) => {\n const url = request.url.substr(7)\n callback({ path: path.normalize(`${__dirname}/${url}`) })\n })\n})\n```\n\n**Note:** All methods unless specified can only be used after the `ready` event of the `app` module gets emitted.\n\n### Using `protocol` with a custom `partition` or `session`\n\nA protocol is registered to a specific Electron `session` object. If you don't specify a session, then your `protocol` will be applied to the default session that Electron uses. However, if you define a `partition` or `session` on your `browserWindow`'s `webPreferences`, then that window will use a different session and your custom protocol will not work if you just use `electron.protocol.XXX`.\n\nTo have your custom protocol work in combination with a custom session, you need to register it to that session explicitly.\n\n```\nconst { session, app, protocol } = require('electron')\nconst path = require('path')\n\napp.whenReady().then(() => {\n const partition = 'persist:example'\n const ses = session.fromPartition(partition)\n\n ses.protocol.registerFileProtocol('atom', (request, callback) => {\n const url = request.url.substr(7)\n callback({ path: path.normalize(`${__dirname}/${url}`) })\n })\n\n mainWindow = new BrowserWindow({ webPreferences: { partition } })\n})\n```",
"slug": "protocol",
"websiteUrl": "https://electronjs.org/docs/api/protocol",
"repoUrl": "https://github.com/electron/electron/blob/12.0.0-beta.12/docs/api/protocol.md",
"version": "12.0.0-beta.12",
"type": "Module",
"process": {
"main": true,
"renderer": false
},
"methods": [
{
"name": "registerSchemesAsPrivileged",
"signature": "(customSchemes)",
"description": "**Note:** This method can only be used before the `ready` event of the `app` module gets emitted and can be called only once.\n\nRegisters the `scheme` as standard, secure, bypasses content security policy for resources, allows registering ServiceWorker, supports fetch API, and streaming video/audio. Specify a privilege with the value of `true` to enable the capability.\n\nAn example of registering a privileged scheme, that bypasses Content Security Policy:\n\nA standard scheme adheres to what RFC 3986 calls generic URI syntax. For example `http` and `https` are standard schemes, while `file` is not.\n\nRegistering a scheme as standard allows relative and absolute resources to be resolved correctly when served. Otherwise the scheme will behave like the `file` protocol, but without the ability to resolve relative URLs.\n\nFor example when you load following page with custom protocol without registering it as standard scheme, the image will not be loaded because non-standard schemes can not recognize relative URLs:\n\nRegistering a scheme as standard will allow access to files through the FileSystem API. Otherwise the renderer will throw a security error for the scheme.\n\nBy default web storage apis (localStorage, sessionStorage, webSQL, indexedDB, cookies) are disabled for non standard schemes. So in general if you want to register a custom protocol to replace the `http` protocol, you have to register it as a standard scheme.\n\nProtocols that use streams (http and stream protocols) should set `stream: true`. The `