[
{
"name": "app",
"description": "Control your application's event lifecycle.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "app",
"websiteUrl": "http://electronjs.org/docs/api/app",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/app.md",
"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. This 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."
},
{
"name": "exit",
"signature": "([exitCode])",
"description": "Exits immediately with exitCode. exitCode defaults to 0. All windows will be closed immediately without asking user and the before-quit and will-quit events will not be emitted.",
"parameters": [
{
"name": "exitCode",
"type": "Integer",
"collection": false,
"required": false
}
]
},
{
"name": "relaunch",
"signature": "([options])",
"description": "Relaunches the app when current instance exits. By 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. Note 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. When app.relaunch is called for multiple times, multiple instances will be started after current instance exited. An example of restarting current instance immediately and adding a new command line argument to the new instance:",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "args",
"type": "String",
"collection": true,
"description": "",
"required": false
},
{
"name": "execPath",
"type": "String",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "isReady",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if Electron has finished initializing, false otherwise."
}
},
{
"name": "whenReady",
"signature": "()",
"returns": {
"type": "Promise",
"collection": false,
"innerType": "void",
"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."
}
},
{
"name": "focus",
"signature": "()",
"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."
},
{
"name": "hide",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Hides all application windows without minimizing them."
},
{
"name": "show",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Shows application windows after they were hidden. Does not automatically focus them."
},
{
"name": "getAppPath",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The current application directory."
}
},
{
"name": "getPath",
"signature": "(name)",
"description": "You can request the following paths by the name:",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "String",
"collection": false,
"description": "A path to a special directory or file associated with name. On failure an Error is thrown."
}
},
{
"name": "getFileIcon",
"signature": "(path[, options], callback)",
"description": "Fetches a path's associated icon. On Windows, there a 2 kinds of icons: On Linux and macOS, icons depend on the application associated with file mime type.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "size",
"type": "String",
"collection": false,
"description": "",
"required": true,
"possibleValues": [
{
"value": "small",
"description": "16x16"
},
{
"value": "normal",
"description": "32x32"
},
{
"value": "large",
"description": "48x48 on Linux, 32x32 on Windows, unsupported on macOS."
}
]
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"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, the directory will be created by this method. On failure an Error is thrown. You can only override paths of a name defined in app.getPath. By 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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getVersion",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"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."
}
},
{
"name": "getName",
"signature": "()",
"description": "Usually the name field of package.json is a short lowercased 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.",
"returns": {
"type": "String",
"collection": false,
"description": "The current application's name, which is the name in the application's package.json file."
}
},
{
"name": "setName",
"signature": "(name)",
"description": "Overrides the current application's name.",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getLocale",
"signature": "()",
"description": "To set the locale, you'll want to use a command line switch at app startup, which may be found here. Note: When distributing your packaged app, you have to also ship the locales folder. Note: On Windows you have to call it after the ready events gets emitted.",
"returns": {
"type": "String",
"collection": false,
"description": "The current application locale. Possible return values are documented here."
}
},
{
"name": "addRecentDocument",
"signature": "(path)",
"platforms": [
"macOS",
"Windows"
],
"description": "Adds path to the recent documents list. This 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",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "clearRecentDocuments",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "Clears the recent documents list."
},
{
"name": "setAsDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"description": "This method sets 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. On Windows you can provide optional parameters path, the path to your executable, and args, an array of arguments to be passed to your executable when it launches. Note: On macOS, you can only register protocols that have been added to your app's info.plist, which can not be modified at runtime. You can however change the file with a simple text editor or script during build time. Please refer to Apple's documentation for details. The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.",
"parameters": [
{
"name": "protocol",
"type": "String",
"collection": false,
"description": "The name of your protocol, without `://`. If you want your app to handle `electron://` links, call this method with `electron` as the parameter.",
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Defaults to `process.execPath`",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "Defaults to an empty array",
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "removeAsDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"platforms": [
"macOS",
"Windows"
],
"description": "This 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",
"type": "String",
"collection": false,
"description": "The name of your protocol, without `://`.",
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Defaults to `process.execPath`",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "Defaults to an empty array",
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "isDefaultProtocolClient",
"signature": "(protocol[, path, args])",
"description": "This method checks if the current executable is the default handler for a protocol (aka URI scheme). If so, it will return true. Otherwise, it will return false. 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. The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.",
"parameters": [
{
"name": "protocol",
"type": "String",
"collection": false,
"description": "The name of your protocol, without `://`.",
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Defaults to `process.execPath`",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "Defaults to an empty array",
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false
}
},
{
"name": "setUserTasks",
"signature": "(tasks)",
"platforms": [
"Windows"
],
"description": "Adds tasks to the Tasks category of the JumpList on Windows. tasks is an array of Task objects. Note: If you'd like to customize the Jump List even more use app.setJumpList(categories) instead.",
"parameters": [
{
"name": "tasks",
"type": "Task",
"collection": true,
"description": "Array of `Task` objects",
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "getJumpListSettings",
"signature": "()",
"platforms": [
"Windows"
],
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "minItems",
"type": "Integer",
"collection": false,
"description": "The minimum number of items that will be shown in the Jump List (for a more detailed description of this value see the ).",
"required": true
},
{
"name": "removedItems",
"type": "JumpListItem",
"collection": true,
"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 call to app.setJumpList(), Windows will not display any custom category that contains any of the removed items.",
"required": true
}
]
}
},
{
"name": "setJumpList",
"signature": "(categories)",
"platforms": [
"Windows"
],
"description": "Sets or removes a custom Jump List for the application, and returns one of the following strings: If 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). 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. 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(). Here's a very simple example of creating a custom Jump List:",
"parameters": [
{
"name": "categories",
"type": "JumpListCategory",
"collection": true,
"description": "or `null` Array of `JumpListCategory` objects.",
"required": true
}
]
},
{
"name": "requestSingleInstanceLock",
"signature": "()",
"description": "This method makes your application a Single Instance Application - instead of allowing multiple instances of your app to run, this will ensure that only a single instance of your app is running, and other instances signal this instance and exit. 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. I.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. On 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. An example of activating the window of primary instance when a second instance starts:",
"returns": {
"type": "Boolean",
"collection": false
}
},
{
"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()",
"returns": {
"type": "Boolean",
"collection": false
}
},
{
"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."
},
{
"name": "setUserActivity",
"signature": "(type, userInfo[, webpageURL])",
"platforms": [
"macOS"
],
"description": "Creates an NSUserActivity and sets it as the current activity. The activity is eligible for Handoff to another device afterward.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Uniquely identifies the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "App-specific state to store for use by another device.",
"required": true
},
{
"name": "webpageURL",
"type": "String",
"collection": false,
"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
}
]
},
{
"name": "getCurrentActivityType",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "String",
"collection": false,
"description": "The type of the currently running activity."
}
},
{
"name": "invalidateCurrentActivity",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Invalidates the current Handoff user activity.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Uniquely identifies the activity. Maps to .",
"required": true
}
]
},
{
"name": "updateCurrentActivity",
"signature": "(type, userInfo)",
"platforms": [
"macOS"
],
"description": "Updates the current activity if its type matches type, merging the entries from userInfo into its current userInfo dictionary.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Uniquely identifies the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "App-specific state to store for use by another device.",
"required": true
}
]
},
{
"name": "setAppUserModelId",
"signature": "(id)",
"platforms": [
"Windows"
],
"description": "Changes the Application User Model ID to id.",
"parameters": [
{
"name": "id",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "importCertificate",
"signature": "(options, callback)",
"platforms": [
"LINUX"
],
"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",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "certificate",
"type": "String",
"collection": false,
"description": "Path for the pkcs12 file.",
"required": true
},
{
"name": "password",
"type": "String",
"collection": false,
"description": "Passphrase for the certificate.",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "result",
"type": "Integer",
"collection": false,
"description": "Result of import.",
"required": true
}
]
}
]
},
{
"name": "disableHardwareAcceleration",
"signature": "()",
"description": "Disables hardware acceleration for current app. This method can only be called before app is ready."
},
{
"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 behaviour. This method can only be called before app is ready."
},
{
"name": "getAppMetrics",
"signature": "()",
"returns": {
"type": "ProcessMetric",
"collection": true,
"description": "Array of ProcessMetric objects that correspond to memory and cpu usage statistics of all the processes associated with the app."
}
},
{
"name": "getGPUFeatureStatus",
"signature": "()",
"returns": {
"type": "GPUFeatureStatus",
"collection": false,
"description": "The Graphics Feature Status from chrome://gpu/."
}
},
{
"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. For infoType equal to basic: Promise is fulfilled with Object containing fewer attributes than when requested with complete. Here's an example of basic response: Using basic should be preferred if only basic information like vendorId or driverId is needed.",
"parameters": [
{
"name": "infoType",
"type": "String",
"collection": false,
"description": "Values can be either `basic` for basic info or `complete` for complete info.",
"required": true
}
],
"returns": {
"type": "Promise",
"collection": false
}
},
{
"name": "setBadgeCount",
"signature": "(count)",
"platforms": [
"Linux",
"macOS"
],
"description": "Sets the counter badge for current app. Setting the count to 0 will hide the badge. On macOS it shows on the dock icon. On Linux it only works for Unity launcher, Note: Unity launcher requires the existence of a .desktop file to work, for more information please read Desktop Environment Integration.",
"parameters": [
{
"name": "count",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the call succeeded."
}
},
{
"name": "getBadgeCount",
"signature": "()",
"platforms": [
"Linux",
"macOS"
],
"returns": {
"type": "Integer",
"collection": false,
"description": "The current value displayed in the counter badge."
}
},
{
"name": "isUnityRunning",
"signature": "()",
"platforms": [
"Linux"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the current desktop environment is Unity launcher."
}
},
{
"name": "getLoginItemSettings",
"signature": "([options])",
"platforms": [
"macOS",
"Windows"
],
"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.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "The executable path to compare against. Defaults to process.execPath.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "The command-line arguments to compare against. Defaults to an empty array.",
"required": false
}
]
}
],
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "options",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "The executable path to compare against. Defaults to process.execPath.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "The command-line arguments to compare against. Defaults to an empty array.",
"required": false
}
]
},
{
"name": "openAtLogin",
"type": "Boolean",
"collection": false,
"description": "true if the app is set to open at login.",
"required": true
},
{
"name": "openAsHidden",
"type": "Boolean",
"collection": false,
"description": "true if the app is set to open as hidden at login. This setting is not available on .",
"required": true
},
{
"name": "wasOpenedAtLogin",
"type": "Boolean",
"collection": false,
"description": "true if the app was opened at login automatically. This setting is not available on .",
"required": true
},
{
"name": "wasOpenedAsHidden",
"type": "Boolean",
"collection": false,
"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 .",
"required": true
},
{
"name": "restoreState",
"type": "Boolean",
"collection": false,
"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 .",
"required": true
}
]
}
},
{
"name": "setLoginItemSettings",
"signature": "(settings)",
"platforms": [
"macOS",
"Windows"
],
"description": "Set the app's login item settings. 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",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "openAtLogin",
"type": "Boolean",
"collection": false,
"description": "true to open the app at login, false to remove the app as a login item. Defaults to false.",
"required": false
},
{
"name": "openAsHidden",
"type": "Boolean",
"collection": false,
"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 .",
"required": false
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "The executable to launch at login. Defaults to process.execPath.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": true,
"description": "The command-line arguments to pass to the executable. Defaults to an empty array. Take care to wrap paths in quotes.",
"required": false
}
]
}
]
},
{
"name": "isAccessibilitySupportEnabled",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"returns": {
"type": "Boolean",
"collection": false,
"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."
}
},
{
"name": "setAccessibilitySupportEnabled",
"signature": "(enabled)",
"platforms": [
"macOS",
"Windows"
],
"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. This API must be called after the ready event is emitted. Note: Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.",
"parameters": [
{
"name": "enabled",
"type": "Boolean",
"collection": false,
"description": "Enable or disable rendering",
"required": true
}
]
},
{
"name": "showAboutPanel",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Show the about panel with the values defined in the app's .plist file or with the options set via app.setAboutPanelOptions(options)."
},
{
"name": "setAboutPanelOptions",
"signature": "(options)",
"platforms": [
"macOS"
],
"description": "Set the about panel options. This will override the values defined in the app's .plist file. See the Apple docs for more details.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "applicationName",
"type": "String",
"collection": false,
"description": "The app's name.",
"required": false
},
{
"name": "applicationVersion",
"type": "String",
"collection": false,
"description": "The app's version.",
"required": false
},
{
"name": "copyright",
"type": "String",
"collection": false,
"description": "Copyright information.",
"required": false
},
{
"name": "credits",
"type": "String",
"collection": false,
"description": "Credit information.",
"required": false
},
{
"name": "version",
"type": "String",
"collection": false,
"description": "The app's build version number.",
"required": false
}
]
}
]
},
{
"name": "startAccessingSecurityScopedResource",
"signature": "(bookmarkData)",
"platforms": [
"macOS (mas)"
],
"description": "Start 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",
"type": "String",
"collection": false,
"description": "The base64 encoded security scoped bookmark data returned by the `dialog.showOpenDialog` or `dialog.showSaveDialog` methods.",
"required": true
}
],
"returns": {
"type": "Function",
"collection": false,
"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."
}
},
{
"name": "enableSandbox",
"signature": "()",
"platforms": [
"Experimental",
"macOS",
"Windows"
],
"description": "Enables full sandbox mode on the app. This method can only be called before app is ready."
},
{
"name": "enableMixedSandbox",
"signature": "()",
"platforms": [
"Experimental",
"macOS",
"Windows"
],
"description": "Enables mixed sandbox mode on the app. This method can only be called before app is ready."
},
{
"name": "isInApplicationsFolder",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the application is currently running from the systems Application folder. Use in combination with app.moveToApplicationsFolder()"
}
},
{
"name": "moveToApplicationsFolder",
"signature": "()",
"platforms": [
"macOS"
],
"description": "No 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. 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",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the move was successful. Please note that if the move is successful your application will quit and relaunch."
}
}
],
"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. In most cases, you should do everything in the ready event handler."
},
{
"name": "ready",
"description": "Emitted when Electron has finished initializing. On macOS, launchInfo holds the userInfo of the NSUserNotification that was used to open the application, if it was launched from Notification Center. You can call app.isReady() to check if this event has already fired.",
"returns": [
{
"name": "launchInfo",
"type": "Object",
"collection": false,
"required": true
}
]
},
{
"name": "window-all-closed",
"description": "Emitted when all windows have been closed. If 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."
},
{
"name": "before-quit",
"description": "Emitted before the application starts closing its windows. Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. Note: If application quit was initiated by autoUpdater.quitAndInstall() then before-quit is emitted after emitting close event on all windows and closing them. 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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "will-quit",
"description": "Emitted when all windows have been closed and the application will quit. Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. See the description of the window-all-closed event for the differences between the will-quit and window-all-closed events. 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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "quit",
"description": "Emitted when the application is quitting. 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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "exitCode",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"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). You should call event.preventDefault() if you want to handle this event. On Windows, you have to parse process.argv (in the main process) to get the filepath.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"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. You should call event.preventDefault() if you want to handle this event.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"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.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "hasVisibleWindows",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"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. A 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.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "A string identifying the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "Contains app-specific state stored by the activity on another device.",
"required": true
}
]
},
{
"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.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "A string identifying the activity. Maps to .",
"required": true
}
]
},
{
"name": "continue-activity-error",
"description": "Emitted during Handoff when an activity from a different device fails to be resumed.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "A string identifying the activity. Maps to .",
"required": true
},
{
"name": "error",
"type": "String",
"collection": false,
"description": "A string with the error's localized description.",
"required": true
}
]
},
{
"name": "activity-was-continued",
"description": "Emitted during Handoff after an activity from this device was successfully resumed on another one.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "A string identifying the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "Contains app-specific state stored by the activity.",
"required": true
}
]
},
{
"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.updateCurrentActiviy() in a timely manner. Otherwise the operation will fail and continue-activity-error will be called.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "A string identifying the activity. Maps to .",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "Contains app-specific state stored by the activity.",
"required": true
}
]
},
{
"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",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "browser-window-blur",
"description": "Emitted when a browserWindow gets blurred.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "window",
"type": "BrowserWindow",
"collection": false,
"required": true
}
]
},
{
"name": "browser-window-focus",
"description": "Emitted when a browserWindow gets focused.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "window",
"type": "BrowserWindow",
"collection": false,
"required": true
}
]
},
{
"name": "browser-window-created",
"description": "Emitted when a new browserWindow is created.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "window",
"type": "BrowserWindow",
"collection": false,
"required": true
}
]
},
{
"name": "web-contents-created",
"description": "Emitted when a new webContents is created.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
}
]
},
{
"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).",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "error",
"type": "String",
"collection": false,
"description": "The error code",
"required": true
},
{
"name": "certificate",
"type": "Certificate",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "isTrusted",
"type": "Boolean",
"collection": false,
"description": "Whether to consider the certificate as trusted",
"required": true
}
]
}
]
},
{
"name": "select-client-certificate",
"description": "Emitted when a client certificate is requested. The 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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
},
{
"name": "url",
"type": "URL",
"collection": false,
"required": true
},
{
"name": "certificateList",
"type": "Certificate",
"collection": true,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "certificate",
"type": "Certificate",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "login",
"description": "Emitted when webContents wants to do basic auth. The 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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
},
{
"name": "request",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "URL",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "URL",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "authInfo",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "isProxy",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "scheme",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "host",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "port",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "realm",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "username",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "password",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "gpu-process-crashed",
"description": "Emitted when the gpu process crashes or is killed.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "killed",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"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.",
"platforms": [
"macOS",
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "accessibilitySupportEnabled",
"type": "Boolean",
"collection": false,
"description": "`true` when Chrome's accessibility support is enabled, `false` otherwise.",
"required": true
}
]
},
{
"name": "session-created",
"description": "Emitted when Electron has created a new session.",
"returns": [
{
"name": "session",
"type": "Session",
"collection": false,
"required": true
}
]
},
{
"name": "second-instance",
"description": "This event will be emitted inside the primary instance of your application when a second instance has been executed. 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. This event is guaranteed to be emitted after the ready event of app gets emitted.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "argv",
"type": "String",
"collection": true,
"description": "An array of the second instance's command line arguments",
"required": true
},
{
"name": "workingDirectory",
"type": "String",
"collection": false,
"description": "The second instance's working directory",
"required": true
}
]
},
{
"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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
},
{
"name": "moduleName",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
},
{
"name": "globalName",
"type": "String",
"collection": false,
"required": true
}
]
}
],
"properties": [
{
"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.",
"type": "Boolean",
"collection": false
},
{
"name": "commandLine",
"type": "Object",
"required": true,
"properties": [
{
"name": "appendSwitch",
"signature": "(switch[, value])",
"description": "Append a switch (with optional value) to Chromium's command line. Note: This will not affect process.argv, and is mainly used by developers to control some low-level Chromium behaviors.",
"parameters": [
{
"name": "switch",
"type": "String",
"collection": false,
"description": "A command-line switch",
"required": true
},
{
"name": "value",
"type": "String",
"collection": false,
"description": "A value for the given switch",
"required": false
}
],
"type": "Function"
},
{
"name": "appendArgument",
"signature": "(value)",
"description": "Append an argument to Chromium's command line. The argument will be quoted correctly. Note: This will not affect process.argv.",
"parameters": [
{
"name": "value",
"type": "String",
"collection": false,
"description": "The argument to append to the command line",
"required": true
}
],
"type": "Function"
}
]
},
{
"name": "dock",
"type": "Object",
"required": true,
"properties": [
{
"name": "bounce",
"signature": "([type])",
"platforms": [
"macOS"
],
"description": "When critical is passed, the dock icon will bounce until either the application becomes active or the request is canceled. When 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.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Can be `critical` or `informational`. The default is `informational`",
"required": false,
"possibleValues": [
{
"value": "critical"
},
{
"value": "informational"
}
]
}
],
"returns": {
"type": "Integer",
"collection": false,
"description": "an ID representing the request."
},
"type": "Function"
},
{
"name": "cancelBounce",
"signature": "(id)",
"platforms": [
"macOS"
],
"description": "Cancel the bounce of id.",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
],
"type": "Function"
},
{
"name": "downloadFinished",
"signature": "(filePath)",
"platforms": [
"macOS"
],
"description": "Bounces the Downloads stack if the filePath is inside the Downloads folder.",
"parameters": [
{
"name": "filePath",
"type": "String",
"collection": false,
"required": true
}
],
"type": "Function"
},
{
"name": "setBadge",
"signature": "(text)",
"platforms": [
"macOS"
],
"description": "Sets the string to be displayed in the dock’s badging area.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
],
"type": "Function"
},
{
"name": "getBadge",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "String",
"collection": false,
"description": "The badge string of the dock."
},
"type": "Function"
},
{
"name": "hide",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Hides the dock icon.",
"type": "Function"
},
{
"name": "show",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Shows the dock icon.",
"type": "Function"
},
{
"name": "isVisible",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the dock icon is visible. The app.dock.show() call is asynchronous so this method might not return true immediately after that call."
},
"type": "Function"
},
{
"name": "setMenu",
"signature": "(menu)",
"platforms": [
"macOS"
],
"description": "Sets the application's dock menu.",
"parameters": [
{
"name": "menu",
"type": "Menu",
"collection": false,
"required": true
}
],
"type": "Function"
},
{
"name": "setIcon",
"signature": "(image)",
"platforms": [
"macOS"
],
"description": "Sets the image associated with this dock icon.",
"parameters": [
{
"name": "image",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"required": true
}
],
"type": "Function"
}
]
}
]
},
{
"name": "autoUpdater",
"description": "Enable apps to automatically update themselves.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "auto-updater",
"websiteUrl": "http://electronjs.org/docs/api/auto-updater",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/auto-updater.md",
"methods": [
{
"name": "setFeedURL",
"signature": "(options)",
"description": "Sets the url and initialize the auto updater.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "headers",
"type": "Object",
"collection": false,
"description": "HTTP request headers.",
"required": false,
"properties": []
},
{
"name": "serverType",
"type": "String",
"collection": false,
"description": "Either json or default, see the README for more information.",
"required": false
}
]
}
]
},
{
"name": "getFeedURL",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The current update feed URL."
}
},
{
"name": "checkForUpdates",
"signature": "()",
"description": "Asks the server whether there is an update. You must call setFeedURL before using this API."
},
{
"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. Under the hood calling autoUpdater.quitAndInstall() will close all application windows first, and automatically call app.quit() after all windows have been closed. 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."
}
],
"events": [
{
"name": "error",
"description": "Emitted when there is an error while updating.",
"returns": [
{
"name": "error",
"type": "Error",
"collection": false,
"required": true
}
]
},
{
"name": "checking-for-update",
"description": "Emitted when checking if an update has started."
},
{
"name": "update-available",
"description": "Emitted when there is an available update. The update is downloaded automatically."
},
{
"name": "update-not-available",
"description": "Emitted when there is no available update."
},
{
"name": "update-downloaded",
"description": "Emitted when an update has been downloaded. On Windows only releaseName is available. Note: It is not strictly necessary to handle this event. A successfully downloaded update will still be applied the next time the application starts.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "releaseNotes",
"type": "String",
"collection": false,
"required": true
},
{
"name": "releaseName",
"type": "String",
"collection": false,
"required": true
},
{
"name": "releaseDate",
"type": "Date",
"collection": false,
"required": true
},
{
"name": "updateURL",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "before-quit-for-update",
"description": "This event is emitted after a user calls quitAndInstall(). When 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."
}
]
},
{
"name": "BluetoothDevice",
"version": "4.0.3",
"type": "Structure",
"slug": "bluetooth-device",
"websiteUrl": "http://electronjs.org/docs/api/structures/bluetooth-device",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/bluetooth-device.md",
"properties": [
{
"name": "deviceName",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "deviceId",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "BrowserView",
"description": "Create and control views.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "browser-view",
"websiteUrl": "http://electronjs.org/docs/api/browser-view",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/browser-view.md",
"staticMethods": [
{
"name": "getAllViews",
"signature": "()",
"returns": {
"type": "BrowserView",
"collection": true,
"description": "An array of all opened BrowserViews."
}
},
{
"name": "fromWebContents",
"signature": "(webContents)",
"parameters": [
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
}
],
"returns": {
"type": [
{
"typeName": "BrowserView",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "The BrowserView that owns the given webContents or null if the contents are not owned by a BrowserView."
}
},
{
"name": "fromId",
"signature": "(id)",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "BrowserView",
"collection": false,
"description": "The view with the given id."
}
}
],
"constructorMethod": {
"signature": "([options])",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "webPreferences",
"type": "Object",
"collection": false,
"description": "See .",
"required": false,
"properties": []
}
]
}
]
},
"instanceName": "view",
"instanceMethods": [
{
"name": "destroy",
"signature": "()",
"description": "Force closing the view, the unload and beforeunload events won't be emitted for the web page. After you're done with a view, call this function in order to free memory and other resources as soon as possible."
},
{
"name": "isDestroyed",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the view is destroyed."
}
},
{
"name": "setAutoResize",
"signature": "(options)",
"platforms": [
"Experimental"
],
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "width",
"type": "Boolean",
"collection": false,
"description": "If true, the view's width will grow and shrink together with the window. false by default.",
"required": true
},
{
"name": "height",
"type": "Boolean",
"collection": false,
"description": "If true, the view's height will grow and shrink together with the window. false by default.",
"required": true
}
]
}
]
},
{
"name": "setBounds",
"signature": "(bounds)",
"platforms": [
"Experimental"
],
"description": "Resizes and moves the view to the supplied bounds relative to the window.",
"parameters": [
{
"name": "bounds",
"type": "Rectangle",
"collection": false,
"required": true
}
]
},
{
"name": "setBackgroundColor",
"signature": "(color)",
"platforms": [
"Experimental"
],
"parameters": [
{
"name": "color",
"type": "String",
"collection": false,
"description": "Color in `#aarrggbb` or `#argb` form. The alpha channel is optional.",
"required": true
}
]
}
],
"instanceProperties": [
{
"name": "webContents",
"description": "A WebContents object owned by this view.",
"type": "WebContents",
"collection": false
},
{
"name": "id",
"description": "A Integer representing the unique ID of the view.",
"type": "Integer",
"collection": false
}
]
},
{
"name": "BrowserWindow",
"description": "Create and control browser windows.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "browser-window",
"websiteUrl": "http://electronjs.org/docs/api/browser-window",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/browser-window.md",
"staticMethods": [
{
"name": "getAllWindows",
"signature": "()",
"returns": {
"type": "BrowserWindow",
"collection": true,
"description": "An array of all opened browser windows."
}
},
{
"name": "getFocusedWindow",
"signature": "()",
"returns": {
"type": [
{
"typeName": "BrowserWindow",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "The window that is focused in this application, otherwise returns null."
}
},
{
"name": "fromWebContents",
"signature": "(webContents)",
"parameters": [
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
}
],
"returns": {
"type": "BrowserWindow",
"collection": false,
"description": "The window that owns the given webContents."
}
},
{
"name": "fromBrowserView",
"signature": "(browserView)",
"parameters": [
{
"name": "browserView",
"type": "BrowserView",
"collection": false,
"required": true
}
],
"returns": {
"type": [
{
"typeName": "BrowserWindow",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "The window that owns the given browserView. If the given view is not attached to any window, returns null."
}
},
{
"name": "fromId",
"signature": "(id)",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "BrowserWindow",
"collection": false,
"description": "The window with the given id."
}
},
{
"name": "addExtension",
"signature": "(path)",
"description": "Adds Chrome extension located at path, and returns extension's name. The method will also not return if the extension's manifest is missing or incomplete. Note: This API cannot be called before the ready event of the app module is emitted.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "removeExtension",
"signature": "(name)",
"description": "Remove a Chrome extension by name. Note: This API cannot be called before the ready event of the app module is emitted.",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getExtensions",
"signature": "()",
"description": "Note: This API cannot be called before the ready event of the app module is emitted.",
"returns": {
"type": "Object",
"collection": false,
"description": "The keys are the extension names and each value is an Object containing name and version properties."
}
},
{
"name": "addDevToolsExtension",
"signature": "(path)",
"description": "Adds DevTools extension located at path, and returns extension's name. The 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. The method will also not return if the extension's manifest is missing or incomplete. Note: This API cannot be called before the ready event of the app module is emitted.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "removeDevToolsExtension",
"signature": "(name)",
"description": "Remove a DevTools extension by name. Note: This API cannot be called before the ready event of the app module is emitted.",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getDevToolsExtensions",
"signature": "()",
"description": "To check if a DevTools extension is installed you can run the following: Note: This API cannot be called before the ready event of the app module is emitted.",
"returns": {
"type": "Object",
"collection": false,
"description": "The keys are the extension names and each value is an Object containing name and version properties."
}
}
],
"constructorMethod": {
"signature": "([options])",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "width",
"type": "Integer",
"collection": false,
"description": "Window's width in pixels. Default is 800.",
"required": false
},
{
"name": "height",
"type": "Integer",
"collection": false,
"description": "Window's height in pixels. Default is 600.",
"required": false
},
{
"name": "x",
"type": "Integer",
"collection": false,
"description": "( if y is used) Window's left offset from screen. Default is to center the window.",
"required": false
},
{
"name": "y",
"type": "Integer",
"collection": false,
"description": "( if x is used) Window's top offset from screen. Default is to center the window.",
"required": false
},
{
"name": "useContentSize",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "center",
"type": "Boolean",
"collection": false,
"description": "Show window in the center of the screen.",
"required": false
},
{
"name": "minWidth",
"type": "Integer",
"collection": false,
"description": "Window's minimum width. Default is 0.",
"required": false
},
{
"name": "minHeight",
"type": "Integer",
"collection": false,
"description": "Window's minimum height. Default is 0.",
"required": false
},
{
"name": "maxWidth",
"type": "Integer",
"collection": false,
"description": "Window's maximum width. Default is no limit.",
"required": false
},
{
"name": "maxHeight",
"type": "Integer",
"collection": false,
"description": "Window's maximum height. Default is no limit.",
"required": false
},
{
"name": "resizable",
"type": "Boolean",
"collection": false,
"description": "Whether window is resizable. Default is true.",
"required": false
},
{
"name": "movable",
"type": "Boolean",
"collection": false,
"description": "Whether window is movable. This is not implemented on Linux. Default is true.",
"required": false
},
{
"name": "minimizable",
"type": "Boolean",
"collection": false,
"description": "Whether window is minimizable. This is not implemented on Linux. Default is true.",
"required": false
},
{
"name": "maximizable",
"type": "Boolean",
"collection": false,
"description": "Whether window is maximizable. This is not implemented on Linux. Default is true.",
"required": false
},
{
"name": "closable",
"type": "Boolean",
"collection": false,
"description": "Whether window is closable. This is not implemented on Linux. Default is true.",
"required": false
},
{
"name": "focusable",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "alwaysOnTop",
"type": "Boolean",
"collection": false,
"description": "Whether the window should always stay on top of other windows. Default is false.",
"required": false
},
{
"name": "fullscreen",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "fullscreenable",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "simpleFullscreen",
"type": "Boolean",
"collection": false,
"description": "Use pre-Lion fullscreen on macOS. Default is false.",
"required": false
},
{
"name": "skipTaskbar",
"type": "Boolean",
"collection": false,
"description": "Whether to show the window in taskbar. Default is false.",
"required": false
},
{
"name": "kiosk",
"type": "Boolean",
"collection": false,
"description": "The kiosk mode. Default is false.",
"required": false
},
{
"name": "title",
"type": "String",
"collection": false,
"description": "Default window title. Default is \"Electron\".",
"required": false
},
{
"name": "icon",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"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
},
{
"name": "show",
"type": "Boolean",
"collection": false,
"description": "Whether window should be shown when created. Default is true.",
"required": false
},
{
"name": "frame",
"type": "Boolean",
"collection": false,
"description": "Specify false to create a . Default is true.",
"required": false
},
{
"name": "parent",
"type": "BrowserWindow",
"collection": false,
"description": "Specify parent window. Default is null.",
"required": false
},
{
"name": "modal",
"type": "Boolean",
"collection": false,
"description": "Whether this is a modal window. This only works when the window is a child window. Default is false.",
"required": false
},
{
"name": "acceptFirstMouse",
"type": "Boolean",
"collection": false,
"description": "Whether the web view accepts a single mouse-down event that simultaneously activates the window. Default is false.",
"required": false
},
{
"name": "disableAutoHideCursor",
"type": "Boolean",
"collection": false,
"description": "Whether to hide cursor when typing. Default is false.",
"required": false
},
{
"name": "autoHideMenuBar",
"type": "Boolean",
"collection": false,
"description": "Auto hide the menu bar unless the Alt key is pressed. Default is false.",
"required": false
},
{
"name": "enableLargerThanScreen",
"type": "Boolean",
"collection": false,
"description": "Enable the window to be resized larger than screen. Default is false.",
"required": false
},
{
"name": "backgroundColor",
"type": "String",
"collection": false,
"description": "Window's background color as a hexadecimal value, like #66CD00 or #FFF or #80FFFFFF (alpha is supported if transparent is set to true). Default is #FFF (white).",
"required": false
},
{
"name": "hasShadow",
"type": "Boolean",
"collection": false,
"description": "Whether window should have a shadow. This is only implemented on macOS. Default is true.",
"required": false
},
{
"name": "opacity",
"type": "Number",
"collection": false,
"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
},
{
"name": "darkTheme",
"type": "Boolean",
"collection": false,
"description": "Forces using dark theme for the window, only works on some GTK+3 desktop environments. Default is false.",
"required": false
},
{
"name": "transparent",
"type": "Boolean",
"collection": false,
"description": "Makes the window . Default is false.",
"required": false
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "The type of window, default is normal window. See more about this below.",
"required": false
},
{
"name": "titleBarStyle",
"type": "String",
"collection": false,
"description": "The style of window title bar. Default is default. Possible values are:",
"required": false,
"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": ""
}
]
},
{
"name": "fullscreenWindowTitle",
"type": "Boolean",
"collection": false,
"description": "Shows the title in the title bar in full screen mode on macOS for all titleBarStyle options. Default is false.",
"required": false
},
{
"name": "thickFrame",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "vibrancy",
"type": "String",
"collection": false,
"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 or ultra-dark. Please note that using frame: false in combination with a vibrancy value requires that you use a non-default titleBarStyle as well.",
"required": false,
"possibleValues": [
{
"value": "appearance-based"
},
{
"value": "light"
},
{
"value": "dark"
},
{
"value": "titlebar"
},
{
"value": "selection"
},
{
"value": "menu"
},
{
"value": "popover"
},
{
"value": "sidebar"
},
{
"value": "medium-light"
},
{
"value": "ultra-dark"
}
]
},
{
"name": "zoomToPageWidth",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "tabbingIdentifier",
"type": "String",
"collection": false,
"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
},
{
"name": "webPreferences",
"type": "Object",
"collection": false,
"description": "Settings of web page's features.",
"required": false,
"properties": [
{
"name": "devTools",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "nodeIntegration",
"type": "Boolean",
"collection": false,
"description": "Whether node integration is enabled. Default is true.",
"required": false
},
{
"name": "nodeIntegrationInWorker",
"type": "Boolean",
"collection": false,
"description": "Whether node integration is enabled in web workers. Default is false. More about this can be found in .",
"required": false
},
{
"name": "preload",
"type": "String",
"collection": false,
"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 .",
"required": false
},
{
"name": "sandbox",
"type": "Boolean",
"collection": false,
"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 . This option is currently experimental and may change or be removed in future Electron releases.",
"required": false
},
{
"name": "enableRemoteModule",
"type": "Boolean",
"collection": false,
"description": "Whether to enable the module. Default is true.",
"required": false
},
{
"name": "session",
"type": "Session",
"collection": false,
"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
},
{
"name": "partition",
"type": "String",
"collection": false,
"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
},
{
"name": "affinity",
"type": "String",
"collection": false,
"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.",
"required": false
},
{
"name": "zoomFactor",
"type": "Number",
"collection": false,
"description": "The default zoom factor of the page, 3.0 represents 300%. Default is 1.0.",
"required": false
},
{
"name": "javascript",
"type": "Boolean",
"collection": false,
"description": "Enables JavaScript support. Default is true.",
"required": false
},
{
"name": "webSecurity",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "allowRunningInsecureContent",
"type": "Boolean",
"collection": false,
"description": "Allow an https page to run JavaScript, CSS or plugins from http URLs. Default is false.",
"required": false
},
{
"name": "images",
"type": "Boolean",
"collection": false,
"description": "Enables image support. Default is true.",
"required": false
},
{
"name": "textAreasAreResizable",
"type": "Boolean",
"collection": false,
"description": "Make TextArea elements resizable. Default is true.",
"required": false
},
{
"name": "webgl",
"type": "Boolean",
"collection": false,
"description": "Enables WebGL support. Default is true.",
"required": false
},
{
"name": "webaudio",
"type": "Boolean",
"collection": false,
"description": "Enables WebAudio support. Default is true.",
"required": false
},
{
"name": "plugins",
"type": "Boolean",
"collection": false,
"description": "Whether plugins should be enabled. Default is false.",
"required": false
},
{
"name": "experimentalFeatures",
"type": "Boolean",
"collection": false,
"description": "Enables Chromium's experimental features. Default is false.",
"required": false
},
{
"name": "scrollBounce",
"type": "Boolean",
"collection": false,
"description": "Enables scroll bounce (rubber banding) effect on macOS. Default is false.",
"required": false
},
{
"name": "enableBlinkFeatures",
"type": "String",
"collection": false,
"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 file.",
"required": false
},
{
"name": "disableBlinkFeatures",
"type": "String",
"collection": false,
"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 file.",
"required": false
},
{
"name": "defaultFontFamily",
"type": "Object",
"collection": false,
"description": "Sets the default font for the font-family.",
"required": false,
"properties": [
{
"name": "standard",
"type": "String",
"collection": false,
"description": "Defaults to Times New Roman.",
"required": false
},
{
"name": "serif",
"type": "String",
"collection": false,
"description": "Defaults to Times New Roman.",
"required": false
},
{
"name": "sansSerif",
"type": "String",
"collection": false,
"description": "Defaults to Arial.",
"required": false
},
{
"name": "monospace",
"type": "String",
"collection": false,
"description": "Defaults to Courier New.",
"required": false
},
{
"name": "cursive",
"type": "String",
"collection": false,
"description": "Defaults to Script.",
"required": false
},
{
"name": "fantasy",
"type": "String",
"collection": false,
"description": "Defaults to Impact.",
"required": false
}
]
},
{
"name": "defaultFontSize",
"type": "Integer",
"collection": false,
"description": "Defaults to 16.",
"required": false
},
{
"name": "defaultMonospaceFontSize",
"type": "Integer",
"collection": false,
"description": "Defaults to 13.",
"required": false
},
{
"name": "minimumFontSize",
"type": "Integer",
"collection": false,
"description": "Defaults to 0.",
"required": false
},
{
"name": "defaultEncoding",
"type": "String",
"collection": false,
"description": "Defaults to ISO-8859-1.",
"required": false
},
{
"name": "backgroundThrottling",
"type": "Boolean",
"collection": false,
"description": "Whether to throttle animations and timers when the page becomes background. This also affects the . Defaults to true.",
"required": false
},
{
"name": "offscreen",
"type": "Boolean",
"collection": false,
"description": "Whether to enable offscreen rendering for the browser window. Defaults to false. See the for more details.",
"required": false
},
{
"name": "contextIsolation",
"type": "Boolean",
"collection": false,
"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 still have full access to the document and window globals but it will use its own set of JavaScript builtins (Array, Object, JSON, etc.) and will be isolated from any changes made to the global environment by the loaded page. 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 . 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
},
{
"name": "nativeWindowOpen",
"type": "Boolean",
"collection": false,
"description": "Whether to use native window.open(). If set to true, the webPreferences of child window will always be the same with parent window, regardless of the parameters passed to window.open(). Defaults to false. This option is currently experimental.",
"required": false
},
{
"name": "webviewTag",
"type": "Boolean",
"collection": false,
"description": "Whether to enable the . Defaults to the value of the nodeIntegration option. 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 to strip away the preload script and to validate or alter the 's initial settings.",
"required": false
},
{
"name": "additionalArguments",
"type": "String",
"collection": true,
"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
},
{
"name": "safeDialogs",
"type": "Boolean",
"collection": false,
"description": "Whether to enable browser style consecutive dialog protection. Default is false.",
"required": false
},
{
"name": "safeDialogsMessage",
"type": "String",
"collection": false,
"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
},
{
"name": "navigateOnDragDrop",
"type": "Boolean",
"collection": false,
"description": "Whether dragging and dropping a file or link onto the page causes a navigation. Default is false.",
"required": false
}
]
}
]
}
]
},
"instanceName": "win",
"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."
},
{
"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."
},
{
"name": "focus",
"signature": "()",
"description": "Focuses on the window."
},
{
"name": "blur",
"signature": "()",
"description": "Removes focus from the window."
},
{
"name": "isFocused",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is focused."
}
},
{
"name": "isDestroyed",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is destroyed."
}
},
{
"name": "show",
"signature": "()",
"description": "Shows and gives focus to the window."
},
{
"name": "showInactive",
"signature": "()",
"description": "Shows the window but doesn't focus on it."
},
{
"name": "hide",
"signature": "()",
"description": "Hides the window."
},
{
"name": "isVisible",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is visible to the user."
}
},
{
"name": "isModal",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether current window is a modal window."
}
},
{
"name": "maximize",
"signature": "()",
"description": "Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already."
},
{
"name": "unmaximize",
"signature": "()",
"description": "Unmaximizes the window."
},
{
"name": "isMaximized",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is maximized."
}
},
{
"name": "minimize",
"signature": "()",
"description": "Minimizes the window. On some platforms the minimized window will be shown in the Dock."
},
{
"name": "restore",
"signature": "()",
"description": "Restores the window from minimized state to its previous state."
},
{
"name": "isMinimized",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is minimized."
}
},
{
"name": "setFullScreen",
"signature": "(flag)",
"description": "Sets whether the window should be in fullscreen mode.",
"parameters": [
{
"name": "flag",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isFullScreen",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is in fullscreen mode."
}
},
{
"name": "setSimpleFullScreen",
"signature": "(flag)",
"platforms": [
"macOS"
],
"description": "Enters or leaves simple fullscreen mode. Simple fullscreen mode emulates the native fullscreen behavior found in versions of Mac OS X prior to Lion (10.7).",
"parameters": [
{
"name": "flag",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isSimpleFullScreen",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is in simple (pre-Lion) fullscreen mode."
}
},
{
"name": "isNormal",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode)."
}
},
{
"name": "setAspectRatio",
"signature": "(aspectRatio[, extraSize])",
"platforms": [
"macOS"
],
"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. Consider 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 [ 40, 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. Calling this function with a value of 0 will remove any previously set aspect ratios.",
"parameters": [
{
"name": "aspectRatio",
"type": "Float",
"collection": false,
"description": "The aspect ratio to maintain for some portion of the content view.",
"required": true
},
{
"name": "extraSize",
"type": "Size",
"collection": false,
"description": "The extra size not to be included while maintaining the aspect ratio.",
"required": true
}
]
},
{
"name": "setBackgroundColor",
"signature": "(backgroundColor)",
"description": "Sets the background color of the window. See Setting backgroundColor.",
"parameters": [
{
"name": "backgroundColor",
"type": "String",
"collection": false,
"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
}
]
},
{
"name": "previewFile",
"signature": "(path[, displayName])",
"platforms": [
"macOS"
],
"description": "Uses Quick Look to preview a file at a given path.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"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
},
{
"name": "displayName",
"type": "String",
"collection": false,
"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
}
]
},
{
"name": "closeFilePreview",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Closes the currently open Quick Look panel."
},
{
"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",
"type": "Rectangle",
"collection": false,
"required": true
},
{
"name": "animate",
"type": "Boolean",
"collection": false,
"required": false
}
]
},
{
"name": "getBounds",
"signature": "()",
"returns": {
"type": "Rectangle",
"collection": false
}
},
{
"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",
"type": "Rectangle",
"collection": false,
"required": true
},
{
"name": "animate",
"type": "Boolean",
"collection": false,
"required": false
}
]
},
{
"name": "getContentBounds",
"signature": "()",
"returns": {
"type": "Rectangle",
"collection": false
}
},
{
"name": "getNormalBounds",
"signature": "()",
"description": "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.",
"returns": {
"type": "Rectangle",
"collection": false,
"description": "Contains the window bounds of the normal state"
}
},
{
"name": "setEnabled",
"signature": "(enable)",
"description": "Disable or enable the window.",
"parameters": [
{
"name": "enable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"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",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "height",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "animate",
"type": "Boolean",
"collection": false,
"required": false
}
]
},
{
"name": "getSize",
"signature": "()",
"returns": {
"type": "Integer",
"collection": true,
"description": "Contains the window's width and height."
}
},
{
"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",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "height",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "animate",
"type": "Boolean",
"collection": false,
"required": false
}
]
},
{
"name": "getContentSize",
"signature": "()",
"returns": {
"type": "Integer",
"collection": true,
"description": "Contains the window's client area's width and height."
}
},
{
"name": "setMinimumSize",
"signature": "(width, height)",
"description": "Sets the minimum size of window to width and height.",
"parameters": [
{
"name": "width",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "height",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "getMinimumSize",
"signature": "()",
"returns": {
"type": "Integer",
"collection": true,
"description": "Contains the window's minimum width and height."
}
},
{
"name": "setMaximumSize",
"signature": "(width, height)",
"description": "Sets the maximum size of window to width and height.",
"parameters": [
{
"name": "width",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "height",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "getMaximumSize",
"signature": "()",
"returns": {
"type": "Integer",
"collection": true,
"description": "Contains the window's maximum width and height."
}
},
{
"name": "setResizable",
"signature": "(resizable)",
"description": "Sets whether the window can be manually resized by user.",
"parameters": [
{
"name": "resizable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isResizable",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window can be manually resized by user."
}
},
{
"name": "setMovable",
"signature": "(movable)",
"platforms": [
"macOS",
"Windows"
],
"description": "Sets whether the window can be moved by user. On Linux does nothing.",
"parameters": [
{
"name": "movable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isMovable",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "On Linux always returns true.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window can be moved by user."
}
},
{
"name": "setMinimizable",
"signature": "(minimizable)",
"platforms": [
"macOS",
"Windows"
],
"description": "Sets whether the window can be manually minimized by user. On Linux does nothing.",
"parameters": [
{
"name": "minimizable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isMinimizable",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "On Linux always returns true.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window can be manually minimized by user"
}
},
{
"name": "setMaximizable",
"signature": "(maximizable)",
"platforms": [
"macOS",
"Windows"
],
"description": "Sets whether the window can be manually maximized by user. On Linux does nothing.",
"parameters": [
{
"name": "maximizable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isMaximizable",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "On Linux always returns true.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window can be manually maximized by user."
}
},
{
"name": "setFullScreenable",
"signature": "(fullscreenable)",
"description": "Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.",
"parameters": [
{
"name": "fullscreenable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isFullScreenable",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window."
}
},
{
"name": "setClosable",
"signature": "(closable)",
"platforms": [
"macOS",
"Windows"
],
"description": "Sets whether the window can be manually closed by user. On Linux does nothing.",
"parameters": [
{
"name": "closable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isClosable",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "On Linux always returns true.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window can be manually closed by user."
}
},
{
"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",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "level",
"type": "String",
"collection": false,
"description": "Values include `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, `screen-saver`, and (Deprecated). The default is `floating`. See the for more details.",
"required": false,
"possibleValues": [
{
"value": "normal"
},
{
"value": "floating"
},
{
"value": "torn-off-menu"
},
{
"value": "modal-panel"
},
{
"value": "main-menu"
},
{
"value": "status"
},
{
"value": "pop-up-menu"
},
{
"value": "screen-saver"
}
]
},
{
"name": "relativeLevel",
"type": "Integer",
"collection": false,
"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
}
]
},
{
"name": "isAlwaysOnTop",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is always on top of other windows."
}
},
{
"name": "moveTop",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "Moves window to top(z-order) regardless of focus"
},
{
"name": "center",
"signature": "()",
"description": "Moves window to the center of the screen."
},
{
"name": "setPosition",
"signature": "(x, y[, animate])",
"description": "Moves window to x and y.",
"parameters": [
{
"name": "x",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "y",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "animate",
"type": "Boolean",
"collection": false,
"required": false
}
]
},
{
"name": "getPosition",
"signature": "()",
"returns": {
"type": "Integer",
"collection": true,
"description": "Contains the window's current position."
}
},
{
"name": "setTitle",
"signature": "(title)",
"description": "Changes the title of native window to title.",
"parameters": [
{
"name": "title",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getTitle",
"signature": "()",
"description": "Note: The title of web page can be different from the title of the native window.",
"returns": {
"type": "String",
"collection": false,
"description": "The title of the native window."
}
},
{
"name": "setSheetOffset",
"signature": "(offsetY[, offsetX])",
"platforms": [
"macOS"
],
"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",
"type": "Float",
"collection": false,
"required": true
},
{
"name": "offsetX",
"type": "Float",
"collection": false,
"required": false
}
]
},
{
"name": "flashFrame",
"signature": "(flag)",
"description": "Starts or stops flashing the window to attract user's attention.",
"parameters": [
{
"name": "flag",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "setSkipTaskbar",
"signature": "(skip)",
"description": "Makes the window not show in the taskbar.",
"parameters": [
{
"name": "skip",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "setKiosk",
"signature": "(flag)",
"description": "Enters or leaves the kiosk mode.",
"parameters": [
{
"name": "flag",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isKiosk",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is in kiosk mode."
}
},
{
"name": "getNativeWindowHandle",
"signature": "()",
"description": "The native type of the handle is HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux.",
"returns": {
"type": "Buffer",
"collection": false,
"description": "The platform-specific handle of the window."
}
},
{
"name": "hookWindowMessage",
"signature": "(message, callback)",
"platforms": [
"Windows"
],
"description": "Hooks a windows message. The callback is called when the message is received in the WndProc.",
"parameters": [
{
"name": "message",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "isWindowMessageHooked",
"signature": "(message)",
"platforms": [
"Windows"
],
"parameters": [
{
"name": "message",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "true or false depending on whether the message is hooked."
}
},
{
"name": "unhookWindowMessage",
"signature": "(message)",
"platforms": [
"Windows"
],
"description": "Unhook the window message.",
"parameters": [
{
"name": "message",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "unhookAllWindowMessages",
"signature": "()",
"platforms": [
"Windows"
],
"description": "Unhooks all of the window messages."
},
{
"name": "setRepresentedFilename",
"signature": "(filename)",
"platforms": [
"macOS"
],
"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",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getRepresentedFilename",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "String",
"collection": false,
"description": "The pathname of the file the window represents."
}
},
{
"name": "setDocumentEdited",
"signature": "(edited)",
"platforms": [
"macOS"
],
"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",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isDocumentEdited",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window's document has been edited."
}
},
{
"name": "focusOnWebView",
"signature": "()"
},
{
"name": "blurWebView",
"signature": "()"
},
{
"name": "capturePage",
"signature": "([rect, ]callback)",
"description": "Same as webContents.capturePage([rect, ]callback).",
"parameters": [
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"description": "The bounds to capture",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "image",
"type": "NativeImage",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "loadURL",
"signature": "(url[, options])",
"description": "Same as webContents.loadURL(url[, options]). The url can be a remote address (e.g. http://) or a path to a local HTML file using the file:// protocol. To ensure that file URLs are properly formatted, it is recommended to use Node's url.format method: You can load a URL using a POST request with URL-encoded data by doing the following:",
"parameters": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "httpReferrer",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Referrer",
"collection": false
}
],
"collection": false,
"description": "An HTTP Referrer url.",
"required": false
},
{
"name": "userAgent",
"type": "String",
"collection": false,
"description": "A user agent originating the request.",
"required": false
},
{
"name": "extraHeaders",
"type": "String",
"collection": false,
"description": "Extra headers separated by \"\\n\"",
"required": false
},
{
"name": "postData",
"type": [
{
"typeName": "UploadRawData",
"collection": true
},
{
"typeName": "UploadFile",
"collection": true
},
{
"typeName": "UploadBlob",
"collection": true
}
],
"collection": false,
"description": "",
"required": false
},
{
"name": "baseURLForDataURL",
"type": "String",
"collection": false,
"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
}
]
}
]
},
{
"name": "loadFile",
"signature": "(filePath[, options])",
"description": "Same 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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "query",
"type": "Object",
"collection": false,
"description": "Passed to url.format().",
"required": false,
"properties": []
},
{
"name": "search",
"type": "String",
"collection": false,
"description": "Passed to url.format().",
"required": false
},
{
"name": "hash",
"type": "String",
"collection": false,
"description": "Passed to url.format().",
"required": false
}
]
}
]
},
{
"name": "reload",
"signature": "()",
"description": "Same as webContents.reload."
},
{
"name": "setMenu",
"signature": "(menu)",
"platforms": [
"Linux",
"Windows"
],
"description": "Sets the menu as the window's menu bar, setting it to null will remove the menu bar.",
"parameters": [
{
"name": "menu",
"type": [
{
"typeName": "Menu",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true
}
]
},
{
"name": "setProgressBar",
"signature": "(progress[, options])",
"description": "Sets progress value in progress bar. Valid range is [0, 1.0]. Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1. On 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.getName().desktop. On 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",
"type": "Double",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "mode",
"type": "String",
"collection": false,
"description": "Mode for the progress bar. Can be none, normal, indeterminate, error or paused.",
"required": true,
"possibleValues": [
{
"value": "none"
},
{
"value": "normal"
},
{
"value": "indeterminate"
},
{
"value": "error"
},
{
"value": "paused"
}
]
}
]
}
]
},
{
"name": "setOverlayIcon",
"signature": "(overlay, description)",
"platforms": [
"Windows"
],
"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",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"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
},
{
"name": "description",
"type": "String",
"collection": false,
"description": "a description that will be provided to Accessibility screen readers",
"required": true
}
]
},
{
"name": "setHasShadow",
"signature": "(hasShadow)",
"platforms": [
"macOS"
],
"description": "Sets whether the window should have a shadow. On Windows and Linux does nothing.",
"parameters": [
{
"name": "hasShadow",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "hasShadow",
"signature": "()",
"platforms": [
"macOS"
],
"description": "On Windows and Linux always returns true.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window has a shadow."
}
},
{
"name": "setOpacity",
"signature": "(opacity)",
"platforms": [
"Windows",
"macOS"
],
"description": "Sets the opacity of the window. On Linux does nothing.",
"parameters": [
{
"name": "opacity",
"type": "Number",
"collection": false,
"description": "between 0.0 (fully transparent) and 1.0 (fully opaque)",
"required": true
}
]
},
{
"name": "getOpacity",
"signature": "()",
"platforms": [
"Windows",
"macOS"
],
"returns": {
"type": "Number",
"collection": false,
"description": "between 0.0 (fully transparent) and 1.0 (fully opaque)"
}
},
{
"name": "setShape",
"signature": "(rects)",
"platforms": [
"Windows",
"Linux",
"Experimental"
],
"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",
"type": "Rectangle",
"collection": true,
"description": "Sets a shape on the window. Passing an empty list reverts the window to being rectangular.",
"required": true
}
]
},
{
"name": "setThumbarButtons",
"signature": "(buttons)",
"platforms": [
"Windows"
],
"description": "Add 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. The 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. The buttons is an array of Button objects: The flags is an array that can include following Strings:",
"parameters": [
{
"name": "buttons",
"type": "ThumbarButton",
"collection": true,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the buttons were added successfully"
}
},
{
"name": "setThumbnailClip",
"signature": "(region)",
"platforms": [
"Windows"
],
"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",
"type": "Rectangle",
"collection": false,
"description": "Region of the window",
"required": true
}
]
},
{
"name": "setThumbnailToolTip",
"signature": "(toolTip)",
"platforms": [
"Windows"
],
"description": "Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar.",
"parameters": [
{
"name": "toolTip",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "setAppDetails",
"signature": "(options)",
"platforms": [
"Windows"
],
"description": "Sets the properties for the window's taskbar button. 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",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "appId",
"type": "String",
"collection": false,
"description": "Window's . It has to be set, otherwise the other options will have no effect.",
"required": false
},
{
"name": "appIconPath",
"type": "String",
"collection": false,
"description": "Window's .",
"required": false
},
{
"name": "appIconIndex",
"type": "Integer",
"collection": false,
"description": "Index of the icon in appIconPath. Ignored when appIconPath is not set. Default is 0.",
"required": false
},
{
"name": "relaunchCommand",
"type": "String",
"collection": false,
"description": "Window's .",
"required": false
},
{
"name": "relaunchDisplayName",
"type": "String",
"collection": false,
"description": "Window's .",
"required": false
}
]
}
]
},
{
"name": "showDefinitionForSelection",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Same as webContents.showDefinitionForSelection()."
},
{
"name": "setIcon",
"signature": "(icon)",
"platforms": [
"Windows",
"Linux"
],
"description": "Changes window icon.",
"parameters": [
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"required": true
}
]
},
{
"name": "setWindowButtonVisibility",
"signature": "(visible)",
"platforms": [
"macOS"
],
"description": "Sets whether the window traffic light buttons should be visible. This cannot be called when titleBarStyle is set to customButtonsOnHover.",
"parameters": [
{
"name": "visible",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"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. If the menu bar is already visible, calling setAutoHideMenuBar(true) won't hide it immediately.",
"parameters": [
{
"name": "hide",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isMenuBarAutoHide",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether menu bar automatically hides itself."
}
},
{
"name": "setMenuBarVisibility",
"signature": "(visible)",
"platforms": [
"Windows",
"Linux"
],
"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",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isMenuBarVisible",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the menu bar is visible."
}
},
{
"name": "setVisibleOnAllWorkspaces",
"signature": "(visible[, options])",
"description": "Sets whether the window should be visible on all workspaces. Note: This API does nothing on Windows.",
"parameters": [
{
"name": "visible",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "visibleOnFullScreen",
"type": "Boolean",
"collection": false,
"description": "Sets whether the window should be visible above fullscreen windows",
"required": false
}
]
}
]
},
{
"name": "isVisibleOnAllWorkspaces",
"signature": "()",
"description": "Note: This API always returns false on Windows.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the window is visible on all workspaces."
}
},
{
"name": "setIgnoreMouseEvents",
"signature": "(ignore[, options])",
"description": "Makes the window ignore all mouse events. All 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",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "forward",
"type": "Boolean",
"collection": false,
"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
}
]
}
]
},
{
"name": "setContentProtection",
"signature": "(enable)",
"platforms": [
"macOS",
"Windows"
],
"description": "Prevents the window contents from being captured by other apps. On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with WDA_MONITOR.",
"parameters": [
{
"name": "enable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "setFocusable",
"signature": "(focusable)",
"platforms": [
"Windows"
],
"description": "Changes whether the window can be focused.",
"parameters": [
{
"name": "focusable",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "setParentWindow",
"signature": "(parent)",
"platforms": [
"Linux",
"macOS"
],
"description": "Sets parent as current window's parent window, passing null will turn current window into a top-level window.",
"parameters": [
{
"name": "parent",
"type": "BrowserWindow",
"collection": false,
"required": true
}
]
},
{
"name": "getParentWindow",
"signature": "()",
"returns": {
"type": "BrowserWindow",
"collection": false,
"description": "The parent window."
}
},
{
"name": "getChildWindows",
"signature": "()",
"returns": {
"type": "BrowserWindow",
"collection": true,
"description": "All child windows."
}
},
{
"name": "setAutoHideCursor",
"signature": "(autoHide)",
"platforms": [
"macOS"
],
"description": "Controls whether to hide cursor when typing.",
"parameters": [
{
"name": "autoHide",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "selectPreviousTab",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Selects the previous tab when native tabs are enabled and there are other tabs in the window."
},
{
"name": "selectNextTab",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Selects the next tab when native tabs are enabled and there are other tabs in the window."
},
{
"name": "mergeAllWindows",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window."
},
{
"name": "moveTabToNewWindow",
"signature": "()",
"platforms": [
"macOS"
],
"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."
},
{
"name": "toggleTabBar",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window."
},
{
"name": "addTabbedWindow",
"signature": "(browserWindow)",
"platforms": [
"macOS"
],
"description": "Adds a window as a tab on this window, after the tab for the window instance.",
"parameters": [
{
"name": "browserWindow",
"type": "BrowserWindow",
"collection": false,
"required": true
}
]
},
{
"name": "setVibrancy",
"signature": "(type)",
"platforms": [
"macOS"
],
"description": "Adds a vibrancy effect to the browser window. Passing null or an empty string will remove the vibrancy effect on the window.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. See the for more details.",
"required": true,
"possibleValues": [
{
"value": "appearance-based"
},
{
"value": "light"
},
{
"value": "dark"
},
{
"value": "titlebar"
},
{
"value": "selection"
},
{
"value": "menu"
},
{
"value": "popover"
},
{
"value": "sidebar"
},
{
"value": "medium-light"
},
{
"value": "ultra-dark"
}
]
}
]
},
{
"name": "setTouchBar",
"signature": "(touchBar)",
"platforms": [
"macOS",
"Experimental"
],
"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+. Note: The TouchBar API is currently experimental and may change or be removed in future Electron releases.",
"parameters": [
{
"name": "touchBar",
"type": "TouchBar",
"collection": false,
"required": true
}
]
},
{
"name": "setBrowserView",
"signature": "(browserView)",
"platforms": [
"Experimental"
],
"parameters": [
{
"name": "browserView",
"type": "BrowserView",
"collection": false,
"required": true
}
]
},
{
"name": "getBrowserView",
"signature": "()",
"platforms": [
"Experimental"
],
"description": "Note: The BrowserView API is currently experimental and may change or be removed in future Electron releases.",
"returns": {
"type": [
{
"typeName": "BrowserView",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "an attached BrowserView. Returns null if none is attached."
}
}
],
"instanceProperties": [
{
"name": "webContents",
"description": "A WebContents object this window owns. All web page related events and operations will be done via it. See the webContents documentation for its methods and events.",
"type": "WebContents",
"collection": false
},
{
"name": "id",
"description": "A Integer representing the unique ID of the window.",
"type": "Integer",
"collection": false
}
],
"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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "title",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"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. Usually 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: 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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"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."
},
{
"name": "session-end",
"description": "Emitted when window session is going to end due to force shutdown or machine restart or session log off.",
"platforms": [
"Windows"
]
},
{
"name": "unresponsive",
"description": "Emitted when the web page becomes unresponsive."
},
{
"name": "responsive",
"description": "Emitted when the unresponsive web page becomes responsive again."
},
{
"name": "blur",
"description": "Emitted when the window loses focus."
},
{
"name": "focus",
"description": "Emitted when the window gains focus."
},
{
"name": "show",
"description": "Emitted when the window is shown."
},
{
"name": "hide",
"description": "Emitted when the window is hidden."
},
{
"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."
},
{
"name": "maximize",
"description": "Emitted when window is maximized."
},
{
"name": "unmaximize",
"description": "Emitted when the window exits from a maximized state."
},
{
"name": "minimize",
"description": "Emitted when the window is minimized."
},
{
"name": "restore",
"description": "Emitted when the window is restored from a minimized state."
},
{
"name": "will-resize",
"description": "Emitted before the window is resized. Calling event.preventDefault() will prevent the window from being resized. Note that this is only emitted when the window is being resized manually. Resizing the window with setBounds/setSize will not emit this event.",
"platforms": [
"macOS",
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "newBounds",
"type": "Rectangle",
"collection": false,
"description": "` Size the window is being resized to.",
"required": true
}
]
},
{
"name": "resize",
"description": "Emitted after the window has been resized."
},
{
"name": "will-move",
"description": "Emitted before the window is moved. Calling event.preventDefault() will prevent the window from being moved. Note that this is only emitted when the window is being resized manually. Resizing the window with setBounds/setSize will not emit this event.",
"platforms": [
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "newBounds",
"type": "Rectangle",
"collection": false,
"description": "` Location the window is being moved to.",
"required": true
}
]
},
{
"name": "move",
"description": "Emitted when the window is being moved to a new position. Note: On macOS this event is an alias of moved."
},
{
"name": "moved",
"description": "Emitted once when the window is moved to a new position.",
"platforms": [
"macOS"
]
},
{
"name": "enter-full-screen",
"description": "Emitted when the window enters a full-screen state."
},
{
"name": "leave-full-screen",
"description": "Emitted when the window leaves a full-screen state."
},
{
"name": "enter-html-full-screen",
"description": "Emitted when the window enters a full-screen state triggered by HTML API."
},
{
"name": "leave-html-full-screen",
"description": "Emitted when the window leaves a full-screen state triggered by HTML API."
},
{
"name": "always-on-top-changed",
"description": "Emitted when the window is set or unset to show always on top of other windows.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "isAlwaysOnTop",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"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. Commands are lowercased, underscores are replaced with hyphens, and the APPCOMMAND_ prefix is stripped off. e.g. APPCOMMAND_BROWSER_BACKWARD is emitted as browser-backward.",
"platforms": [
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "command",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "scroll-touch-begin",
"description": "Emitted when scroll wheel event phase has begun.",
"platforms": [
"macOS"
]
},
{
"name": "scroll-touch-end",
"description": "Emitted when scroll wheel event phase has ended.",
"platforms": [
"macOS"
]
},
{
"name": "scroll-touch-edge",
"description": "Emitted when scroll wheel event phase filed upon reaching the edge of element.",
"platforms": [
"macOS"
]
},
{
"name": "swipe",
"description": "Emitted on 3-finger swipe. Possible directions are up, right, down, left.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "direction",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "sheet-begin",
"description": "Emitted when the window opens a sheet.",
"platforms": [
"macOS"
]
},
{
"name": "sheet-end",
"description": "Emitted when the window has closed a sheet.",
"platforms": [
"macOS"
]
},
{
"name": "new-window-for-tab",
"description": "Emitted when the native new tab button is clicked.",
"platforms": [
"macOS"
]
}
]
},
{
"name": "BrowserWindowProxy",
"description": "Manipulate the child browser window",
"process": {
"main": false,
"renderer": true
},
"version": "4.0.3",
"type": "Class",
"slug": "browser-window-proxy",
"websiteUrl": "http://electronjs.org/docs/api/browser-window-proxy",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/browser-window-proxy.md",
"instanceName": "win",
"instanceMethods": [
{
"name": "blur",
"signature": "()",
"description": "Removes focus from the child window."
},
{
"name": "close",
"signature": "()",
"description": "Forcefully closes the child window without calling its unload event."
},
{
"name": "eval",
"signature": "(code)",
"description": "Evaluates the code in the child window.",
"parameters": [
{
"name": "code",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "focus",
"signature": "()",
"description": "Focuses the child window (brings the window to front)."
},
{
"name": "print",
"signature": "()",
"description": "Invokes the print dialog on the child window."
},
{
"name": "postMessage",
"signature": "(message, targetOrigin)",
"description": "Sends a message to the child window with the specified origin or * for no origin preference. In addition to these methods, the child window implements window.opener object with no properties and a single method.",
"parameters": [
{
"name": "message",
"type": "String",
"collection": false,
"required": true
},
{
"name": "targetOrigin",
"type": "String",
"collection": false,
"required": true
}
]
}
],
"instanceProperties": [
{
"name": "closed",
"description": "A Boolean that is set to true after the child window gets closed.",
"type": "Boolean",
"collection": false
}
]
},
{
"name": "Certificate",
"version": "4.0.3",
"type": "Structure",
"slug": "certificate",
"websiteUrl": "http://electronjs.org/docs/api/structures/certificate",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/certificate.md",
"properties": [
{
"name": "data",
"type": "String",
"collection": false,
"description": "PEM encoded data",
"required": true
},
{
"name": "issuer",
"type": "CertificatePrincipal",
"collection": false,
"description": "Issuer principal",
"required": true
},
{
"name": "issuerName",
"type": "String",
"collection": false,
"description": "Issuer's Common Name",
"required": true
},
{
"name": "issuerCert",
"type": "Certificate",
"collection": false,
"description": "Issuer certificate (if not self-signed)",
"required": true
},
{
"name": "subject",
"type": "CertificatePrincipal",
"collection": false,
"description": "Subject principal",
"required": true
},
{
"name": "subjectName",
"type": "String",
"collection": false,
"description": "Subject's Common Name",
"required": true
},
{
"name": "serialNumber",
"type": "String",
"collection": false,
"description": "Hex value represented string",
"required": true
},
{
"name": "validStart",
"type": "Number",
"collection": false,
"description": "Start date of the certificate being valid in seconds",
"required": true
},
{
"name": "validExpiry",
"type": "Number",
"collection": false,
"description": "End date of the certificate being valid in seconds",
"required": true
},
{
"name": "fingerprint",
"type": "String",
"collection": false,
"description": "Fingerprint of the certificate",
"required": true
}
]
},
{
"name": "CertificatePrincipal",
"version": "4.0.3",
"type": "Structure",
"slug": "certificate-principal",
"websiteUrl": "http://electronjs.org/docs/api/structures/certificate-principal",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/certificate-principal.md",
"properties": [
{
"name": "commonName",
"type": "String",
"collection": false,
"description": "Common Name.",
"required": true
},
{
"name": "organizations",
"type": "String",
"collection": true,
"description": "Organization names.",
"required": true
},
{
"name": "organizationUnits",
"type": "String",
"collection": true,
"description": "Organization Unit names.",
"required": true
},
{
"name": "locality",
"type": "String",
"collection": false,
"description": "Locality.",
"required": true
},
{
"name": "state",
"type": "String",
"collection": false,
"description": "State or province.",
"required": true
},
{
"name": "country",
"type": "String",
"collection": false,
"description": "Country or region.",
"required": true
}
]
},
{
"name": "ClientRequest",
"description": "Make HTTP/HTTPS requests.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "client-request",
"websiteUrl": "http://electronjs.org/docs/api/client-request",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/client-request.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": [
{
"typeName": "Object",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"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,
"properties": [
{
"name": "method",
"type": "String",
"collection": false,
"description": "The HTTP request method. Defaults to the GET method.",
"required": false
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "The request URL. Must be provided in the absolute form with the protocol scheme specified as http or https.",
"required": false
},
{
"name": "session",
"type": "Object",
"collection": false,
"description": "The instance with which the request is associated.",
"required": false,
"properties": []
},
{
"name": "partition",
"type": "String",
"collection": false,
"description": "The name of the with which the request is associated. Defaults to the empty string. The session option prevails on partition. Thus if a session is explicitly specified, partition is ignored.",
"required": false
},
{
"name": "protocol",
"type": "String",
"collection": false,
"description": "The protocol scheme in the form 'scheme:'. Currently supported values are 'http:' or 'https:'. Defaults to 'http:'.",
"required": false
},
{
"name": "host",
"type": "String",
"collection": false,
"description": "The server host provided as a concatenation of the hostname and the port number 'hostname:port'.",
"required": false
},
{
"name": "hostname",
"type": "String",
"collection": false,
"description": "The server host name.",
"required": false
},
{
"name": "port",
"type": "Integer",
"collection": false,
"description": "The server's listening port number.",
"required": false
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "The path part of the request URL.",
"required": false
},
{
"name": "redirect",
"type": "String",
"collection": false,
"description": "The redirect mode for this request. Should be one of follow, error or manual. Defaults to follow. When mode is error, any redirection will be aborted. When mode is manual the redirection will be deferred until is invoked. Listen for the event in this mode to get more details about the redirect request.",
"required": false
}
],
"possibleValues": [
{
"value": "method",
"description": ""
},
{
"value": "url",
"description": ""
},
{
"value": "session",
"description": ""
},
{
"value": "partition",
"description": ""
},
{
"value": "protocol",
"description": ""
},
{
"value": "host",
"description": ""
},
{
"value": "hostname",
"description": ""
},
{
"value": "port",
"description": ""
},
{
"value": "path",
"description": ""
},
{
"value": "redirect",
"description": ""
}
]
}
]
},
"instanceName": "request",
"instanceMethods": [
{
"name": "setHeader",
"signature": "(name, value)",
"description": "Adds an extra HTTP header. The header name will issued as it 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.",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"description": "An extra HTTP header name.",
"required": true
},
{
"name": "value",
"type": "Object",
"collection": false,
"description": "An extra HTTP header value.",
"required": true
}
]
},
{
"name": "getHeader",
"signature": "(name)",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"description": "Specify an extra header name.",
"required": true
}
],
"returns": {
"type": "Object",
"collection": false,
"description": "The value of a previously set extra header name.",
"properties": [
{
"name": "name",
"type": "String",
"collection": false,
"description": "Specify an extra header name.",
"required": true
}
]
}
},
{
"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",
"type": "String",
"collection": false,
"description": "Specify an extra header name.",
"required": true
}
]
},
{
"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. Adds 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",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Buffer",
"collection": false
}
],
"collection": false,
"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
},
{
"name": "encoding",
"type": "String",
"collection": false,
"description": "Used to convert string chunks into Buffer objects. Defaults to 'utf-8'.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called after the write operation ends.",
"required": false
}
]
},
{
"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",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Buffer",
"collection": false
}
],
"collection": false,
"required": false
},
{
"name": "encoding",
"type": "String",
"collection": false,
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": false
}
]
},
{
"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."
},
{
"name": "followRedirect",
"signature": "()",
"description": "Continues any deferred redirection request when the redirection mode is manual."
},
{
"name": "getUploadProgress",
"signature": "()",
"description": "You can use this method in conjunction with POST requests to get the progress of a file upload or other data transfer.",
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "active",
"type": "Boolean",
"collection": false,
"description": "Whether the request is currently active. If this is false no other properties will be set",
"required": true
},
{
"name": "started",
"type": "Boolean",
"collection": false,
"description": "Whether the upload has started. If this is false both current and total will be set to 0.",
"required": true
},
{
"name": "current",
"type": "Integer",
"collection": false,
"description": "The number of bytes that have been uploaded so far",
"required": true
},
{
"name": "total",
"type": "Integer",
"collection": false,
"description": "The number of bytes that will be uploaded this request",
"required": true
}
]
}
}
],
"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. Using 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.",
"type": "Boolean",
"collection": false
}
],
"instanceEvents": [
{
"name": "response",
"returns": [
{
"name": "response",
"type": "IncomingMessage",
"collection": false,
"description": "An object representing the HTTP response message.",
"required": true
}
]
},
{
"name": "login",
"description": "Emitted when an authenticating proxy is asking for user credentials. The callback function is expected to be called back with user credentials: Providing empty credentials will cancel the request and report an authentication error on the response object:",
"returns": [
{
"name": "authInfo",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "isProxy",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "scheme",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "host",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "port",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "realm",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "username",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "password",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "finish",
"description": "Emitted just after the last chunk of the request's data has been written into the request object."
},
{
"name": "abort",
"description": "Emitted when the request is aborted. The abort event will not be fired if the request is already closed."
},
{
"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.",
"returns": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "an error object providing some information about the failure.",
"required": true
}
]
},
{
"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."
},
{
"name": "redirect",
"description": "Emitted when there is redirection and the mode is manual. Calling request.followRedirect will continue with the redirection.",
"returns": [
{
"name": "statusCode",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"required": true
},
{
"name": "redirectUrl",
"type": "String",
"collection": false,
"required": true
},
{
"name": "responseHeaders",
"type": "Object",
"collection": false,
"required": true
}
]
}
]
},
{
"name": "clipboard",
"description": "Perform copy and paste operations on the system clipboard.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "clipboard",
"websiteUrl": "http://electronjs.org/docs/api/clipboard",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/clipboard.md",
"methods": [
{
"name": "readText",
"signature": "([type])",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
],
"returns": {
"type": "String",
"collection": false,
"description": "The content in the clipboard as plain text."
}
},
{
"name": "writeText",
"signature": "(text[, type])",
"description": "Writes the text into the clipboard as plain text.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "readHTML",
"signature": "([type])",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
],
"returns": {
"type": "String",
"collection": false,
"description": "The content in the clipboard as markup."
}
},
{
"name": "writeHTML",
"signature": "(markup[, type])",
"description": "Writes markup to the clipboard.",
"parameters": [
{
"name": "markup",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "readImage",
"signature": "([type])",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
],
"returns": {
"type": "NativeImage",
"collection": false,
"description": "The image content in the clipboard."
}
},
{
"name": "writeImage",
"signature": "(image[, type])",
"description": "Writes image to the clipboard.",
"parameters": [
{
"name": "image",
"type": "NativeImage",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "readRTF",
"signature": "([type])",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
],
"returns": {
"type": "String",
"collection": false,
"description": "The content in the clipboard as RTF."
}
},
{
"name": "writeRTF",
"signature": "(text[, type])",
"description": "Writes the text into the clipboard in RTF.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "readBookmark",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "Returns 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.",
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "title",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
},
{
"name": "writeBookmark",
"signature": "(title, url[, type])",
"platforms": [
"macOS",
"Windows"
],
"description": "Writes the title and url into the clipboard as a bookmark. 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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "readFindText",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "String",
"collection": false,
"description": "The text on the find pasteboard. This method uses synchronous IPC when called from the renderer process. The cached value is reread from the find pasteboard whenever the application is activated."
}
},
{
"name": "writeFindText",
"signature": "(text)",
"platforms": [
"macOS"
],
"description": "Writes the text into the find pasteboard as plain text. This method uses synchronous IPC when called from the renderer process.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "clear",
"signature": "([type])",
"description": "Clears the clipboard content.",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "availableFormats",
"signature": "([type])",
"parameters": [
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
],
"returns": {
"type": "String",
"collection": true,
"description": "An array of supported formats for the clipboard type."
}
},
{
"name": "has",
"signature": "(format[, type])",
"platforms": [
"Experimental"
],
"parameters": [
{
"name": "format",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the clipboard supports the specified format."
}
},
{
"name": "read",
"signature": "(format)",
"platforms": [
"Experimental"
],
"parameters": [
{
"name": "format",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "String",
"collection": false,
"description": "Reads format type from the clipboard."
}
},
{
"name": "readBuffer",
"signature": "(format)",
"platforms": [
"Experimental"
],
"parameters": [
{
"name": "format",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "Buffer",
"collection": false,
"description": "Reads format type from the clipboard."
}
},
{
"name": "writeBuffer",
"signature": "(format, buffer[, type])",
"platforms": [
"Experimental"
],
"description": "Writes the buffer into the clipboard as format.",
"parameters": [
{
"name": "format",
"type": "String",
"collection": false,
"required": true
},
{
"name": "buffer",
"type": "Buffer",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "write",
"signature": "(data[, type])",
"description": "Writes data to the clipboard.",
"parameters": [
{
"name": "data",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "text",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "html",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "image",
"type": "NativeImage",
"collection": false,
"description": "",
"required": false
},
{
"name": "rtf",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "bookmark",
"type": "String",
"collection": false,
"description": "The title of the url at text.",
"required": false
}
]
},
{
"name": "type",
"type": "String",
"collection": false,
"required": false
}
]
}
]
},
{
"name": "contentTracing",
"description": "Collect tracing data from Chromium's content module for finding performance\nbottlenecks and slow operations.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "content-tracing",
"websiteUrl": "http://electronjs.org/docs/api/content-tracing",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/content-tracing.md",
"methods": [
{
"name": "getCategories",
"signature": "(callback)",
"description": "Get a set of category groups. The category groups can change as new code paths are reached. Once all child processes have acknowledged the getCategories request the callback is invoked with an array of category groups.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "categories",
"type": "String",
"collection": true,
"description": "",
"required": true
}
]
}
]
},
{
"name": "startRecording",
"signature": "(options, callback)",
"description": "Start recording on all processes. Recording begins immediately locally and asynchronously on child processes as soon as they receive the EnableRecording request. The callback will be called once all child processes have acknowledged the startRecording request.",
"parameters": [
{
"name": "options",
"type": [
{
"typeName": "TraceCategoriesAndOptions",
"collection": false
},
{
"typeName": "TraceConfig",
"collection": false
}
],
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "stopRecording",
"signature": "(resultFilePath, callback)",
"description": "Stop recording on all processes. Child 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, we must asynchronously ask all child processes to flush any pending trace data. Once all child processes have acknowledged the stopRecording request, callback will be called with a file that contains the traced data. Trace data will be written into resultFilePath if it is not empty or into a temporary file. The actual file path will be passed to callback if it's not null.",
"parameters": [
{
"name": "resultFilePath",
"type": "String",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "resultFilePath",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "startMonitoring",
"signature": "(options, callback)",
"description": "Start monitoring on all processes. Monitoring begins immediately locally and asynchronously on child processes as soon as they receive the startMonitoring request. Once all child processes have acknowledged the startMonitoring request the callback will be called.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "categoryFilter",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "traceOptions",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "stopMonitoring",
"signature": "(callback)",
"description": "Stop monitoring on all processes. Once all child processes have acknowledged the stopMonitoring request the callback is called.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "captureMonitoringSnapshot",
"signature": "(resultFilePath, callback)",
"description": "Get the current monitoring traced data. Child processes typically cache trace data and only rarely flush and send trace data back to the main process. This is because it may be an expensive operation to send the trace data over IPC and we would like to avoid unneeded runtime overhead from tracing. So, to end tracing, we must asynchronously ask all child processes to flush any pending trace data. Once all child processes have acknowledged the captureMonitoringSnapshot request the callback will be called with a file that contains the traced data.",
"parameters": [
{
"name": "resultFilePath",
"type": "String",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "resultFilePath",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "getTraceBufferUsage",
"signature": "(callback)",
"description": "Get the maximum usage across processes of trace buffer as a percentage of the full state. When the TraceBufferUsage value is determined the callback is called.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "value",
"type": "Number",
"collection": false,
"description": "",
"required": true
},
{
"name": "percentage",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
}
]
}
]
},
{
"name": "Cookie",
"version": "4.0.3",
"type": "Structure",
"slug": "cookie",
"websiteUrl": "http://electronjs.org/docs/api/structures/cookie",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/cookie.md",
"properties": [
{
"name": "name",
"type": "String",
"collection": false,
"description": "The name of the cookie.",
"required": true
},
{
"name": "value",
"type": "String",
"collection": false,
"description": "The value of the cookie.",
"required": true
},
{
"name": "domain",
"type": "String",
"collection": false,
"description": "The domain of the cookie.",
"required": false
},
{
"name": "hostOnly",
"type": "Boolean",
"collection": false,
"description": "Whether the cookie is a host-only cookie.",
"required": false
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "The path of the cookie.",
"required": false
},
{
"name": "secure",
"type": "Boolean",
"collection": false,
"description": "Whether the cookie is marked as secure.",
"required": false
},
{
"name": "httpOnly",
"type": "Boolean",
"collection": false,
"description": "Whether the cookie is marked as HTTP only.",
"required": false
},
{
"name": "session",
"type": "Boolean",
"collection": false,
"description": "Whether the cookie is a session cookie or a persistent cookie with an expiration date.",
"required": false
},
{
"name": "expirationDate",
"type": "Double",
"collection": false,
"description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies.",
"required": false
}
]
},
{
"name": "Cookies",
"description": "Query and modify a session's cookies.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "cookies",
"websiteUrl": "http://electronjs.org/docs/api/cookies",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/cookies.md",
"instanceName": "cookies",
"instanceMethods": [
{
"name": "get",
"signature": "(filter, callback)",
"description": "Sends a request to get all cookies matching filter, callback will be called with callback(error, cookies) on complete.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "Retrieves cookies which are associated with url. Empty implies retrieving cookies of all urls.",
"required": false
},
{
"name": "name",
"type": "String",
"collection": false,
"description": "Filters cookies by name.",
"required": false
},
{
"name": "domain",
"type": "String",
"collection": false,
"description": "Retrieves cookies whose domains match or are subdomains of domains.",
"required": false
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Retrieves cookies whose path matches path.",
"required": false
},
{
"name": "secure",
"type": "Boolean",
"collection": false,
"description": "Filters cookies by their Secure property.",
"required": false
},
{
"name": "session",
"type": "Boolean",
"collection": false,
"description": "Filters out session or persistent cookies.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
},
{
"name": "cookies",
"type": "Cookie",
"collection": true,
"description": "an array of cookie objects.",
"required": true
}
]
}
]
},
{
"name": "set",
"signature": "(details, callback)",
"description": "Sets a cookie with details, callback will be called with callback(error) on complete.",
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "The url to associate the cookie with.",
"required": true
},
{
"name": "name",
"type": "String",
"collection": false,
"description": "The name of the cookie. Empty by default if omitted.",
"required": false
},
{
"name": "value",
"type": "String",
"collection": false,
"description": "The value of the cookie. Empty by default if omitted.",
"required": false
},
{
"name": "domain",
"type": "String",
"collection": false,
"description": "The domain of the cookie. Empty by default if omitted.",
"required": false
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "The path of the cookie. Empty by default if omitted.",
"required": false
},
{
"name": "secure",
"type": "Boolean",
"collection": false,
"description": "Whether the cookie should be marked as Secure. Defaults to false.",
"required": false
},
{
"name": "httpOnly",
"type": "Boolean",
"collection": false,
"description": "Whether the cookie should be marked as HTTP only. Defaults to false.",
"required": false
},
{
"name": "expirationDate",
"type": "Double",
"collection": false,
"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
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "remove",
"signature": "(url, name, callback)",
"description": "Removes the cookies matching url and name, callback will called with callback() on complete.",
"parameters": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "The URL associated with the cookie.",
"required": true
},
{
"name": "name",
"type": "String",
"collection": false,
"description": "The name of cookie to remove.",
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "flushStore",
"signature": "(callback)",
"description": "Writes any unwritten cookies data to disk.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
}
],
"instanceEvents": [
{
"name": "changed",
"description": "Emitted when a cookie is changed because it was added, edited, removed, or expired.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "cookie",
"type": "Cookie",
"collection": false,
"description": "The cookie that was changed.",
"required": true
},
{
"name": "cause",
"type": "String",
"collection": false,
"description": "The cause of the change with one of the following values:",
"required": true,
"possibleValues": [
{
"value": "explicit",
"description": "The cookie was changed directly by a consumer's action."
},
{
"value": "overwrite",
"description": "The cookie was automatically removed due to an insert operation that overwrote it."
},
{
"value": "expired",
"description": "The cookie was automatically removed as it expired."
},
{
"value": "evicted",
"description": "The cookie was automatically evicted during garbage collection."
},
{
"value": "expired-overwrite",
"description": "The cookie was overwritten with an already-expired expiration date."
}
]
},
{
"name": "removed",
"type": "Boolean",
"collection": false,
"description": "`true` if the cookie was removed, `false` otherwise.",
"required": true
}
]
}
]
},
{
"name": "CPUUsage",
"version": "4.0.3",
"type": "Structure",
"slug": "cpu-usage",
"websiteUrl": "http://electronjs.org/docs/api/structures/cpu-usage",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/cpu-usage.md",
"properties": [
{
"name": "percentCPUUsage",
"type": "Number",
"collection": false,
"description": "Percentage of CPU used since the last call to getCPUUsage. First call returns 0.",
"required": true
},
{
"name": "idleWakeupsPerSecond",
"type": "Number",
"collection": false,
"description": "The number of average idle cpu wakeups per second since the last call to getCPUUsage. First call returns 0. Will always return 0 on Windows.",
"required": true
}
]
},
{
"name": "CrashReport",
"version": "4.0.3",
"type": "Structure",
"slug": "crash-report",
"websiteUrl": "http://electronjs.org/docs/api/structures/crash-report",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/crash-report.md",
"properties": [
{
"name": "date",
"type": "Date",
"collection": false,
"description": "",
"required": true
},
{
"name": "id",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "crashReporter",
"description": "Submit crash reports to a remote server.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "crash-reporter",
"websiteUrl": "http://electronjs.org/docs/api/crash-reporter",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/crash-reporter.md",
"methods": [
{
"name": "start",
"signature": "(options)",
"description": "You are required to call this method before using any other crashReporter APIs and in each process (main/renderer) from which you want to collect crash reports. You can pass different options to crashReporter.start when calling from different processes. Note Child processes created via the child_process module will not have access to the Electron modules. Therefore, to collect crash reports from them, use process.crashReporter.start instead. Pass the same options as above along with an additional one called crashesDirectory that should point to a directory to store the crash reports temporarily. You can test this out by calling process.crash() to crash the child process. Note: To collect crash reports from child process in Windows, you need to add this extra code as well. This will start the process that will monitor and send the crash reports. Replace submitURL, productName and crashesDirectory with appropriate values. Note: If you need send additional/updated extra parameters after your first call start you can call addExtraParameter on macOS or call start again with the new/updated extra parameters on Linux and Windows. Note: On macOS, Electron uses a new crashpad client for crash collection and reporting. If you want to enable crash reporting, initializing crashpad from the main process using crashReporter.start is required regardless of which process you want to collect crashes from. Once initialized this way, the crashpad handler collects crashes from all processes. You still have to call crashReporter.start from the renderer or child process, otherwise crashes from them will get reported without companyName, productName or any of the extra information.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "companyName",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "submitURL",
"type": "String",
"collection": false,
"description": "URL that crash reports will be sent to as POST.",
"required": true
},
{
"name": "productName",
"type": "String",
"collection": false,
"description": "Defaults to app.getName().",
"required": false
},
{
"name": "uploadToServer",
"type": "Boolean",
"collection": false,
"description": "Whether crash reports should be sent to the server Default is true.",
"required": false
},
{
"name": "ignoreSystemCrashHandler",
"type": "Boolean",
"collection": false,
"description": "Default is false.",
"required": false
},
{
"name": "extra",
"type": "Object",
"collection": false,
"description": "An object you can define that will be sent along with the report. Only string properties are sent correctly. Nested objects are not supported and the property names and values must be less than 64 characters long.",
"required": false,
"properties": []
},
{
"name": "crashesDirectory",
"type": "String",
"collection": false,
"description": "Directory to store the crashreports temporarily (only used when the crash reporter is started via process.crashReporter.start).",
"required": false
}
]
}
]
},
{
"name": "getLastCrashReport",
"signature": "()",
"description": "Returns the date and ID of the last crash report. If no crash reports have been sent or the crash reporter has not been started, null is returned.",
"returns": {
"type": "CrashReport",
"collection": false
}
},
{
"name": "getUploadedReports",
"signature": "()",
"description": "Returns all uploaded crash reports. Each report contains the date and uploaded ID.",
"returns": {
"type": "CrashReport",
"collection": true
}
},
{
"name": "getUploadToServer",
"signature": "()",
"platforms": [
"Linux",
"macOS"
],
"description": "Note: This API can only be called from the main process.",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether reports should be submitted to the server. Set through the start method or setUploadToServer."
}
},
{
"name": "setUploadToServer",
"signature": "(uploadToServer)",
"platforms": [
"Linux",
"macOS"
],
"description": "This would normally be controlled by user preferences. This has no effect if called before start is called. Note: This API can only be called from the main process.",
"parameters": [
{
"name": "uploadToServer",
"type": "Boolean",
"collection": false,
"description": "Whether reports should be submitted to the server.",
"required": true
}
]
},
{
"name": "addExtraParameter",
"signature": "(key, value)",
"platforms": [
"macOS"
],
"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. This API is only available on macOS, if you need to add/update extra parameters on Linux and Windows after your first call to start you can call start again with the updated extra options.",
"parameters": [
{
"name": "key",
"type": "String",
"collection": false,
"description": "Parameter key, must be less than 64 characters long.",
"required": true
},
{
"name": "value",
"type": "String",
"collection": false,
"description": "Parameter value, must be less than 64 characters long.",
"required": true
}
]
},
{
"name": "removeExtraParameter",
"signature": "(key)",
"platforms": [
"macOS"
],
"description": "Remove a extra parameter from the current set of parameters so that it will not be sent with the crash report.",
"parameters": [
{
"name": "key",
"type": "String",
"collection": false,
"description": "Parameter key, must be less than 64 characters long.",
"required": true
}
]
},
{
"name": "getParameters",
"signature": "()",
"description": "See all of the current parameters being passed to the crash reporter."
}
]
},
{
"name": "Debugger",
"description": "An alternate transport for Chrome's remote debugging protocol.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "debugger",
"websiteUrl": "http://electronjs.org/docs/api/debugger",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/debugger.md",
"instanceName": "debugger",
"instanceMethods": [
{
"name": "attach",
"signature": "([protocolVersion])",
"description": "Attaches the debugger to the webContents.",
"parameters": [
{
"name": "protocolVersion",
"type": "String",
"collection": false,
"description": "Requested debugging protocol version.",
"required": false
}
]
},
{
"name": "isAttached",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether a debugger is attached to the webContents."
}
},
{
"name": "detach",
"signature": "()",
"description": "Detaches the debugger from the webContents."
},
{
"name": "sendCommand",
"signature": "(method[, commandParams, callback])",
"description": "Send given command to the debugging target.",
"parameters": [
{
"name": "method",
"type": "String",
"collection": false,
"description": "Method name, should be one of the methods defined by the remote debugging protocol.",
"required": true
},
{
"name": "commandParams",
"type": "Object",
"collection": false,
"description": "JSON object with request parameters.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Response",
"required": false,
"parameters": [
{
"name": "error",
"type": "Object",
"collection": false,
"description": "Error message indicating the failure of the command.",
"required": true,
"properties": []
},
{
"name": "result",
"type": "Any",
"collection": false,
"description": "Response defined by the 'returns' attribute of the command description in the remote debugging protocol.",
"required": true
}
]
}
]
}
],
"instanceEvents": [
{
"name": "detach",
"description": "Emitted when debugging session is terminated. This happens either when webContents is closed or devtools is invoked for the attached webContents.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "reason",
"type": "String",
"collection": false,
"description": "Reason for detaching debugger.",
"required": true
}
]
},
{
"name": "message",
"description": "Emitted whenever debugging target issues instrumentation event.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "Method name.",
"required": true
},
{
"name": "params",
"type": "Object",
"collection": false,
"description": "Event parameters defined by the 'parameters' attribute in the remote debugging protocol.",
"required": true
}
]
}
]
},
{
"name": "desktopCapturer",
"description": "Access information about media sources that can be used to capture audio and\nvideo from the desktop using the navigator.mediaDevices.getUserMedia API.",
"process": {
"main": false,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "desktop-capturer",
"websiteUrl": "http://electronjs.org/docs/api/desktop-capturer",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/desktop-capturer.md",
"methods": [
{
"name": "getSources",
"signature": "(options, callback)",
"description": "Starts gathering information about all available desktop media sources, and calls callback(error, sources) when finished. sources is an array of DesktopCapturerSource objects, each DesktopCapturerSource represents a screen or an individual window that can be captured.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "types",
"type": "String",
"collection": true,
"description": "An array of Strings that lists the types of desktop sources to be captured, available types are screen and window.",
"required": true
},
{
"name": "thumbnailSize",
"type": "Size",
"collection": false,
"description": "The size that the media source thumbnail should be scaled to. Default is 150 x 150.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
},
{
"name": "sources",
"type": "DesktopCapturerSource",
"collection": true,
"description": "",
"required": true
}
]
}
]
}
]
},
{
"name": "DesktopCapturerSource",
"version": "4.0.3",
"type": "Structure",
"slug": "desktop-capturer-source",
"websiteUrl": "http://electronjs.org/docs/api/structures/desktop-capturer-source",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/desktop-capturer-source.md",
"properties": [
{
"name": "id",
"type": "String",
"collection": false,
"description": "The identifier of a window or screen that can be used as a chromeMediaSourceId constraint when calling [navigator.webkitGetUserMedia]. The format of the identifier will be window:XX or screen:XX, where XX is a random generated number.",
"required": true
},
{
"name": "name",
"type": "String",
"collection": false,
"description": "A screen source will be named either Entire Screen or Screen , while the name of a window source will match the window title.",
"required": true
},
{
"name": "thumbnail",
"type": "NativeImage",
"collection": false,
"description": "A thumbnail image. There is no guarantee that the size of the thumbnail is the same as the thumbnailSize specified in the options passed to desktopCapturer.getSources. The actual size depends on the scale of the screen or window.",
"required": true
},
{
"name": "display_id",
"type": "String",
"collection": false,
"description": "A unique identifier that will correspond to the id of the matching returned by the . On some platforms, this is equivalent to the XX portion of the id field above and on others it will differ. It will be an empty string if not available.",
"required": true
}
]
},
{
"name": "dialog",
"description": "Display native system dialogs for opening and saving files, alerting, etc.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "dialog",
"websiteUrl": "http://electronjs.org/docs/api/dialog",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/dialog.md",
"methods": [
{
"name": "showOpenDialog",
"signature": "([browserWindow, ]options[, callback])",
"description": "The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. The 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: The 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). If a callback is passed, the API call will be asynchronous and the result will be passed via callback(filenames). 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",
"type": "BrowserWindow",
"collection": false,
"required": false
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "title",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "defaultPath",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "buttonLabel",
"type": "String",
"collection": false,
"description": "Custom label for the confirmation button, when left empty the default label will be used.",
"required": false
},
{
"name": "filters",
"type": "FileFilter",
"collection": true,
"description": "",
"required": false
},
{
"name": "properties",
"type": "String",
"collection": true,
"description": "Contains which features the dialog should use. The following values are supported:",
"required": false,
"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": ""
},
{
"value": "promptToCreate",
"description": ""
},
{
"value": "noResolveAliases",
"description": ""
},
{
"value": "treatPackageAsDirectory",
"description": ""
}
]
},
{
"name": "message",
"type": "String",
"collection": false,
"description": "Message to display above input boxes.",
"required": false
},
{
"name": "securityScopedBookmarks",
"type": "Boolean",
"collection": false,
"description": "Create when packaged for the Mac App Store.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "filePaths",
"type": "String",
"collection": true,
"description": "An array of file paths chosen by the user",
"required": true
},
{
"name": "bookmarks",
"type": "String",
"collection": true,
"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.",
"required": true
}
]
}
],
"returns": {
"type": "String",
"collection": true,
"description": ", an array of file paths chosen by the user, if the callback is provided it returns undefined."
}
},
{
"name": "showSaveDialog",
"signature": "([browserWindow, ]options[, callback])",
"description": "The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. The filters specifies an array of file types that can be displayed, see dialog.showOpenDialog for an example. If a callback is passed, the API call will be asynchronous and the result will be passed via callback(filename).",
"parameters": [
{
"name": "browserWindow",
"type": "BrowserWindow",
"collection": false,
"required": false
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "title",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "defaultPath",
"type": "String",
"collection": false,
"description": "Absolute directory path, absolute file path, or file name to use by default.",
"required": false
},
{
"name": "buttonLabel",
"type": "String",
"collection": false,
"description": "Custom label for the confirmation button, when left empty the default label will be used.",
"required": false
},
{
"name": "filters",
"type": "FileFilter",
"collection": true,
"description": "",
"required": false
},
{
"name": "message",
"type": "String",
"collection": false,
"description": "Message to display above text fields.",
"required": false
},
{
"name": "nameFieldLabel",
"type": "String",
"collection": false,
"description": "Custom label for the text displayed in front of the filename text field.",
"required": false
},
{
"name": "showsTagField",
"type": "Boolean",
"collection": false,
"description": "Show the tags input box, defaults to true.",
"required": false
},
{
"name": "securityScopedBookmarks",
"type": "Boolean",
"collection": false,
"description": "Create a 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
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "filename",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "bookmark",
"type": "String",
"collection": false,
"description": "Base64 encoded string which contains the security scoped bookmark data for the saved file. securityScopedBookmarks must be enabled for this to be present.",
"required": true
}
]
}
],
"returns": {
"type": "String",
"collection": false,
"description": ", the path of the file chosen by the user, if a callback is provided it returns undefined."
}
},
{
"name": "showMessageBox",
"signature": "([browserWindow, ]options[, callback])",
"description": "Shows a message box, it will block the process until the message box is closed. It returns the index of the clicked button. The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. If a callback is passed, the dialog will not block the process. The API call will be asynchronous and the result will be passed via callback(response).",
"parameters": [
{
"name": "browserWindow",
"type": "BrowserWindow",
"collection": false,
"required": false
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"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
},
{
"name": "buttons",
"type": "String",
"collection": true,
"description": "Array of texts for buttons. On Windows, an empty array will result in one button labeled \"OK\".",
"required": false
},
{
"name": "defaultId",
"type": "Integer",
"collection": false,
"description": "Index of the button in the buttons array which will be selected by default when the message box opens.",
"required": false
},
{
"name": "title",
"type": "String",
"collection": false,
"description": "Title of the message box, some platforms will not show it.",
"required": false
},
{
"name": "message",
"type": "String",
"collection": false,
"description": "Content of the message box.",
"required": true
},
{
"name": "detail",
"type": "String",
"collection": false,
"description": "Extra information of the message.",
"required": false
},
{
"name": "checkboxLabel",
"type": "String",
"collection": false,
"description": "If provided, the message box will include a checkbox with the given label. The checkbox state can be inspected only when using callback.",
"required": false
},
{
"name": "checkboxChecked",
"type": "Boolean",
"collection": false,
"description": "Initial checked state of the checkbox. false by default.",
"required": false
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "",
"required": false
},
{
"name": "cancelId",
"type": "Integer",
"collection": false,
"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 or callback response.",
"required": false
},
{
"name": "noLink",
"type": "Boolean",
"collection": false,
"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
},
{
"name": "normalizeAccessKeys",
"type": "Boolean",
"collection": false,
"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
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "response",
"type": "Number",
"collection": false,
"description": "The index of the button that was clicked.",
"required": true
},
{
"name": "checkboxChecked",
"type": "Boolean",
"collection": false,
"description": "The checked state of the checkbox if checkboxLabel was set. Otherwise false.",
"required": true
}
]
}
],
"returns": {
"type": "Integer",
"collection": false,
"description": ", the index of the clicked button, if a callback is provided it returns undefined."
}
},
{
"name": "showErrorBox",
"signature": "(title, content)",
"description": "Displays a modal dialog that shows an error message. This 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 readyevent on Linux, the message will be emitted to stderr, and no GUI dialog will appear.",
"parameters": [
{
"name": "title",
"type": "String",
"collection": false,
"description": "The title to display in the error box.",
"required": true
},
{
"name": "content",
"type": "String",
"collection": false,
"description": "The text content to display in the error box.",
"required": true
}
]
},
{
"name": "showCertificateTrustDialog",
"signature": "([browserWindow, ]options, callback)",
"platforms": [
"macOS",
"Windows"
],
"description": "On 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. On Windows the options are more limited, due to the Win32 APIs used:",
"parameters": [
{
"name": "browserWindow",
"type": "BrowserWindow",
"collection": false,
"required": false
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "certificate",
"type": "Certificate",
"collection": false,
"description": "The certificate to trust/import.",
"required": true
},
{
"name": "message",
"type": "String",
"collection": false,
"description": "The message to display to the user.",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
}
]
},
{
"name": "Display",
"version": "4.0.3",
"type": "Structure",
"slug": "display",
"websiteUrl": "http://electronjs.org/docs/api/structures/display",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/display.md",
"properties": [
{
"name": "id",
"type": "Number",
"collection": false,
"description": "Unique identifier associated with the display.",
"required": true
},
{
"name": "rotation",
"type": "Number",
"collection": false,
"description": "Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.",
"required": true
},
{
"name": "scaleFactor",
"type": "Number",
"collection": false,
"description": "Output device's pixel scale factor.",
"required": true
},
{
"name": "touchSupport",
"type": "String",
"collection": false,
"description": "Can be available, unavailable, unknown.",
"required": true,
"possibleValues": [
{
"value": "available"
},
{
"value": "unavailable"
},
{
"value": "unknown"
}
]
},
{
"name": "bounds",
"type": "Rectangle",
"collection": false,
"description": "",
"required": true
},
{
"name": "size",
"type": "Size",
"collection": false,
"description": "",
"required": true
},
{
"name": "workArea",
"type": "Rectangle",
"collection": false,
"description": "",
"required": true
},
{
"name": "workAreaSize",
"type": "Size",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "DownloadItem",
"description": "Control file downloads from remote sources.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "download-item",
"websiteUrl": "http://electronjs.org/docs/api/download-item",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/download-item.md",
"instanceName": "downloadItem",
"instanceMethods": [
{
"name": "setSavePath",
"signature": "(path)",
"description": "The API is only available in session's will-download callback function. If user doesn't set the save path via the API, Electron will use the original routine to determine the save path(Usually prompts a save dialog).",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "Set the save file path of the download item.",
"required": true
}
]
},
{
"name": "getSavePath",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"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."
}
},
{
"name": "pause",
"signature": "()",
"description": "Pauses the download."
},
{
"name": "isPaused",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the download is paused."
}
},
{
"name": "resume",
"signature": "()",
"description": "Resumes the download that has been paused. 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."
},
{
"name": "canResume",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the download can resume."
}
},
{
"name": "cancel",
"signature": "()",
"description": "Cancels the download operation."
},
{
"name": "getURL",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The origin url where the item is downloaded from."
}
},
{
"name": "getMimeType",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The files mime type."
}
},
{
"name": "hasUserGesture",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the download has user gesture."
}
},
{
"name": "getFilename",
"signature": "()",
"description": "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.",
"returns": {
"type": "String",
"collection": false,
"description": "The file name of the download item."
}
},
{
"name": "getTotalBytes",
"signature": "()",
"description": "If the size is unknown, it returns 0.",
"returns": {
"type": "Integer",
"collection": false,
"description": "The total size in bytes of the download item."
}
},
{
"name": "getReceivedBytes",
"signature": "()",
"returns": {
"type": "Integer",
"collection": false,
"description": "The received bytes of the download item."
}
},
{
"name": "getContentDisposition",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The Content-Disposition field from the response header."
}
},
{
"name": "getState",
"signature": "()",
"description": "Note: The following methods are useful specifically to resume a cancelled item when session is restarted.",
"returns": {
"type": "String",
"collection": false,
"description": "The current state. Can be progressing, completed, cancelled or interrupted.",
"possibleValues": [
{
"value": "progressing"
},
{
"value": "completed"
},
{
"value": "cancelled"
},
{
"value": "interrupted"
}
]
}
},
{
"name": "getURLChain",
"signature": "()",
"returns": {
"type": "String",
"collection": true,
"description": "The complete url chain of the item including any redirects."
}
},
{
"name": "getLastModifiedTime",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "Last-Modified header value."
}
},
{
"name": "getETag",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "ETag header value."
}
},
{
"name": "getStartTime",
"signature": "()",
"returns": {
"type": "Double",
"collection": false,
"description": "Number of seconds since the UNIX epoch when the download was started."
}
}
],
"instanceEvents": [
{
"name": "updated",
"description": "Emitted when the download has been updated and is not done. The state can be one of following:",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "state",
"type": "String",
"collection": false,
"description": "Can be `progressing` or `interrupted`.",
"required": true,
"possibleValues": [
{
"value": "progressing"
},
{
"value": "interrupted"
}
]
}
]
},
{
"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. The state can be one of following:",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "state",
"type": "String",
"collection": false,
"description": "Can be `completed`, `cancelled` or `interrupted`.",
"required": true,
"possibleValues": [
{
"value": "completed"
},
{
"value": "cancelled"
},
{
"value": "interrupted"
}
]
}
]
}
]
},
{
"name": "FileFilter",
"version": "4.0.3",
"type": "Structure",
"slug": "file-filter",
"websiteUrl": "http://electronjs.org/docs/api/structures/file-filter",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/file-filter.md",
"properties": [
{
"name": "name",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "extensions",
"type": "String",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "globalShortcut",
"description": "Detect keyboard events when the application does not have keyboard focus.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "global-shortcut",
"websiteUrl": "http://electronjs.org/docs/api/global-shortcut",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/global-shortcut.md",
"methods": [
{
"name": "register",
"signature": "(accelerator, callback)",
"description": "Registers a global shortcut of accelerator. The callback is called when the registered shortcut is pressed by the user. When 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. The following accelerators will not be registered successfully on macOS 10.14 Mojave unless the app has been authorized as a trusted accessibility client:",
"parameters": [
{
"name": "accelerator",
"type": "Accelerator",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "isRegistered",
"signature": "(accelerator)",
"description": "When 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",
"type": "Accelerator",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether this application has registered accelerator."
}
},
{
"name": "unregister",
"signature": "(accelerator)",
"description": "Unregisters the global shortcut of accelerator.",
"parameters": [
{
"name": "accelerator",
"type": "Accelerator",
"collection": false,
"required": true
}
]
},
{
"name": "unregisterAll",
"signature": "()",
"description": "Unregisters all of the global shortcuts."
}
]
},
{
"name": "GPUFeatureStatus",
"version": "4.0.3",
"type": "Structure",
"slug": "gpu-feature-status",
"websiteUrl": "http://electronjs.org/docs/api/structures/gpu-feature-status",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/gpu-feature-status.md",
"properties": [
{
"name": "2d_canvas",
"type": "String",
"collection": false,
"description": "Canvas.",
"required": true
},
{
"name": "flash_3d",
"type": "String",
"collection": false,
"description": "Flash.",
"required": true
},
{
"name": "flash_stage3d",
"type": "String",
"collection": false,
"description": "Flash Stage3D.",
"required": true
},
{
"name": "flash_stage3d_baseline",
"type": "String",
"collection": false,
"description": "Flash Stage3D Baseline profile.",
"required": true
},
{
"name": "gpu_compositing",
"type": "String",
"collection": false,
"description": "Compositing.",
"required": true
},
{
"name": "multiple_raster_threads",
"type": "String",
"collection": false,
"description": "Multiple Raster Threads.",
"required": true
},
{
"name": "native_gpu_memory_buffers",
"type": "String",
"collection": false,
"description": "Native GpuMemoryBuffers.",
"required": true
},
{
"name": "rasterization",
"type": "String",
"collection": false,
"description": "Rasterization.",
"required": true
},
{
"name": "video_decode",
"type": "String",
"collection": false,
"description": "Video Decode.",
"required": true
},
{
"name": "video_encode",
"type": "String",
"collection": false,
"description": "Video Encode.",
"required": true
},
{
"name": "vpx_decode",
"type": "String",
"collection": false,
"description": "VPx Video Decode.",
"required": true
},
{
"name": "webgl",
"type": "String",
"collection": false,
"description": "WebGL.",
"required": true
},
{
"name": "webgl2",
"type": "String",
"collection": false,
"description": "WebGL2.",
"required": true
}
]
},
{
"name": "inAppPurchase",
"description": "In-app purchases on Mac App Store.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "in-app-purchase",
"websiteUrl": "http://electronjs.org/docs/api/in-app-purchase",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/in-app-purchase.md",
"methods": [
{
"name": "purchaseProduct",
"signature": "(productID, quantity, callback)",
"description": "You should listen for the transactions-updated event as soon as possible and certainly before you call purchaseProduct.",
"parameters": [
{
"name": "productID",
"type": "String",
"collection": false,
"description": "The identifiers of the product to purchase. (The identifier of `com.example.app.product1` is `product1`).",
"required": true
},
{
"name": "quantity",
"type": "Integer",
"collection": false,
"description": "The number of items the user wants to purchase.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "The callback called when the payment is added to the PaymentQueue.",
"required": false,
"parameters": [
{
"name": "isProductValid",
"type": "Boolean",
"collection": false,
"description": "Determine if the product is valid and added to the payment queue.",
"required": true
}
]
}
]
},
{
"name": "getProducts",
"signature": "(productIDs, callback)",
"description": "Retrieves the product descriptions.",
"parameters": [
{
"name": "productIDs",
"type": "String",
"collection": true,
"description": "The identifiers of the products to get.",
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "The callback called with the products or an empty array if the products don't exist.",
"required": true,
"parameters": [
{
"name": "products",
"type": "Product",
"collection": true,
"description": "Array of objects",
"required": true
}
]
}
]
},
{
"name": "canMakePayments",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": ", whether a user can make a payment."
}
},
{
"name": "getReceiptURL",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": ", the path to the receipt."
}
},
{
"name": "finishAllTransactions",
"signature": "()",
"description": "Completes all pending transactions."
},
{
"name": "finishTransactionByDate",
"signature": "(date)",
"description": "Completes the pending transactions corresponding to the date.",
"parameters": [
{
"name": "date",
"type": "String",
"collection": false,
"description": "The ISO formatted date of the transaction to finish.",
"required": true
}
]
}
],
"events": [
{
"name": "transactions-updated",
"description": "Emitted when one or more transactions have been updated.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "transactions",
"type": "Transaction",
"collection": true,
"description": "Array of objects.",
"required": true
}
]
}
]
},
{
"name": "IncomingMessage",
"description": "Handle responses to HTTP/HTTPS requests.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "incoming-message",
"websiteUrl": "http://electronjs.org/docs/api/incoming-message",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/incoming-message.md",
"instanceName": "response",
"instanceProperties": [
{
"name": "statusCode",
"description": "An Integer indicating the HTTP response status code.",
"type": "Integer",
"collection": false
},
{
"name": "statusMessage",
"description": "A String representing the HTTP status message.",
"type": "String",
"collection": false
},
{
"name": "headers",
"description": "An Object representing the response HTTP headers. The headers object is formatted as follows:",
"type": "Object",
"collection": false
},
{
"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.",
"type": "String",
"collection": false
},
{
"name": "httpVersionMajor",
"description": "An Integer indicating the HTTP protocol major version number.",
"type": "Integer",
"collection": false
},
{
"name": "httpVersionMinor",
"description": "An Integer indicating the HTTP protocol minor version number.",
"type": "Integer",
"collection": false
}
],
"instanceEvents": [
{
"name": "data",
"description": "The data event is the usual method of transferring response data into applicative code.",
"returns": [
{
"name": "chunk",
"type": "Buffer",
"collection": false,
"description": "A chunk of response body's data.",
"required": true
}
]
},
{
"name": "end",
"description": "Indicates that response body has ended."
},
{
"name": "aborted",
"description": "Emitted when a request has been canceled during an ongoing HTTP transaction."
},
{
"name": "error",
"description": "error Error - Typically holds an error string identifying failure root cause. Emitted 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."
}
]
},
{
"name": "IOCounters",
"version": "4.0.3",
"type": "Structure",
"slug": "io-counters",
"websiteUrl": "http://electronjs.org/docs/api/structures/io-counters",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/io-counters.md",
"properties": [
{
"name": "readOperationCount",
"type": "Number",
"collection": false,
"description": "The number of I/O read operations.",
"required": true
},
{
"name": "writeOperationCount",
"type": "Number",
"collection": false,
"description": "The number of I/O write operations.",
"required": true
},
{
"name": "otherOperationCount",
"type": "Number",
"collection": false,
"description": "Then number of I/O other operations.",
"required": true
},
{
"name": "readTransferCount",
"type": "Number",
"collection": false,
"description": "The number of I/O read transfers.",
"required": true
},
{
"name": "writeTransferCount",
"type": "Number",
"collection": false,
"description": "The number of I/O write transfers.",
"required": true
},
{
"name": "otherTransferCount",
"type": "Number",
"collection": false,
"description": "Then number of I/O other transfers.",
"required": true
}
]
},
{
"name": "ipcMain",
"description": "Communicate asynchronously from the main process to renderer processes.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "ipc-main",
"websiteUrl": "http://electronjs.org/docs/api/ipc-main",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/ipc-main.md",
"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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "removeListener",
"signature": "(channel, listener)",
"description": "Removes the specified listener from the listener array for the specified channel.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "removeAllListeners",
"signature": "([channel])",
"description": "Removes listeners of the specified channel.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
}
]
}
]
},
{
"name": "ipcRenderer",
"description": "Communicate asynchronously from a renderer process to the main process.",
"process": {
"main": false,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "ipc-renderer",
"websiteUrl": "http://electronjs.org/docs/api/ipc-renderer",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/ipc-renderer.md",
"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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "removeListener",
"signature": "(channel, listener)",
"description": "Removes the specified listener from the listener array for the specified channel.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true
}
]
},
{
"name": "removeAllListeners",
"signature": "(channel)",
"description": "Removes all listeners, or those of the specified channel.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "send",
"signature": "(channel[, arg1][, arg2][, ...])",
"description": "Send a message to the main process asynchronously via channel, you can also send arbitrary arguments. Arguments will be serialized in JSON internally and hence no functions or prototype chain will be included. The main process handles it by listening for channel with ipcMain module.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "...args",
"type": "any",
"collection": true,
"required": true
}
]
},
{
"name": "sendSync",
"signature": "(channel[, arg1][, arg2][, ...])",
"description": "Send a message to the main process synchronously via channel, you can also send arbitrary arguments. Arguments will be serialized in JSON internally and hence no functions or prototype chain will be included. The main process handles it by listening for channel with ipcMain module, and replies by setting event.returnValue. Note: Sending a synchronous message will block the whole renderer process, unless you know what you are doing you should never use it.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "...args",
"type": "any",
"collection": true,
"required": true
}
],
"returns": {
"type": "any",
"collection": false,
"description": "The value sent back by the ipcMain handler."
}
},
{
"name": "sendTo",
"signature": "(webContentsId, channel, [, arg1][, arg2][, ...])",
"description": "Sends a message to a window with webContentsId via channel.",
"parameters": [
{
"name": "webContentsId",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "...args",
"type": "any",
"collection": true,
"required": true
}
]
},
{
"name": "sendToHost",
"signature": "(channel[, arg1][, arg2][, ...])",
"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",
"type": "String",
"collection": false,
"required": true
},
{
"name": "...args",
"type": "any",
"collection": true,
"required": true
}
]
}
]
},
{
"name": "JumpListCategory",
"version": "4.0.3",
"type": "Structure",
"slug": "jump-list-category",
"websiteUrl": "http://electronjs.org/docs/api/structures/jump-list-category",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/jump-list-category.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "One of the following:",
"required": false,
"possibleValues": [
{
"value": "tasks",
"description": "Items in this category will be placed into the standard Tasks
category. There can be only one such category, and it will always be displayed at the bottom of the Jump List."
},
{
"value": "frequent",
"description": "Displays a list of files frequently opened by the app, the name of the category and its items are set by Windows."
},
{
"value": "recent",
"description": "Displays a list of files recently opened by the app, the name of the category and its items are set by Windows. Items may be added to this category indirectly using app.addRecentDocument(path)
."
},
{
"value": "custom",
"description": "Displays tasks or file links, name
must be set by the app."
}
]
},
{
"name": "name",
"type": "String",
"collection": false,
"description": "Must be set if type is custom, otherwise it should be omitted.",
"required": false
},
{
"name": "items",
"type": "JumpListItem",
"collection": true,
"description": "Array of objects if type is tasks or custom, otherwise it should be omitted.",
"required": false
}
]
},
{
"name": "JumpListItem",
"version": "4.0.3",
"type": "Structure",
"slug": "jump-list-item",
"websiteUrl": "http://electronjs.org/docs/api/structures/jump-list-item",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/jump-list-item.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "One of the following:",
"required": false,
"possibleValues": [
{
"value": "task",
"description": "A task will launch an app with specific arguments."
},
{
"value": "separator",
"description": "Can be used to separate items in the standard Tasks
category."
},
{
"value": "file",
"description": "A file link will open a file using the app that created the Jump List, for this to work the app must be registered as a handler for the file type (though it doesn't have to be the default handler)."
}
]
},
{
"name": "path",
"type": "String",
"collection": false,
"description": "Path of the file to open, should only be set if type is file.",
"required": false
},
{
"name": "program",
"type": "String",
"collection": false,
"description": "Path of the program to execute, usually you should specify process.execPath which opens the current program. Should only be set if type is task.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": false,
"description": "The command line arguments when program is executed. Should only be set if type is task.",
"required": false
},
{
"name": "title",
"type": "String",
"collection": false,
"description": "The text to be displayed for the item in the Jump List. Should only be set if type is task.",
"required": false
},
{
"name": "description",
"type": "String",
"collection": false,
"description": "Description of the task (displayed in a tooltip). Should only be set if type is task.",
"required": false
},
{
"name": "iconPath",
"type": "String",
"collection": false,
"description": "The absolute path to an icon to be displayed in a Jump List, which can be an arbitrary resource file that contains an icon (e.g. .ico, .exe, .dll). You can usually specify process.execPath to show the program icon.",
"required": false
},
{
"name": "iconIndex",
"type": "Number",
"collection": false,
"description": "The index of the icon in the resource file. If a resource file contains multiple icons this value can be used to specify the zero-based index of the icon that should be displayed for this task. If a resource file contains only one icon, this property should be set to zero.",
"required": false
}
]
},
{
"name": "MemoryInfo",
"version": "4.0.3",
"type": "Structure",
"slug": "memory-info",
"websiteUrl": "http://electronjs.org/docs/api/structures/memory-info",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/memory-info.md",
"properties": [
{
"name": "pid",
"type": "Integer",
"collection": false,
"description": "Process id of the process.",
"required": true
},
{
"name": "workingSetSize",
"type": "Integer",
"collection": false,
"description": "The amount of memory currently pinned to actual physical RAM.",
"required": true
},
{
"name": "peakWorkingSetSize",
"type": "Integer",
"collection": false,
"description": "The maximum amount of memory that has ever been pinned to actual physical RAM. On macOS its value will always be 0.",
"required": true
},
{
"name": "privateBytes",
"type": "Integer",
"collection": false,
"description": "The amount of memory not shared by other processes, such as JS heap or HTML content.",
"required": true
},
{
"name": "sharedBytes",
"type": "Integer",
"collection": false,
"description": "The amount of memory shared between processes, typically memory consumed by the Electron code itself",
"required": true
}
]
},
{
"name": "MemoryUsageDetails",
"version": "4.0.3",
"type": "Structure",
"slug": "memory-usage-details",
"websiteUrl": "http://electronjs.org/docs/api/structures/memory-usage-details",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/memory-usage-details.md",
"properties": [
{
"name": "count",
"type": "Number",
"collection": false,
"description": "",
"required": true
},
{
"name": "size",
"type": "Number",
"collection": false,
"description": "",
"required": true
},
{
"name": "liveSize",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "Menu",
"description": "Create native application menus and context menus.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "menu",
"websiteUrl": "http://electronjs.org/docs/api/menu",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/menu.md",
"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. Passing null will remove the menu bar on Windows and Linux but has no effect on macOS. Note: This API has to be called after the ready event of app module.",
"parameters": [
{
"name": "menu",
"type": [
{
"typeName": "Menu",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true
}
]
},
{
"name": "getApplicationMenu",
"signature": "()",
"description": "Note: The returned Menu instance doesn't support dynamic addition or removal of menu items. Instance properties can still be dynamically modified.",
"returns": {
"type": [
{
"typeName": "Menu",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "The application menu, if set, or null, if not set."
}
},
{
"name": "sendActionToFirstResponder",
"signature": "(action)",
"platforms": [
"macOS"
],
"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. See the macOS Cocoa Event Handling Guide for more information on macOS' native actions.",
"parameters": [
{
"name": "action",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "buildFromTemplate",
"signature": "(template)",
"description": "Generally, the template is an array of options for constructing a MenuItem. The usage can be referenced above. You can also attach other fields to the element of the template and they will become properties of the constructed menu items.",
"parameters": [
{
"name": "template",
"type": "MenuItemConstructorOptions",
"collection": true,
"required": true
}
],
"returns": {
"type": "Menu",
"collection": false
}
}
],
"constructorMethod": {
"signature": "()"
},
"instanceName": "menu",
"instanceMethods": [
{
"name": "popup",
"signature": "(options)",
"description": "Pops up this menu as a context menu in the BrowserWindow.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "window",
"type": "BrowserWindow",
"collection": false,
"description": "Default is the focused window.",
"required": false
},
{
"name": "x",
"type": "Number",
"collection": false,
"description": "Default is the current mouse cursor position. Must be declared if y is declared.",
"required": false
},
{
"name": "y",
"type": "Number",
"collection": false,
"description": "Default is the current mouse cursor position. Must be declared if x is declared.",
"required": false
},
{
"name": "positioningItem",
"type": "Number",
"collection": false,
"description": "The index of the menu item to be positioned under the mouse cursor at the specified coordinates. Default is -1.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called when menu is closed.",
"required": false,
"parameters": []
}
]
}
]
},
{
"name": "closePopup",
"signature": "([browserWindow])",
"description": "Closes the context menu in the browserWindow.",
"parameters": [
{
"name": "browserWindow",
"type": "BrowserWindow",
"collection": false,
"description": "Default is the focused window.",
"required": false
}
]
},
{
"name": "append",
"signature": "(menuItem)",
"description": "Appends the menuItem to the menu.",
"parameters": [
{
"name": "menuItem",
"type": "MenuItem",
"collection": false,
"required": true
}
]
},
{
"name": "getMenuItemById",
"signature": "(id)",
"parameters": [
{
"name": "id",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "MenuItem",
"collection": false,
"description": "the item with the specified id"
}
},
{
"name": "insert",
"signature": "(pos, menuItem)",
"description": "Inserts the menuItem to the pos position of the menu.",
"parameters": [
{
"name": "pos",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "menuItem",
"type": "MenuItem",
"collection": false,
"required": true
}
]
}
],
"instanceProperties": [
{
"name": "items",
"description": "A MenuItem[] array containing the menu's items. Each Menu consists of multiple MenuItems and each MenuItem can have a submenu.",
"type": "MenuItem",
"collection": true
}
],
"instanceEvents": [
{
"name": "menu-will-show",
"description": "Emitted when menu.popup() is called.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "menu-will-close",
"description": "Emitted when a popup is closed either manually or with menu.closePopup().",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
}
]
},
{
"name": "MenuItem",
"description": "Add items to native application menus and context menus.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "menu-item",
"websiteUrl": "http://electronjs.org/docs/api/menu-item",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/menu-item.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "click",
"type": "Function",
"collection": false,
"description": "Will be called with click(menuItem, browserWindow, event) when the menu item is clicked.",
"required": false,
"parameters": [
{
"name": "menuItem",
"type": "MenuItem",
"collection": false,
"description": "",
"required": true
},
{
"name": "browserWindow",
"type": "BrowserWindow",
"collection": false,
"description": "",
"required": true
},
{
"name": "event",
"type": "Event",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "role",
"type": "String",
"collection": false,
"description": "Define the action of the menu item, when specified the click property will be ignored. See .",
"required": false
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "Can be normal, separator, submenu, checkbox or radio.",
"required": false,
"possibleValues": [
{
"value": "normal"
},
{
"value": "separator"
},
{
"value": "submenu"
},
{
"value": "checkbox"
},
{
"value": "radio"
}
]
},
{
"name": "label",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "sublabel",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "accelerator",
"type": "Accelerator",
"collection": false,
"description": "",
"required": false
},
{
"name": "icon",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"description": "",
"required": false
},
{
"name": "enabled",
"type": "Boolean",
"collection": false,
"description": "If false, the menu item will be greyed out and unclickable.",
"required": false
},
{
"name": "visible",
"type": "Boolean",
"collection": false,
"description": "If false, the menu item will be entirely hidden.",
"required": false
},
{
"name": "checked",
"type": "Boolean",
"collection": false,
"description": "Should only be specified for checkbox or radio type menu items.",
"required": false
},
{
"name": "registerAccelerator",
"type": "Boolean",
"collection": false,
"description": "If false, the accelerator won't be registered with the system, but it will still be displayed. Defaults to true.",
"required": false
},
{
"name": "submenu",
"type": [
{
"typeName": "MenuItemConstructorOptions",
"collection": true
},
{
"typeName": "Menu",
"collection": false
}
],
"collection": false,
"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 then it will be automatically converted to one using Menu.buildFromTemplate.",
"required": false
},
{
"name": "id",
"type": "String",
"collection": false,
"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
},
{
"name": "before",
"type": "String",
"collection": true,
"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
},
{
"name": "after",
"type": "String",
"collection": true,
"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
},
{
"name": "beforeGroupContaining",
"type": "String",
"collection": true,
"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
},
{
"name": "afterGroupContaining",
"type": "String",
"collection": true,
"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
}
]
}
]
},
"instanceName": "menuItem",
"instanceProperties": [
{
"name": "enabled",
"description": "A Boolean indicating whether the item is enabled, this property can be dynamically changed.",
"type": "Boolean",
"collection": false
},
{
"name": "visible",
"description": "A Boolean indicating whether the item is visible, this property can be dynamically changed.",
"type": "Boolean",
"collection": false
},
{
"name": "checked",
"description": "A Boolean indicating whether the item is checked, this property can be dynamically changed. A checkbox menu item will toggle the checked property on and off when selected. A 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. You can add a click function for additional behavior.",
"type": "Boolean",
"collection": false
},
{
"name": "label",
"description": "A String representing the menu items visible label.",
"type": "String",
"collection": false
},
{
"name": "click",
"description": "A Function that is fired when the MenuItem receives a click event.",
"type": "Function",
"collection": false
}
]
},
{
"name": "MimeTypedBuffer",
"version": "4.0.3",
"type": "Structure",
"slug": "mime-typed-buffer",
"websiteUrl": "http://electronjs.org/docs/api/structures/mime-typed-buffer",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/mime-typed-buffer.md",
"properties": [
{
"name": "mimeType",
"type": "String",
"collection": false,
"description": "The mimeType of the Buffer that you are sending.",
"required": true
},
{
"name": "data",
"type": "Buffer",
"collection": false,
"description": "The actual Buffer content.",
"required": true
}
]
},
{
"name": "nativeImage",
"description": "Create tray, dock, and application icons using PNG or JPG files.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "native-image",
"websiteUrl": "http://electronjs.org/docs/api/native-image",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/native-image.md",
"methods": [
{
"name": "createEmpty",
"signature": "()",
"description": "Creates an empty NativeImage instance.",
"returns": {
"type": "NativeImage",
"collection": false
}
},
{
"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",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "NativeImage",
"collection": false
}
},
{
"name": "createFromBuffer",
"signature": "(buffer[, options])",
"description": "Creates a new NativeImage instance from buffer.",
"parameters": [
{
"name": "buffer",
"type": "Buffer",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "width",
"type": "Integer",
"collection": false,
"description": "Required for bitmap buffers.",
"required": false
},
{
"name": "height",
"type": "Integer",
"collection": false,
"description": "Required for bitmap buffers.",
"required": false
},
{
"name": "scaleFactor",
"type": "Double",
"collection": false,
"description": "Defaults to 1.0.",
"required": false
}
]
}
],
"returns": {
"type": "NativeImage",
"collection": false
}
},
{
"name": "createFromDataURL",
"signature": "(dataURL)",
"description": "Creates a new NativeImage instance from dataURL.",
"parameters": [
{
"name": "dataURL",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "NativeImage",
"collection": false
}
},
{
"name": "createFromNamedImage",
"signature": "(imageName[, hslShift])",
"platforms": [
"macOS"
],
"description": "Creates a new NativeImage instance from the NSImage that maps to the given image name. See NSImageName for a list of possible values. The hslShift is applied to the image with the following rules This means that [-1, 0, 1] will make the image completely white and [-1, 1, 0] will make the image completely black.",
"parameters": [
{
"name": "imageName",
"type": "String",
"collection": false,
"required": true
},
{
"name": "hslShift",
"type": "Number",
"collection": true,
"required": true
}
],
"returns": {
"type": "NativeImage",
"collection": false
}
}
]
},
{
"name": "NativeImage",
"description": "Natively wrap images such as tray, dock, and application icons.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Class",
"slug": "native-image",
"websiteUrl": "http://electronjs.org/docs/api/native-image",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/native-image.md",
"instanceName": "image",
"instanceMethods": [
{
"name": "toPNG",
"signature": "([options])",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "scaleFactor",
"type": "Double",
"collection": false,
"description": "Defaults to 1.0.",
"required": false
}
]
}
],
"returns": {
"type": "Buffer",
"collection": false,
"description": "A Buffer that contains the image's PNG encoded data."
}
},
{
"name": "toJPEG",
"signature": "(quality)",
"parameters": [
{
"name": "quality",
"type": "Integer",
"collection": false,
"description": "() Between 0 100.",
"required": true
}
],
"returns": {
"type": "Buffer",
"collection": false,
"description": "A Buffer that contains the image's JPEG encoded data."
}
},
{
"name": "toBitmap",
"signature": "([options])",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "scaleFactor",
"type": "Double",
"collection": false,
"description": "Defaults to 1.0.",
"required": false
}
]
}
],
"returns": {
"type": "Buffer",
"collection": false,
"description": "A Buffer that contains a copy of the image's raw bitmap pixel data."
}
},
{
"name": "toDataURL",
"signature": "([options])",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "scaleFactor",
"type": "Double",
"collection": false,
"description": "Defaults to 1.0.",
"required": false
}
]
}
],
"returns": {
"type": "String",
"collection": false,
"description": "The data URL of the image."
}
},
{
"name": "getBitmap",
"signature": "([options])",
"description": "The difference between getBitmap() and toBitmap() is, 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",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "scaleFactor",
"type": "Double",
"collection": false,
"description": "Defaults to 1.0.",
"required": false
}
]
}
],
"returns": {
"type": "Buffer",
"collection": false,
"description": "A Buffer that contains the image's raw bitmap pixel data."
}
},
{
"name": "getNativeHandle",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Notice 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.",
"returns": {
"type": "Buffer",
"collection": false,
"description": "A Buffer that stores C pointer to underlying native handle of the image. On macOS, a pointer to NSImage instance would be returned."
}
},
{
"name": "isEmpty",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the image is empty."
}
},
{
"name": "getSize",
"signature": "()",
"returns": {
"type": "Size",
"collection": false
}
},
{
"name": "setTemplateImage",
"signature": "(option)",
"description": "Marks the image as a template image.",
"parameters": [
{
"name": "option",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isTemplateImage",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the image is a template image."
}
},
{
"name": "crop",
"signature": "(rect)",
"parameters": [
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"description": "The area of the image to crop.",
"required": true
}
],
"returns": {
"type": "NativeImage",
"collection": false,
"description": "The cropped image."
}
},
{
"name": "resize",
"signature": "(options)",
"description": "If only the height or the width are specified then the current aspect ratio will be preserved in the resized image.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "width",
"type": "Integer",
"collection": false,
"description": "Defaults to the image's width.",
"required": false
},
{
"name": "height",
"type": "Integer",
"collection": false,
"description": "Defaults to the image's height.",
"required": false
},
{
"name": "quality",
"type": "String",
"collection": false,
"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
}
]
}
],
"returns": {
"type": "NativeImage",
"collection": false,
"description": "The resized image."
}
},
{
"name": "getAspectRatio",
"signature": "()",
"returns": {
"type": "Float",
"collection": false,
"description": "The image's aspect ratio."
}
},
{
"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",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "scaleFactor",
"type": "Double",
"collection": false,
"description": "The scale factor to add the image representation for.",
"required": true
},
{
"name": "width",
"type": "Integer",
"collection": false,
"description": "Defaults to 0. Required if a bitmap buffer is specified as buffer.",
"required": false
},
{
"name": "height",
"type": "Integer",
"collection": false,
"description": "Defaults to 0. Required if a bitmap buffer is specified as buffer.",
"required": false
},
{
"name": "buffer",
"type": "Buffer",
"collection": false,
"description": "The buffer containing the raw image data.",
"required": false
},
{
"name": "dataURL",
"type": "String",
"collection": false,
"description": "The data URL containing either a base 64 encoded PNG or JPEG image.",
"required": false
}
]
}
]
}
]
},
{
"name": "net",
"description": "Issue HTTP/HTTPS requests using Chromium's native networking library",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "net",
"websiteUrl": "http://electronjs.org/docs/api/net",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/net.md",
"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",
"type": [
{
"typeName": "Object",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"description": "The `ClientRequest` constructor options.",
"required": true
}
],
"returns": {
"type": "ClientRequest",
"collection": false
}
}
]
},
{
"name": "netLog",
"description": "Logging network events for a session.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "net-log",
"websiteUrl": "http://electronjs.org/docs/api/net-log",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/net-log.md",
"methods": [
{
"name": "startLogging",
"signature": "(path)",
"description": "Starts recording network events to path.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "File path to record network logs.",
"required": true
}
]
},
{
"name": "stopLogging",
"signature": "([callback])",
"description": "Stops recording network events. If not called, net logging will automatically end when app quits.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "File path to which network logs were recorded.",
"required": true
}
]
}
]
}
],
"properties": [
{
"name": "currentlyLogging",
"description": "A Boolean property that indicates whether network logs are recorded.",
"type": "Boolean",
"collection": false
},
{
"name": "currentlyLoggingPath",
"description": "A String property that returns the path to the current log file.",
"type": "String",
"collection": false
}
]
},
{
"name": "Notification",
"description": "Create OS desktop notifications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "notification",
"websiteUrl": "http://electronjs.org/docs/api/notification",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/notification.md",
"staticMethods": [
{
"name": "isSupported",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether or not desktop notifications are supported on the current system"
}
}
],
"constructorMethod": {
"signature": "([options])",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "title",
"type": "String",
"collection": false,
"description": "A title for the notification, which will be shown at the top of the notification window when it is shown.",
"required": true
},
{
"name": "subtitle",
"type": "String",
"collection": false,
"description": "A subtitle for the notification, which will be displayed below the title.",
"required": false
},
{
"name": "body",
"type": "String",
"collection": false,
"description": "The body text of the notification, which will be displayed below the title or subtitle.",
"required": true
},
{
"name": "silent",
"type": "Boolean",
"collection": false,
"description": "Whether or not to emit an OS notification noise when showing the notification.",
"required": false
},
{
"name": "icon",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "NativeImage",
"collection": false
}
],
"collection": false,
"description": "An icon to use in the notification.",
"required": false
},
{
"name": "hasReply",
"type": "Boolean",
"collection": false,
"description": "Whether or not to add an inline reply option to the notification.",
"required": false
},
{
"name": "replyPlaceholder",
"type": "String",
"collection": false,
"description": "The placeholder to write in the inline reply input field.",
"required": false
},
{
"name": "sound",
"type": "String",
"collection": false,
"description": "The name of the sound file to play when the notification is shown.",
"required": false
},
{
"name": "actions",
"type": "NotificationAction",
"collection": true,
"description": "Actions to add to the notification. Please read the available actions and limitations in the NotificationAction documentation.",
"required": false
},
{
"name": "closeButtonText",
"type": "String",
"collection": false,
"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
}
]
}
]
},
"instanceName": "notification",
"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. If the notification has been shown before, this method will dismiss the previously shown notification and create a new one with identical properties."
},
{
"name": "close",
"signature": "()",
"description": "Dismisses the notification."
}
],
"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.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "click",
"description": "Emitted when the notification is clicked by the user.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "close",
"description": "Emitted when the notification is closed by manual intervention from the user. This event is not guaranteed to be emitted in all cases where the notification is closed.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "reply",
"description": "Emitted when the user clicks the \"Reply\" button on a notification with hasReply: true.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "reply",
"type": "String",
"collection": false,
"description": "The string the user entered into the inline reply field.",
"required": true
}
]
},
{
"name": "action",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "index",
"type": "Number",
"collection": false,
"description": "The index of the action that was activated.",
"required": true
}
]
}
]
},
{
"name": "NotificationAction",
"version": "4.0.3",
"type": "Structure",
"slug": "notification-action",
"websiteUrl": "http://electronjs.org/docs/api/structures/notification-action",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/notification-action.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "The type of action, can be button.",
"required": true,
"possibleValues": [
{
"value": "button"
}
]
},
{
"name": "text",
"type": "String",
"collection": false,
"description": "The label for the given action.",
"required": false
}
]
},
{
"name": "Point",
"version": "4.0.3",
"type": "Structure",
"slug": "point",
"websiteUrl": "http://electronjs.org/docs/api/structures/point",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/point.md",
"properties": [
{
"name": "x",
"type": "Number",
"collection": false,
"description": "",
"required": true
},
{
"name": "y",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "powerMonitor",
"description": "Monitor power state changes.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "power-monitor",
"websiteUrl": "http://electronjs.org/docs/api/power-monitor",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/power-monitor.md",
"events": [
{
"name": "suspend",
"description": "Emitted when the system is suspending."
},
{
"name": "resume",
"description": "Emitted when system is resuming."
},
{
"name": "on-ac",
"description": "Emitted when the system changes to AC power.",
"platforms": [
"Windows"
]
},
{
"name": "on-battery",
"description": "Emitted when system changes to battery power.",
"platforms": [
"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().",
"platforms": [
"Linux",
"macOS"
]
},
{
"name": "lock-screen",
"description": "Emitted when the system is about to lock the screen.",
"platforms": [
"macOS",
"Windows"
]
},
{
"name": "unlock-screen",
"description": "Emitted as soon as the systems screen is unlocked.",
"platforms": [
"macOS",
"Windows"
]
}
]
},
{
"name": "powerSaveBlocker",
"description": "Block the system from entering low-power (sleep) mode.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "power-save-blocker",
"websiteUrl": "http://electronjs.org/docs/api/power-save-blocker",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/power-save-blocker.md",
"methods": [
{
"name": "start",
"signature": "(type)",
"description": "Starts preventing the system from entering lower-power mode. Returns an integer identifying the power save blocker. 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. For 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",
"type": "String",
"collection": false,
"description": "Power save blocker type.",
"required": true,
"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": {
"type": "Integer",
"collection": false,
"description": "The blocker ID that is assigned to this power blocker."
}
},
{
"name": "stop",
"signature": "(id)",
"description": "Stops the specified power save blocker.",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "The power save blocker id returned by `powerSaveBlocker.start`.",
"required": true
}
]
},
{
"name": "isStarted",
"signature": "(id)",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "The power save blocker id returned by `powerSaveBlocker.start`.",
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the corresponding powerSaveBlocker has started."
}
}
]
},
{
"name": "PrinterInfo",
"version": "4.0.3",
"type": "Structure",
"slug": "printer-info",
"websiteUrl": "http://electronjs.org/docs/api/structures/printer-info",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/printer-info.md",
"properties": [
{
"name": "name",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "description",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "status",
"type": "Number",
"collection": false,
"description": "",
"required": true
},
{
"name": "isDefault",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "process",
"description": "Extensions to process object.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "process",
"websiteUrl": "http://electronjs.org/docs/api/process",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/process.md",
"methods": [
{
"name": "crash",
"signature": "()",
"description": "Causes the main thread of the current process crash."
},
{
"name": "getCreationTime",
"signature": "()",
"description": "Indicates 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.",
"returns": {
"type": [
{
"typeName": "Number",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "The number of milliseconds since epoch, or null if the information is unavailable"
}
},
{
"name": "getCPUUsage",
"signature": "()",
"returns": {
"type": "CPUUsage",
"collection": false
}
},
{
"name": "getIOCounters",
"signature": "()",
"platforms": [
"Windows",
"Linux"
],
"returns": {
"type": "IOCounters",
"collection": false
}
},
{
"name": "getHeapStatistics",
"signature": "()",
"description": "Returns an object with V8 heap statistics. Note that all statistics are reported in Kilobytes.",
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "totalHeapSize",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "totalHeapSizeExecutable",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "totalPhysicalSize",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "totalAvailableSize",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "usedHeapSize",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "heapSizeLimit",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "mallocedMemory",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "peakMallocedMemory",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "doesZapGarbage",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
}
]
}
},
{
"name": "getSystemMemoryInfo",
"signature": "()",
"description": "Returns an object giving memory usage statistics about the entire system. Note that all statistics are reported in Kilobytes.",
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "total",
"type": "Integer",
"collection": false,
"description": "The total amount of physical memory in Kilobytes available to the system.",
"required": true
},
{
"name": "free",
"type": "Integer",
"collection": false,
"description": "The total amount of memory not being used by applications or disk cache.",
"required": true
},
{
"name": "swapTotal",
"type": "Integer",
"collection": false,
"description": "The total amount of swap memory in Kilobytes available to the system.",
"required": true
},
{
"name": "swapFree",
"type": "Integer",
"collection": false,
"description": "The free amount of swap memory in Kilobytes available to the system.",
"required": true
}
]
}
},
{
"name": "takeHeapSnapshot",
"signature": "(filePath)",
"description": "Takes a V8 heap snapshot and saves it to filePath.",
"parameters": [
{
"name": "filePath",
"type": "String",
"collection": false,
"description": "Path to the output file.",
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Indicates whether the snapshot has been created successfully."
}
},
{
"name": "hang",
"signature": "()",
"description": "Causes the main thread of the current process hang."
},
{
"name": "setFdLimit",
"signature": "(maxDescriptors)",
"platforms": [
"macOS",
"Linux"
],
"description": "Sets the file descriptor soft limit to maxDescriptors or the OS hard limit, whichever is lower for the current process.",
"parameters": [
{
"name": "maxDescriptors",
"type": "Integer",
"collection": false,
"required": true
}
]
}
],
"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. It can be used by the preload script to add removed Node global symbols back to the global scope when node integration is turned off:"
}
],
"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.",
"type": "Boolean",
"collection": false
},
{
"name": "mas",
"description": "A Boolean. For Mac App Store build, this property is true, for other builds it is undefined.",
"type": "Boolean",
"collection": false
},
{
"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.",
"type": "Boolean",
"collection": false
},
{
"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.",
"type": "Boolean",
"collection": false
},
{
"name": "resourcesPath",
"description": "A String representing the path to the resources directory.",
"type": "String",
"collection": false
},
{
"name": "sandboxed",
"description": "A Boolean. When the renderer process is sandboxed, this property is true, otherwise it is undefined.",
"type": "Boolean",
"collection": false
},
{
"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.",
"type": "Boolean",
"collection": false
},
{
"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.",
"type": "Boolean",
"collection": false
},
{
"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.",
"type": "Boolean",
"collection": false
},
{
"name": "type",
"description": "A String representing the current process's type, can be \"browser\" (i.e. main process) or \"renderer\".",
"type": "String",
"collection": false
},
{
"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.",
"type": "Boolean",
"collection": false
},
{
"name": "versions",
"type": "Object",
"required": true,
"properties": [
{
"name": "chrome",
"description": "A String representing Chrome's version string.",
"type": "String",
"collection": false,
"_superObject": "versions"
},
{
"name": "electron",
"description": "A String representing Electron's version string.",
"type": "String",
"collection": false,
"_superObject": "versions"
}
]
}
]
},
{
"name": "ProcessMetric",
"version": "4.0.3",
"type": "Structure",
"slug": "process-metric",
"websiteUrl": "http://electronjs.org/docs/api/structures/process-metric",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/process-metric.md",
"properties": [
{
"name": "pid",
"type": "Integer",
"collection": false,
"description": "Process id of the process.",
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "Process type (Browser or Tab or GPU etc).",
"required": true
},
{
"name": "cpu",
"type": "CPUUsage",
"collection": false,
"description": "CPU usage of the process.",
"required": true
}
]
},
{
"name": "Product",
"version": "4.0.3",
"type": "Structure",
"slug": "product",
"websiteUrl": "http://electronjs.org/docs/api/structures/product",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/product.md",
"properties": [
{
"name": "productIdentifier",
"type": "String",
"collection": false,
"description": "The string that identifies the product to the Apple App Store.",
"required": true
},
{
"name": "localizedDescription",
"type": "String",
"collection": false,
"description": "A description of the product.",
"required": true
},
{
"name": "localizedTitle",
"type": "String",
"collection": false,
"description": "The name of the product.",
"required": true
},
{
"name": "contentVersion",
"type": "String",
"collection": false,
"description": "A string that identifies the version of the content.",
"required": true
},
{
"name": "contentLengths",
"type": "Number",
"collection": true,
"description": "The total size of the content, in bytes.",
"required": true
},
{
"name": "price",
"type": "Number",
"collection": false,
"description": "The cost of the product in the local currency.",
"required": true
},
{
"name": "formattedPrice",
"type": "String",
"collection": false,
"description": "The locale formatted price of the product.",
"required": true
},
{
"name": "downloadable",
"type": "Boolean",
"collection": false,
"description": "A Boolean value that indicates whether the App Store has downloadable content for this product.",
"required": true
}
]
},
{
"name": "protocol",
"description": "Register a custom protocol and intercept existing protocol requests.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "protocol",
"websiteUrl": "http://electronjs.org/docs/api/protocol",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/protocol.md",
"methods": [
{
"name": "registerStandardSchemes",
"signature": "(schemes[, options])",
"description": "A standard scheme adheres to what RFC 3986 calls generic URI syntax. For example http and https are standard schemes, while file is not. Registering a scheme as standard, will allow 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. For 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: Registering a scheme as standard will allow access to files through the FileSystem API. Otherwise the renderer will throw a security error for the scheme. By 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: Note: This method can only be used before the ready event of the app module gets emitted.",
"parameters": [
{
"name": "schemes",
"type": "String",
"collection": true,
"description": "Custom schemes to be registered as standard schemes.",
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "secure",
"type": "Boolean",
"collection": false,
"description": "true to register the scheme as secure. Default false.",
"required": false
}
]
}
]
},
{
"name": "registerServiceWorkerSchemes",
"signature": "(schemes)",
"parameters": [
{
"name": "schemes",
"type": "String",
"collection": true,
"description": "Custom schemes to be registered to handle service workers.",
"required": true
}
]
},
{
"name": "registerFileProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Registers a protocol of scheme that will send the file as a response. The handler will be called with handler(request, callback) when a request is going to be created with scheme. completion will be called with completion(null) when scheme is successfully registered or completion(error) when failed. To handle the request, the callback should be called with either the file's path or an object that has a path property, e.g. callback(filePath) or callback({ path: filePath }). When callback is called with nothing, a number, or an object that has an error property, the request will fail with the error number you specified. For the available error numbers you can use, please see the net error list. By default the scheme is treated like http:, which is parsed differently than protocols that follow the \"generic URI syntax\" like file:, so you probably want to call protocol.registerStandardSchemes to have your scheme treated as a standard scheme.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "filePath",
"type": "String",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "registerBufferProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Registers a protocol of scheme that will send a Buffer as a response. The usage is the same with registerFileProtocol, except that the callback should be called with either a Buffer object or an object that has the data, mimeType, and charset properties. Example:",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "buffer",
"type": [
{
"typeName": "Buffer",
"collection": false
},
{
"typeName": "MimeTypedBuffer",
"collection": false
}
],
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "registerStringProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Registers a protocol of scheme that will send a String as a response. The usage is the same with registerFileProtocol, except that the callback should be called with either a String or an object that has the data, mimeType, and charset properties.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "data",
"type": "String",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "registerHttpProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Registers a protocol of scheme that will send an HTTP request as a response. The usage is the same with registerFileProtocol, except that the callback should be called with a redirectRequest object that has the url, method, referrer, uploadData and session properties. By default the HTTP request will reuse the current session. If you want the request to have a different session you should set session to null. For POST requests the uploadData object must be provided.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "headers",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "redirectRequest",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "session",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": []
},
{
"name": "uploadData",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": [
{
"name": "contentType",
"type": "String",
"collection": false,
"description": "MIME type of the content.",
"required": true
},
{
"name": "data",
"type": "String",
"collection": false,
"description": "Content to be sent.",
"required": true
}
]
}
]
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "registerStreamProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Registers a protocol of scheme that will send a Readable as a response. The usage is similar to the other register{Any}Protocol, except that the callback should be called with either a Readable object or an object that has the data, statusCode, and headers properties. Example: It is possible to pass any object that implements the readable stream API (emits data/end/error events). For example, here's how a file could be returned:",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "headers",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "stream",
"type": [
{
"typeName": "ReadableStream",
"collection": false
},
{
"typeName": "StreamProtocolResponse",
"collection": false
}
],
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "unregisterProtocol",
"signature": "(scheme[, completion])",
"description": "Unregisters the custom protocol of scheme.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "isProtocolHandled",
"signature": "(scheme, callback)",
"description": "The callback will be called with a boolean that indicates whether there is already a handler for scheme.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "interceptFileProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Intercepts scheme protocol and uses handler as the protocol's new handler which sends a file as a response.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "filePath",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "interceptStringProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Intercepts scheme protocol and uses handler as the protocol's new handler which sends a String as a response.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "data",
"type": "String",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "interceptBufferProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Intercepts scheme protocol and uses handler as the protocol's new handler which sends a Buffer as a response.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "buffer",
"type": "Buffer",
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "interceptHttpProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Intercepts scheme protocol and uses handler as the protocol's new handler which sends a new HTTP request as a response.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "headers",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "redirectRequest",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "session",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": []
},
{
"name": "uploadData",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": [
{
"name": "contentType",
"type": "String",
"collection": false,
"description": "MIME type of the content.",
"required": true
},
{
"name": "data",
"type": "String",
"collection": false,
"description": "Content to be sent.",
"required": true
}
]
}
]
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "interceptStreamProtocol",
"signature": "(scheme, handler[, completion])",
"description": "Same as protocol.registerStreamProtocol, except that it replaces an existing protocol handler.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "handler",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "headers",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
},
{
"name": "referrer",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "stream",
"type": [
{
"typeName": "ReadableStream",
"collection": false
},
{
"typeName": "StreamProtocolResponse",
"collection": false
}
],
"collection": false,
"description": "",
"required": false
}
]
}
]
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "uninterceptProtocol",
"signature": "(scheme[, completion])",
"description": "Remove the interceptor installed for scheme and restore its original handler.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "completion",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
]
}
]
},
{
"name": "Rectangle",
"version": "4.0.3",
"type": "Structure",
"slug": "rectangle",
"websiteUrl": "http://electronjs.org/docs/api/structures/rectangle",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/rectangle.md",
"properties": [
{
"name": "x",
"type": "Number",
"collection": false,
"description": "The x coordinate of the origin of the rectangle (must be an integer).",
"required": true
},
{
"name": "y",
"type": "Number",
"collection": false,
"description": "The y coordinate of the origin of the rectangle (must be an integer).",
"required": true
},
{
"name": "width",
"type": "Number",
"collection": false,
"description": "The width of the rectangle (must be an integer).",
"required": true
},
{
"name": "height",
"type": "Number",
"collection": false,
"description": "The height of the rectangle (must be an integer).",
"required": true
}
]
},
{
"name": "Referrer",
"version": "4.0.3",
"type": "Structure",
"slug": "referrer",
"websiteUrl": "http://electronjs.org/docs/api/structures/referrer",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/referrer.md",
"properties": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "HTTP Referrer URL.",
"required": true
},
{
"name": "policy",
"type": "String",
"collection": false,
"description": "Can be default, unsafe-url, no-referrer-when-downgrade, no-referrer, origin, strict-origin-when-cross-origin, same-origin or strict-origin. See the for more details on the meaning of these values.",
"required": true,
"possibleValues": [
{
"value": "default"
},
{
"value": "unsafe-url"
},
{
"value": "no-referrer-when-downgrade"
},
{
"value": "no-referrer"
},
{
"value": "origin"
},
{
"value": "strict-origin-when-cross-origin"
},
{
"value": "same-origin"
},
{
"value": "strict-origin"
}
]
}
]
},
{
"name": "remote",
"description": "Use main process modules from the renderer process.",
"process": {
"main": false,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "remote",
"websiteUrl": "http://electronjs.org/docs/api/remote",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/remote.md",
"methods": [
{
"name": "require",
"signature": "(module)",
"description": "e.g.",
"parameters": [
{
"name": "module",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "any",
"collection": false,
"description": "The object returned by require(module) in the main process. Modules specified by their relative path will resolve relative to the entrypoint of the main process."
}
},
{
"name": "getCurrentWindow",
"signature": "()",
"description": "Note: Do not use removeAllListeners on BrowserWindow. Use of this can remove all blur listeners, disable click events on touch bar buttons, and other unintended consequences.",
"returns": {
"type": "BrowserWindow",
"collection": false,
"description": "The window to which this web page belongs."
}
},
{
"name": "getCurrentWebContents",
"signature": "()",
"returns": {
"type": "WebContents",
"collection": false,
"description": "The web contents of this web page."
}
},
{
"name": "getGlobal",
"signature": "(name)",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "any",
"collection": false,
"description": "The global variable of name (e.g. global[name]) in the main process."
}
}
],
"properties": [
{
"name": "process",
"description": "The process object in the main process. This is the same as remote.getGlobal('process') but is cached."
}
]
},
{
"name": "RemoveClientCertificate",
"version": "4.0.3",
"type": "Structure",
"slug": "remove-client-certificate",
"websiteUrl": "http://electronjs.org/docs/api/structures/remove-client-certificate",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/remove-client-certificate.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "clientCertificate.",
"required": true
},
{
"name": "origin",
"type": "String",
"collection": false,
"description": "Origin of the server whose associated client certificate must be removed from the cache.",
"required": true
}
]
},
{
"name": "RemovePassword",
"version": "4.0.3",
"type": "Structure",
"slug": "remove-password",
"websiteUrl": "http://electronjs.org/docs/api/structures/remove-password",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/remove-password.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "password.",
"required": true
},
{
"name": "origin",
"type": "String",
"collection": false,
"description": "When provided, the authentication info related to the origin will only be removed otherwise the entire cache will be cleared.",
"required": false
},
{
"name": "scheme",
"type": "String",
"collection": false,
"description": "Scheme of the authentication. Can be basic, digest, ntlm, negotiate. Must be provided if removing by origin.",
"required": false,
"possibleValues": [
{
"value": "basic"
},
{
"value": "digest"
},
{
"value": "ntlm"
},
{
"value": "negotiate"
}
]
},
{
"name": "realm",
"type": "String",
"collection": false,
"description": "Realm of the authentication. Must be provided if removing by origin.",
"required": false
},
{
"name": "username",
"type": "String",
"collection": false,
"description": "Credentials of the authentication. Must be provided if removing by origin.",
"required": false
},
{
"name": "password",
"type": "String",
"collection": false,
"description": "Credentials of the authentication. Must be provided if removing by origin.",
"required": false
}
]
},
{
"name": "screen",
"description": "Retrieve information about screen size, displays, cursor position, etc.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "screen",
"websiteUrl": "http://electronjs.org/docs/api/screen",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/screen.md",
"methods": [
{
"name": "getCursorScreenPoint",
"signature": "()",
"description": "The current absolute position of the mouse pointer.",
"returns": {
"type": "Point",
"collection": false
}
},
{
"name": "getPrimaryDisplay",
"signature": "()",
"returns": {
"type": "Display",
"collection": false,
"description": "The primary display."
}
},
{
"name": "getAllDisplays",
"signature": "()",
"returns": {
"type": "Display",
"collection": true,
"description": "An array of displays that are currently available."
}
},
{
"name": "getDisplayNearestPoint",
"signature": "(point)",
"parameters": [
{
"name": "point",
"type": "Point",
"collection": false,
"required": true
}
],
"returns": {
"type": "Display",
"collection": false,
"description": "The display nearest the specified point."
}
},
{
"name": "getDisplayMatching",
"signature": "(rect)",
"parameters": [
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"required": true
}
],
"returns": {
"type": "Display",
"collection": false,
"description": "The display that most closely intersects the provided bounds."
}
},
{
"name": "screenToDipPoint",
"signature": "(point)",
"platforms": [
"Windows"
],
"description": "Converts a screen physical point to a screen DIP point. The DPI scale is performed relative to the display containing the physical point.",
"parameters": [
{
"name": "point",
"type": "Point",
"collection": false,
"required": true
}
],
"returns": {
"type": "Point",
"collection": false
}
},
{
"name": "dipToScreenPoint",
"signature": "(point)",
"platforms": [
"Windows"
],
"description": "Converts a screen DIP point to a screen physical point. The DPI scale is performed relative to the display containing the DIP point.",
"parameters": [
{
"name": "point",
"type": "Point",
"collection": false,
"required": true
}
],
"returns": {
"type": "Point",
"collection": false
}
},
{
"name": "screenToDipRect",
"signature": "(window, rect)",
"platforms": [
"Windows"
],
"description": "Converts a screen physical rect to a screen DIP rect. The DPI scale is performed relative to the display nearest to window. If window is null, scaling will be performed to the display nearest to rect.",
"parameters": [
{
"name": "window",
"type": [
{
"typeName": "BrowserWindow",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true
},
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"required": true
}
],
"returns": {
"type": "Rectangle",
"collection": false
}
},
{
"name": "dipToScreenRect",
"signature": "(window, rect)",
"platforms": [
"Windows"
],
"description": "Converts a screen DIP rect to a screen physical rect. The DPI scale is performed relative to the display nearest to window. If window is null, scaling will be performed to the display nearest to rect.",
"parameters": [
{
"name": "window",
"type": [
{
"typeName": "BrowserWindow",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true
},
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"required": true
}
],
"returns": {
"type": "Rectangle",
"collection": false
}
}
],
"events": [
{
"name": "display-added",
"description": "Emitted when newDisplay has been added.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "newDisplay",
"type": "Display",
"collection": false,
"required": true
}
]
},
{
"name": "display-removed",
"description": "Emitted when oldDisplay has been removed.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "oldDisplay",
"type": "Display",
"collection": false,
"required": true
}
]
},
{
"name": "display-metrics-changed",
"description": "Emitted when one or more metrics change in a display. The changedMetrics is an array of strings that describe the changes. Possible changes are bounds, workArea, scaleFactor and rotation.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "display",
"type": "Display",
"collection": false,
"required": true
},
{
"name": "changedMetrics",
"type": "String",
"collection": true,
"required": true
}
]
}
]
},
{
"name": "ScrubberItem",
"version": "4.0.3",
"type": "Structure",
"slug": "scrubber-item",
"websiteUrl": "http://electronjs.org/docs/api/structures/scrubber-item",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/scrubber-item.md",
"properties": [
{
"name": "label",
"type": "String",
"collection": false,
"description": "The text to appear in this item.",
"required": false
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "The image to appear in this item.",
"required": false
}
]
},
{
"name": "SegmentedControlSegment",
"version": "4.0.3",
"type": "Structure",
"slug": "segmented-control-segment",
"websiteUrl": "http://electronjs.org/docs/api/structures/segmented-control-segment",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/segmented-control-segment.md",
"properties": [
{
"name": "label",
"type": "String",
"collection": false,
"description": "The text to appear in this segment.",
"required": false
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "The image to appear in this segment.",
"required": false
},
{
"name": "enabled",
"type": "Boolean",
"collection": false,
"description": "Whether this segment is selectable. Default: true.",
"required": false
}
]
},
{
"name": "session",
"description": "Manage browser sessions, cookies, cache, proxy settings, etc.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "session",
"websiteUrl": "http://electronjs.org/docs/api/session",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/session.md",
"methods": [
{
"name": "fromPartition",
"signature": "(partition[, options])",
"description": "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. If the partition is empty then default session of the app will be returned. To create a Session with options, you have to ensure the Session with the partition has never been used before. There is no way to change the options of an existing Session object.",
"parameters": [
{
"name": "partition",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "cache",
"type": "Boolean",
"collection": false,
"description": "Whether to enable cache.",
"required": true
}
]
}
],
"returns": {
"type": "Session",
"collection": false,
"description": "A session instance from partition string. When there is an existing Session with the same partition, it will be returned; otherwise a new Session instance will be created with options."
}
}
],
"properties": [
{
"name": "defaultSession",
"description": "A Session object, the default session object of the app.",
"type": "Session",
"collection": false
}
]
},
{
"name": "Session",
"description": "Get and set properties of a session.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "session",
"websiteUrl": "http://electronjs.org/docs/api/session",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/session.md",
"instanceName": "ses",
"instanceMethods": [
{
"name": "getCacheSize",
"signature": "(callback)",
"description": "Callback is invoked with the session's current cache size.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "size",
"type": "Integer",
"collection": false,
"description": "Cache size used in bytes.",
"required": true
}
]
}
]
},
{
"name": "clearCache",
"signature": "(callback)",
"description": "Clears the session’s HTTP cache.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called when operation is done.",
"required": true
}
]
},
{
"name": "clearStorageData",
"signature": "([options, callback])",
"description": "Clears the data of web storages.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "origin",
"type": "String",
"collection": false,
"description": "Should follow window.location.origin’s representation scheme://host:port.",
"required": false
},
{
"name": "storages",
"type": "String",
"collection": true,
"description": "The types of storages to clear, can contain: appcache, cookies, filesystem, indexdb, localstorage, shadercache, websql, serviceworkers, cachestorage.",
"required": false
},
{
"name": "quotas",
"type": "String",
"collection": true,
"description": "The types of quotas to clear, can contain: temporary, persistent, syncable.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called when operation is done.",
"required": false
}
]
},
{
"name": "flushStorageData",
"signature": "()",
"description": "Writes any unwritten DOMStorage data to disk."
},
{
"name": "setProxy",
"signature": "(config, callback)",
"description": "Sets the proxy settings. When pacScript and proxyRules are provided together, the proxyRules option is ignored and pacScript configuration is applied. The proxyRules has to follow the rules below: For example: The proxyBypassRules is a comma separated list of rules described below:",
"parameters": [
{
"name": "config",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "pacScript",
"type": "String",
"collection": false,
"description": "The URL associated with the PAC file.",
"required": true
},
{
"name": "proxyRules",
"type": "String",
"collection": false,
"description": "Rules indicating which proxies to use.",
"required": true
},
{
"name": "proxyBypassRules",
"type": "String",
"collection": false,
"description": "Rules indicating which URLs should bypass the proxy settings.",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called when operation is done.",
"required": true
}
]
},
{
"name": "resolveProxy",
"signature": "(url, callback)",
"description": "Resolves the proxy information for url. The callback will be called with callback(proxy) when the request is performed.",
"parameters": [
{
"name": "url",
"type": "URL",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "proxy",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "setDownloadPath",
"signature": "(path)",
"description": "Sets download saving directory. By default, the download directory will be the Downloads under the respective app folder.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "The download location.",
"required": true
}
]
},
{
"name": "enableNetworkEmulation",
"signature": "(options)",
"description": "Emulates network with the given configuration for the session.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "offline",
"type": "Boolean",
"collection": false,
"description": "Whether to emulate network outage. Defaults to false.",
"required": false
},
{
"name": "latency",
"type": "Double",
"collection": false,
"description": "RTT in ms. Defaults to 0 which will disable latency throttling.",
"required": false
},
{
"name": "downloadThroughput",
"type": "Double",
"collection": false,
"description": "Download rate in Bps. Defaults to 0 which will disable download throttling.",
"required": false
},
{
"name": "uploadThroughput",
"type": "Double",
"collection": false,
"description": "Upload rate in Bps. Defaults to 0 which will disable upload throttling.",
"required": false
}
]
}
]
},
{
"name": "disableNetworkEmulation",
"signature": "()",
"description": "Disables any network emulation already active for the session. Resets to the original network configuration."
},
{
"name": "setCertificateVerifyProc",
"signature": "(proc)",
"description": "Sets the certificate verify proc for session, the proc will be called with proc(request, callback) whenever a server certificate verification is requested. Calling callback(0) accepts the certificate, calling callback(-2) rejects it. Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc.",
"parameters": [
{
"name": "proc",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "request",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "hostname",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "certificate",
"type": "Certificate",
"collection": false,
"description": "",
"required": true
},
{
"name": "verificationResult",
"type": "String",
"collection": false,
"description": "Verification result from chromium.",
"required": true
},
{
"name": "errorCode",
"type": "Integer",
"collection": false,
"description": "Error code.",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "verificationResult",
"type": "Integer",
"collection": false,
"description": "Value can be one of certificate error codes from . Apart from the certificate error codes, the following special codes can be used.",
"required": true
}
]
}
]
}
]
},
{
"name": "setPermissionRequestHandler",
"signature": "(handler)",
"description": "Sets the handler which can be used to respond to permission requests for the session. Calling callback(true) will allow the permission and callback(false) will reject it. To clear the handler, call setPermissionRequestHandler(null).",
"parameters": [
{
"name": "handler",
"type": [
{
"typeName": "Function",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true,
"parameters": [
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"description": "WebContents requesting the permission.",
"required": true
},
{
"name": "permission",
"type": "String",
"collection": false,
"description": "Enum of 'media', 'geolocation', 'notifications', 'midiSysex', 'pointerLock', 'fullscreen', 'openExternal'.",
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "permissionGranted",
"type": "Boolean",
"collection": false,
"description": "Allow or deny the permission.",
"required": true
}
]
},
{
"name": "details",
"type": "Object",
"collection": false,
"description": "Some properties are only available on certain permission types.",
"required": true,
"properties": [
{
"name": "externalURL",
"type": "String",
"collection": false,
"description": "The url of the openExternal request.",
"required": true
},
{
"name": "mediaTypes",
"type": "String",
"collection": true,
"description": "The types of media access being requested, elements can be video or audio",
"required": true,
"possibleValues": [
{
"value": "video"
},
{
"value": "audio"
}
]
}
]
}
]
}
]
},
{
"name": "setPermissionCheckHandler",
"signature": "(handler)",
"description": "Sets the handler which can be used to respond to permission checks for the session. Returning true will allow the permission and false will reject it. To clear the handler, call setPermissionCheckHandler(null).",
"parameters": [
{
"name": "handler",
"type": [
{
"typeName": "Function",
"collection": false,
"innerType": "Boolean"
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true,
"parameters": [
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"description": "WebContents checking the permission.",
"required": true
},
{
"name": "permission",
"type": "String",
"collection": false,
"description": "Enum of 'media'.",
"required": true
},
{
"name": "requestingOrigin",
"type": "String",
"collection": false,
"description": "The origin URL of the permission check",
"required": true
},
{
"name": "details",
"type": "Object",
"collection": false,
"description": "Some properties are only available on certain permission types.",
"required": true,
"properties": [
{
"name": "securityOrigin",
"type": "String",
"collection": false,
"description": "The security orign of the media check.",
"required": true
},
{
"name": "mediaType",
"type": "String",
"collection": false,
"description": "The type of media access being requested, can be video, audio or unknown",
"required": true,
"possibleValues": [
{
"value": "video"
},
{
"value": "audio"
},
{
"value": "unknown"
}
]
}
]
}
]
}
]
},
{
"name": "clearHostResolverCache",
"signature": "([callback])",
"description": "Clears the host resolver cache.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called when operation is done.",
"required": false
}
]
},
{
"name": "allowNTLMCredentialsForDomains",
"signature": "(domains)",
"description": "Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication.",
"parameters": [
{
"name": "domains",
"type": "String",
"collection": false,
"description": "A comma-separated list of servers for which integrated authentication is enabled.",
"required": true
}
]
},
{
"name": "setUserAgent",
"signature": "(userAgent[, acceptLanguages])",
"description": "Overrides the userAgent and acceptLanguages for this session. The acceptLanguages must a comma separated ordered list of language codes, for example \"en-US,fr,de,ko,zh-CN,ja\". This doesn't affect existing WebContents, and each WebContents can use webContents.setUserAgent to override the session-wide user agent.",
"parameters": [
{
"name": "userAgent",
"type": "String",
"collection": false,
"required": true
},
{
"name": "acceptLanguages",
"type": "String",
"collection": false,
"required": false
}
]
},
{
"name": "getUserAgent",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The user agent for this session."
}
},
{
"name": "getBlobData",
"signature": "(identifier, callback)",
"parameters": [
{
"name": "identifier",
"type": "String",
"collection": false,
"description": "Valid UUID.",
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "result",
"type": "Buffer",
"collection": false,
"description": "Blob data.",
"required": true
}
]
}
]
},
{
"name": "createInterruptedDownload",
"signature": "(options)",
"description": "Allows resuming cancelled or interrupted downloads from previous Session. The API will generate a DownloadItem that can be accessed with the will-download event. The DownloadItem will not have any WebContents associated with it and the initial state will be interrupted. The download will start only when the resume API is called on the DownloadItem.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "path",
"type": "String",
"collection": false,
"description": "Absolute path of the download.",
"required": true
},
{
"name": "urlChain",
"type": "String",
"collection": true,
"description": "Complete URL chain for the download.",
"required": true
},
{
"name": "mimeType",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "offset",
"type": "Integer",
"collection": false,
"description": "Start range for the download.",
"required": true
},
{
"name": "length",
"type": "Integer",
"collection": false,
"description": "Total length of the download.",
"required": true
},
{
"name": "lastModified",
"type": "String",
"collection": false,
"description": "Last-Modified header value.",
"required": true
},
{
"name": "eTag",
"type": "String",
"collection": false,
"description": "ETag header value.",
"required": true
},
{
"name": "startTime",
"type": "Double",
"collection": false,
"description": "Time when download was started in number of seconds since UNIX epoch.",
"required": false
}
]
}
]
},
{
"name": "clearAuthCache",
"signature": "(options[, callback])",
"description": "Clears the session’s HTTP authentication cache.",
"parameters": [
{
"name": "options",
"type": [
{
"typeName": "RemovePassword",
"collection": false
},
{
"typeName": "RemoveClientCertificate",
"collection": false
}
],
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called when operation is done.",
"required": false
}
]
},
{
"name": "setPreloads",
"signature": "(preloads)",
"description": "Adds scripts that will be executed on ALL web contents that are associated with this session just before normal preload scripts run.",
"parameters": [
{
"name": "preloads",
"type": "String",
"collection": true,
"description": "An array of absolute path to preload scripts",
"required": true
}
]
},
{
"name": "getPreloads",
"signature": "()",
"returns": {
"type": "String",
"collection": true,
"description": "an array of paths to preload scripts that have been registered."
}
}
],
"instanceProperties": [
{
"name": "cookies",
"description": "A Cookies object for this session.",
"type": "Cookies",
"collection": false
},
{
"name": "webRequest",
"description": "A WebRequest object for this session.",
"type": "WebRequest",
"collection": false
},
{
"name": "protocol",
"description": "A Protocol object for this session.",
"type": "Protocol",
"collection": false
},
{
"name": "netLog",
"description": "A NetLog object for this session.",
"type": "NetLog",
"collection": false
}
],
"instanceEvents": [
{
"name": "will-download",
"description": "Emitted when Electron is about to download item in webContents. Calling event.preventDefault() will cancel the download and item will not be available from next tick of the process.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "item",
"type": "DownloadItem",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"required": true
}
]
}
]
},
{
"name": "shell",
"description": "Manage files and URLs using their default applications.",
"process": {
"main": true,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "shell",
"websiteUrl": "http://electronjs.org/docs/api/shell",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/shell.md",
"methods": [
{
"name": "showItemInFolder",
"signature": "(fullPath)",
"description": "Show the given file in a file manager. If possible, select the file.",
"parameters": [
{
"name": "fullPath",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the item was successfully shown."
}
},
{
"name": "openItem",
"signature": "(fullPath)",
"description": "Open the given file in the desktop's default manner.",
"parameters": [
{
"name": "fullPath",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the item was successfully opened."
}
},
{
"name": "openExternal",
"signature": "(url[, options, callback])",
"description": "Open the given external protocol URL in the desktop's default manner. (For example, mailto: URLs in the user's default mail agent).",
"parameters": [
{
"name": "url",
"type": "String",
"collection": false,
"description": "Max 2081 characters on windows, or the function returns false.",
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "activate",
"type": "Boolean",
"collection": false,
"description": "true to bring the opened application to the foreground. The default is true.",
"required": false
},
{
"name": "workingDirectory",
"type": "String",
"collection": false,
"description": "The working directory.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "If specified will perform the open asynchronously.",
"required": false,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether an application was available to open the URL. If callback is specified, always returns true."
}
},
{
"name": "moveItemToTrash",
"signature": "(fullPath)",
"description": "Move the given file to trash and returns a boolean status for the operation.",
"parameters": [
{
"name": "fullPath",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the item was successfully moved to the trash."
}
},
{
"name": "beep",
"signature": "()",
"description": "Play the beep sound."
},
{
"name": "writeShortcutLink",
"signature": "(shortcutPath[, operation], options)",
"platforms": [
"Windows"
],
"description": "Creates or updates a shortcut link at shortcutPath.",
"parameters": [
{
"name": "shortcutPath",
"type": "String",
"collection": false,
"required": true
},
{
"name": "operation",
"type": "String",
"collection": false,
"description": "Default is `create`, can be one of following:",
"required": false,
"possibleValues": [
{
"value": "create",
"description": "Creates a new shortcut, overwriting if necessary."
},
{
"value": "update",
"description": "Updates specified properties only on an existing shortcut."
},
{
"value": "replace",
"description": "Overwrites an existing shortcut, fails if the shortcut doesn't exist."
}
]
},
{
"name": "options",
"type": "ShortcutDetails",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the shortcut was created successfully."
}
},
{
"name": "readShortcutLink",
"signature": "(shortcutPath)",
"platforms": [
"Windows"
],
"description": "Resolves the shortcut link at shortcutPath. An exception will be thrown when any error happens.",
"parameters": [
{
"name": "shortcutPath",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "ShortcutDetails",
"collection": false
}
}
]
},
{
"name": "ShortcutDetails",
"version": "4.0.3",
"type": "Structure",
"slug": "shortcut-details",
"websiteUrl": "http://electronjs.org/docs/api/structures/shortcut-details",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/shortcut-details.md",
"properties": [
{
"name": "target",
"type": "String",
"collection": false,
"description": "The target to launch from this shortcut.",
"required": true
},
{
"name": "cwd",
"type": "String",
"collection": false,
"description": "The working directory. Default is empty.",
"required": false
},
{
"name": "args",
"type": "String",
"collection": false,
"description": "The arguments to be applied to target when launching from this shortcut. Default is empty.",
"required": false
},
{
"name": "description",
"type": "String",
"collection": false,
"description": "The description of the shortcut. Default is empty.",
"required": false
},
{
"name": "icon",
"type": "String",
"collection": false,
"description": "The path to the icon, can be a DLL or EXE. icon and iconIndex have to be set together. Default is empty, which uses the target's icon.",
"required": false
},
{
"name": "iconIndex",
"type": "Number",
"collection": false,
"description": "The resource ID of icon when icon is a DLL or EXE. Default is 0.",
"required": false
},
{
"name": "appUserModelId",
"type": "String",
"collection": false,
"description": "The Application User Model ID. Default is empty.",
"required": false
}
]
},
{
"name": "Size",
"version": "4.0.3",
"type": "Structure",
"slug": "size",
"websiteUrl": "http://electronjs.org/docs/api/structures/size",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/size.md",
"properties": [
{
"name": "width",
"type": "Number",
"collection": false,
"description": "",
"required": true
},
{
"name": "height",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "StreamProtocolResponse",
"version": "4.0.3",
"type": "Structure",
"slug": "stream-protocol-response",
"websiteUrl": "http://electronjs.org/docs/api/structures/stream-protocol-response",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/stream-protocol-response.md",
"properties": [
{
"name": "statusCode",
"type": "Number",
"collection": false,
"description": "The HTTP response code.",
"required": true
},
{
"name": "headers",
"type": "Object",
"collection": false,
"description": "An object containing the response headers.",
"required": true,
"properties": []
},
{
"name": "data",
"type": "ReadableStream",
"collection": false,
"description": "A Node.js readable stream representing the response body.",
"required": true
}
]
},
{
"name": "systemPreferences",
"description": "Get system preferences.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "system-preferences",
"websiteUrl": "http://electronjs.org/docs/api/system-preferences",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/system-preferences.md",
"methods": [
{
"name": "isDarkMode",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the system is in Dark Mode."
}
},
{
"name": "isSwipeTrackingFromScrollEventsEnabled",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the Swipe between pages setting is on."
}
},
{
"name": "postNotification",
"signature": "(event, userInfo)",
"platforms": [
"macOS"
],
"description": "Posts event as native notifications of macOS. The userInfo is an Object that contains the user information dictionary sent along with the notification.",
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"required": true
}
]
},
{
"name": "postLocalNotification",
"signature": "(event, userInfo)",
"platforms": [
"macOS"
],
"description": "Posts event as native notifications of macOS. The userInfo is an Object that contains the user information dictionary sent along with the notification.",
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"required": true
}
]
},
{
"name": "postWorkspaceNotification",
"signature": "(event, userInfo)",
"platforms": [
"macOS"
],
"description": "Posts event as native notifications of macOS. The userInfo is an Object that contains the user information dictionary sent along with the notification.",
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"required": true
}
]
},
{
"name": "subscribeNotification",
"signature": "(event, callback)",
"platforms": [
"macOS"
],
"description": "Subscribes to native notifications of macOS, callback will be called with callback(event, userInfo) when the corresponding event happens. The userInfo is an Object that contains the user information dictionary sent along with the notification. The id of the subscriber is returned, which can be used to unsubscribe the event. Under the hood this API subscribes to NSDistributedNotificationCenter, example values of event are:",
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
}
],
"returns": {
"type": "Number",
"collection": false,
"description": "The ID of this subscription"
}
},
{
"name": "subscribeLocalNotification",
"signature": "(event, callback)",
"platforms": [
"macOS"
],
"description": "Same as subscribeNotification, but uses NSNotificationCenter for local defaults. This is necessary for events such as NSUserDefaultsDidChangeNotification.",
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
}
],
"returns": {
"type": "Number",
"collection": false,
"description": "The ID of this subscription"
}
},
{
"name": "subscribeWorkspaceNotification",
"signature": "(event, callback)",
"platforms": [
"macOS"
],
"description": "Same as subscribeNotification, but uses NSWorkspace.sharedWorkspace.notificationCenter. This is necessary for events such as NSWorkspaceDidActivateApplicationNotification.",
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "event",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "userInfo",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
}
]
},
{
"name": "unsubscribeNotification",
"signature": "(id)",
"platforms": [
"macOS"
],
"description": "Removes the subscriber with id.",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "unsubscribeLocalNotification",
"signature": "(id)",
"platforms": [
"macOS"
],
"description": "Same as unsubscribeNotification, but removes the subscriber from NSNotificationCenter.",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "unsubscribeWorkspaceNotification",
"signature": "(id)",
"platforms": [
"macOS"
],
"description": "Same as unsubscribeNotification, but removes the subscriber from NSWorkspace.sharedWorkspace.notificationCenter.",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "registerDefaults",
"signature": "(defaults)",
"platforms": [
"macOS"
],
"description": "Add the specified defaults to your application's NSUserDefaults.",
"parameters": [
{
"name": "defaults",
"type": "Object",
"collection": false,
"description": "a dictionary of (`key: value`) user defaults",
"required": true
}
]
},
{
"name": "getUserDefault",
"signature": "(key, type)",
"platforms": [
"macOS"
],
"description": "Some popular key and types are:",
"parameters": [
{
"name": "key",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`.",
"required": true,
"possibleValues": [
{
"value": "string"
},
{
"value": "boolean"
},
{
"value": "integer"
},
{
"value": "float"
},
{
"value": "double"
},
{
"value": "url"
},
{
"value": "array"
},
{
"value": "dictionary"
}
]
}
],
"returns": {
"type": "any",
"collection": false,
"description": "The value of key in NSUserDefaults."
}
},
{
"name": "setUserDefault",
"signature": "(key, type, value)",
"platforms": [
"macOS"
],
"description": "Set the value of key in NSUserDefaults. Note that type should match actual type of value. An exception is thrown if they don't. Some popular key and types are:",
"parameters": [
{
"name": "key",
"type": "String",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"description": "See .",
"required": true
},
{
"name": "value",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "removeUserDefault",
"signature": "(key)",
"platforms": [
"macOS"
],
"description": "Removes the key in NSUserDefaults. This can be used to restore the default or global value of a key previously set with setUserDefault.",
"parameters": [
{
"name": "key",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "isAeroGlassEnabled",
"signature": "()",
"platforms": [
"Windows"
],
"description": "An example of using it to determine if you should create a transparent window or not (transparent windows won't work correctly when DWM composition is disabled):",
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if DWM composition (Aero Glass) is enabled, and false otherwise."
}
},
{
"name": "getAccentColor",
"signature": "()",
"platforms": [
"Windows"
],
"returns": {
"type": "String",
"collection": false,
"description": "The users current system wide accent color preference in RGBA hexadecimal form."
}
},
{
"name": "getColor",
"signature": "(color)",
"platforms": [
"Windows"
],
"parameters": [
{
"name": "color",
"type": "String",
"collection": false,
"description": "One of the following values:",
"required": true,
"possibleValues": [
{
"value": "3d-dark-shadow",
"description": "Dark shadow for three-dimensional display elements."
},
{
"value": "3d-face",
"description": "Face color for three-dimensional display elements and for dialog box backgrounds."
},
{
"value": "3d-highlight",
"description": "Highlight color for three-dimensional display elements."
},
{
"value": "3d-light",
"description": "Light color for three-dimensional display elements."
},
{
"value": "3d-shadow",
"description": "Shadow color for three-dimensional display elements."
},
{
"value": "active-border",
"description": "Active window border."
},
{
"value": "active-caption",
"description": "Active window title bar. Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled."
},
{
"value": "active-caption-gradient",
"description": "Right side color in the color gradient of an active window's title bar."
},
{
"value": "app-workspace",
"description": "Background color of multiple document interface (MDI) applications."
},
{
"value": "button-text",
"description": "Text on push buttons."
},
{
"value": "caption-text",
"description": "Text in caption, size box, and scroll bar arrow box."
},
{
"value": "desktop",
"description": "Desktop background color."
},
{
"value": "disabled-text",
"description": "Grayed (disabled) text."
},
{
"value": "highlight",
"description": "Item(s) selected in a control."
},
{
"value": "highlight-text",
"description": "Text of item(s) selected in a control."
},
{
"value": "hotlight",
"description": "Color for a hyperlink or hot-tracked item."
},
{
"value": "inactive-border",
"description": "Inactive window border."
},
{
"value": "inactive-caption",
"description": "Inactive window caption. Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled."
},
{
"value": "inactive-caption-gradient",
"description": "Right side color in the color gradient of an inactive window's title bar."
},
{
"value": "inactive-caption-text",
"description": "Color of text in an inactive caption."
},
{
"value": "info-background",
"description": "Background color for tooltip controls."
},
{
"value": "info-text",
"description": "Text color for tooltip controls."
},
{
"value": "menu",
"description": "Menu background."
},
{
"value": "menu-highlight",
"description": "The color used to highlight menu items when the menu appears as a flat menu."
},
{
"value": "menubar",
"description": "The background color for the menu bar when menus appear as flat menus."
},
{
"value": "menu-text",
"description": "Text in menus."
},
{
"value": "scrollbar",
"description": "Scroll bar gray area."
},
{
"value": "window",
"description": "Window background."
},
{
"value": "window-frame",
"description": "Window frame."
},
{
"value": "window-text",
"description": "Text in windows."
}
]
}
],
"returns": {
"type": "String",
"collection": false,
"description": "The system color setting in RGB hexadecimal form (#ABCDEF). See the Windows docs for more details."
}
},
{
"name": "isInvertedColorScheme",
"signature": "()",
"platforms": [
"Windows"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if an inverted color scheme, such as a high contrast theme, is active, false otherwise."
}
},
{
"name": "getEffectiveAppearance",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Gets the macOS appearance setting that is currently applied to your application, maps to NSApplication.effectiveAppearance Please note that until Electron is built targeting the 10.14 SDK, your application's effectiveAppearance will default to 'light' and won't inherit the OS preference. In the interim in order for your application to inherit the OS preference you must set the NSRequiresAquaSystemAppearance key in your apps Info.plist to false. If you are using electron-packager or electron-forge just set the enableDarwinDarkMode packager option to true. See the Electron Packager API for more details.",
"returns": {
"type": "String",
"collection": false,
"description": "Can be dark, light or unknown.",
"possibleValues": [
{
"value": "dark"
},
{
"value": "light"
},
{
"value": "unknown"
}
]
}
},
{
"name": "getAppLevelAppearance",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Gets the macOS appearance setting that you have declared you want for your application, maps to NSApplication.appearance. You can use the setAppLevelAppearance API to set this value.",
"returns": {
"type": "String",
"collection": false,
"description": "| null Can be dark, light or unknown.",
"possibleValues": [
{
"value": "dark"
},
{
"value": "light"
},
{
"value": "unknown"
}
]
}
},
{
"name": "setAppLevelAppearance",
"signature": "(appearance)",
"platforms": [
"macOS"
],
"description": "Sets the appearance setting for your application, this should override the system default and override the value of getEffectiveAppearance.",
"parameters": [
{
"name": "appearance",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "Can be `dark` or `light`",
"required": true,
"possibleValues": [
{
"value": "dark"
},
{
"value": "light"
}
]
}
]
},
{
"name": "isTrustedAccessibilityClient",
"signature": "(prompt)",
"platforms": [
"macOS"
],
"parameters": [
{
"name": "prompt",
"type": "Boolean",
"collection": false,
"description": "whether or not the user will be informed via prompt if the current process is untrusted.",
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if the current process is a trusted accessibility client and false if it is not."
}
},
{
"name": "getMediaAccessStatus",
"signature": "(mediaType)",
"platforms": [
"macOS"
],
"description": "This user consent was not required until macOS 10.14 Mojave, so this method will always return granted if your system is running 10.13 High Sierra or lower.",
"parameters": [
{
"name": "mediaType",
"type": "String",
"collection": false,
"description": "`microphone` or `camera`.",
"required": true
}
],
"returns": {
"type": "String",
"collection": false,
"description": "Can be not-determined, granted, denied, restricted or unknown.",
"possibleValues": [
{
"value": "not-determined"
},
{
"value": "granted"
},
{
"value": "denied"
},
{
"value": "restricted"
},
{
"value": "unknown"
}
]
}
},
{
"name": "askForMediaAccess",
"signature": "(mediaType)",
"platforms": [
"macOS"
],
"description": "Important: In order to properly leverage this API, you must set the NSMicrophoneUsageDescription and NSCameraUsageDescription strings in your app's Info.plist file. The values for these keys will be used to populate the permission dialogs so that the user will be properly informed as to the purpose of the permission request. See Electron Application Distribution for more information about how to set these in the context of Electron. This user consent was not required until macOS 10.14 Mojave, so this method will always return true if your system is running 10.13 High Sierra or lower.",
"parameters": [
{
"name": "mediaType",
"type": "String",
"collection": false,
"description": "the type of media being requested; can be `microphone`, `camera`.",
"required": true,
"possibleValues": [
{
"value": "microphone"
},
{
"value": "camera"
}
]
}
],
"returns": {
"type": "Promise",
"collection": false,
"innerType": "Boolean",
"description": "A promise that resolves with true if consent was granted and false if it was denied. If an invalid mediaType is passed, the promise will be rejected. If an access request was denied and later is changed through the System Preferences pane, a restart of the app will be required for the new permissions to take effect. If access has already been requested and denied, it must be changed through the preference pane; an alert will not pop up and the promise will resolve with the existing access status."
}
}
],
"events": [
{
"name": "accent-color-changed",
"platforms": [
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "newColor",
"type": "String",
"collection": false,
"description": "The new RGBA color the user assigned to be their system accent color.",
"required": true
}
]
},
{
"name": "color-changed",
"platforms": [
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "inverted-color-scheme-changed",
"platforms": [
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "invertedColorScheme",
"type": "Boolean",
"collection": false,
"description": "`true` if an inverted color scheme, such as a high contrast theme, is being used, `false` otherwise.",
"required": true
}
]
},
{
"name": "appearance-changed",
"description": "NOTE: This event is only emitted after you have called startAppLevelAppearanceTrackingOS",
"platforms": [
"macOS"
],
"returns": [
{
"name": "newAppearance",
"type": "String",
"collection": false,
"description": "Can be `dark` or `light`",
"required": true,
"possibleValues": [
{
"value": "dark"
},
{
"value": "light"
}
]
}
]
}
]
},
{
"name": "Task",
"version": "4.0.3",
"type": "Structure",
"slug": "task",
"websiteUrl": "http://electronjs.org/docs/api/structures/task",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/task.md",
"properties": [
{
"name": "program",
"type": "String",
"collection": false,
"description": "Path of the program to execute, usually you should specify process.execPath which opens the current program.",
"required": true
},
{
"name": "arguments",
"type": "String",
"collection": false,
"description": "The command line arguments when program is executed.",
"required": true
},
{
"name": "title",
"type": "String",
"collection": false,
"description": "The string to be displayed in a JumpList.",
"required": true
},
{
"name": "description",
"type": "String",
"collection": false,
"description": "Description of this task.",
"required": true
},
{
"name": "iconPath",
"type": "String",
"collection": false,
"description": "The absolute path to an icon to be displayed in a JumpList, which can be an arbitrary resource file that contains an icon. You can usually specify process.execPath to show the icon of the program.",
"required": true
},
{
"name": "iconIndex",
"type": "Number",
"collection": false,
"description": "The icon index in the icon file. If an icon file consists of two or more icons, set this value to identify the icon. If an icon file consists of one icon, this value is 0.",
"required": true
}
]
},
{
"name": "ThumbarButton",
"version": "4.0.3",
"type": "Structure",
"slug": "thumbar-button",
"websiteUrl": "http://electronjs.org/docs/api/structures/thumbar-button",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/thumbar-button.md",
"properties": [
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "The icon showing in thumbnail toolbar.",
"required": true
},
{
"name": "click",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": []
},
{
"name": "tooltip",
"type": "String",
"collection": false,
"description": "The text of the button's tooltip.",
"required": false
},
{
"name": "flags",
"type": "String",
"collection": true,
"description": "Control specific states and behaviors of the button. By default, it is ['enabled'].",
"required": false
}
]
},
{
"name": "TouchBar",
"description": "Create TouchBar layouts for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar.md",
"staticProperties": [
{
"name": "TouchBarButton",
"description": "Create a button in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-button",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-button",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-button.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "label",
"type": "String",
"collection": false,
"description": "Button text.",
"required": false
},
{
"name": "backgroundColor",
"type": "String",
"collection": false,
"description": "Button background color in hex format, i.e #ABCDEF.",
"required": false
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "Button icon.",
"required": false
},
{
"name": "iconPosition",
"type": "String",
"collection": false,
"description": "Can be left, right or overlay.",
"required": false,
"possibleValues": [
{
"value": "left"
},
{
"value": "right"
},
{
"value": "overlay"
}
]
},
{
"name": "click",
"type": "Function",
"collection": false,
"description": "Function to call when the button is clicked.",
"required": false,
"parameters": []
}
]
}
]
},
"instanceName": "touchBarButton",
"instanceProperties": [
{
"name": "label",
"description": "A String representing the button's current text. Changing this value immediately updates the button in the touch bar.",
"type": "String",
"collection": false
},
{
"name": "backgroundColor",
"description": "A String hex code representing the button's current background color. Changing this value immediately updates the button in the touch bar.",
"type": "String",
"collection": false
},
{
"name": "icon",
"description": "A NativeImage representing the button's current icon. Changing this value immediately updates the button in the touch bar.",
"type": "NativeImage",
"collection": false
}
]
},
{
"name": "TouchBarColorPicker",
"description": "Create a color picker in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-color-picker",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-color-picker",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-color-picker.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "availableColors",
"type": "String",
"collection": true,
"description": "Array of hex color strings to appear as possible colors to select.",
"required": false
},
{
"name": "selectedColor",
"type": "String",
"collection": false,
"description": "The selected hex color in the picker, i.e #ABCDEF.",
"required": false
},
{
"name": "change",
"type": "Function",
"collection": false,
"description": "Function to call when a color is selected.",
"required": false,
"parameters": [
{
"name": "color",
"type": "String",
"collection": false,
"description": "The color that the user selected from the picker.",
"required": true
}
]
}
]
}
]
},
"instanceName": "touchBarColorPicker",
"instanceProperties": [
{
"name": "availableColors",
"description": "A String[] array representing the color picker's available colors to select. Changing this value immediately updates the color picker in the touch bar.",
"type": "String",
"collection": true
},
{
"name": "selectedColor",
"description": "A String hex code representing the color picker's currently selected color. Changing this value immediately updates the color picker in the touch bar.",
"type": "String",
"collection": false
}
]
},
{
"name": "TouchBarGroup",
"description": "Create a group in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-group",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-group",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-group.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "items",
"type": "TouchBar",
"collection": false,
"description": "Items to display as a group.",
"required": true
}
]
}
]
},
"instanceName": "touchBarGroup"
},
{
"name": "TouchBarLabel",
"description": "Create a label in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-label",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-label",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-label.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "label",
"type": "String",
"collection": false,
"description": "Text to display.",
"required": false
},
{
"name": "textColor",
"type": "String",
"collection": false,
"description": "Hex color of text, i.e #ABCDEF.",
"required": false
}
]
}
]
},
"instanceName": "touchBarLabel",
"instanceProperties": [
{
"name": "label",
"description": "A String representing the label's current text. Changing this value immediately updates the label in the touch bar.",
"type": "String",
"collection": false
},
{
"name": "textColor",
"description": "A String hex code representing the label's current text color. Changing this value immediately updates the label in the touch bar.",
"type": "String",
"collection": false
}
]
},
{
"name": "TouchBarPopover",
"description": "Create a popover in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-popover",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-popover",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-popover.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "label",
"type": "String",
"collection": false,
"description": "Popover button text.",
"required": false
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "Popover button icon.",
"required": false
},
{
"name": "items",
"type": "TouchBar",
"collection": false,
"description": "Items to display in the popover.",
"required": false
},
{
"name": "showCloseButton",
"type": "Boolean",
"collection": false,
"description": "true to display a close button on the left of the popover, false to not show it. Default is true.",
"required": false
}
]
}
]
},
"instanceName": "touchBarPopover",
"instanceProperties": [
{
"name": "label",
"description": "A String representing the popover's current button text. Changing this value immediately updates the popover in the touch bar.",
"type": "String",
"collection": false
},
{
"name": "icon",
"description": "A NativeImage representing the popover's current button icon. Changing this value immediately updates the popover in the touch bar.",
"type": "NativeImage",
"collection": false
}
]
},
{
"name": "TouchBarScrubber",
"description": "Create a scrubber (a scrollable selector)",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-scrubber",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-scrubber",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-scrubber.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "items",
"type": "ScrubberItem",
"collection": true,
"description": "An array of items to place in this scrubber.",
"required": true
},
{
"name": "select",
"type": "Function",
"collection": false,
"description": "Called when the user taps an item that was not the last tapped item.",
"required": true,
"parameters": [
{
"name": "selectedIndex",
"type": "Integer",
"collection": false,
"description": "The index of the item the user selected.",
"required": true
}
]
},
{
"name": "highlight",
"type": "Function",
"collection": false,
"description": "Called when the user taps any item.",
"required": true,
"parameters": [
{
"name": "highlightedIndex",
"type": "Integer",
"collection": false,
"description": "The index of the item the user touched.",
"required": true
}
]
},
{
"name": "selectedStyle",
"type": "String",
"collection": false,
"description": "Selected item style. Defaults to null.",
"required": true
},
{
"name": "overlayStyle",
"type": "String",
"collection": false,
"description": "Selected overlay item style. Defaults to null.",
"required": true
},
{
"name": "showArrowButtons",
"type": "Boolean",
"collection": false,
"description": "Defaults to false.",
"required": true
},
{
"name": "mode",
"type": "String",
"collection": false,
"description": "Defaults to free.",
"required": true
},
{
"name": "continuous",
"type": "Boolean",
"collection": false,
"description": "Defaults to true.",
"required": true
}
]
}
]
},
"instanceName": "touchBarScrubber",
"instanceProperties": [
{
"name": "items",
"description": "A ScrubberItem[] array representing the items in this scrubber. Updating this value immediately updates the control in the touch bar. Updating deep properties inside this array does not update the touch bar.",
"type": "ScrubberItem",
"collection": true
},
{
"name": "selectedStyle",
"description": "A String representing the style that selected items in the scrubber should have. Updating this value immediately updates the control in the touch bar. Possible values:",
"type": "String",
"collection": false
},
{
"name": "overlayStyle",
"description": "A String representing the style that selected items in the scrubber should have. This style is overlayed on top of the scrubber item instead of being placed behind it. Updating this value immediately updates the control in the touch bar. Possible values:",
"type": "String",
"collection": false
},
{
"name": "showArrowButtons",
"description": "A Boolean representing whether to show the left / right selection arrows in this scrubber. Updating this value immediately updates the control in the touch bar.",
"type": "Boolean",
"collection": false
},
{
"name": "mode",
"description": "A String representing the mode of this scrubber. Updating this value immediately updates the control in the touch bar. Possible values:",
"type": "String",
"collection": false
},
{
"name": "continuous",
"description": "A Boolean representing whether this scrubber is continuous or not. Updating this value immediately updates the control in the touch bar.",
"type": "Boolean",
"collection": false
}
]
},
{
"name": "TouchBarSegmentedControl",
"description": "Create a segmented control (a button group) where one button has a selected state",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-segmented-control",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-segmented-control",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-segmented-control.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "segmentStyle",
"type": "String",
"collection": false,
"description": "Style of the segments:",
"required": false,
"possibleValues": [
{
"value": "automatic",
"description": "Default. The appearance of the segmented control is automatically determined based on the type of window in which the control is displayed and the position within the window."
},
{
"value": "rounded",
"description": "The control is displayed using the rounded style."
},
{
"value": "textured-rounded",
"description": "The control is displayed using the textured rounded style."
},
{
"value": "round-rect",
"description": "The control is displayed using the round rect style."
},
{
"value": "textured-square",
"description": "The control is displayed using the textured square style."
},
{
"value": "capsule",
"description": "The control is displayed using the capsule style."
},
{
"value": "small-square",
"description": "The control is displayed using the small square style."
},
{
"value": "separated",
"description": "The segments in the control are displayed very close to each other but not touching."
}
]
},
{
"name": "mode",
"type": "String",
"collection": false,
"description": "The selection mode of the control:",
"required": false,
"possibleValues": [
{
"value": "single",
"description": "Default. One item selected at a time, selecting one deselects the previously selected item."
},
{
"value": "multiple",
"description": "Multiple items can be selected at a time."
},
{
"value": "buttons",
"description": "Make the segments act as buttons, each segment can be pressed and released but never marked as active."
}
]
},
{
"name": "segments",
"type": "SegmentedControlSegment",
"collection": true,
"description": "An array of segments to place in this control.",
"required": true
},
{
"name": "selectedIndex",
"type": "Integer",
"collection": false,
"description": "The index of the currently selected segment, will update automatically with user interaction. When the mode is multiple it will be the last selected item.",
"required": false
},
{
"name": "change",
"type": "Function",
"collection": false,
"description": "Called when the user selects a new segment.",
"required": true,
"parameters": [
{
"name": "selectedIndex",
"type": "Integer",
"collection": false,
"description": "The index of the segment the user selected.",
"required": true
},
{
"name": "isSelected",
"type": "Boolean",
"collection": false,
"description": "Whether as a result of user selection the segment is selected or not.",
"required": true
}
]
}
]
}
]
},
"instanceName": "touchBarSegmentedControl",
"instanceProperties": [
{
"name": "segmentStyle",
"description": "A String representing the controls current segment style. Updating this value immediately updates the control in the touch bar.",
"type": "String",
"collection": false
},
{
"name": "segments",
"description": "A SegmentedControlSegment[] array representing the segments in this control. Updating this value immediately updates the control in the touch bar. Updating deep properties inside this array does not update the touch bar.",
"type": "SegmentedControlSegment",
"collection": true
},
{
"name": "selectedIndex",
"description": "An Integer representing the currently selected segment. Changing this value immediately updates the control in the touch bar. User interaction with the touch bar will update this value automatically.",
"type": "Integer",
"collection": false
}
]
},
{
"name": "TouchBarSlider",
"description": "Create a slider in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-slider",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-slider",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-slider.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "label",
"type": "String",
"collection": false,
"description": "Label text.",
"required": false
},
{
"name": "value",
"type": "Integer",
"collection": false,
"description": "Selected value.",
"required": false
},
{
"name": "minValue",
"type": "Integer",
"collection": false,
"description": "Minimum value.",
"required": false
},
{
"name": "maxValue",
"type": "Integer",
"collection": false,
"description": "Maximum value.",
"required": false
},
{
"name": "change",
"type": "Function",
"collection": false,
"description": "Function to call when the slider is changed.",
"required": false,
"parameters": [
{
"name": "newValue",
"type": "Number",
"collection": false,
"description": "The value that the user selected on the Slider.",
"required": true
}
]
}
]
}
]
},
"instanceName": "touchBarSlider",
"instanceProperties": [
{
"name": "label",
"description": "A String representing the slider's current text. Changing this value immediately updates the slider in the touch bar.",
"type": "String",
"collection": false
},
{
"name": "value",
"description": "A Number representing the slider's current value. Changing this value immediately updates the slider in the touch bar.",
"type": "Number",
"collection": false
},
{
"name": "minValue",
"description": "A Number representing the slider's current minimum value. Changing this value immediately updates the slider in the touch bar.",
"type": "Number",
"collection": false
},
{
"name": "maxValue",
"description": "A Number representing the slider's current maximum value. Changing this value immediately updates the slider in the touch bar.",
"type": "Number",
"collection": false
}
]
},
{
"name": "TouchBarSpacer",
"description": "Create a spacer between two items in the touch bar for native macOS applications",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "touch-bar-spacer",
"websiteUrl": "http://electronjs.org/docs/api/touch-bar-spacer",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/touch-bar-spacer.md",
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "size",
"type": "String",
"collection": false,
"description": "Size of spacer, possible values are:",
"required": false,
"possibleValues": [
{
"value": "small",
"description": "Small space between items."
},
{
"value": "large",
"description": "Large space between items."
},
{
"value": "flexible",
"description": "Take up all available space."
}
]
}
]
}
]
},
"instanceName": "touchBarSpacer"
}
],
"constructorMethod": {
"signature": "(options)",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "items",
"type": [
{
"typeName": "TouchBarButton",
"collection": false
},
{
"typeName": "TouchBarColorPicker",
"collection": false
},
{
"typeName": "TouchBarGroup",
"collection": false
},
{
"typeName": "TouchBarLabel",
"collection": false
},
{
"typeName": "TouchBarPopover",
"collection": false
},
{
"typeName": "TouchBarScrubber",
"collection": false
},
{
"typeName": "TouchBarSegmentedControl",
"collection": false
},
{
"typeName": "TouchBarSlider",
"collection": false
},
{
"typeName": "TouchBarSpacer",
"collection": false
}
],
"collection": true,
"description": "",
"required": true
},
{
"name": "escapeItem",
"type": [
{
"typeName": "TouchBarButton",
"collection": false
},
{
"typeName": "TouchBarColorPicker",
"collection": false
},
{
"typeName": "TouchBarGroup",
"collection": false
},
{
"typeName": "TouchBarLabel",
"collection": false
},
{
"typeName": "TouchBarPopover",
"collection": false
},
{
"typeName": "TouchBarScrubber",
"collection": false
},
{
"typeName": "TouchBarSegmentedControl",
"collection": false
},
{
"typeName": "TouchBarSlider",
"collection": false
},
{
"typeName": "TouchBarSpacer",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "",
"required": false
}
]
}
]
},
"instanceName": "touchBar",
"instanceProperties": [
{
"name": "escapeItem",
"description": "A TouchBarItem that will replace the \"esc\" button on the touch bar when set. Setting to null restores the default \"esc\" button. Changing this value immediately updates the escape item in the touch bar.",
"type": "TouchBarItem",
"collection": false
}
]
},
{
"name": "TraceCategoriesAndOptions",
"version": "4.0.3",
"type": "Structure",
"slug": "trace-categories-and-options",
"websiteUrl": "http://electronjs.org/docs/api/structures/trace-categories-and-options",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/trace-categories-and-options.md",
"properties": [
{
"name": "categoryFilter",
"type": "String",
"collection": false,
"description": "– is a filter to control what category groups should be traced. A filter can have an optional prefix to exclude category groups that contain a matching category. Having both included and excluded category patterns in the same list is not supported. Examples: test_MyTest*, test_MyTest*,test_OtherStuff, -excluded_category1,-excluded_category2.",
"required": true
},
{
"name": "traceOptions",
"type": "String",
"collection": false,
"description": "Controls what kind of tracing is enabled, it is a comma-delimited sequence of the following strings: record-until-full, record-continuously, trace-to-console, enable-sampling, enable-systrace, e.g. 'record-until-full,enable-sampling'. The first 3 options are trace recording modes and hence mutually exclusive. If more than one trace recording modes appear in the traceOptions string, the last one takes precedence. If none of the trace recording modes are specified, recording mode is record-until-full. The trace option will first be reset to the default option (record_mode set to record-until-full, enable_sampling and enable_systrace set to false) before options parsed from traceOptions are applied on it.",
"required": true
}
]
},
{
"name": "TraceConfig",
"version": "4.0.3",
"type": "Structure",
"slug": "trace-config",
"websiteUrl": "http://electronjs.org/docs/api/structures/trace-config",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/trace-config.md",
"properties": [
{
"name": "included_categories",
"type": "String",
"collection": true,
"description": "",
"required": false
},
{
"name": "excluded_categories",
"type": "String",
"collection": true,
"description": "",
"required": false
},
{
"name": "memory_dump_config",
"type": "Object",
"collection": false,
"description": "",
"required": false,
"properties": []
}
]
},
{
"name": "Transaction",
"version": "4.0.3",
"type": "Structure",
"slug": "transaction",
"websiteUrl": "http://electronjs.org/docs/api/structures/transaction",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/transaction.md",
"properties": [
{
"name": "transactionIdentifier",
"type": "String",
"collection": false,
"description": "A string that uniquely identifies a successful payment transaction.",
"required": true
},
{
"name": "transactionDate",
"type": "String",
"collection": false,
"description": "The date the transaction was added to the App Store’s payment queue.",
"required": true
},
{
"name": "originalTransactionIdentifier",
"type": "String",
"collection": false,
"description": "The identifier of the restored transaction by the App Store.",
"required": true
},
{
"name": "transactionState",
"type": "String",
"collection": false,
"description": "The transaction state, can be purchasing, purchased, failed, restored or deferred.",
"required": true,
"possibleValues": [
{
"value": "purchasing"
},
{
"value": "purchased"
},
{
"value": "failed"
},
{
"value": "restored"
},
{
"value": "deferred"
}
]
},
{
"name": "errorCode",
"type": "Integer",
"collection": false,
"description": "The error code if an error occurred while processing the transaction.",
"required": true
},
{
"name": "errorMessage",
"type": "String",
"collection": false,
"description": "The error message if an error occurred while processing the transaction.",
"required": true
},
{
"name": "payment",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "productIdentifier",
"type": "String",
"collection": false,
"description": "The identifier of the purchased product.",
"required": true
},
{
"name": "quantity",
"type": "Integer",
"collection": false,
"description": "The quantity purchased.",
"required": true
}
]
}
]
},
{
"name": "Tray",
"description": "Add icons and context menus to the system's notification area.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "tray",
"websiteUrl": "http://electronjs.org/docs/api/tray",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/tray.md",
"constructorMethod": {
"signature": "(image)",
"parameters": [
{
"name": "image",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"required": true
}
]
},
"instanceName": "tray",
"instanceMethods": [
{
"name": "destroy",
"signature": "()",
"description": "Destroys the tray icon immediately."
},
{
"name": "setImage",
"signature": "(image)",
"description": "Sets the image associated with this tray icon.",
"parameters": [
{
"name": "image",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"required": true
}
]
},
{
"name": "setPressedImage",
"signature": "(image)",
"platforms": [
"macOS"
],
"description": "Sets the image associated with this tray icon when pressed on macOS.",
"parameters": [
{
"name": "image",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"required": true
}
]
},
{
"name": "setToolTip",
"signature": "(toolTip)",
"description": "Sets the hover text for this tray icon.",
"parameters": [
{
"name": "toolTip",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "setTitle",
"signature": "(title)",
"platforms": [
"macOS"
],
"description": "Sets the title displayed aside of the tray icon in the status bar (Support ANSI colors).",
"parameters": [
{
"name": "title",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "setHighlightMode",
"signature": "(mode)",
"platforms": [
"macOS"
],
"description": "Sets when the tray's icon background becomes highlighted (in blue). Note: You can use highlightMode with a BrowserWindow by toggling between 'never' and 'always' modes when the window visibility changes.",
"parameters": [
{
"name": "mode",
"type": "String",
"collection": false,
"description": "Highlight mode with one of the following values:",
"required": true,
"possibleValues": [
{
"value": "selection",
"description": "Highlight the tray icon when it is clicked and also when its context menu is open. This is the default."
},
{
"value": "always",
"description": "Always highlight the tray icon."
},
{
"value": "never",
"description": "Never highlight the tray icon."
}
]
}
]
},
{
"name": "setIgnoreDoubleClickEvents",
"signature": "(ignore)",
"platforms": [
"macOS"
],
"description": "Sets the option to ignore double click events. Ignoring these events allows you to detect every individual click of the tray icon. This value is set to false by default.",
"parameters": [
{
"name": "ignore",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "getIgnoreDoubleClickEvents",
"signature": "()",
"platforms": [
"macOS"
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether double click events will be ignored."
}
},
{
"name": "displayBalloon",
"signature": "(options)",
"platforms": [
"Windows"
],
"description": "Displays a tray balloon.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "icon",
"type": [
{
"typeName": "NativeImage",
"collection": false
},
{
"typeName": "String",
"collection": false
}
],
"collection": false,
"description": "-",
"required": false
},
{
"name": "title",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "content",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "popUpContextMenu",
"signature": "([menu, position])",
"platforms": [
"macOS",
"Windows"
],
"description": "Pops up the context menu of the tray icon. When menu is passed, the menu will be shown instead of the tray icon's context menu. The position is only available on Windows, and it is (0, 0) by default.",
"parameters": [
{
"name": "menu",
"type": "Menu",
"collection": false,
"required": false
},
{
"name": "position",
"type": "Point",
"collection": false,
"description": "The pop up position.",
"required": false
}
]
},
{
"name": "setContextMenu",
"signature": "(menu)",
"description": "Sets the context menu for this icon.",
"parameters": [
{
"name": "menu",
"type": [
{
"typeName": "Menu",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"required": true
}
]
},
{
"name": "getBounds",
"signature": "()",
"platforms": [
"macOS",
"Windows"
],
"description": "The bounds of this tray icon as Object.",
"returns": {
"type": "Rectangle",
"collection": false
}
},
{
"name": "isDestroyed",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the tray icon is destroyed."
}
}
],
"instanceEvents": [
{
"name": "click",
"description": "Emitted when the tray icon is clicked.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "bounds",
"type": "Rectangle",
"collection": false,
"description": "The bounds of tray icon.",
"required": true
},
{
"name": "position",
"type": "Point",
"collection": false,
"description": "The position of the event.",
"required": true
}
]
},
{
"name": "right-click",
"description": "Emitted when the tray icon is right clicked.",
"platforms": [
"macOS",
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "bounds",
"type": "Rectangle",
"collection": false,
"description": "The bounds of tray icon.",
"required": true
}
]
},
{
"name": "double-click",
"description": "Emitted when the tray icon is double clicked.",
"platforms": [
"macOS",
"Windows"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "bounds",
"type": "Rectangle",
"collection": false,
"description": "The bounds of tray icon.",
"required": true
}
]
},
{
"name": "balloon-show",
"description": "Emitted when the tray balloon shows.",
"platforms": [
"Windows"
]
},
{
"name": "balloon-click",
"description": "Emitted when the tray balloon is clicked.",
"platforms": [
"Windows"
]
},
{
"name": "balloon-closed",
"description": "Emitted when the tray balloon is closed because of timeout or user manually closes it.",
"platforms": [
"Windows"
]
},
{
"name": "drop",
"description": "Emitted when any dragged items are dropped on the tray icon.",
"platforms": [
"macOS"
]
},
{
"name": "drop-files",
"description": "Emitted when dragged files are dropped in the tray icon.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "files",
"type": "String",
"collection": true,
"description": "The paths of the dropped files.",
"required": true
}
]
},
{
"name": "drop-text",
"description": "Emitted when dragged text is dropped in the tray icon.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "text",
"type": "String",
"collection": false,
"description": "the dropped text string.",
"required": true
}
]
},
{
"name": "drag-enter",
"description": "Emitted when a drag operation enters the tray icon.",
"platforms": [
"macOS"
]
},
{
"name": "drag-leave",
"description": "Emitted when a drag operation exits the tray icon.",
"platforms": [
"macOS"
]
},
{
"name": "drag-end",
"description": "Emitted when a drag operation ends on the tray or ends at another location.",
"platforms": [
"macOS"
]
},
{
"name": "mouse-enter",
"description": "Emitted when the mouse enters the tray icon.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "position",
"type": "Point",
"collection": false,
"description": "The position of the event.",
"required": true
}
]
},
{
"name": "mouse-leave",
"description": "Emitted when the mouse exits the tray icon.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "position",
"type": "Point",
"collection": false,
"description": "The position of the event.",
"required": true
}
]
},
{
"name": "mouse-move",
"description": "Emitted when the mouse moves in the tray icon.",
"platforms": [
"macOS"
],
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "position",
"type": "Point",
"collection": false,
"description": "The position of the event.",
"required": true
}
]
}
]
},
{
"name": "UploadBlob",
"version": "4.0.3",
"type": "Structure",
"slug": "upload-blob",
"websiteUrl": "http://electronjs.org/docs/api/structures/upload-blob",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/upload-blob.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "blob.",
"required": true
},
{
"name": "blobUUID",
"type": "String",
"collection": false,
"description": "UUID of blob data to upload.",
"required": true
}
]
},
{
"name": "UploadData",
"version": "4.0.3",
"type": "Structure",
"slug": "upload-data",
"websiteUrl": "http://electronjs.org/docs/api/structures/upload-data",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/upload-data.md",
"properties": [
{
"name": "bytes",
"type": "Buffer",
"collection": false,
"description": "Content being sent.",
"required": true
},
{
"name": "file",
"type": "String",
"collection": false,
"description": "Path of file being uploaded.",
"required": true
},
{
"name": "blobUUID",
"type": "String",
"collection": false,
"description": "UUID of blob data. Use method to retrieve the data.",
"required": true
}
]
},
{
"name": "UploadFile",
"version": "4.0.3",
"type": "Structure",
"slug": "upload-file",
"websiteUrl": "http://electronjs.org/docs/api/structures/upload-file",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/upload-file.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "file.",
"required": true
},
{
"name": "filePath",
"type": "String",
"collection": false,
"description": "Path of file to be uploaded.",
"required": true
},
{
"name": "offset",
"type": "Integer",
"collection": false,
"description": "Defaults to 0.",
"required": true
},
{
"name": "length",
"type": "Integer",
"collection": false,
"description": "Number of bytes to read from offset. Defaults to 0.",
"required": true
},
{
"name": "modificationTime",
"type": "Double",
"collection": false,
"description": "Last Modification time in number of seconds since the UNIX epoch.",
"required": true
}
]
},
{
"name": "UploadRawData",
"version": "4.0.3",
"type": "Structure",
"slug": "upload-raw-data",
"websiteUrl": "http://electronjs.org/docs/api/structures/upload-raw-data",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/upload-raw-data.md",
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "rawData.",
"required": true
},
{
"name": "bytes",
"type": "Buffer",
"collection": false,
"description": "Data to be uploaded.",
"required": true
}
]
},
{
"name": "webContents",
"description": "Render and control web pages.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Module",
"slug": "web-contents",
"websiteUrl": "http://electronjs.org/docs/api/web-contents",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/web-contents.md",
"methods": [
{
"name": "getAllWebContents",
"signature": "()",
"returns": {
"type": "WebContents",
"collection": true,
"description": "An array of all WebContents instances. This will contain web contents for all windows, webviews, opened devtools, and devtools extension background pages."
}
},
{
"name": "getFocusedWebContents",
"signature": "()",
"returns": {
"type": "WebContents",
"collection": false,
"description": "The web contents that is focused in this application, otherwise returns null."
}
},
{
"name": "fromId",
"signature": "(id)",
"parameters": [
{
"name": "id",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "WebContents",
"collection": false,
"description": "A WebContents instance with the given ID."
}
}
]
},
{
"name": "WebContents",
"description": "Render and control the contents of a BrowserWindow instance.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "web-contents",
"websiteUrl": "http://electronjs.org/docs/api/web-contents",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/web-contents.md",
"instanceName": "contents",
"instanceMethods": [
{
"name": "loadURL",
"signature": "(url[, options])",
"description": "Loads the url in the window. The url must contain the protocol prefix, e.g. the http:// or file://. If the load should bypass http cache then use the pragma header to achieve it.",
"parameters": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "httpReferrer",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Referrer",
"collection": false
}
],
"collection": false,
"description": "An HTTP Referrer url.",
"required": false
},
{
"name": "userAgent",
"type": "String",
"collection": false,
"description": "A user agent originating the request.",
"required": false
},
{
"name": "extraHeaders",
"type": "String",
"collection": false,
"description": "Extra headers separated by \"\\n\".",
"required": false
},
{
"name": "postData",
"type": [
{
"typeName": "UploadRawData",
"collection": true
},
{
"typeName": "UploadFile",
"collection": true
},
{
"typeName": "UploadBlob",
"collection": true
}
],
"collection": false,
"description": "",
"required": false
},
{
"name": "baseURLForDataURL",
"type": "String",
"collection": false,
"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
}
]
}
]
},
{
"name": "loadFile",
"signature": "(filePath[, options])",
"description": "Loads the given file in the window, filePath should be a path to an HTML file relative to the root of your application. For instance an app structure like this: Would require code like this",
"parameters": [
{
"name": "filePath",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "query",
"type": "Object",
"collection": false,
"description": "Passed to url.format().",
"required": false,
"properties": []
},
{
"name": "search",
"type": "String",
"collection": false,
"description": "Passed to url.format().",
"required": false
},
{
"name": "hash",
"type": "String",
"collection": false,
"description": "Passed to url.format().",
"required": false
}
]
}
]
},
{
"name": "downloadURL",
"signature": "(url)",
"description": "Initiates a download of the resource at url without navigating. The will-download event of session will be triggered.",
"parameters": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getURL",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The URL of the current web page."
}
},
{
"name": "getTitle",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The title of the current web page."
}
},
{
"name": "isDestroyed",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the web page is destroyed."
}
},
{
"name": "focus",
"signature": "()",
"description": "Focuses the web page."
},
{
"name": "isFocused",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the web page is focused."
}
},
{
"name": "isLoading",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether web page is still loading resources."
}
},
{
"name": "isLoadingMainFrame",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the main frame (and not just iframes or frames within it) is still loading."
}
},
{
"name": "isWaitingForResponse",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the web page is waiting for a first-response from the main resource of the page."
}
},
{
"name": "stop",
"signature": "()",
"description": "Stops any pending navigation."
},
{
"name": "reload",
"signature": "()",
"description": "Reloads the current web page."
},
{
"name": "reloadIgnoringCache",
"signature": "()",
"description": "Reloads current page and ignores cache."
},
{
"name": "canGoBack",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the browser can go back to previous web page."
}
},
{
"name": "canGoForward",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the browser can go forward to next web page."
}
},
{
"name": "canGoToOffset",
"signature": "(offset)",
"parameters": [
{
"name": "offset",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the web page can go to offset."
}
},
{
"name": "clearHistory",
"signature": "()",
"description": "Clears the navigation history."
},
{
"name": "goBack",
"signature": "()",
"description": "Makes the browser go back a web page."
},
{
"name": "goForward",
"signature": "()",
"description": "Makes the browser go forward a web page."
},
{
"name": "goToIndex",
"signature": "(index)",
"description": "Navigates browser to the specified absolute web page index.",
"parameters": [
{
"name": "index",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "goToOffset",
"signature": "(offset)",
"description": "Navigates to the specified offset from the \"current entry\".",
"parameters": [
{
"name": "offset",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "isCrashed",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the renderer process has crashed."
}
},
{
"name": "setUserAgent",
"signature": "(userAgent)",
"description": "Overrides the user agent for this web page.",
"parameters": [
{
"name": "userAgent",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getUserAgent",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The user agent for this web page."
}
},
{
"name": "insertCSS",
"signature": "(css)",
"description": "Injects CSS into the current web page.",
"parameters": [
{
"name": "css",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "executeJavaScript",
"signature": "(code[, userGesture, callback])",
"description": "Evaluates code in page. In the browser window some HTML APIs like requestFullScreen can only be invoked by a gesture from the user. Setting userGesture to true will remove this limitation. If the result of the executed code is a promise the callback result will be the resolved value of the promise. We recommend that you use the returned Promise to handle code that results in a Promise.",
"parameters": [
{
"name": "code",
"type": "String",
"collection": false,
"required": true
},
{
"name": "userGesture",
"type": "Boolean",
"collection": false,
"description": "Default is `false`.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called after script has been executed.",
"required": false,
"parameters": [
{
"name": "result",
"type": "Any",
"collection": false,
"description": "",
"required": true
}
]
}
],
"returns": {
"type": "Promise",
"collection": false,
"innerType": "any",
"description": "A promise that resolves with the result of the executed code or is rejected if the result of the code is a rejected promise."
}
},
{
"name": "setIgnoreMenuShortcuts",
"signature": "(ignore)",
"platforms": [
"Experimental"
],
"description": "Ignore application menu shortcuts while this web contents is focused.",
"parameters": [
{
"name": "ignore",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "setAudioMuted",
"signature": "(muted)",
"description": "Mute the audio on the current web page.",
"parameters": [
{
"name": "muted",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isAudioMuted",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether this page has been muted."
}
},
{
"name": "isCurrentlyAudible",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether audio is currently playing."
}
},
{
"name": "setZoomFactor",
"signature": "(factor)",
"description": "Changes the zoom factor to the specified factor. Zoom factor is zoom percent divided by 100, so 300% = 3.0.",
"parameters": [
{
"name": "factor",
"type": "Number",
"collection": false,
"description": "Zoom factor.",
"required": true
}
]
},
{
"name": "getZoomFactor",
"signature": "(callback)",
"description": "Sends a request to get current zoom factor, the callback will be called with callback(zoomFactor).",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "zoomFactor",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "setZoomLevel",
"signature": "(level)",
"description": "Changes the zoom level to the specified level. The original size is 0 and each increment above or below represents zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. The formula for this is scale := 1.2 ^ level.",
"parameters": [
{
"name": "level",
"type": "Number",
"collection": false,
"description": "Zoom level.",
"required": true
}
]
},
{
"name": "getZoomLevel",
"signature": "(callback)",
"description": "Sends a request to get current zoom level, the callback will be called with callback(zoomLevel).",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "zoomLevel",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "setVisualZoomLevelLimits",
"signature": "(minimumLevel, maximumLevel)",
"description": "Sets the maximum and minimum pinch-to-zoom level.",
"parameters": [
{
"name": "minimumLevel",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "maximumLevel",
"type": "Number",
"collection": false,
"required": true
}
]
},
{
"name": "setLayoutZoomLevelLimits",
"signature": "(minimumLevel, maximumLevel)",
"description": "Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.",
"parameters": [
{
"name": "minimumLevel",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "maximumLevel",
"type": "Number",
"collection": false,
"required": true
}
]
},
{
"name": "undo",
"signature": "()",
"description": "Executes the editing command undo in web page."
},
{
"name": "redo",
"signature": "()",
"description": "Executes the editing command redo in web page."
},
{
"name": "cut",
"signature": "()",
"description": "Executes the editing command cut in web page."
},
{
"name": "copy",
"signature": "()",
"description": "Executes the editing command copy in web page."
},
{
"name": "copyImageAt",
"signature": "(x, y)",
"description": "Copy the image at the given position to the clipboard.",
"parameters": [
{
"name": "x",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "y",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "paste",
"signature": "()",
"description": "Executes the editing command paste in web page."
},
{
"name": "pasteAndMatchStyle",
"signature": "()",
"description": "Executes the editing command pasteAndMatchStyle in web page."
},
{
"name": "delete",
"signature": "()",
"description": "Executes the editing command delete in web page."
},
{
"name": "selectAll",
"signature": "()",
"description": "Executes the editing command selectAll in web page."
},
{
"name": "unselect",
"signature": "()",
"description": "Executes the editing command unselect in web page."
},
{
"name": "replace",
"signature": "(text)",
"description": "Executes the editing command replace in web page.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "replaceMisspelling",
"signature": "(text)",
"description": "Executes the editing command replaceMisspelling in web page.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "insertText",
"signature": "(text)",
"description": "Inserts text to the focused element.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "findInPage",
"signature": "(text[, options])",
"description": "Starts a request to find all matches for the text in the web page. The result of the request can be obtained by subscribing to found-in-page event.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"description": "Content to be searched, must not be empty.",
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "forward",
"type": "Boolean",
"collection": false,
"description": "Whether to search forward or backward, defaults to true.",
"required": false
},
{
"name": "findNext",
"type": "Boolean",
"collection": false,
"description": "Whether the operation is first request or a follow up, defaults to false.",
"required": false
},
{
"name": "matchCase",
"type": "Boolean",
"collection": false,
"description": "Whether search should be case-sensitive, defaults to false.",
"required": false
},
{
"name": "wordStart",
"type": "Boolean",
"collection": false,
"description": "(Deprecated) Whether to look only at the start of words. defaults to false.",
"required": false
},
{
"name": "medialCapitalAsWordStart",
"type": "Boolean",
"collection": false,
"description": "(Deprecated) When combined with wordStart, accepts a match in the middle of a word if the match begins with an uppercase letter followed by a lowercase or non-letter. Accepts several other intra-word matches, defaults to false.",
"required": false
}
]
}
],
"returns": {
"type": "Integer",
"collection": false,
"description": "The request id used for the request."
}
},
{
"name": "stopFindInPage",
"signature": "(action)",
"description": "Stops any findInPage request for the webContents with the provided action.",
"parameters": [
{
"name": "action",
"type": "String",
"collection": false,
"description": "Specifies the action to take place when ending [`webContents.findInPage`] request.",
"required": true,
"possibleValues": [
{
"value": "clearSelection",
"description": "Clear the selection."
},
{
"value": "keepSelection",
"description": "Translate the selection into a normal selection."
},
{
"value": "activateSelection",
"description": "Focus and click the selection node."
}
]
}
]
},
{
"name": "capturePage",
"signature": "([rect, ]callback)",
"description": "Captures a snapshot of the page within rect. Upon completion callback will be called with callback(image). The image is an instance of NativeImage that stores data of the snapshot. Omitting rect will capture the whole visible page.",
"parameters": [
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"description": "The area of the page to be captured.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "image",
"type": "NativeImage",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "hasServiceWorker",
"signature": "(callback)",
"description": "Checks if any ServiceWorker is registered and returns a boolean as response to callback.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "hasWorker",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "unregisterServiceWorker",
"signature": "(callback)",
"description": "Unregisters any ServiceWorker if present and returns a boolean as response to callback when the JS promise is fulfilled or false when the JS promise is rejected.",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "success",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "getPrinters",
"signature": "()",
"description": "Get the system printer list.",
"returns": {
"type": "PrinterInfo",
"collection": true,
"description": "."
}
},
{
"name": "print",
"signature": "([options], [callback])",
"description": "Prints window's web page. When silent is set to true, Electron will pick the system's default printer if deviceName is empty and the default settings for printing. Calling window.print() in web page is equivalent to calling webContents.print({ silent: false, printBackground: false, deviceName: '' }). Use page-break-before: always; CSS style to force to print to a new page.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "silent",
"type": "Boolean",
"collection": false,
"description": "Don't ask user for print settings. Default is false.",
"required": false
},
{
"name": "printBackground",
"type": "Boolean",
"collection": false,
"description": "Also prints the background color and image of the web page. Default is false.",
"required": false
},
{
"name": "deviceName",
"type": "String",
"collection": false,
"description": "Set the printer device name to use. Default is ''.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": false,
"parameters": [
{
"name": "success",
"type": "Boolean",
"collection": false,
"description": "Indicates success of the print call.",
"required": true
}
]
}
]
},
{
"name": "printToPDF",
"signature": "(options, callback)",
"description": "Prints window's web page as PDF with Chromium's preview printing custom settings. The callback will be called with callback(error, data) on completion. The data is a Buffer that contains the generated PDF data. The landscape will be ignored if @page CSS at-rule is used in the web page. By default, an empty options will be regarded as: Use page-break-before: always; CSS style to force to print to a new page. An example of webContents.printToPDF:",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "marginsType",
"type": "Integer",
"collection": false,
"description": "Specifies the type of margins to use. Uses 0 for default margin, 1 for no margin, and 2 for minimum margin.",
"required": false
},
{
"name": "pageSize",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Size",
"collection": false
}
],
"collection": false,
"description": "Specify page size of the generated PDF. Can be A3, A4, A5, Legal, Letter, Tabloid or an Object containing height and width in microns.",
"required": false
},
{
"name": "printBackground",
"type": "Boolean",
"collection": false,
"description": "Whether to print CSS backgrounds.",
"required": false
},
{
"name": "printSelectionOnly",
"type": "Boolean",
"collection": false,
"description": "Whether to print selection only.",
"required": false
},
{
"name": "landscape",
"type": "Boolean",
"collection": false,
"description": "true for landscape, false for portrait.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
},
{
"name": "data",
"type": "Buffer",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "addWorkSpace",
"signature": "(path)",
"description": "Adds the specified path to DevTools workspace. Must be used after DevTools creation:",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "removeWorkSpace",
"signature": "(path)",
"description": "Removes the specified path from DevTools workspace.",
"parameters": [
{
"name": "path",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "setDevToolsWebContents",
"signature": "(devToolsWebContents)",
"description": "Uses the devToolsWebContents as the target WebContents to show devtools. The devToolsWebContents must not have done any navigation, and it should not be used for other purposes after the call. By default Electron manages the devtools by creating an internal WebContents with native view, which developers have very limited control of. With the setDevToolsWebContents method, developers can use any WebContents to show the devtools in it, including BrowserWindow, BrowserView and tag. Note that closing the devtools does not destroy the devToolsWebContents, it is caller's responsibility to destroy devToolsWebContents. An example of showing devtools in a tag: An example of showing devtools in a BrowserWindow:",
"parameters": [
{
"name": "devToolsWebContents",
"type": "WebContents",
"collection": false,
"required": true
}
]
},
{
"name": "openDevTools",
"signature": "([options])",
"description": "Opens the devtools. When contents is a tag, the mode would be detach by default, explicitly passing an empty mode can force using last used dock state.",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "mode",
"type": "String",
"collection": false,
"description": "Opens the devtools with specified dock state, can be right, bottom, undocked, detach. Defaults to last used dock state. In undocked mode it's possible to dock back. In detach mode it's not.",
"required": true,
"possibleValues": [
{
"value": "right"
},
{
"value": "bottom"
},
{
"value": "undocked"
},
{
"value": "detach"
}
]
}
]
}
]
},
{
"name": "closeDevTools",
"signature": "()",
"description": "Closes the devtools."
},
{
"name": "isDevToolsOpened",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the devtools is opened."
}
},
{
"name": "isDevToolsFocused",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the devtools view is focused ."
}
},
{
"name": "toggleDevTools",
"signature": "()",
"description": "Toggles the developer tools."
},
{
"name": "inspectElement",
"signature": "(x, y)",
"description": "Starts inspecting element at position (x, y).",
"parameters": [
{
"name": "x",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "y",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "inspectServiceWorker",
"signature": "()",
"description": "Opens the developer tools for the service worker context."
},
{
"name": "send",
"signature": "(channel[, arg1][, arg2][, ...])",
"description": "Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. Arguments will be serialized in JSON internally and hence no functions or prototype chain will be included. The renderer process can handle the message by listening to channel with the ipcRenderer module. An example of sending messages from the main process to the renderer process:",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "...args",
"type": "any",
"collection": true,
"required": true
}
]
},
{
"name": "enableDeviceEmulation",
"signature": "(parameters)",
"description": "Enable device emulation with the given parameters.",
"parameters": [
{
"name": "parameters",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "screenPosition",
"type": "String",
"collection": false,
"description": "Specify the screen type to emulate (default: desktop):",
"required": true,
"possibleValues": [
{
"value": "desktop",
"description": "Desktop screen type."
},
{
"value": "mobile",
"description": "Mobile screen type."
}
]
},
{
"name": "screenSize",
"type": "Size",
"collection": false,
"description": "Set the emulated screen size (screenPosition == mobile).",
"required": true
},
{
"name": "viewPosition",
"type": "Point",
"collection": false,
"description": "Position the view on the screen (screenPosition == mobile) (default: { x: 0, y: 0 }).",
"required": true
},
{
"name": "deviceScaleFactor",
"type": "Integer",
"collection": false,
"description": "Set the device scale factor (if zero defaults to original device scale factor) (default: 0).",
"required": true
},
{
"name": "viewSize",
"type": "Size",
"collection": false,
"description": "Set the emulated view size (empty means no override)",
"required": true
},
{
"name": "scale",
"type": "Float",
"collection": false,
"description": "Scale of emulated view inside available space (not in fit to view mode) (default: 1).",
"required": true
}
]
}
]
},
{
"name": "disableDeviceEmulation",
"signature": "()",
"description": "Disable device emulation enabled by webContents.enableDeviceEmulation."
},
{
"name": "sendInputEvent",
"signature": "(event)",
"description": "Sends an input event to the page. Note: The BrowserWindow containing the contents needs to be focused for sendInputEvent() to work. For keyboard events, the event object also have following properties: For mouse events, the event object also have following properties: For the mouseWheel event, the event object also have following properties:",
"parameters": [
{
"name": "event",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "() The type of the event, can be mouseDown, mouseUp, mouseEnter, mouseLeave, contextMenu, mouseWheel, mouseMove, keyDown, keyUp or char.",
"required": true,
"possibleValues": [
{
"value": "mouseDown"
},
{
"value": "mouseUp"
},
{
"value": "mouseEnter"
},
{
"value": "mouseLeave"
},
{
"value": "contextMenu"
},
{
"value": "mouseWheel"
},
{
"value": "mouseMove"
},
{
"value": "keyDown"
},
{
"value": "keyUp"
},
{
"value": "char"
}
]
},
{
"name": "modifiers",
"type": "String",
"collection": true,
"description": "An array of modifiers of the event, can include shift, control, alt, meta, isKeypad, isAutoRepeat, leftButtonDown, middleButtonDown, rightButtonDown, capsLock, numLock, left, right.",
"required": true
}
]
}
]
},
{
"name": "beginFrameSubscription",
"signature": "([onlyDirty ,]callback)",
"description": "Begin subscribing for presentation events and captured frames, the callback will be called with callback(image, dirtyRect) when there is a presentation event. The image is an instance of NativeImage that stores the captured frame. The dirtyRect is an object with x, y, width, height properties that describes which part of the page was repainted. If onlyDirty is set to true, image will only contain the repainted area. onlyDirty defaults to false.",
"parameters": [
{
"name": "onlyDirty",
"type": "Boolean",
"collection": false,
"description": "Defaults to `false`.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "image",
"type": "NativeImage",
"collection": false,
"description": "",
"required": true
},
{
"name": "dirtyRect",
"type": "Rectangle",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "endFrameSubscription",
"signature": "()",
"description": "End subscribing for frame presentation events."
},
{
"name": "startDrag",
"signature": "(item)",
"description": "Sets the item as dragging item for current drag-drop operation, file is the absolute path of the file to be dragged, and icon is the image showing under the cursor when dragging.",
"parameters": [
{
"name": "item",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "file",
"type": "String",
"collection": false,
"description": "or files Array The path(s) to the file(s) being dragged.",
"required": true
},
{
"name": "icon",
"type": "NativeImage",
"collection": false,
"description": "The image must be non-empty on macOS.",
"required": true
}
]
}
]
},
{
"name": "savePage",
"signature": "(fullPath, saveType, callback)",
"parameters": [
{
"name": "fullPath",
"type": "String",
"collection": false,
"description": "The full file path.",
"required": true
},
{
"name": "saveType",
"type": "String",
"collection": false,
"description": "Specify the save type.",
"required": true,
"possibleValues": [
{
"value": "HTMLOnly",
"description": "Save only the HTML of the page."
},
{
"value": "HTMLComplete",
"description": "Save complete-html page."
},
{
"value": "MHTML",
"description": "Save complete-html page as MHTML."
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "`(error) => {}`.",
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
}
]
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "true if the process of saving page has been initiated successfully."
}
},
{
"name": "showDefinitionForSelection",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Shows pop-up dictionary that searches the selected word on the page."
},
{
"name": "isOffscreen",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Indicates whether offscreen rendering is enabled."
}
},
{
"name": "startPainting",
"signature": "()",
"description": "If offscreen rendering is enabled and not painting, start painting."
},
{
"name": "stopPainting",
"signature": "()",
"description": "If offscreen rendering is enabled and painting, stop painting."
},
{
"name": "isPainting",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "If offscreen rendering is enabled returns whether it is currently painting."
}
},
{
"name": "setFrameRate",
"signature": "(fps)",
"description": "If offscreen rendering is enabled sets the frame rate to the specified number. Only values between 1 and 60 are accepted.",
"parameters": [
{
"name": "fps",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "getFrameRate",
"signature": "()",
"returns": {
"type": "Integer",
"collection": false,
"description": "If offscreen rendering is enabled returns the current frame rate."
}
},
{
"name": "invalidate",
"signature": "()",
"description": "Schedules a full repaint of the window this web contents is in. If offscreen rendering is enabled invalidates the frame and generates a new one through the 'paint' event."
},
{
"name": "getWebRTCIPHandlingPolicy",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "Returns the WebRTC IP Handling Policy."
}
},
{
"name": "setWebRTCIPHandlingPolicy",
"signature": "(policy)",
"description": "Setting the WebRTC IP handling policy allows you to control which IPs are exposed via WebRTC. See BrowserLeaks for more details.",
"parameters": [
{
"name": "policy",
"type": "String",
"collection": false,
"description": "Specify the WebRTC IP Handling Policy.",
"required": true,
"possibleValues": [
{
"value": "default",
"description": "Exposes user's public and local IPs. This is the default behavior. When this policy is used, WebRTC has the right to enumerate all interfaces and bind them to discover public interfaces."
},
{
"value": "default_public_interface_only",
"description": "Exposes user's public IP, but does not expose user's local IP. When this policy is used, WebRTC should only use the default route used by http. This doesn't expose any local addresses."
},
{
"value": "default_public_and_private_interfaces",
"description": "Exposes user's public and local IPs. When this policy is used, WebRTC should only use the default route used by http. This also exposes the associated default private address. Default route is the route chosen by the OS on a multi-homed endpoint."
},
{
"value": "disable_non_proxied_udp",
"description": "Does not expose public or local IPs. When this policy is used, WebRTC should only use TCP to contact peers or servers unless the proxy server supports UDP."
}
]
}
]
},
{
"name": "getOSProcessId",
"signature": "()",
"returns": {
"type": "Integer",
"collection": false,
"description": "The operating system pid of the associated renderer process."
}
},
{
"name": "getProcessId",
"signature": "()",
"returns": {
"type": "Integer",
"collection": false,
"description": "The Chromium internal pid of the associated renderer. Can be compared to the frameProcessId passed by frame specific navigation events (e.g. did-frame-navigate)"
}
},
{
"name": "takeHeapSnapshot",
"signature": "(filePath)",
"description": "Takes a V8 heap snapshot and saves it to filePath.",
"parameters": [
{
"name": "filePath",
"type": "String",
"collection": false,
"description": "Path to the output file.",
"required": true
}
],
"returns": {
"type": "Promise",
"collection": false,
"innerType": "void",
"description": "Indicates whether the snapshot has been created successfully."
}
},
{
"name": "setBackgroundThrottling",
"signature": "(allowed)",
"description": "Controls whether or not this WebContents will throttle animations and timers when the page becomes backgrounded. This also affects the Page Visibility API.",
"parameters": [
{
"name": "allowed",
"type": "Boolean",
"collection": false,
"required": true
}
]
}
],
"instanceProperties": [
{
"name": "id",
"description": "A Integer representing the unique ID of this WebContents.",
"type": "Integer",
"collection": false
},
{
"name": "session",
"description": "A Session used by this webContents.",
"type": "Session",
"collection": false
},
{
"name": "hostWebContents",
"description": "A WebContents instance that might own this WebContents.",
"type": "WebContents",
"collection": false
},
{
"name": "devToolsWebContents",
"description": "A WebContents of DevTools for this WebContents. Note: Users should never store this object because it may become null when the DevTools has been closed.",
"type": "WebContents",
"collection": false
},
{
"name": "debugger",
"description": "A Debugger instance for this webContents.",
"type": "Debugger",
"collection": false
}
],
"instanceEvents": [
{
"name": "did-finish-load",
"description": "Emitted when the navigation is done, i.e. the spinner of the tab has stopped spinning, and the onload event was dispatched."
},
{
"name": "did-fail-load",
"description": "This event is like did-finish-load but emitted when the load failed or was cancelled, e.g. window.stop() is invoked. The full list of error codes and their meaning is available here.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "errorCode",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "errorDescription",
"type": "String",
"collection": false,
"required": true
},
{
"name": "validatedURL",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "did-frame-finish-load",
"description": "Emitted when a frame has done navigation.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "did-start-loading",
"description": "Corresponds to the points in time when the spinner of the tab started spinning."
},
{
"name": "did-stop-loading",
"description": "Corresponds to the points in time when the spinner of the tab stopped spinning."
},
{
"name": "dom-ready",
"description": "Emitted when the document in the given frame is loaded.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "page-favicon-updated",
"description": "Emitted when page receives favicon urls.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "favicons",
"type": "String",
"collection": true,
"description": "Array of URLs.",
"required": true
}
]
},
{
"name": "new-window",
"description": "Emitted when the page requests to open a new window for a url. It could be requested by window.open or an external link like . By default a new BrowserWindow will be created for the url. Calling event.preventDefault() will prevent Electron from automatically creating a new BrowserWindow. If you call event.preventDefault() and manually create a new BrowserWindow then you must set event.newGuest to reference the new BrowserWindow instance, failing to do so may result in unexpected behavior. For example:",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "frameName",
"type": "String",
"collection": false,
"required": true
},
{
"name": "disposition",
"type": "String",
"collection": false,
"description": "Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`.",
"required": true,
"possibleValues": [
{
"value": "default"
},
{
"value": "foreground-tab"
},
{
"value": "background-tab"
},
{
"value": "new-window"
},
{
"value": "save-to-disk"
},
{
"value": "other"
}
]
},
{
"name": "options",
"type": "Object",
"collection": false,
"description": "The options which will be used for creating the new .",
"required": true
},
{
"name": "additionalFeatures",
"type": "String",
"collection": true,
"description": "The non-standard features (features not handled by Chromium or Electron) given to `window.open()`.",
"required": true
},
{
"name": "referrer",
"type": "Referrer",
"collection": false,
"description": "The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy.",
"required": true
}
]
},
{
"name": "will-navigate",
"description": "Emitted when a user or the page wants to start navigation. It can happen when the window.location object is changed or a user clicks a link in the page. This event will not emit when the navigation is started programmatically with APIs like webContents.loadURL and webContents.back. It is also not emitted for in-page navigations, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose. Calling event.preventDefault() will prevent the navigation.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "did-start-navigation",
"description": "Emitted when any frame (including main) starts navigating. isInplace will be true for in-page navigations.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isInPlace",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "will-redirect",
"description": "Emitted as a server side redirect occurs during navigation. For example a 302 redirect. This event will be emitted after did-start-navigation and always before the did-redirect-navigation event for the same navigation. Calling event.preventDefault() will prevent the navigation (not just the redirect).",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isInPlace",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "did-redirect-navigation",
"description": "Emitted after a server side redirect occurs during navigation. For example a 302 redirect. This event can not be prevented, if you want to prevent redirects you should checkout out the will-redirect event above.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isInPlace",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "did-navigate",
"description": "Emitted when a main frame navigation is done. This event is not emitted for in-page navigations, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "httpResponseCode",
"type": "Integer",
"collection": false,
"description": "-1 for non HTTP navigations",
"required": true
},
{
"name": "httpStatusText",
"type": "String",
"collection": false,
"description": "empty for non HTTP navigations",
"required": true
}
]
},
{
"name": "did-frame-navigate",
"description": "Emitted when any frame navigation is done. This event is not emitted for in-page navigations, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "httpResponseCode",
"type": "Integer",
"collection": false,
"description": "-1 for non HTTP navigations",
"required": true
},
{
"name": "httpStatusText",
"type": "String",
"collection": false,
"description": "empty for non HTTP navigations,",
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "did-navigate-in-page",
"description": "Emitted when an in-page navigation happened in any frame. When in-page navigation happens, the page URL changes but does not cause navigation outside of the page. Examples of this occurring are when anchor links are clicked or when the DOM hashchange event is triggered.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "frameProcessId",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "frameRoutingId",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "will-prevent-unload",
"description": "Emitted when a beforeunload event handler is attempting to cancel a page unload. Calling event.preventDefault() will ignore the beforeunload event handler and allow the page to be unloaded.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
}
]
},
{
"name": "crashed",
"description": "Emitted when the renderer process crashes or is killed.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "killed",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "unresponsive",
"description": "Emitted when the web page becomes unresponsive."
},
{
"name": "responsive",
"description": "Emitted when the unresponsive web page becomes responsive again."
},
{
"name": "plugin-crashed",
"description": "Emitted when a plugin process has crashed.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "name",
"type": "String",
"collection": false,
"required": true
},
{
"name": "version",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "destroyed",
"description": "Emitted when webContents is destroyed."
},
{
"name": "before-input-event",
"description": "Emitted before dispatching the keydown and keyup events in the page. Calling event.preventDefault will prevent the page keydown/keyup events and the menu shortcuts. To only prevent the menu shortcuts, use setIgnoreMenuShortcuts:",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "input",
"type": "Object",
"collection": false,
"description": "Input properties.",
"required": true,
"properties": [
{
"name": "type",
"type": "String",
"collection": false,
"description": "Either keyUp or keyDown.",
"required": true
},
{
"name": "key",
"type": "String",
"collection": false,
"description": "Equivalent to .",
"required": true
},
{
"name": "code",
"type": "String",
"collection": false,
"description": "Equivalent to .",
"required": true
},
{
"name": "isAutoRepeat",
"type": "Boolean",
"collection": false,
"description": "Equivalent to .",
"required": true
},
{
"name": "shift",
"type": "Boolean",
"collection": false,
"description": "Equivalent to .",
"required": true
},
{
"name": "control",
"type": "Boolean",
"collection": false,
"description": "Equivalent to .",
"required": true
},
{
"name": "alt",
"type": "Boolean",
"collection": false,
"description": "Equivalent to .",
"required": true
},
{
"name": "meta",
"type": "Boolean",
"collection": false,
"description": "Equivalent to .",
"required": true
}
]
}
]
},
{
"name": "devtools-opened",
"description": "Emitted when DevTools is opened."
},
{
"name": "devtools-closed",
"description": "Emitted when DevTools is closed."
},
{
"name": "devtools-focused",
"description": "Emitted when DevTools is focused / opened."
},
{
"name": "certificate-error",
"description": "Emitted when failed to verify the certificate for url. The usage is the same with the certificate-error event of app.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "error",
"type": "String",
"collection": false,
"description": "The error code.",
"required": true
},
{
"name": "certificate",
"type": "Certificate",
"collection": false,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "isTrusted",
"type": "Boolean",
"collection": false,
"description": "Indicates whether the certificate can be considered trusted.",
"required": true
}
]
}
]
},
{
"name": "select-client-certificate",
"description": "Emitted when a client certificate is requested. The usage is the same with the select-client-certificate event of app.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "URL",
"collection": false,
"required": true
},
{
"name": "certificateList",
"type": "Certificate",
"collection": true,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "certificate",
"type": "Certificate",
"collection": false,
"description": "Must be a certificate from the given list.",
"required": true
}
]
}
]
},
{
"name": "login",
"description": "Emitted when webContents wants to do basic auth. The usage is the same with the login event of app.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "request",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "URL",
"collection": false,
"description": "",
"required": true
},
{
"name": "referrer",
"type": "URL",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "authInfo",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "isProxy",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "scheme",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "host",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "port",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "realm",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "username",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "password",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "found-in-page",
"description": "Emitted when a result is available for [webContents.findInPage] request.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "result",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "requestId",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "activeMatchOrdinal",
"type": "Integer",
"collection": false,
"description": "Position of the active match.",
"required": true
},
{
"name": "matches",
"type": "Integer",
"collection": false,
"description": "Number of Matches.",
"required": true
},
{
"name": "selectionArea",
"type": "Object",
"collection": false,
"description": "Coordinates of first match region.",
"required": true,
"properties": []
},
{
"name": "finalUpdate",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "media-started-playing",
"description": "Emitted when media starts playing."
},
{
"name": "media-paused",
"description": "Emitted when media is paused or done playing."
},
{
"name": "did-change-theme-color",
"description": "Emitted when a page's theme color changes. This is usually due to encountering a meta tag:",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "color",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "null",
"collection": false
}
],
"collection": false,
"description": "Theme color is in format of '#rrggbb'. It is `null` when no theme color is set.",
"required": true
}
]
},
{
"name": "update-target-url",
"description": "Emitted when mouse moves over a link or the keyboard moves the focus to a link.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "cursor-changed",
"description": "Emitted when the cursor's type changes. The type parameter can be default, crosshair, pointer, text, wait, help, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize, ns-resize, ew-resize, nesw-resize, nwse-resize, col-resize, row-resize, m-panning, e-panning, n-panning, ne-panning, nw-panning, s-panning, se-panning, sw-panning, w-panning, move, vertical-text, cell, context-menu, alias, progress, nodrop, copy, none, not-allowed, zoom-in, zoom-out, grab, grabbing or custom. If the type parameter is custom, the image parameter will hold the custom cursor image in a NativeImage, and scale, size and hotspot will hold additional information about the custom cursor.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "type",
"type": "String",
"collection": false,
"required": true
},
{
"name": "image",
"type": "NativeImage",
"collection": false,
"required": false
},
{
"name": "scale",
"type": "Float",
"collection": false,
"description": "scaling factor for the custom cursor.",
"required": false
},
{
"name": "size",
"type": "Size",
"collection": false,
"description": "the size of the `image`.",
"required": false
},
{
"name": "hotspot",
"type": "Point",
"collection": false,
"description": "coordinates of the custom cursor's hotspot.",
"required": false
}
]
},
{
"name": "context-menu",
"description": "Emitted when there is a new context menu that needs to be handled.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "params",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "x",
"type": "Integer",
"collection": false,
"description": "x coordinate.",
"required": true
},
{
"name": "y",
"type": "Integer",
"collection": false,
"description": "y coordinate.",
"required": true
},
{
"name": "linkURL",
"type": "String",
"collection": false,
"description": "URL of the link that encloses the node the context menu was invoked on.",
"required": true
},
{
"name": "linkText",
"type": "String",
"collection": false,
"description": "Text associated with the link. May be an empty string if the contents of the link are an image.",
"required": true
},
{
"name": "pageURL",
"type": "String",
"collection": false,
"description": "URL of the top level page that the context menu was invoked on.",
"required": true
},
{
"name": "frameURL",
"type": "String",
"collection": false,
"description": "URL of the subframe that the context menu was invoked on.",
"required": true
},
{
"name": "srcURL",
"type": "String",
"collection": false,
"description": "Source URL for the element that the context menu was invoked on. Elements with source URLs are images, audio and video.",
"required": true
},
{
"name": "mediaType",
"type": "String",
"collection": false,
"description": "Type of the node the context menu was invoked on. Can be none, image, audio, video, canvas, file or plugin.",
"required": true,
"possibleValues": [
{
"value": "none"
},
{
"value": "image"
},
{
"value": "audio"
},
{
"value": "video"
},
{
"value": "canvas"
},
{
"value": "file"
},
{
"value": "plugin"
}
]
},
{
"name": "hasImageContents",
"type": "Boolean",
"collection": false,
"description": "Whether the context menu was invoked on an image which has non-empty contents.",
"required": true
},
{
"name": "isEditable",
"type": "Boolean",
"collection": false,
"description": "Whether the context is editable.",
"required": true
},
{
"name": "selectionText",
"type": "String",
"collection": false,
"description": "Text of the selection that the context menu was invoked on.",
"required": true
},
{
"name": "titleText",
"type": "String",
"collection": false,
"description": "Title or alt text of the selection that the context was invoked on.",
"required": true
},
{
"name": "misspelledWord",
"type": "String",
"collection": false,
"description": "The misspelled word under the cursor, if any.",
"required": true
},
{
"name": "frameCharset",
"type": "String",
"collection": false,
"description": "The character encoding of the frame on which the menu was invoked.",
"required": true
},
{
"name": "inputFieldType",
"type": "String",
"collection": false,
"description": "If the context menu was invoked on an input field, the type of that field. Possible values are none, plainText, password, other.",
"required": true
},
{
"name": "menuSourceType",
"type": "String",
"collection": false,
"description": "Input source that invoked the context menu. Can be none, mouse, keyboard, touch or touchMenu.",
"required": true,
"possibleValues": [
{
"value": "none"
},
{
"value": "mouse"
},
{
"value": "keyboard"
},
{
"value": "touch"
},
{
"value": "touchMenu"
}
]
},
{
"name": "mediaFlags",
"type": "Object",
"collection": false,
"description": "The flags for the media element the context menu was invoked on.",
"required": true,
"properties": [
{
"name": "inError",
"type": "Boolean",
"collection": false,
"description": "Whether the media element has crashed.",
"required": true
},
{
"name": "isPaused",
"type": "Boolean",
"collection": false,
"description": "Whether the media element is paused.",
"required": true
},
{
"name": "isMuted",
"type": "Boolean",
"collection": false,
"description": "Whether the media element is muted.",
"required": true
},
{
"name": "hasAudio",
"type": "Boolean",
"collection": false,
"description": "Whether the media element has audio.",
"required": true
},
{
"name": "isLooping",
"type": "Boolean",
"collection": false,
"description": "Whether the media element is looping.",
"required": true
},
{
"name": "isControlsVisible",
"type": "Boolean",
"collection": false,
"description": "Whether the media element's controls are visible.",
"required": true
},
{
"name": "canToggleControls",
"type": "Boolean",
"collection": false,
"description": "Whether the media element's controls are toggleable.",
"required": true
},
{
"name": "canRotate",
"type": "Boolean",
"collection": false,
"description": "Whether the media element can be rotated.",
"required": true
}
]
},
{
"name": "editFlags",
"type": "Object",
"collection": false,
"description": "These flags indicate whether the renderer believes it is able to perform the corresponding action.",
"required": true,
"properties": [
{
"name": "canUndo",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can undo.",
"required": true
},
{
"name": "canRedo",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can redo.",
"required": true
},
{
"name": "canCut",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can cut.",
"required": true
},
{
"name": "canCopy",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can copy",
"required": true
},
{
"name": "canPaste",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can paste.",
"required": true
},
{
"name": "canDelete",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can delete.",
"required": true
},
{
"name": "canSelectAll",
"type": "Boolean",
"collection": false,
"description": "Whether the renderer believes it can select all.",
"required": true
}
]
}
]
}
]
},
{
"name": "select-bluetooth-device",
"description": "Emitted when bluetooth device needs to be selected on call to navigator.bluetooth.requestDevice. To use navigator.bluetooth api webBluetooth should be enabled. If event.preventDefault is not called, first available device will be selected. callback should be called with deviceId to be selected, passing empty string to callback will cancel the request.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "devices",
"type": "BluetoothDevice",
"collection": true,
"required": true
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "deviceId",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "paint",
"description": "Emitted when a new frame is generated. Only the dirty area is passed in the buffer.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "dirtyRect",
"type": "Rectangle",
"collection": false,
"required": true
},
{
"name": "image",
"type": "NativeImage",
"collection": false,
"description": "The image data of the whole frame.",
"required": true
}
]
},
{
"name": "devtools-reload-page",
"description": "Emitted when the devtools window instructs the webContents to reload"
},
{
"name": "will-attach-webview",
"description": "Emitted when a 's web contents is being attached to this web contents. Calling event.preventDefault() will destroy the guest page. This event can be used to configure webPreferences for the webContents of a before it's loaded, and provides the ability to set settings that can't be set via attributes. Note: The specified preload script option will be appear as preloadURL (not preload) in the webPreferences object emitted with this event.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webPreferences",
"type": "Object",
"collection": false,
"description": "The web preferences that will be used by the guest page. This object can be modified to adjust the preferences for the guest page.",
"required": true
},
{
"name": "params",
"type": "Object",
"collection": false,
"description": "The other `",
"required": true
}
]
},
{
"name": "did-attach-webview",
"description": "Emitted when a has been attached to this web contents.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "webContents",
"type": "WebContents",
"collection": false,
"description": "The guest web contents that is used by the `",
"required": true
}
]
},
{
"name": "console-message",
"description": "Emitted when the associated window logs a console message. Will not be emitted for windows with offscreen rendering enabled.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "level",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "message",
"type": "String",
"collection": false,
"required": true
},
{
"name": "line",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "sourceId",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "remote-require",
"description": "Emitted when remote.require() is called in the renderer process. Calling event.preventDefault() will prevent the module from being returned. Custom value can be returned by setting event.returnValue.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "moduleName",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "remote-get-global",
"description": "Emitted when remote.getGlobal() is called in the renderer process. Calling event.preventDefault() will prevent the global from being returned. Custom value can be returned by setting event.returnValue.",
"returns": [
{
"name": "event",
"type": "Event",
"collection": false,
"required": true
},
{
"name": "globalName",
"type": "String",
"collection": false,
"required": true
}
]
}
]
},
{
"name": "webFrame",
"description": "Customize the rendering of the current web page.",
"process": {
"main": false,
"renderer": true
},
"version": "4.0.3",
"type": "Module",
"slug": "web-frame",
"websiteUrl": "http://electronjs.org/docs/api/web-frame",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/web-frame.md",
"methods": [
{
"name": "setZoomFactor",
"signature": "(factor)",
"description": "Changes the zoom factor to the specified factor. Zoom factor is zoom percent divided by 100, so 300% = 3.0.",
"parameters": [
{
"name": "factor",
"type": "Number",
"collection": false,
"description": "Zoom factor.",
"required": true
}
]
},
{
"name": "getZoomFactor",
"signature": "()",
"returns": {
"type": "Number",
"collection": false,
"description": "The current zoom factor."
}
},
{
"name": "setZoomLevel",
"signature": "(level)",
"description": "Changes the zoom level to the specified level. The original size is 0 and each increment above or below represents zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively.",
"parameters": [
{
"name": "level",
"type": "Number",
"collection": false,
"description": "Zoom level.",
"required": true
}
]
},
{
"name": "getZoomLevel",
"signature": "()",
"returns": {
"type": "Number",
"collection": false,
"description": "The current zoom level."
}
},
{
"name": "setVisualZoomLevelLimits",
"signature": "(minimumLevel, maximumLevel)",
"description": "Sets the maximum and minimum pinch-to-zoom level.",
"parameters": [
{
"name": "minimumLevel",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "maximumLevel",
"type": "Number",
"collection": false,
"required": true
}
]
},
{
"name": "setLayoutZoomLevelLimits",
"signature": "(minimumLevel, maximumLevel)",
"description": "Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.",
"parameters": [
{
"name": "minimumLevel",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "maximumLevel",
"type": "Number",
"collection": false,
"required": true
}
]
},
{
"name": "setSpellCheckProvider",
"signature": "(language, autoCorrectWord, provider)",
"description": "Sets a provider for spell checking in input fields and text areas. The provider must be an object that has a spellCheck method that returns whether the word passed is correctly spelled. An example of using node-spellchecker as provider:",
"parameters": [
{
"name": "language",
"type": "String",
"collection": false,
"required": true
},
{
"name": "autoCorrectWord",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "provider",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "spellCheck",
"type": "Function",
"collection": false,
"description": "Returns Boolean.",
"required": true,
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
}
]
},
{
"name": "registerURLSchemeAsBypassingCSP",
"signature": "(scheme)",
"description": "Resources will be loaded from this scheme regardless of the current page's Content Security Policy.",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "registerURLSchemeAsPrivileged",
"signature": "(scheme[, options])",
"description": "Registers the scheme as secure, bypasses content security policy for resources, allows registering ServiceWorker and supports fetch API. Specify an option with the value of false to omit it from the registration. An example of registering a privileged scheme, without bypassing Content Security Policy:",
"parameters": [
{
"name": "scheme",
"type": "String",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "secure",
"type": "Boolean",
"collection": false,
"description": "Default true.",
"required": false
},
{
"name": "bypassCSP",
"type": "Boolean",
"collection": false,
"description": "Default true.",
"required": false
},
{
"name": "allowServiceWorkers",
"type": "Boolean",
"collection": false,
"description": "Default true.",
"required": false
},
{
"name": "supportFetchAPI",
"type": "Boolean",
"collection": false,
"description": "Default true.",
"required": false
},
{
"name": "corsEnabled",
"type": "Boolean",
"collection": false,
"description": "Default true.",
"required": false
}
]
}
]
},
{
"name": "insertText",
"signature": "(text)",
"description": "Inserts text to the focused element.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "executeJavaScript",
"signature": "(code[, userGesture, callback])",
"description": "Evaluates code in page. In the browser window some HTML APIs like requestFullScreen can only be invoked by a gesture from the user. Setting userGesture to true will remove this limitation.",
"parameters": [
{
"name": "code",
"type": "String",
"collection": false,
"required": true
},
{
"name": "userGesture",
"type": "Boolean",
"collection": false,
"description": "Default is `false`.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called after script has been executed.",
"required": false,
"parameters": [
{
"name": "result",
"type": "Any",
"collection": false,
"description": "",
"required": true
}
]
}
],
"returns": {
"type": "Promise",
"collection": false,
"innerType": "any",
"description": "A promise that resolves with the result of the executed code or is rejected if the result of the code is a rejected promise."
}
},
{
"name": "executeJavaScriptInIsolatedWorld",
"signature": "(worldId, scripts[, userGesture, callback])",
"description": "Work like executeJavaScript but evaluates scripts in an isolated context.",
"parameters": [
{
"name": "worldId",
"type": "Integer",
"collection": false,
"description": "The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. You can provide any integer here.",
"required": true
},
{
"name": "scripts",
"type": "WebSource",
"collection": true,
"required": true
},
{
"name": "userGesture",
"type": "Boolean",
"collection": false,
"description": "Default is `false`.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called after script has been executed.",
"required": false,
"parameters": [
{
"name": "result",
"type": "Any",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "setIsolatedWorldContentSecurityPolicy",
"signature": "(worldId, csp)",
"description": "Set the content security policy of the isolated world.",
"parameters": [
{
"name": "worldId",
"type": "Integer",
"collection": false,
"description": "The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. You can provide any integer here.",
"required": true
},
{
"name": "csp",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "setIsolatedWorldHumanReadableName",
"signature": "(worldId, name)",
"description": "Set the name of the isolated world. Useful in devtools.",
"parameters": [
{
"name": "worldId",
"type": "Integer",
"collection": false,
"description": "The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. You can provide any integer here.",
"required": true
},
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "setIsolatedWorldSecurityOrigin",
"signature": "(worldId, securityOrigin)",
"description": "Set the security origin of the isolated world.",
"parameters": [
{
"name": "worldId",
"type": "Integer",
"collection": false,
"description": "The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. You can provide any integer here.",
"required": true
},
{
"name": "securityOrigin",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getResourceUsage",
"signature": "()",
"description": "Returns an object describing usage information of Blink's internal memory caches. This will generate:",
"returns": {
"type": "Object",
"collection": false,
"properties": [
{
"name": "images",
"type": "MemoryUsageDetails",
"collection": false,
"description": "",
"required": true
},
{
"name": "scripts",
"type": "MemoryUsageDetails",
"collection": false,
"description": "",
"required": true
},
{
"name": "cssStyleSheets",
"type": "MemoryUsageDetails",
"collection": false,
"description": "",
"required": true
},
{
"name": "xslStyleSheets",
"type": "MemoryUsageDetails",
"collection": false,
"description": "",
"required": true
},
{
"name": "fonts",
"type": "MemoryUsageDetails",
"collection": false,
"description": "",
"required": true
},
{
"name": "other",
"type": "MemoryUsageDetails",
"collection": false,
"description": "",
"required": true
}
]
}
},
{
"name": "clearCache",
"signature": "()",
"description": "Attempts to free memory that is no longer being used (like images from a previous navigation). Note that blindly calling this method probably makes Electron slower since it will have to refill these emptied caches, you should only call it if an event in your app has occurred that makes you think your page is actually using less memory (i.e. you have navigated from a super heavy page to a mostly empty one, and intend to stay there)."
},
{
"name": "getFrameForSelector",
"signature": "(selector)",
"parameters": [
{
"name": "selector",
"type": "String",
"collection": false,
"description": "CSS selector for a frame element.",
"required": true
}
],
"returns": {
"type": "WebFrame",
"collection": false,
"description": "The frame element in webFrame's document selected by selector, null would be returned if selector does not select a frame or if the frame is not in the current renderer process."
}
},
{
"name": "findFrameByName",
"signature": "(name)",
"parameters": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
}
],
"returns": {
"type": "WebFrame",
"collection": false,
"description": "A child of webFrame with the supplied name, null would be returned if there's no such frame or if the frame is not in the current renderer process."
}
},
{
"name": "findFrameByRoutingId",
"signature": "(routingId)",
"parameters": [
{
"name": "routingId",
"type": "Integer",
"collection": false,
"description": "An `Integer` representing the unique frame id in the current renderer process. Routing IDs can be retrieved from `WebFrame` instances (`webFrame.routingId`) and are also passed by frame specific `WebContents` navigation events (e.g. `did-frame-navigate`)",
"required": true
}
],
"returns": {
"type": "WebFrame",
"collection": false,
"description": "that has the supplied routingId, null if not found."
}
}
],
"properties": [
{
"name": "top",
"description": "A WebFrame representing top frame in frame hierarchy to which webFrame belongs, the property would be null if top frame is not in the current renderer process.",
"type": "WebFrame",
"collection": false
},
{
"name": "opener",
"description": "A WebFrame representing the frame which opened webFrame, the property would be null if there's no opener or opener is not in the current renderer process.",
"type": "WebFrame",
"collection": false
},
{
"name": "parent",
"description": "A WebFrame representing parent frame of webFrame, the property would be null if webFrame is top or parent is not in the current renderer process.",
"type": "WebFrame",
"collection": false
},
{
"name": "firstChild",
"description": "A WebFrame representing the first child frame of webFrame, the property would be null if webFrame has no children or if first child is not in the current renderer process.",
"type": "WebFrame",
"collection": false
},
{
"name": "nextSibling",
"description": "A WebFrame representing next sibling frame, the property would be null if webFrame is the last frame in its parent or if the next sibling is not in the current renderer process.",
"type": "WebFrame",
"collection": false
},
{
"name": "routingId",
"description": "An Integer representing the unique frame id in the current renderer process. Distinct WebFrame instances that refer to the same underlying frame will have the same routingId.",
"type": "Integer",
"collection": false
}
]
},
{
"name": "WebRequest",
"description": "Intercept and modify the contents of a request at various stages of its lifetime.",
"process": {
"main": true,
"renderer": false
},
"version": "4.0.3",
"type": "Class",
"slug": "web-request",
"websiteUrl": "http://electronjs.org/docs/api/web-request",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/web-request.md",
"instanceName": "webRequest",
"instanceMethods": [
{
"name": "onBeforeRequest",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details, callback) when a request is about to occur. The uploadData is an array of UploadData objects. The callback has to be called with an response object.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "uploadData",
"type": "UploadData",
"collection": true,
"description": "",
"required": true
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "response",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "cancel",
"type": "Boolean",
"collection": false,
"description": "",
"required": false
},
{
"name": "redirectURL",
"type": "String",
"collection": false,
"description": "The original request is prevented from being sent or completed and is instead redirected to the given URL.",
"required": false
}
]
}
]
}
]
}
]
},
{
"name": "onBeforeSendHeaders",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details, callback) before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any http data is sent. The callback has to be called with an response object.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "requestHeaders",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "response",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "cancel",
"type": "Boolean",
"collection": false,
"description": "",
"required": false
},
{
"name": "requestHeaders",
"type": "Object",
"collection": false,
"description": "When provided, request will be made with these headers.",
"required": false,
"properties": []
}
]
}
]
}
]
}
]
},
{
"name": "onSendHeaders",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details) just before a request is going to be sent to the server, modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "requestHeaders",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
}
]
}
]
},
{
"name": "onHeadersReceived",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details, callback) when HTTP response headers of a request have been received. The callback has to be called with an response object.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "statusLine",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "statusCode",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "responseHeaders",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "",
"required": true,
"parameters": [
{
"name": "response",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "cancel",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "responseHeaders",
"type": "Object",
"collection": false,
"description": "When provided, the server is assumed to have responded with these headers.",
"required": false,
"properties": []
},
{
"name": "statusLine",
"type": "String",
"collection": false,
"description": "Should be provided when overriding responseHeaders to change header status otherwise original response header's status will be used.",
"required": false
}
]
}
]
}
]
}
]
},
{
"name": "onResponseStarted",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details) when first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "responseHeaders",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
},
{
"name": "fromCache",
"type": "Boolean",
"collection": false,
"description": "Indicates whether the response was fetched from disk cache.",
"required": true
},
{
"name": "statusCode",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "statusLine",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
}
]
},
{
"name": "onBeforeRedirect",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details) when a server initiated redirect is about to occur.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "redirectURL",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "statusCode",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "ip",
"type": "String",
"collection": false,
"description": "The server IP address that the request was actually sent to.",
"required": false
},
{
"name": "fromCache",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "responseHeaders",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
}
]
}
]
}
]
},
{
"name": "onCompleted",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details) when a request is completed.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "responseHeaders",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": []
},
{
"name": "fromCache",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "statusCode",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "statusLine",
"type": "String",
"collection": false,
"description": "",
"required": true
}
]
}
]
}
]
},
{
"name": "onErrorOccurred",
"signature": "([filter, ]listener)",
"description": "The listener will be called with listener(details) when an error occurs.",
"parameters": [
{
"name": "filter",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "urls",
"type": "String",
"collection": true,
"description": "Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.",
"required": true
}
]
},
{
"name": "listener",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "details",
"type": "Object",
"collection": false,
"description": "",
"required": true,
"properties": [
{
"name": "id",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "method",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "webContentsId",
"type": "Integer",
"collection": false,
"description": "",
"required": false
},
{
"name": "resourceType",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "timestamp",
"type": "Double",
"collection": false,
"description": "",
"required": true
},
{
"name": "fromCache",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
},
{
"name": "error",
"type": "String",
"collection": false,
"description": "The error description.",
"required": true
}
]
}
]
}
]
}
]
},
{
"name": "WebSource",
"version": "4.0.3",
"type": "Structure",
"slug": "web-source",
"websiteUrl": "http://electronjs.org/docs/api/structures/web-source",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/structures/web-source.md",
"properties": [
{
"name": "code",
"type": "String",
"collection": false,
"description": "",
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"description": "",
"required": false
},
{
"name": "startLine",
"type": "Integer",
"collection": false,
"description": "Default is 1.",
"required": false
}
]
},
{
"name": "webviewTag",
"description": "Display external web content in an isolated frame and process.",
"process": {
"main": false,
"renderer": true
},
"version": "4.0.3",
"type": "Element",
"slug": "webview-tag",
"websiteUrl": "http://electronjs.org/docs/api/webview-tag",
"repoUrl": "https://github.com/electron/electron/blob/v4.0.3/docs/api/webview-tag.md",
"methods": [
{
"name": "loadURL",
"signature": "(url[, options])",
"description": "Loads the url in the webview, the url must contain the protocol prefix, e.g. the http:// or file://.",
"parameters": [
{
"name": "url",
"type": "URL",
"collection": false,
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "httpReferrer",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Referrer",
"collection": false
}
],
"collection": false,
"description": "An HTTP Referrer url.",
"required": false
},
{
"name": "userAgent",
"type": "String",
"collection": false,
"description": "A user agent originating the request.",
"required": false
},
{
"name": "extraHeaders",
"type": "String",
"collection": false,
"description": "Extra headers separated by \"\\n\"",
"required": false
},
{
"name": "postData",
"type": [
{
"typeName": "UploadRawData",
"collection": true
},
{
"typeName": "UploadFile",
"collection": true
},
{
"typeName": "UploadBlob",
"collection": true
}
],
"collection": false,
"description": "",
"required": false
},
{
"name": "baseURLForDataURL",
"type": "String",
"collection": false,
"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
}
]
}
]
},
{
"name": "downloadURL",
"signature": "(url)",
"description": "Initiates a download of the resource at url without navigating.",
"parameters": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getURL",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The URL of guest page."
}
},
{
"name": "getTitle",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The title of guest page."
}
},
{
"name": "isLoading",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether guest page is still loading resources."
}
},
{
"name": "isLoadingMainFrame",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the main frame (and not just iframes or frames within it) is still loading."
}
},
{
"name": "isWaitingForResponse",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the guest page is waiting for a first-response for the main resource of the page."
}
},
{
"name": "stop",
"signature": "()",
"description": "Stops any pending navigation."
},
{
"name": "reload",
"signature": "()",
"description": "Reloads the guest page."
},
{
"name": "reloadIgnoringCache",
"signature": "()",
"description": "Reloads the guest page and ignores cache."
},
{
"name": "canGoBack",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the guest page can go back."
}
},
{
"name": "canGoForward",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the guest page can go forward."
}
},
{
"name": "canGoToOffset",
"signature": "(offset)",
"parameters": [
{
"name": "offset",
"type": "Integer",
"collection": false,
"required": true
}
],
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the guest page can go to offset."
}
},
{
"name": "clearHistory",
"signature": "()",
"description": "Clears the navigation history."
},
{
"name": "goBack",
"signature": "()",
"description": "Makes the guest page go back."
},
{
"name": "goForward",
"signature": "()",
"description": "Makes the guest page go forward."
},
{
"name": "goToIndex",
"signature": "(index)",
"description": "Navigates to the specified absolute index.",
"parameters": [
{
"name": "index",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "goToOffset",
"signature": "(offset)",
"description": "Navigates to the specified offset from the \"current entry\".",
"parameters": [
{
"name": "offset",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "isCrashed",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether the renderer process has crashed."
}
},
{
"name": "setUserAgent",
"signature": "(userAgent)",
"description": "Overrides the user agent for the guest page.",
"parameters": [
{
"name": "userAgent",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "getUserAgent",
"signature": "()",
"returns": {
"type": "String",
"collection": false,
"description": "The user agent for guest page."
}
},
{
"name": "insertCSS",
"signature": "(css)",
"description": "Injects CSS into the guest page.",
"parameters": [
{
"name": "css",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "executeJavaScript",
"signature": "(code[, userGesture, callback])",
"description": "Evaluates code in page. If userGesture is set, it will create the user gesture context in the page. HTML APIs like requestFullScreen, which require user action, can take advantage of this option for automation.",
"parameters": [
{
"name": "code",
"type": "String",
"collection": false,
"required": true
},
{
"name": "userGesture",
"type": "Boolean",
"collection": false,
"description": "Default `false`.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"description": "Called after script has been executed.",
"required": false,
"parameters": [
{
"name": "result",
"type": "Any",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "openDevTools",
"signature": "()",
"description": "Opens a DevTools window for guest page."
},
{
"name": "closeDevTools",
"signature": "()",
"description": "Closes the DevTools window of guest page."
},
{
"name": "isDevToolsOpened",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether guest page has a DevTools window attached."
}
},
{
"name": "isDevToolsFocused",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether DevTools window of guest page is focused."
}
},
{
"name": "inspectElement",
"signature": "(x, y)",
"description": "Starts inspecting element at position (x, y) of guest page.",
"parameters": [
{
"name": "x",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "y",
"type": "Integer",
"collection": false,
"required": true
}
]
},
{
"name": "inspectServiceWorker",
"signature": "()",
"description": "Opens the DevTools for the service worker context present in the guest page."
},
{
"name": "setAudioMuted",
"signature": "(muted)",
"description": "Set guest page muted.",
"parameters": [
{
"name": "muted",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "isAudioMuted",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether guest page has been muted."
}
},
{
"name": "isCurrentlyAudible",
"signature": "()",
"returns": {
"type": "Boolean",
"collection": false,
"description": "Whether audio is currently playing."
}
},
{
"name": "undo",
"signature": "()",
"description": "Executes editing command undo in page."
},
{
"name": "redo",
"signature": "()",
"description": "Executes editing command redo in page."
},
{
"name": "cut",
"signature": "()",
"description": "Executes editing command cut in page."
},
{
"name": "copy",
"signature": "()",
"description": "Executes editing command copy in page."
},
{
"name": "paste",
"signature": "()",
"description": "Executes editing command paste in page."
},
{
"name": "pasteAndMatchStyle",
"signature": "()",
"description": "Executes editing command pasteAndMatchStyle in page."
},
{
"name": "delete",
"signature": "()",
"description": "Executes editing command delete in page."
},
{
"name": "selectAll",
"signature": "()",
"description": "Executes editing command selectAll in page."
},
{
"name": "unselect",
"signature": "()",
"description": "Executes editing command unselect in page."
},
{
"name": "replace",
"signature": "(text)",
"description": "Executes editing command replace in page.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "replaceMisspelling",
"signature": "(text)",
"description": "Executes editing command replaceMisspelling in page.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "insertText",
"signature": "(text)",
"description": "Inserts text to the focused element.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "findInPage",
"signature": "(text[, options])",
"description": "Starts a request to find all matches for the text in the web page. The result of the request can be obtained by subscribing to found-in-page event.",
"parameters": [
{
"name": "text",
"type": "String",
"collection": false,
"description": "Content to be searched, must not be empty.",
"required": true
},
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "forward",
"type": "Boolean",
"collection": false,
"description": "Whether to search forward or backward, defaults to true.",
"required": false
},
{
"name": "findNext",
"type": "Boolean",
"collection": false,
"description": "Whether the operation is first request or a follow up, defaults to false.",
"required": false
},
{
"name": "matchCase",
"type": "Boolean",
"collection": false,
"description": "Whether search should be case-sensitive, defaults to false.",
"required": false
},
{
"name": "wordStart",
"type": "Boolean",
"collection": false,
"description": "Whether to look only at the start of words. defaults to false.",
"required": false
},
{
"name": "medialCapitalAsWordStart",
"type": "Boolean",
"collection": false,
"description": "When combined with wordStart, accepts a match in the middle of a word if the match begins with an uppercase letter followed by a lowercase or non-letter. Accepts several other intra-word matches, defaults to false.",
"required": false
}
]
}
],
"returns": {
"type": "Integer",
"collection": false,
"description": "The request id used for the request."
}
},
{
"name": "stopFindInPage",
"signature": "(action)",
"description": "Stops any findInPage request for the webview with the provided action.",
"parameters": [
{
"name": "action",
"type": "String",
"collection": false,
"description": "Specifies the action to take place when ending request.",
"required": true,
"possibleValues": [
{
"value": "clearSelection",
"description": "Clear the selection."
},
{
"value": "keepSelection",
"description": "Translate the selection into a normal selection."
},
{
"value": "activateSelection",
"description": "Focus and click the selection node."
}
]
}
]
},
{
"name": "print",
"signature": "([options])",
"description": "Prints webview's web page. Same as webContents.print([options]).",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": false,
"properties": [
{
"name": "silent",
"type": "Boolean",
"collection": false,
"description": "Don't ask user for print settings. Default is false.",
"required": false
},
{
"name": "printBackground",
"type": "Boolean",
"collection": false,
"description": "Also prints the background color and image of the web page. Default is false.",
"required": false
},
{
"name": "deviceName",
"type": "String",
"collection": false,
"description": "Set the printer device name to use. Default is ''.",
"required": false
}
]
}
]
},
{
"name": "printToPDF",
"signature": "(options, callback)",
"description": "Prints webview's web page as PDF, Same as webContents.printToPDF(options, callback).",
"parameters": [
{
"name": "options",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "marginsType",
"type": "Integer",
"collection": false,
"description": "Specifies the type of margins to use. Uses 0 for default margin, 1 for no margin, and 2 for minimum margin.",
"required": false
},
{
"name": "pageSize",
"type": [
{
"typeName": "String",
"collection": false
},
{
"typeName": "Size",
"collection": false
}
],
"collection": false,
"description": "Specify page size of the generated PDF. Can be A3, A4, A5, Legal, Letter, Tabloid or an Object containing height and width in microns.",
"required": false
},
{
"name": "printBackground",
"type": "Boolean",
"collection": false,
"description": "Whether to print CSS backgrounds.",
"required": false
},
{
"name": "printSelectionOnly",
"type": "Boolean",
"collection": false,
"description": "Whether to print selection only.",
"required": false
},
{
"name": "landscape",
"type": "Boolean",
"collection": false,
"description": "true for landscape, false for portrait.",
"required": false
}
]
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "error",
"type": "Error",
"collection": false,
"description": "",
"required": true
},
{
"name": "data",
"type": "Buffer",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "capturePage",
"signature": "([rect, ]callback)",
"description": "Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback).",
"parameters": [
{
"name": "rect",
"type": "Rectangle",
"collection": false,
"description": "The area of the page to be captured.",
"required": false
},
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "image",
"type": "NativeImage",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "send",
"signature": "(channel[, arg1][, arg2][, ...])",
"description": "Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. The renderer process can handle the message by listening to the channel event with the ipcRenderer module. See webContents.send for examples.",
"parameters": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "...args",
"type": "any",
"collection": true,
"required": true
}
]
},
{
"name": "sendInputEvent",
"signature": "(event)",
"description": "Sends an input event to the page. See webContents.sendInputEvent for detailed description of event object.",
"parameters": [
{
"name": "event",
"type": "Object",
"collection": false,
"required": true
}
]
},
{
"name": "setZoomFactor",
"signature": "(factor)",
"description": "Changes the zoom factor to the specified factor. Zoom factor is zoom percent divided by 100, so 300% = 3.0.",
"parameters": [
{
"name": "factor",
"type": "Number",
"collection": false,
"description": "Zoom factor.",
"required": true
}
]
},
{
"name": "setZoomLevel",
"signature": "(level)",
"description": "Changes the zoom level to the specified level. The original size is 0 and each increment above or below represents zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. The formula for this is scale := 1.2 ^ level.",
"parameters": [
{
"name": "level",
"type": "Number",
"collection": false,
"description": "Zoom level.",
"required": true
}
]
},
{
"name": "getZoomFactor",
"signature": "(callback)",
"description": "Sends a request to get current zoom factor, the callback will be called with callback(zoomFactor).",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "zoomFactor",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "getZoomLevel",
"signature": "(callback)",
"description": "Sends a request to get current zoom level, the callback will be called with callback(zoomLevel).",
"parameters": [
{
"name": "callback",
"type": "Function",
"collection": false,
"required": true,
"parameters": [
{
"name": "zoomLevel",
"type": "Number",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "setVisualZoomLevelLimits",
"signature": "(minimumLevel, maximumLevel)",
"description": "Sets the maximum and minimum pinch-to-zoom level.",
"parameters": [
{
"name": "minimumLevel",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "maximumLevel",
"type": "Number",
"collection": false,
"required": true
}
]
},
{
"name": "setLayoutZoomLevelLimits",
"signature": "(minimumLevel, maximumLevel)",
"description": "Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.",
"parameters": [
{
"name": "minimumLevel",
"type": "Number",
"collection": false,
"required": true
},
{
"name": "maximumLevel",
"type": "Number",
"collection": false,
"required": true
}
]
},
{
"name": "showDefinitionForSelection",
"signature": "()",
"platforms": [
"macOS"
],
"description": "Shows pop-up dictionary that searches the selected word on the page."
},
{
"name": "getWebContents",
"signature": "()",
"description": "It depends on the remote module, it is therefore not available when this module is disabled.",
"returns": {
"type": "WebContents",
"collection": false,
"description": "The web contents associated with this webview."
}
}
],
"attributes": [
{
"name": "src",
"description": "Returns the visible URL. Writing to this attribute initiates top-level navigation. Assigning src its own value will reload the current page. The src attribute can also accept data URLs, such as data:text/plain,Hello, world!."
},
{
"name": "autosize",
"description": "When this attribute is present the webview container will automatically resize within the bounds specified by the attributes minwidth, minheight, maxwidth, and maxheight. These constraints do not impact the webview unless autosize is enabled. When autosize is enabled, the webview container size cannot be less than the minimum values or greater than the maximum."
},
{
"name": "nodeintegration",
"description": "When this attribute is present the guest page in webview will have node integration and can use node APIs like require and process to access low level system resources. Node integration is disabled by default in the guest page."
},
{
"name": "enableremotemodule",
"description": "When this attribute is false the guest page in webview will not have access to the remote module. The remote module is avaiable by default."
},
{
"name": "plugins",
"description": "When this attribute is present the guest page in webview will be able to use browser plugins. Plugins are disabled by default."
},
{
"name": "preload",
"description": "Specifies a script that will be loaded before other scripts run in the guest page. The protocol of script's URL must be either file: or asar:, because it will be loaded by require in guest page under the hood. When the guest page doesn't have node integration this script will still have access to all Node APIs, but global objects injected by Node will be deleted after this script has finished executing. Note: This option will be appear as preloadURL (not preload) in the webPreferences specified to the will-attach-webview event."
},
{
"name": "httpreferrer",
"description": "Sets the referrer URL for the guest page."
},
{
"name": "useragent",
"description": "Sets the user agent for the guest page before the page is navigated to. Once the page is loaded, use the setUserAgent method to change the user agent."
},
{
"name": "disablewebsecurity",
"description": "When this attribute is present the guest page will have web security disabled. Web security is enabled by default."
},
{
"name": "partition",
"description": "Sets the session used by the page. 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. If the partition is unset then default session of the app will be used. This value can only be modified before the first navigation, since the session of an active renderer process cannot change. Subsequent attempts to modify the value will fail with a DOM exception."
},
{
"name": "allowpopups",
"description": "When this attribute is present the guest page will be allowed to open new windows. Popups are disabled by default."
},
{
"name": "webpreferences",
"description": "A list of strings which specifies the web preferences to be set on the webview, separated by ,. The full list of supported preference strings can be found in BrowserWindow. The string follows the same format as the features string in window.open. A name by itself is given a true boolean value. A preference can be set to another value by including an =, followed by the value. Special values yes and 1 are interpreted as true, while no and 0 are interpreted as false."
},
{
"name": "enableblinkfeatures",
"description": "A list of strings which specifies the blink features to be enabled separated by ,. The full list of supported feature strings can be found in the RuntimeEnabledFeatures.json5 file."
},
{
"name": "disableblinkfeatures",
"description": "A list of strings which specifies the blink features to be disabled separated by ,. The full list of supported feature strings can be found in the RuntimeEnabledFeatures.json5 file."
}
],
"domEvents": [
{
"name": "load-commit",
"description": "Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads.",
"returns": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "did-finish-load",
"description": "Fired when the navigation is done, i.e. the spinner of the tab will stop spinning, and the onload event is dispatched."
},
{
"name": "did-fail-load",
"description": "This event is like did-finish-load, but fired when the load failed or was cancelled, e.g. window.stop() is invoked.",
"returns": [
{
"name": "errorCode",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "errorDescription",
"type": "String",
"collection": false,
"required": true
},
{
"name": "validatedURL",
"type": "String",
"collection": false,
"required": true
},
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "did-frame-finish-load",
"description": "Fired when a frame has done navigation.",
"returns": [
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "did-start-loading",
"description": "Corresponds to the points in time when the spinner of the tab starts spinning."
},
{
"name": "did-stop-loading",
"description": "Corresponds to the points in time when the spinner of the tab stops spinning."
},
{
"name": "dom-ready",
"description": "Fired when document in the given frame is loaded."
},
{
"name": "page-title-updated",
"description": "Fired when page title is set during navigation. explicitSet is false when title is synthesized from file url.",
"returns": [
{
"name": "title",
"type": "String",
"collection": false,
"required": true
},
{
"name": "explicitSet",
"type": "Boolean",
"collection": false,
"required": true
}
]
},
{
"name": "page-favicon-updated",
"description": "Fired when page receives favicon urls.",
"returns": [
{
"name": "favicons",
"type": "String",
"collection": true,
"description": "Array of URLs.",
"required": true
}
]
},
{
"name": "enter-html-full-screen",
"description": "Fired when page enters fullscreen triggered by HTML API."
},
{
"name": "leave-html-full-screen",
"description": "Fired when page leaves fullscreen triggered by HTML API."
},
{
"name": "console-message",
"description": "Fired when the guest window logs a console message. The following example code forwards all log messages to the embedder's console without regard for log level or other properties.",
"returns": [
{
"name": "level",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "message",
"type": "String",
"collection": false,
"required": true
},
{
"name": "line",
"type": "Integer",
"collection": false,
"required": true
},
{
"name": "sourceId",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "found-in-page",
"description": "Fired when a result is available for webview.findInPage request.",
"returns": [
{
"name": "result",
"type": "Object",
"collection": false,
"required": true,
"properties": [
{
"name": "requestId",
"type": "Integer",
"collection": false,
"description": "",
"required": true
},
{
"name": "activeMatchOrdinal",
"type": "Integer",
"collection": false,
"description": "Position of the active match.",
"required": true
},
{
"name": "matches",
"type": "Integer",
"collection": false,
"description": "Number of Matches.",
"required": true
},
{
"name": "selectionArea",
"type": "Object",
"collection": false,
"description": "Coordinates of first match region.",
"required": true,
"properties": []
},
{
"name": "finalUpdate",
"type": "Boolean",
"collection": false,
"description": "",
"required": true
}
]
}
]
},
{
"name": "new-window",
"description": "Fired when the guest page attempts to open a new browser window. The following example code opens the new url in system's default browser.",
"returns": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
},
{
"name": "frameName",
"type": "String",
"collection": false,
"required": true
},
{
"name": "disposition",
"type": "String",
"collection": false,
"description": "Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`.",
"required": true,
"possibleValues": [
{
"value": "default"
},
{
"value": "foreground-tab"
},
{
"value": "background-tab"
},
{
"value": "new-window"
},
{
"value": "save-to-disk"
},
{
"value": "other"
}
]
},
{
"name": "options",
"type": "Object",
"collection": false,
"description": "The options which should be used for creating the new .",
"required": true
}
]
},
{
"name": "will-navigate",
"description": "Emitted when a user or the page wants to start navigation. It can happen when the window.location object is changed or a user clicks a link in the page. This event will not emit when the navigation is started programmatically with APIs like .loadURL and .back. It is also not emitted during in-page navigation, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose. Calling event.preventDefault() does NOT have any effect.",
"returns": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "did-navigate",
"description": "Emitted when a navigation is done. This event is not emitted for in-page navigations, such as clicking anchor links or updating the window.location.hash. Use did-navigate-in-page event for this purpose.",
"returns": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "did-navigate-in-page",
"description": "Emitted when an in-page navigation happened. When in-page navigation happens, the page URL changes but does not cause navigation outside of the page. Examples of this occurring are when anchor links are clicked or when the DOM hashchange event is triggered.",
"returns": [
{
"name": "isMainFrame",
"type": "Boolean",
"collection": false,
"required": true
},
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "close",
"description": "Fired when the guest page attempts to close itself. The following example code navigates the webview to about:blank when the guest attempts to close itself."
},
{
"name": "ipc-message",
"description": "Fired when the guest page has sent an asynchronous message to embedder page. With sendToHost method and ipc-message event you can communicate between guest page and embedder page:",
"returns": [
{
"name": "channel",
"type": "String",
"collection": false,
"required": true
},
{
"name": "args",
"type": "Array",
"collection": false,
"required": true
}
]
},
{
"name": "crashed",
"description": "Fired when the renderer process is crashed."
},
{
"name": "gpu-crashed",
"description": "Fired when the gpu process is crashed."
},
{
"name": "plugin-crashed",
"description": "Fired when a plugin process is crashed.",
"returns": [
{
"name": "name",
"type": "String",
"collection": false,
"required": true
},
{
"name": "version",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "destroyed",
"description": "Fired when the WebContents is destroyed."
},
{
"name": "media-started-playing",
"description": "Emitted when media starts playing."
},
{
"name": "media-paused",
"description": "Emitted when media is paused or done playing."
},
{
"name": "did-change-theme-color",
"description": "Emitted when a page's theme color changes. This is usually due to encountering a meta tag:",
"returns": [
{
"name": "themeColor",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "update-target-url",
"description": "Emitted when mouse moves over a link or the keyboard moves the focus to a link.",
"returns": [
{
"name": "url",
"type": "String",
"collection": false,
"required": true
}
]
},
{
"name": "devtools-opened",
"description": "Emitted when DevTools is opened."
},
{
"name": "devtools-closed",
"description": "Emitted when DevTools is closed."
},
{
"name": "devtools-focused",
"description": "Emitted when DevTools is focused / opened."
}
]
}
]