diff --git a/demo/package-lock.json b/demo/package-lock.json index 7710cfa1..39f35e06 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -9,7 +9,7 @@ "version": "0.3.0", "license": "MIT", "devDependencies": { - "electron": "v29.3.0" + "electron": "v30.0.1" } }, "node_modules/@electron/get": { @@ -245,9 +245,9 @@ "optional": true }, "node_modules/electron": { - "version": "29.3.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-29.3.0.tgz", - "integrity": "sha512-ZxFKm0/v48GSoBuO3DdnMlCYXefEUKUHLMsKxyXY4nZGgzbBKpF/X8haZa2paNj23CLfsCKBOtfc2vsEQiOOsA==", + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/electron/-/electron-30.0.1.tgz", + "integrity": "sha512-iwxkI/n2wBd29NH7TH0ZY8aWGzCoKpzJz+D10u7aGSJi1TV6d4MSM3rWyKvT/UkAHkTKOEgYfUyCa2vWQm8L0g==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -997,9 +997,9 @@ "optional": true }, "electron": { - "version": "29.3.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-29.3.0.tgz", - "integrity": "sha512-ZxFKm0/v48GSoBuO3DdnMlCYXefEUKUHLMsKxyXY4nZGgzbBKpF/X8haZa2paNj23CLfsCKBOtfc2vsEQiOOsA==", + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/electron/-/electron-30.0.1.tgz", + "integrity": "sha512-iwxkI/n2wBd29NH7TH0ZY8aWGzCoKpzJz+D10u7aGSJi1TV6d4MSM3rWyKvT/UkAHkTKOEgYfUyCa2vWQm8L0g==", "dev": true, "requires": { "@electron/get": "^2.0.0", diff --git a/demo/package.json b/demo/package.json index 2905f463..1466d2d0 100644 --- a/demo/package.json +++ b/demo/package.json @@ -13,6 +13,6 @@ "start": "electron ." }, "devDependencies": { - "electron": "v29.3.0" + "electron": "v30.0.1" } } diff --git a/electron-api.json b/electron-api.json index 38b95ca1..81e6bdf8 100644 --- a/electron-api.json +++ b/electron-api.json @@ -4,8 +4,8 @@ "description": "> Control your application's event lifecycle.\n\nProcess: Main\n\nThe following example shows how to quit the application when the last window is closed:", "slug": "app", "websiteUrl": "https://electronjs.org/docs/api/app", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/app.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/app.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -2065,7 +2065,7 @@ }, { "name": "ready", - "description": "Emitted once, when Electron has finished initializing. On macOS, `launchInfo` holds the `userInfo` of the `NSUserNotification` or information from `UNNotificationResponse` that was used to open the application, if it was launched from Notification Center. You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()` to get a Promise that is fulfilled when Electron is initialized.", + "description": "Emitted once, when Electron has finished initializing. On macOS, `launchInfo` holds the `userInfo` of the `NSUserNotification` or information from `UNNotificationResponse` that was used to open the application, if it was launched from Notification Center. You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()` to get a Promise that is fulfilled when Electron is initialized.\n\n**Note**: The `ready` event is only fired after the main process has finished running the first tick of the event loop. If an Electron API needs to be called before the `ready` event, ensure that it is called synchronously in the top-level context of the main process.", "parameters": [ { "name": "event", @@ -3105,8 +3105,8 @@ "description": "> Enable apps to automatically update themselves.\n\nProcess: Main\n\n**See also: A detailed guide about how to implement updates in your application.**\n\n`autoUpdater` is an EventEmitter.\n\n### Platform Notices\n\nCurrently, only macOS and Windows are supported. There is no built-in support for auto-updater on Linux, so it is recommended to use the distribution's package manager to update your app.\n\nIn addition, there are some subtle differences on each platform:\n\n### macOS\n\nOn macOS, the `autoUpdater` module is built upon Squirrel.Mac, meaning you don't need any special setup to make it work. For server-side requirements, you can read Server Support. Note that App Transport Security (ATS) applies to all requests made as part of the update process. Apps that need to disable ATS can add the `NSAllowsArbitraryLoads` key to their app's plist.\n\n**Note:** Your application must be signed for automatic updates on macOS. This is a requirement of `Squirrel.Mac`.\n\n### Windows\n\nOn Windows, you have to install your app into a user's machine before you can use the `autoUpdater`, so it is recommended that you use the electron-winstaller, Electron Forge or the grunt-electron-installer package to generate a Windows installer.\n\nWhen using electron-winstaller or Electron Forge make sure you do not try to update your app the first time it runs (Also see this issue for more info). It's also recommended to use electron-squirrel-startup to get desktop shortcuts for your app.\n\nThe installer generated with Squirrel will create a shortcut icon with an Application User Model ID in the format of `com.squirrel.PACKAGE_ID.YOUR_EXE_WITHOUT_DOT_EXE`, examples are `com.squirrel.slack.Slack` and `com.squirrel.code.Code`. You have to use the same ID for your app with `app.setAppUserModelId` API, otherwise Windows will not be able to pin your app properly in task bar.\n\nLike Squirrel.Mac, Windows can host updates on S3 or any other static file host. You can read the documents of Squirrel.Windows to get more details about how Squirrel.Windows works.", "slug": "auto-updater", "websiteUrl": "https://electronjs.org/docs/api/auto-updater", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/auto-updater.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/auto-updater.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -3318,174 +3318,12 @@ "exportedClasses": [] }, { - "name": "BrowserView", - "description": "A `BrowserView` can be used to embed additional web content into a `BrowserWindow`. It is like a child window, except that it is positioned relative to its owning window. It is meant to be an alternative to the `webview` tag.\n\n### Class: BrowserView\n\n> Create and control views.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Example\n\n```\n// In the main process.\nconst { app, BrowserView, BrowserWindow } = require('electron')\n\napp.whenReady().then(() => {\n const win = new BrowserWindow({ width: 800, height: 600 })\n\n const view = new BrowserView()\n win.setBrowserView(view)\n view.setBounds({ x: 0, y: 0, width: 300, height: 300 })\n view.webContents.loadURL('https://electronjs.org')\n})\n```", - "slug": "browser-view", - "websiteUrl": "https://electronjs.org/docs/api/browser-view", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/browser-view.md", - "version": "29.3.0", - "type": "Class", - "process": { - "main": true, - "renderer": false, - "utility": false, - "exported": true - }, - "constructorMethod": { - "signature": "([options])", - "parameters": [ - { - "name": "options", - "description": "", - "required": false, - "collection": false, - "type": "Object", - "properties": [ - { - "name": "webPreferences", - "description": "Settings of web page's features.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "WebPreferences" - } - ] - } - ] - }, - "staticMethods": [], - "staticProperties": [], - "instanceMethods": [ - { - "name": "setAutoResize", - "signature": "(options)", - "description": "", - "parameters": [ - { - "name": "options", - "description": "", - "required": true, - "collection": false, - "type": "Object", - "properties": [ - { - "name": "width", - "description": "If `true`, the view's width will grow and shrink together with the window. `false` by default.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "boolean" - }, - { - "name": "height", - "description": "If `true`, the view's height will grow and shrink together with the window. `false` by default.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "boolean" - }, - { - "name": "horizontal", - "description": "If `true`, the view's x position and width will grow and shrink proportionally with the window. `false` by default.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "boolean" - }, - { - "name": "vertical", - "description": "If `true`, the view's y position and height will grow and shrink proportionally with the window. `false` by default.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "boolean" - } - ] - } - ], - "returns": null, - "additionalTags": [ - "stability_experimental" - ], - "urlFragment": "#viewsetautoresizeoptions-experimental" - }, - { - "name": "setBounds", - "signature": "(bounds)", - "description": "Resizes and moves the view to the supplied bounds relative to the window.", - "parameters": [ - { - "name": "bounds", - "description": "", - "required": true, - "collection": false, - "type": "Rectangle" - } - ], - "returns": null, - "additionalTags": [ - "stability_experimental" - ], - "urlFragment": "#viewsetboundsbounds-experimental" - }, - { - "name": "getBounds", - "signature": "()", - "description": "The `bounds` of this BrowserView instance as `Object`.", - "parameters": [], - "returns": { - "collection": false, - "type": "Rectangle" - }, - "additionalTags": [ - "stability_experimental" - ], - "urlFragment": "#viewgetbounds-experimental" - }, - { - "name": "setBackgroundColor", - "signature": "(color)", - "description": "Examples of valid `color` values:\n\n* Hex\n * #fff (RGB)\n * #ffff (ARGB)\n * #ffffff (RRGGBB)\n * #ffffffff (AARRGGBB)\n* RGB\n * rgb(([\\d]+),\\s*([\\d]+),\\s*([\\d]+))\n * e.g. rgb(255, 255, 255)\n* RGBA\n * rgba(([\\d]+),\\s*([\\d]+),\\s*([\\d]+),\\s*([\\d.]+))\n * e.g. rgba(255, 255, 255, 1.0)\n* HSL\n * hsl((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%)\n * e.g. hsl(200, 20%, 50%)\n* HSLA\n * hsla((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+))\n * e.g. hsla(200, 20%, 50%, 0.5)\n* Color name\n * Options are listed in SkParseColor.cpp\n * Similar to CSS Color Module Level 3 keywords, but case-sensitive.\n * e.g. `blueviolet` or `red`\n\n**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBA` or `RGA`.", - "parameters": [ - { - "name": "color", - "description": "Color in Hex, RGB, ARGB, HSL, HSLA or named CSS color format. The alpha channel is optional for the hex type.", - "required": true, - "collection": false, - "type": "String", - "possibleValues": null - } - ], - "returns": null, - "additionalTags": [ - "stability_experimental" - ], - "urlFragment": "#viewsetbackgroundcolorcolor-experimental" - } - ], - "instanceProperties": [ - { - "name": "webContents", - "description": "A `WebContents` object owned by this view.", - "required": true, - "additionalTags": [ - "stability_experimental" - ], - "urlFragment": "#viewwebcontents-experimental", - "collection": false, - "type": "WebContents" - } - ], - "instanceEvents": [], - "instanceName": "view" - }, - { - "name": "BrowserWindow", - "description": "> Create and control browser windows.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Window customization\n\nThe `BrowserWindow` class exposes various ways to modify the look and behavior of your app's windows. For more details, see the Window Customization tutorial.\n\n### Showing the window gracefully\n\nWhen loading a page in the window directly, users may see the page load incrementally, which is not a good experience for a native app. To make the window display without a visual flash, there are two solutions for different situations.\n\n### Using the `ready-to-show` event\n\nWhile loading the page, the `ready-to-show` event will be emitted when the renderer process has rendered the page for the first time if the window has not been shown yet. Showing the window after this event will have no visual flash:\n\n```\nconst { BrowserWindow } = require('electron')\nconst win = new BrowserWindow({ show: false })\nwin.once('ready-to-show', () => {\n win.show()\n})\n```\n\nThis event is usually emitted after the `did-finish-load` event, but for pages with many remote resources, it may be emitted before the `did-finish-load` event.\n\nPlease note that using this event implies that the renderer will be considered \"visible\" and paint even though `show` is false. This event will never fire if you use `paintWhenInitiallyHidden: false`\n\n### Setting the `backgroundColor` property\n\nFor a complex app, the `ready-to-show` event could be emitted too late, making the app feel slow. In this case, it is recommended to show the window immediately, and use a `backgroundColor` close to your app's background:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow({ backgroundColor: '#2e2c29' })\nwin.loadURL('https://github.com')\n```\n\nNote that even for apps that use `ready-to-show` event, it is still recommended to set `backgroundColor` to make the app feel more native.\n\nSome examples of valid `backgroundColor` values include:\n\n```\nconst win = new BrowserWindow()\nwin.setBackgroundColor('hsl(230, 100%, 50%)')\nwin.setBackgroundColor('rgb(255, 145, 145)')\nwin.setBackgroundColor('#ff00a3')\nwin.setBackgroundColor('blueviolet')\n```\n\nFor more information about these color types see valid options in win.setBackgroundColor.\n\n### Parent and child windows\n\nBy using `parent` option, you can create child windows:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst top = new BrowserWindow()\nconst child = new BrowserWindow({ parent: top })\nchild.show()\ntop.show()\n```\n\nThe `child` window will always show on top of the `top` window.\n\n### Modal windows\n\nA modal window is a child window that disables parent window, to create a modal window, you have to set both `parent` and `modal` options:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst top = new BrowserWindow()\nconst child = new BrowserWindow({ parent: top, modal: true, show: false })\nchild.loadURL('https://github.com')\nchild.once('ready-to-show', () => {\n child.show()\n})\n```\n\n### Page visibility\n\nThe Page Visibility API works as follows:\n\n* On all platforms, the visibility state tracks whether the window is hidden/minimized or not.\n* Additionally, on macOS, the visibility state also tracks the window occlusion state. If the window is occluded (i.e. fully covered) by another window, the visibility state will be `hidden`. On other platforms, the visibility state will be `hidden` only when the window is minimized or explicitly hidden with `win.hide()`.\n* If a `BrowserWindow` is created with `show: false`, the initial visibility state will be `visible` despite the window actually being hidden.\n* If `backgroundThrottling` is disabled, the visibility state will remain `visible` even if the window is minimized, occluded, or hidden.\n\nIt is recommended that you pause expensive operations when the visibility state is `hidden` in order to minimize power consumption.\n\n### Platform notices\n\n* On macOS modal windows will be displayed as sheets attached to the parent window.\n* On macOS the child windows will keep the relative position to parent window when parent window moves, while on Windows and Linux child windows will not move.\n* On Linux the type of modal windows will be changed to `dialog`.\n* On Linux many desktop environments do not support hiding a modal window.\n\n### Class: BrowserWindow\n\n> Create and control browser windows.\n\nProcess: Main\n\n`BrowserWindow` is an EventEmitter.\n\nIt creates a new `BrowserWindow` with native properties as set by the `options`.", - "slug": "browser-window", - "websiteUrl": "https://electronjs.org/docs/api/browser-window", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/browser-window.md", - "version": "29.3.0", + "name": "BaseWindow", + "description": "> Create and control windows.\n\nProcess: Main\n\n> **Note** `BaseWindow` provides a flexible way to compose multiple web views in a single window. For windows with only a single, full-size web view, the `BrowserWindow` class may be a simpler option.\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Parent and child windows\n\nBy using `parent` option, you can create child windows:\n\n```\nconst { BaseWindow } = require('electron')\n\nconst parent = new BaseWindow()\nconst child = new BaseWindow({ parent })\n```\n\nThe `child` window will always show on top of the `parent` window.\n\n### Modal windows\n\nA modal window is a child window that disables parent window. To create a modal window, you have to set both the `parent` and `modal` options:\n\n```\nconst { BaseWindow } = require('electron')\n\nconst parent = new BaseWindow()\nconst child = new BaseWindow({ parent, modal: true })\n```\n\n### Platform notices\n\n* On macOS modal windows will be displayed as sheets attached to the parent window.\n* On macOS the child windows will keep the relative position to parent window when parent window moves, while on Windows and Linux child windows will not move.\n* On Linux the type of modal windows will be changed to `dialog`.\n* On Linux many desktop environments do not support hiding a modal window.\n\n### Class: BaseWindow\n\n> Create and control windows.\n\nProcess: Main\n\n`BaseWindow` is an EventEmitter.\n\nIt creates a new `BaseWindow` with native properties as set by the `options`.", + "slug": "base-window", + "websiteUrl": "https://electronjs.org/docs/api/base-window", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/base-window.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -3501,7 +3339,7 @@ "description": "", "required": false, "collection": false, - "type": "BrowserWindowConstructorOptions" + "type": "BaseWindowConstructorOptions" } ] }, @@ -3513,10 +3351,10 @@ "parameters": [], "returns": { "collection": true, - "type": "BrowserWindow" + "type": "BaseWindow" }, "additionalTags": [], - "urlFragment": "#browserwindowgetallwindows" + "urlFragment": "#basewindowgetallwindows" }, { "name": "getFocusedWindow", @@ -3528,7 +3366,7 @@ "type": [ { "collection": false, - "type": "BrowserWindow" + "type": "BaseWindow" }, { "type": "null", @@ -3537,19 +3375,19 @@ ] }, "additionalTags": [], - "urlFragment": "#browserwindowgetfocusedwindow" + "urlFragment": "#basewindowgetfocusedwindow" }, { - "name": "fromWebContents", - "signature": "(webContents)", - "description": "The window that owns the given `webContents` or `null` if the contents are not owned by a window.", + "name": "fromId", + "signature": "(id)", + "description": "The window with the given `id`.", "parameters": [ { - "name": "webContents", + "name": "id", "description": "", "required": true, "collection": false, - "type": "WebContents" + "type": "Integer" } ], "returns": { @@ -3557,7 +3395,7 @@ "type": [ { "collection": false, - "type": "BrowserWindow" + "type": "BaseWindow" }, { "type": "null", @@ -3566,69 +3404,37 @@ ] }, "additionalTags": [], - "urlFragment": "#browserwindowfromwebcontentswebcontents" - }, + "urlFragment": "#basewindowfromidid" + } + ], + "staticProperties": [], + "instanceMethods": [ { - "name": "fromBrowserView", - "signature": "(browserView)", - "description": "The window that owns the given `browserView`. If the given view is not attached to any window, returns `null`.", + "name": "setContentView", + "signature": "(view)", + "description": "Sets the content view of the window.", "parameters": [ { - "name": "browserView", + "name": "view", "description": "", "required": true, "collection": false, - "type": "BrowserView" + "type": "View" } ], - "returns": { - "collection": false, - "type": [ - { - "collection": false, - "type": "BrowserWindow" - }, - { - "type": "null", - "collection": false - } - ] - }, + "returns": null, "additionalTags": [], - "urlFragment": "#browserwindowfrombrowserviewbrowserview" + "urlFragment": "#winsetcontentviewview" }, { - "name": "fromId", - "signature": "(id)", - "description": "The window with the given `id`.", - "parameters": [ - { - "name": "id", - "description": "", - "required": true, - "collection": false, - "type": "Integer" - } - ], - "returns": { - "collection": false, - "type": [ - { - "collection": false, - "type": "BrowserWindow" - }, - { - "type": "null", - "collection": false - } - ] - }, + "name": "getContentView", + "signature": "()", + "description": "Returns View - The content view of the window.", + "parameters": [], + "returns": null, "additionalTags": [], - "urlFragment": "#browserwindowfromidid" - } - ], - "staticProperties": [], - "instanceMethods": [ + "urlFragment": "#wingetcontentview" + }, { "name": "destroy", "signature": "()", @@ -3901,7 +3707,7 @@ { "name": "setBackgroundColor", "signature": "(backgroundColor)", - "description": "Examples of valid `backgroundColor` values:\n\n* Hex\n * #fff (shorthand RGB)\n * #ffff (shorthand ARGB)\n * #ffffff (RGB)\n * #ffffffff (ARGB)\n* RGB\n * rgb(([\\d]+),\\s*([\\d]+),\\s*([\\d]+))\n * e.g. rgb(255, 255, 255)\n* RGBA\n * rgba(([\\d]+),\\s*([\\d]+),\\s*([\\d]+),\\s*([\\d.]+))\n * e.g. rgba(255, 255, 255, 1.0)\n* HSL\n * hsl((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%)\n * e.g. hsl(200, 20%, 50%)\n* HSLA\n * hsla((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+))\n * e.g. hsla(200, 20%, 50%, 0.5)\n* Color name\n * Options are listed in SkParseColor.cpp\n * Similar to CSS Color Module Level 3 keywords, but case-sensitive.\n * e.g. `blueviolet` or `red`\n\nSets the background color of the window. See Setting `backgroundColor`.", + "description": "Examples of valid `backgroundColor` values:\n\n* Hex\n * #fff (shorthand RGB)\n * #ffff (shorthand ARGB)\n * #ffffff (RGB)\n * #ffffffff (ARGB)\n* RGB\n * `rgb\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+)\\)`\n * e.g. rgb(255, 255, 255)\n* RGBA\n * `rgba\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+),\\s*([\\d.]+)\\)`\n * e.g. rgba(255, 255, 255, 1.0)\n* HSL\n * `hsl\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)`\n * e.g. hsl(200, 20%, 50%)\n* HSLA\n * `hsla\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)`\n * e.g. hsla(200, 20%, 50%, 0.5)\n* Color name\n * Options are listed in SkParseColor.cpp\n * Similar to CSS Color Module Level 3 keywords, but case-sensitive.\n * e.g. `blueviolet` or `red`\n\nSets the background color of the window. See Setting `backgroundColor`.", "parameters": [ { "name": "backgroundColor", @@ -4957,256 +4763,3592 @@ ], "urlFragment": "#winisdocumentedited-macos" }, - { - "name": "focusOnWebView", - "signature": "()", - "description": "", - "parameters": [], - "returns": null, - "additionalTags": [], - "urlFragment": "#winfocusonwebview" - }, - { - "name": "blurWebView", - "signature": "()", - "description": "", - "parameters": [], - "returns": null, - "additionalTags": [], - "urlFragment": "#winblurwebview" - }, - { - "name": "capturePage", - "signature": "([rect, opts])", - "description": "Resolves with a NativeImage\n\nCaptures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. The page is considered visible when its browser window is hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.", - "parameters": [ - { - "name": "rect", - "description": "The bounds to capture", - "required": false, - "collection": false, - "type": "Rectangle" - }, - { - "name": "opts", - "description": "", - "required": false, - "collection": false, - "type": "Object", - "properties": [ - { - "name": "stayHidden", - "description": " Keep the page hidden instead of visible. Default is `false`.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "boolean" - }, - { - "name": "stayAwake", - "description": " Keep the system awake instead of allowing it to sleep. Default is `false`.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "boolean" - } - ] - } - ], - "returns": { - "collection": false, - "type": "Promise", - "innerTypes": [ - { - "collection": false, - "type": "NativeImage" - } - ] - }, - "additionalTags": [], - "urlFragment": "#wincapturepagerect-opts" - }, - { - "name": "loadURL", - "signature": "(url[, options])", - "description": "the promise will resolve when the page has finished loading (see `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).\n\nSame as `webContents.loadURL(url[, options])`.\n\nThe `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol.\n\nTo ensure that file URLs are properly formatted, it is recommended to use Node's `url.format` method:\n\nYou can load a URL using a `POST` request with URL-encoded data by doing the following:", - "parameters": [ - { - "name": "url", - "description": "", - "required": true, - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "options", - "description": "", - "required": false, - "collection": false, - "type": "Object", - "properties": [ - { - "name": "httpReferrer", - "description": "An HTTP Referrer URL.", - "required": false, - "additionalTags": [], - "collection": false, - "type": [ - { - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "collection": false, - "type": "Referrer" - } - ] - }, - { - "name": "userAgent", - "description": "A user agent originating the request.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "extraHeaders", - "description": "Extra headers separated by \"\\n\"", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "postData", - "description": "", - "required": false, - "additionalTags": [], - "collection": true, - "type": [ - { - "collection": false, - "type": "UploadRawData" - }, - { - "collection": false, - "type": "UploadFile" - } - ] - }, - { - "name": "baseURLForDataURL", - "description": "Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - } - ] - } - ], - "returns": { - "collection": false, - "type": "Promise", - "innerTypes": [ - { - "collection": false, - "type": "void" - } - ] - }, - "additionalTags": [], - "urlFragment": "#winloadurlurl-options" - }, - { - "name": "loadFile", - "signature": "(filePath[, options])", - "description": "the promise will resolve when the page has finished loading (see `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).\n\nSame as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information.", - "parameters": [ - { - "name": "filePath", - "description": "", - "required": true, - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "options", - "description": "", - "required": false, - "collection": false, - "type": "Object", - "properties": [ - { - "name": "query", - "description": "Passed to `url.format()`.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "Record", - "innerTypes": [ - { - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "collection": false, - "type": "String", - "possibleValues": null - } - ] - }, - { - "name": "search", - "description": "Passed to `url.format()`.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "hash", - "description": "Passed to `url.format()`.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - } - ] - } - ], - "returns": { - "collection": false, - "type": "Promise", - "innerTypes": [ - { - "collection": false, - "type": "void" - } - ] - }, - "additionalTags": [], - "urlFragment": "#winloadfilefilepath-options" - }, - { - "name": "reload", - "signature": "()", - "description": "Same as `webContents.reload`.", - "parameters": [], - "returns": null, - "additionalTags": [], - "urlFragment": "#winreload" - }, + { + "name": "setMenu", + "signature": "(menu)", + "description": "Sets the `menu` as the window's menu bar.", + "parameters": [ + { + "name": "menu", + "description": "", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "Menu" + }, + { + "type": "null", + "collection": false + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_linux", + "os_windows" + ], + "urlFragment": "#winsetmenumenu-linux-windows" + }, + { + "name": "removeMenu", + "signature": "()", + "description": "Remove the window's menu bar.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_linux", + "os_windows" + ], + "urlFragment": "#winremovemenu-linux-windows" + }, + { + "name": "setProgressBar", + "signature": "(progress[, options])", + "description": "Sets progress value in progress bar. Valid range is [0, 1.0].\n\nRemove progress bar when progress < 0; Change to indeterminate mode when progress > 1.\n\nOn Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`.\n\nOn Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed.", + "parameters": [ + { + "name": "progress", + "description": "", + "required": true, + "collection": false, + "type": "Double" + }, + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "mode", + "description": "Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`.", + "required": true, + "additionalTags": [ + "os_windows" + ], + "collection": false, + "type": "String", + "possibleValues": [ + { + "value": "none", + "description": "" + }, + { + "value": "normal", + "description": "" + }, + { + "value": "indeterminate", + "description": "" + }, + { + "value": "error", + "description": "" + }, + { + "value": "paused", + "description": "" + } + ] + } + ] + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetprogressbarprogress-options" + }, + { + "name": "setOverlayIcon", + "signature": "(overlay, description)", + "description": "Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user.", + "parameters": [ + { + "name": "overlay", + "description": "the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "NativeImage" + }, + { + "type": "null", + "collection": false + } + ] + }, + { + "name": "description", + "description": "a description that will be provided to Accessibility screen readers", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsetoverlayiconoverlay-description-windows" + }, + { + "name": "invalidateShadow", + "signature": "()", + "description": "Invalidates the window shadow so that it is recomputed based on the current window shape.\n\n`BaseWindow`s that are transparent can sometimes leave behind visual artifacts on macOS. This method can be used to clear these artifacts when, for example, performing an animation.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#wininvalidateshadow-macos" + }, + { + "name": "setHasShadow", + "signature": "(hasShadow)", + "description": "Sets whether the window should have a shadow.", + "parameters": [ + { + "name": "hasShadow", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsethasshadowhasshadow" + }, + { + "name": "hasShadow", + "signature": "()", + "description": "Whether the window has a shadow.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winhasshadow" + }, + { + "name": "setOpacity", + "signature": "(opacity)", + "description": "Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range.", + "parameters": [ + { + "name": "opacity", + "description": "between 0.0 (fully transparent) and 1.0 (fully opaque)", + "required": true, + "collection": false, + "type": "number" + } + ], + "returns": null, + "additionalTags": [ + "os_windows", + "os_macos" + ], + "urlFragment": "#winsetopacityopacity-windows-macos" + }, + { + "name": "getOpacity", + "signature": "()", + "description": "between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1.", + "parameters": [], + "returns": { + "collection": false, + "type": "number" + }, + "additionalTags": [], + "urlFragment": "#wingetopacity" + }, + { + "name": "setShape", + "signature": "(rects)", + "description": "Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window.", + "parameters": [ + { + "name": "rects", + "description": "Sets a shape on the window. Passing an empty list reverts the window to being rectangular.", + "required": true, + "collection": true, + "type": "Rectangle" + } + ], + "returns": null, + "additionalTags": [ + "os_windows", + "os_linux", + "stability_experimental" + ], + "urlFragment": "#winsetshaperects-windows-linux-experimental" + }, + { + "name": "setThumbarButtons", + "signature": "(buttons)", + "description": "Whether the buttons were added successfully\n\nAdd a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `boolean` object indicates whether the thumbnail has been added successfully.\n\nThe number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons.\n\nThe `buttons` is an array of `Button` objects:\n\n* `Button` Object\n * `icon` NativeImage - The icon showing in thumbnail toolbar.\n * `click` Function\n * `tooltip` string (optional) - The text of the button's tooltip.\n * `flags` string[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`.\n\nThe `flags` is an array that can include following `string`s:\n\n* `enabled` - The button is active and available to the user.\n* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action.\n* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately.\n* `nobackground` - Do not draw a button border, use only the image.\n* `hidden` - The button is not shown to the user.\n* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification.", + "parameters": [ + { + "name": "buttons", + "description": "", + "required": true, + "collection": true, + "type": "ThumbarButton" + } + ], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsetthumbarbuttonsbuttons-windows" + }, + { + "name": "setThumbnailClip", + "signature": "(region)", + "description": "Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`.", + "parameters": [ + { + "name": "region", + "description": "Region of the window", + "required": true, + "collection": false, + "type": "Rectangle" + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsetthumbnailclipregion-windows" + }, + { + "name": "setThumbnailToolTip", + "signature": "(toolTip)", + "description": "Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar.", + "parameters": [ + { + "name": "toolTip", + "description": "", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsetthumbnailtooltiptooltip-windows" + }, + { + "name": "setAppDetails", + "signature": "(options)", + "description": "Sets the properties for the window's taskbar button.\n\n**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used.", + "parameters": [ + { + "name": "options", + "description": "", + "required": true, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "appId", + "description": "Window's App User Model ID. It has to be set, otherwise the other options will have no effect.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "appIconPath", + "description": "Window's Relaunch Icon.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "appIconIndex", + "description": "Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. Default is `0`.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "Integer" + }, + { + "name": "relaunchCommand", + "description": "Window's Relaunch Command.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "relaunchDisplayName", + "description": "Window's Relaunch Display Name.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsetappdetailsoptions-windows" + }, + { + "name": "setIcon", + "signature": "(icon)", + "description": "Changes window icon.", + "parameters": [ + { + "name": "icon", + "description": "", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "NativeImage" + }, + { + "collection": false, + "type": "String", + "possibleValues": null + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#winseticonicon-windows-linux" + }, + { + "name": "setWindowButtonVisibility", + "signature": "(visible)", + "description": "Sets whether the window traffic light buttons should be visible.", + "parameters": [ + { + "name": "visible", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetwindowbuttonvisibilityvisible-macos" + }, + { + "name": "setAutoHideMenuBar", + "signature": "(hide)", + "description": "Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single `Alt` key.\n\nIf the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately.", + "parameters": [ + { + "name": "hide", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#winsetautohidemenubarhide-windows-linux" + }, + { + "name": "isMenuBarAutoHide", + "signature": "()", + "description": "Whether menu bar automatically hides itself.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#winismenubarautohide-windows-linux" + }, + { + "name": "setMenuBarVisibility", + "signature": "(visible)", + "description": "Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.", + "parameters": [ + { + "name": "visible", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#winsetmenubarvisibilityvisible-windows-linux" + }, + { + "name": "isMenuBarVisible", + "signature": "()", + "description": "Whether the menu bar is visible.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#winismenubarvisible-windows-linux" + }, + { + "name": "setVisibleOnAllWorkspaces", + "signature": "(visible[, options])", + "description": "Sets whether the window should be visible on all workspaces.\n\n**Note:** This API does nothing on Windows.", + "parameters": [ + { + "name": "visible", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + }, + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "visibleOnFullScreen", + "description": "Sets whether the window should be visible above fullscreen windows.", + "required": false, + "additionalTags": [ + "os_macos" + ], + "collection": false, + "type": "boolean" + }, + { + "name": "skipTransformProcessType", + "description": "Calling setVisibleOnAllWorkspaces will by default transform the process type between UIElementApplication and ForegroundApplication to ensure the correct behavior. However, this will hide the window and dock for a short time every time it is called. If your window is already of type UIElementApplication, you can bypass this transformation by passing true to skipTransformProcessType.", + "required": false, + "additionalTags": [ + "os_macos" + ], + "collection": false, + "type": "boolean" + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_linux" + ], + "urlFragment": "#winsetvisibleonallworkspacesvisible-options-macos-linux" + }, + { + "name": "isVisibleOnAllWorkspaces", + "signature": "()", + "description": "Whether the window is visible on all workspaces.\n\n**Note:** This API always returns false on Windows.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos", + "os_linux" + ], + "urlFragment": "#winisvisibleonallworkspaces-macos-linux" + }, + { + "name": "setIgnoreMouseEvents", + "signature": "(ignore[, options])", + "description": "Makes the window ignore all mouse events.\n\nAll mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events.", + "parameters": [ + { + "name": "ignore", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + }, + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "forward", + "description": "If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value.", + "required": false, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "collection": false, + "type": "boolean" + } + ] + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetignoremouseeventsignore-options" + }, + { + "name": "setContentProtection", + "signature": "(enable)", + "description": "Prevents the window contents from being captured by other apps.\n\nOn macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.", + "parameters": [ + { + "name": "enable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetcontentprotectionenable-macos-windows" + }, + { + "name": "setFocusable", + "signature": "(focusable)", + "description": "Changes whether the window can be focused.\n\nOn macOS it does not remove the focus from the window.", + "parameters": [ + { + "name": "focusable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetfocusablefocusable-macos-windows" + }, + { + "name": "isFocusable", + "signature": "()", + "description": "Whether the window can be focused.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winisfocusable-macos-windows" + }, + { + "name": "setParentWindow", + "signature": "(parent)", + "description": "Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window.", + "parameters": [ + { + "name": "parent", + "description": "", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "BaseWindow" + }, + { + "type": "null", + "collection": false + } + ] + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetparentwindowparent" + }, + { + "name": "getParentWindow", + "signature": "()", + "description": "The parent window or `null` if there is no parent.", + "parameters": [], + "returns": { + "collection": false, + "type": [ + { + "collection": false, + "type": "BaseWindow" + }, + { + "type": "null", + "collection": false + } + ] + }, + "additionalTags": [], + "urlFragment": "#wingetparentwindow" + }, + { + "name": "getChildWindows", + "signature": "()", + "description": "All child windows.", + "parameters": [], + "returns": { + "collection": true, + "type": "BaseWindow" + }, + "additionalTags": [], + "urlFragment": "#wingetchildwindows" + }, + { + "name": "setAutoHideCursor", + "signature": "(autoHide)", + "description": "Controls whether to hide cursor when typing.", + "parameters": [ + { + "name": "autoHide", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetautohidecursorautohide-macos" + }, + { + "name": "selectPreviousTab", + "signature": "()", + "description": "Selects the previous tab when native tabs are enabled and there are other tabs in the window.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winselectprevioustab-macos" + }, + { + "name": "selectNextTab", + "signature": "()", + "description": "Selects the next tab when native tabs are enabled and there are other tabs in the window.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winselectnexttab-macos" + }, + { + "name": "showAllTabs", + "signature": "()", + "description": "Shows or hides the tab overview when native tabs are enabled.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winshowalltabs-macos" + }, + { + "name": "mergeAllWindows", + "signature": "()", + "description": "Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winmergeallwindows-macos" + }, + { + "name": "moveTabToNewWindow", + "signature": "()", + "description": "Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winmovetabtonewwindow-macos" + }, + { + "name": "toggleTabBar", + "signature": "()", + "description": "Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#wintoggletabbar-macos" + }, + { + "name": "addTabbedWindow", + "signature": "(baseWindow)", + "description": "Adds a window as a tab on this window, after the tab for the window instance.", + "parameters": [ + { + "name": "baseWindow", + "description": "", + "required": true, + "collection": false, + "type": "BaseWindow" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winaddtabbedwindowbasewindow-macos" + }, + { + "name": "setVibrancy", + "signature": "(type)", + "description": "Adds a vibrancy effect to the window. Passing `null` or an empty string will remove the vibrancy effect on the window.", + "parameters": [ + { + "name": "type", + "description": "Can be `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the macOS documentation for more details.", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "String", + "possibleValues": [ + { + "value": "titlebar", + "description": "" + }, + { + "value": "selection", + "description": "" + }, + { + "value": "menu", + "description": "" + }, + { + "value": "popover", + "description": "" + }, + { + "value": "sidebar", + "description": "" + }, + { + "value": "header", + "description": "" + }, + { + "value": "sheet", + "description": "" + }, + { + "value": "window", + "description": "" + }, + { + "value": "hud", + "description": "" + }, + { + "value": "fullscreen-ui", + "description": "" + }, + { + "value": "tooltip", + "description": "" + }, + { + "value": "content", + "description": "" + }, + { + "value": "under-window", + "description": "" + }, + { + "value": "under-page", + "description": "" + } + ] + }, + { + "type": "null", + "collection": false + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetvibrancytype-macos" + }, + { + "name": "setBackgroundMaterial", + "signature": "(material)", + "description": "This method sets the browser window's system-drawn background material, including behind the non-client area.\n\nSee the Windows documentation for more details.\n\n**Note:** This method is only supported on Windows 11 22H2 and up.", + "parameters": [ + { + "name": "material", + "description": "", + "required": true, + "collection": false, + "type": "String", + "possibleValues": [ + { + "value": "auto", + "description": "Let the Desktop Window Manager (DWM) automatically decide the system-drawn backdrop material for this window. This is the default." + }, + { + "value": "none", + "description": "Don't draw any system backdrop." + }, + { + "value": "mica", + "description": "Draw the backdrop material effect corresponding to a long-lived window." + }, + { + "value": "acrylic", + "description": "Draw the backdrop material effect corresponding to a transient window." + }, + { + "value": "tabbed", + "description": "Draw the backdrop material effect corresponding to a window with a tabbed title bar." + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsetbackgroundmaterialmaterial-windows" + }, + { + "name": "setWindowButtonPosition", + "signature": "(position)", + "description": "Set a custom position for the traffic light buttons in frameless window. Passing `null` will reset the position to default.", + "parameters": [ + { + "name": "position", + "description": "", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "Point" + }, + { + "type": "null", + "collection": false + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetwindowbuttonpositionposition-macos" + }, + { + "name": "getWindowButtonPosition", + "signature": "()", + "description": "The custom position for the traffic light buttons in frameless window, `null` will be returned when there is no custom position.", + "parameters": [], + "returns": { + "collection": false, + "type": [ + { + "collection": false, + "type": "Point" + }, + { + "type": "null", + "collection": false + } + ] + }, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#wingetwindowbuttonposition-macos" + }, + { + "name": "setTouchBar", + "signature": "(touchBar)", + "description": "Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar.\n\n**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases.", + "parameters": [ + { + "name": "touchBar", + "description": "", + "required": true, + "collection": false, + "type": [ + { + "collection": false, + "type": "TouchBar" + }, + { + "type": "null", + "collection": false + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsettouchbartouchbar-macos" + }, + { + "name": "setTitleBarOverlay", + "signature": "(options)", + "description": "On a Window with Window Controls Overlay already enabled, this method updates the style of the title bar overlay.", + "parameters": [ + { + "name": "options", + "description": "", + "required": true, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "color", + "description": "The CSS color of the Window Controls Overlay when enabled.", + "required": false, + "additionalTags": [ + "os_windows" + ], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "symbolColor", + "description": "The CSS color of the symbols on the Window Controls Overlay when enabled.", + "required": false, + "additionalTags": [ + "os_windows" + ], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "height", + "description": "The height of the title bar and Window Controls Overlay in pixels.", + "required": false, + "additionalTags": [ + "os_windows" + ], + "collection": false, + "type": "Integer" + } + ] + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winsettitlebaroverlayoptions-windows" + } + ], + "instanceProperties": [ + { + "name": "id", + "description": "A `Integer` property representing the unique ID of the window. Each ID is unique among all `BaseWindow` instances of the entire Electron application.", + "required": true, + "additionalTags": [ + "availability_readonly" + ], + "urlFragment": "#winid-readonly", + "collection": false, + "type": "Integer" + }, + { + "name": "contentView", + "description": "A `View` property for the content view of the window.", + "required": true, + "additionalTags": [], + "urlFragment": "#wincontentview", + "collection": false, + "type": "View" + }, + { + "name": "tabbingIdentifier", + "description": "A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.", + "required": false, + "additionalTags": [ + "os_macos", + "availability_readonly" + ], + "urlFragment": "#wintabbingidentifier-macos-readonly", + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "autoHideMenuBar", + "description": "A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.\n\nIf the menu bar is already visible, setting this property to `true` won't hide it immediately.", + "required": true, + "additionalTags": [], + "urlFragment": "#winautohidemenubar", + "collection": false, + "type": "boolean" + }, + { + "name": "simpleFullScreen", + "description": "A `boolean` property that determines whether the window is in simple (pre-Lion) fullscreen mode.", + "required": true, + "additionalTags": [], + "urlFragment": "#winsimplefullscreen", + "collection": false, + "type": "boolean" + }, + { + "name": "fullScreen", + "description": "A `boolean` property that determines whether the window is in fullscreen mode.", + "required": true, + "additionalTags": [], + "urlFragment": "#winfullscreen", + "collection": false, + "type": "boolean" + }, + { + "name": "focusable", + "description": "A `boolean` property that determines whether the window is focusable.", + "required": true, + "additionalTags": [ + "os_windows", + "os_macos" + ], + "urlFragment": "#winfocusable-windows-macos", + "collection": false, + "type": "boolean" + }, + { + "name": "visibleOnAllWorkspaces", + "description": "A `boolean` property that determines whether the window is visible on all workspaces.\n\n**Note:** Always returns false on Windows.", + "required": true, + "additionalTags": [ + "os_macos", + "os_linux" + ], + "urlFragment": "#winvisibleonallworkspaces-macos-linux", + "collection": false, + "type": "boolean" + }, + { + "name": "shadow", + "description": "A `boolean` property that determines whether the window has a shadow.", + "required": true, + "additionalTags": [], + "urlFragment": "#winshadow", + "collection": false, + "type": "boolean" + }, + { + "name": "menuBarVisible", + "description": "A `boolean` property that determines whether the menu bar should be visible.\n\n**Note:** If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.", + "required": true, + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#winmenubarvisible-windows-linux", + "collection": false, + "type": "boolean" + }, + { + "name": "kiosk", + "description": "A `boolean` property that determines whether the window is in kiosk mode.", + "required": true, + "additionalTags": [], + "urlFragment": "#winkiosk", + "collection": false, + "type": "boolean" + }, + { + "name": "documentEdited", + "description": "A `boolean` property that specifies whether the window’s document has been edited.\n\nThe icon in title bar will become gray when set to `true`.", + "required": true, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#windocumentedited-macos", + "collection": false, + "type": "boolean" + }, + { + "name": "representedFilename", + "description": "A `string` property that determines the pathname of the file the window represents, and the icon of the file will show in window's title bar.", + "required": true, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winrepresentedfilename-macos", + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "title", + "description": "A `string` property that determines the title of the native window.\n\n**Note:** The title of the web page can be different from the title of the native window.", + "required": true, + "additionalTags": [], + "urlFragment": "#wintitle", + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "minimizable", + "description": "A `boolean` property that determines whether the window can be manually minimized by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.", + "required": true, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winminimizable-macos-windows", + "collection": false, + "type": "boolean" + }, + { + "name": "maximizable", + "description": "A `boolean` property that determines whether the window can be manually maximized by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.", + "required": true, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winmaximizable-macos-windows", + "collection": false, + "type": "boolean" + }, + { + "name": "fullScreenable", + "description": "A `boolean` property that determines whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.", + "required": true, + "additionalTags": [], + "urlFragment": "#winfullscreenable", + "collection": false, + "type": "boolean" + }, + { + "name": "resizable", + "description": "A `boolean` property that determines whether the window can be manually resized by user.", + "required": true, + "additionalTags": [], + "urlFragment": "#winresizable", + "collection": false, + "type": "boolean" + }, + { + "name": "closable", + "description": "A `boolean` property that determines whether the window can be manually closed by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.", + "required": true, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winclosable-macos-windows", + "collection": false, + "type": "boolean" + }, + { + "name": "movable", + "description": "A `boolean` property that determines Whether the window can be moved by user.\n\nOn Linux the setter is a no-op, although the getter returns `true`.", + "required": true, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winmovable-macos-windows", + "collection": false, + "type": "boolean" + }, + { + "name": "excludedFromShownWindowsMenu", + "description": "A `boolean` property that determines whether the window is excluded from the application’s Windows menu. `false` by default.", + "required": true, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winexcludedfromshownwindowsmenu-macos", + "collection": false, + "type": "boolean" + }, + { + "name": "accessibleTitle", + "description": "A `string` property that defines an alternative title provided only to accessibility tools such as screen readers. This string is not directly visible to users.", + "required": true, + "additionalTags": [], + "urlFragment": "#winaccessibletitle", + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "instanceEvents": [ + { + "name": "close", + "description": "Emitted when the window is going to be closed. It's emitted before the `beforeunload` and `unload` event of the DOM. Calling `event.preventDefault()` will cancel the close.\n\nUsually you would want to use the `beforeunload` handler to decide whether the window should be closed, which will also be called when the window is reloaded. In Electron, returning any value other than `undefined` would cancel the close. For example:\n\n_**Note**: There is a subtle difference between the behaviors of `window.onbeforeunload = handler` and `window.addEventListener('beforeunload', handler)`. It is recommended to always set the `event.returnValue` explicitly, instead of only returning a value, as the former works more consistently within Electron._", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + } + ], + "additionalTags": [], + "urlFragment": "#event-close" + }, + { + "name": "closed", + "description": "Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-closed" + }, + { + "name": "session-end", + "description": "Emitted when window session is going to end due to force shutdown or machine restart or session log off.", + "parameters": [], + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#event-session-end-windows" + }, + { + "name": "blur", + "description": "Emitted when the window loses focus.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-blur" + }, + { + "name": "focus", + "description": "Emitted when the window gains focus.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-focus" + }, + { + "name": "show", + "description": "Emitted when the window is shown.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-show" + }, + { + "name": "hide", + "description": "Emitted when the window is hidden.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-hide" + }, + { + "name": "maximize", + "description": "Emitted when window is maximized.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-maximize" + }, + { + "name": "unmaximize", + "description": "Emitted when the window exits from a maximized state.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-unmaximize" + }, + { + "name": "minimize", + "description": "Emitted when the window is minimized.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-minimize" + }, + { + "name": "restore", + "description": "Emitted when the window is restored from a minimized state.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-restore" + }, + { + "name": "will-resize", + "description": "Emitted before the window is resized. Calling `event.preventDefault()` will prevent the window from being resized.\n\nNote that this is only emitted when the window is being resized manually. Resizing the window with `setBounds`/`setSize` will not emit this event.\n\nThe possible values and behaviors of the `edge` option are platform dependent. Possible values are:\n\n* On Windows, possible values are `bottom`, `top`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right`.\n* On macOS, possible values are `bottom` and `right`.\n * The value `bottom` is used to denote vertical resizing.\n * The value `right` is used to denote horizontal resizing.", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "newBounds", + "description": "Size the window is being resized to.", + "collection": false, + "type": "Rectangle", + "additionalTags": [], + "required": true + }, + { + "name": "details", + "description": "", + "collection": false, + "type": "Object", + "properties": [ + { + "name": "edge", + "description": "The edge of the window being dragged for resizing. Can be `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left` or `bottom-right`.", + "required": true, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": [ + { + "value": "bottom", + "description": "" + }, + { + "value": "left", + "description": "" + }, + { + "value": "right", + "description": "" + }, + { + "value": "top-left", + "description": "" + }, + { + "value": "top-right", + "description": "" + }, + { + "value": "bottom-left", + "description": "" + }, + { + "value": "bottom-right", + "description": "" + } + ] + } + ], + "additionalTags": [], + "required": true + } + ], + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#event-will-resize-macos-windows" + }, + { + "name": "resize", + "description": "Emitted after the window has been resized.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-resize" + }, + { + "name": "resized", + "description": "Emitted once when the window has finished being resized.\n\nThis is usually emitted when the window has been resized manually. On macOS, resizing the window with `setBounds`/`setSize` and setting the `animate` parameter to `true` will also emit this event once resizing has finished.", + "parameters": [], + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#event-resized-macos-windows" + }, + { + "name": "will-move", + "description": "Emitted before the window is moved. On Windows, calling `event.preventDefault()` will prevent the window from being moved.\n\nNote that this is only emitted when the window is being moved manually. Moving the window with `setPosition`/`setBounds`/`center` will not emit this event.", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "newBounds", + "description": "Location the window is being moved to.", + "collection": false, + "type": "Rectangle", + "additionalTags": [], + "required": true + } + ], + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#event-will-move-macos-windows" + }, + { + "name": "move", + "description": "Emitted when the window is being moved to a new position.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-move" + }, + { + "name": "moved", + "description": "Emitted once when the window is moved to a new position.\n\n**Note**: On macOS this event is an alias of `move`.", + "parameters": [], + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#event-moved-macos-windows" + }, + { + "name": "enter-full-screen", + "description": "Emitted when the window enters a full-screen state.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-enter-full-screen" + }, + { + "name": "leave-full-screen", + "description": "Emitted when the window leaves a full-screen state.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-leave-full-screen" + }, + { + "name": "always-on-top-changed", + "description": "Emitted when the window is set or unset to show always on top of other windows.", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "isAlwaysOnTop", + "description": "", + "collection": false, + "type": "boolean", + "additionalTags": [], + "required": true + } + ], + "additionalTags": [], + "urlFragment": "#event-always-on-top-changed" + }, + { + "name": "app-command", + "description": "Emitted when an App Command is invoked. These are typically related to keyboard media keys or browser commands, as well as the \"Back\" button built into some mice on Windows.\n\nCommands are lowercased, underscores are replaced with hyphens, and the `APPCOMMAND_` prefix is stripped off. e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.\n\nThe following app commands are explicitly supported on Linux:\n\n* `browser-backward`\n* `browser-forward`", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "command", + "description": "", + "collection": false, + "type": "String", + "possibleValues": null, + "additionalTags": [], + "required": true + } + ], + "additionalTags": [ + "os_windows", + "os_linux" + ], + "urlFragment": "#event-app-command-windows-linux" + }, + { + "name": "swipe", + "description": "Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`, `left`.\n\nThe method underlying this event is built to handle older macOS-style trackpad swiping, where the content on the screen doesn't move with the swipe. Most macOS trackpads are not configured to allow this kind of swiping anymore, so in order for it to emit properly the 'Swipe between pages' preference in `System Preferences > Trackpad > More Gestures` must be set to 'Swipe with two or three fingers'.", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "direction", + "description": "", + "collection": false, + "type": "String", + "possibleValues": null, + "additionalTags": [], + "required": true + } + ], + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#event-swipe-macos" + }, + { + "name": "rotate-gesture", + "description": "Emitted on trackpad rotation gesture. Continually emitted until rotation gesture is ended. The `rotation` value on each emission is the angle in degrees rotated since the last emission. The last emitted event upon a rotation gesture will always be of value `0`. Counter-clockwise rotation values are positive, while clockwise ones are negative.", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "rotation", + "description": "", + "collection": false, + "type": "Float", + "additionalTags": [], + "required": true + } + ], + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#event-rotate-gesture-macos" + }, + { + "name": "sheet-begin", + "description": "Emitted when the window opens a sheet.", + "parameters": [], + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#event-sheet-begin-macos" + }, + { + "name": "sheet-end", + "description": "Emitted when the window has closed a sheet.", + "parameters": [], + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#event-sheet-end-macos" + }, + { + "name": "new-window-for-tab", + "description": "Emitted when the native new tab button is clicked.", + "parameters": [], + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#event-new-window-for-tab-macos" + }, + { + "name": "system-context-menu", + "description": "Emitted when the system context menu is triggered on the window, this is normally only triggered when the user right clicks on the non-client area of your window. This is the window titlebar or any area you have declared as `-webkit-app-region: drag` in a frameless window.\n\nCalling `event.preventDefault()` will prevent the menu from being displayed.", + "parameters": [ + { + "name": "event", + "description": "", + "collection": false, + "type": "Event", + "additionalTags": [], + "required": true + }, + { + "name": "point", + "description": "The screen coordinates the context menu was triggered at", + "collection": false, + "type": "Point", + "additionalTags": [], + "required": true + } + ], + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#event-system-context-menu-windows" + } + ], + "instanceName": "baseWindow" + }, + { + "name": "BrowserView", + "description": "> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.\n\nA `BrowserView` can be used to embed additional web content into a `BrowserWindow`. It is like a child window, except that it is positioned relative to its owning window. It is meant to be an alternative to the `webview` tag.\n\n### Class: BrowserView\n\n> Create and control views.\n\n> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Example\n\n```\n// In the main process.\nconst { app, BrowserView, BrowserWindow } = require('electron')\n\napp.whenReady().then(() => {\n const win = new BrowserWindow({ width: 800, height: 600 })\n\n const view = new BrowserView()\n win.setBrowserView(view)\n view.setBounds({ x: 0, y: 0, width: 300, height: 300 })\n view.webContents.loadURL('https://electronjs.org')\n})\n```", + "slug": "browser-view", + "websiteUrl": "https://electronjs.org/docs/api/browser-view", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/browser-view.md", + "version": "30.0.1", + "type": "Class", + "process": { + "main": true, + "renderer": false, + "utility": false, + "exported": true + }, + "constructorMethod": { + "signature": "([options])", + "parameters": [ + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "webPreferences", + "description": "Settings of web page's features.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "WebPreferences" + } + ] + } + ] + }, + "staticMethods": [], + "staticProperties": [], + "instanceMethods": [ + { + "name": "setAutoResize", + "signature": "(options)", + "description": "", + "parameters": [ + { + "name": "options", + "description": "", + "required": true, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "width", + "description": "If `true`, the view's width will grow and shrink together with the window. `false` by default.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "boolean" + }, + { + "name": "height", + "description": "If `true`, the view's height will grow and shrink together with the window. `false` by default.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "boolean" + }, + { + "name": "horizontal", + "description": "If `true`, the view's x position and width will grow and shrink proportionally with the window. `false` by default.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "boolean" + }, + { + "name": "vertical", + "description": "If `true`, the view's y position and height will grow and shrink proportionally with the window. `false` by default.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "boolean" + } + ] + } + ], + "returns": null, + "additionalTags": [ + "stability_experimental", + "stability_deprecated" + ], + "urlFragment": "#viewsetautoresizeoptions-experimental-deprecated" + }, + { + "name": "setBounds", + "signature": "(bounds)", + "description": "Resizes and moves the view to the supplied bounds relative to the window.", + "parameters": [ + { + "name": "bounds", + "description": "", + "required": true, + "collection": false, + "type": "Rectangle" + } + ], + "returns": null, + "additionalTags": [ + "stability_experimental", + "stability_deprecated" + ], + "urlFragment": "#viewsetboundsbounds-experimental-deprecated" + }, + { + "name": "getBounds", + "signature": "()", + "description": "The `bounds` of this BrowserView instance as `Object`.", + "parameters": [], + "returns": { + "collection": false, + "type": "Rectangle" + }, + "additionalTags": [ + "stability_experimental", + "stability_deprecated" + ], + "urlFragment": "#viewgetbounds-experimental-deprecated" + }, + { + "name": "setBackgroundColor", + "signature": "(color)", + "description": "Examples of valid `color` values:\n\n* Hex\n * `#fff` (RGB)\n * `#ffff` (ARGB)\n * `#ffffff` (RRGGBB)\n * `#ffffffff` (AARRGGBB)\n* RGB\n * `rgb\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+)\\)`\n * e.g. `rgb(255, 255, 255)`\n* RGBA\n * `rgba\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+),\\s*([\\d.]+)\\)`\n * e.g. `rgba(255, 255, 255, 1.0)`\n* HSL\n * `hsl\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)`\n * e.g. `hsl(200, 20%, 50%)`\n* HSLA\n * `hsla\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)`\n * e.g. `hsla(200, 20%, 50%, 0.5)`\n* Color name\n * Options are listed in SkParseColor.cpp\n * Similar to CSS Color Module Level 3 keywords, but case-sensitive.\n * e.g. `blueviolet` or `red`\n\n**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or `RGB`.", + "parameters": [ + { + "name": "color", + "description": "Color in Hex, RGB, ARGB, HSL, HSLA or named CSS color format. The alpha channel is optional for the hex type.", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [ + "stability_experimental", + "stability_deprecated" + ], + "urlFragment": "#viewsetbackgroundcolorcolor-experimental-deprecated" + } + ], + "instanceProperties": [ + { + "name": "webContents", + "description": "A `WebContents` object owned by this view.", + "required": true, + "additionalTags": [ + "stability_experimental", + "stability_deprecated" + ], + "urlFragment": "#viewwebcontents-experimental-deprecated", + "collection": false, + "type": "WebContents" + } + ], + "instanceEvents": [], + "instanceName": "view" + }, + { + "name": "BrowserWindow", + "extends": "BaseWindow", + "description": "> Create and control browser windows.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Window customization\n\nThe `BrowserWindow` class exposes various ways to modify the look and behavior of your app's windows. For more details, see the Window Customization tutorial.\n\n### Showing the window gracefully\n\nWhen loading a page in the window directly, users may see the page load incrementally, which is not a good experience for a native app. To make the window display without a visual flash, there are two solutions for different situations.\n\n### Using the `ready-to-show` event\n\nWhile loading the page, the `ready-to-show` event will be emitted when the renderer process has rendered the page for the first time if the window has not been shown yet. Showing the window after this event will have no visual flash:\n\n```\nconst { BrowserWindow } = require('electron')\nconst win = new BrowserWindow({ show: false })\nwin.once('ready-to-show', () => {\n win.show()\n})\n```\n\nThis event is usually emitted after the `did-finish-load` event, but for pages with many remote resources, it may be emitted before the `did-finish-load` event.\n\nPlease note that using this event implies that the renderer will be considered \"visible\" and paint even though `show` is false. This event will never fire if you use `paintWhenInitiallyHidden: false`\n\n### Setting the `backgroundColor` property\n\nFor a complex app, the `ready-to-show` event could be emitted too late, making the app feel slow. In this case, it is recommended to show the window immediately, and use a `backgroundColor` close to your app's background:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow({ backgroundColor: '#2e2c29' })\nwin.loadURL('https://github.com')\n```\n\nNote that even for apps that use `ready-to-show` event, it is still recommended to set `backgroundColor` to make the app feel more native.\n\nSome examples of valid `backgroundColor` values include:\n\n```\nconst win = new BrowserWindow()\nwin.setBackgroundColor('hsl(230, 100%, 50%)')\nwin.setBackgroundColor('rgb(255, 145, 145)')\nwin.setBackgroundColor('#ff00a3')\nwin.setBackgroundColor('blueviolet')\n```\n\nFor more information about these color types see valid options in win.setBackgroundColor.\n\n### Parent and child windows\n\nBy using `parent` option, you can create child windows:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst top = new BrowserWindow()\nconst child = new BrowserWindow({ parent: top })\nchild.show()\ntop.show()\n```\n\nThe `child` window will always show on top of the `top` window.\n\n### Modal windows\n\nA modal window is a child window that disables parent window. To create a modal window, you have to set both the `parent` and `modal` options:\n\n```\nconst { BrowserWindow } = require('electron')\n\nconst top = new BrowserWindow()\nconst child = new BrowserWindow({ parent: top, modal: true, show: false })\nchild.loadURL('https://github.com')\nchild.once('ready-to-show', () => {\n child.show()\n})\n```\n\n### Page visibility\n\nThe Page Visibility API works as follows:\n\n* On all platforms, the visibility state tracks whether the window is hidden/minimized or not.\n* Additionally, on macOS, the visibility state also tracks the window occlusion state. If the window is occluded (i.e. fully covered) by another window, the visibility state will be `hidden`. On other platforms, the visibility state will be `hidden` only when the window is minimized or explicitly hidden with `win.hide()`.\n* If a `BrowserWindow` is created with `show: false`, the initial visibility state will be `visible` despite the window actually being hidden.\n* If `backgroundThrottling` is disabled, the visibility state will remain `visible` even if the window is minimized, occluded, or hidden.\n\nIt is recommended that you pause expensive operations when the visibility state is `hidden` in order to minimize power consumption.\n\n### Platform notices\n\n* On macOS modal windows will be displayed as sheets attached to the parent window.\n* On macOS the child windows will keep the relative position to parent window when parent window moves, while on Windows and Linux child windows will not move.\n* On Linux the type of modal windows will be changed to `dialog`.\n* On Linux many desktop environments do not support hiding a modal window.\n\n### Class: BrowserWindow extends `BaseWindow`\n\n> Create and control browser windows.\n\nProcess: Main\n\n`BrowserWindow` is an EventEmitter.\n\nIt creates a new `BrowserWindow` with native properties as set by the `options`.", + "slug": "browser-window", + "websiteUrl": "https://electronjs.org/docs/api/browser-window", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/browser-window.md", + "version": "30.0.1", + "type": "Class", + "process": { + "main": true, + "renderer": false, + "utility": false, + "exported": true + }, + "constructorMethod": { + "signature": "([options])", + "parameters": [ + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "BrowserWindowConstructorOptions" + } + ] + }, + "staticMethods": [ + { + "name": "getAllWindows", + "signature": "()", + "description": "An array of all opened browser windows.", + "parameters": [], + "returns": { + "collection": true, + "type": "BrowserWindow" + }, + "additionalTags": [], + "urlFragment": "#browserwindowgetallwindows" + }, + { + "name": "getFocusedWindow", + "signature": "()", + "description": "The window that is focused in this application, otherwise returns `null`.", + "parameters": [], + "returns": { + "collection": false, + "type": [ + { + "collection": false, + "type": "BrowserWindow" + }, + { + "type": "null", + "collection": false + } + ] + }, + "additionalTags": [], + "urlFragment": "#browserwindowgetfocusedwindow" + }, + { + "name": "fromWebContents", + "signature": "(webContents)", + "description": "The window that owns the given `webContents` or `null` if the contents are not owned by a window.", + "parameters": [ + { + "name": "webContents", + "description": "", + "required": true, + "collection": false, + "type": "WebContents" + } + ], + "returns": { + "collection": false, + "type": [ + { + "collection": false, + "type": "BrowserWindow" + }, + { + "type": "null", + "collection": false + } + ] + }, + "additionalTags": [], + "urlFragment": "#browserwindowfromwebcontentswebcontents" + }, + { + "name": "fromBrowserView", + "signature": "(browserView)", + "description": "> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.\n\nThe window that owns the given `browserView`. If the given view is not attached to any window, returns `null`.", + "parameters": [ + { + "name": "browserView", + "description": "", + "required": true, + "collection": false, + "type": "BrowserView" + } + ], + "returns": { + "collection": false, + "type": [ + { + "collection": false, + "type": "BrowserWindow" + }, + { + "type": "null", + "collection": false + } + ] + }, + "additionalTags": [ + "stability_deprecated" + ], + "urlFragment": "#browserwindowfrombrowserviewbrowserview-deprecated" + }, + { + "name": "fromId", + "signature": "(id)", + "description": "The window with the given `id`.", + "parameters": [ + { + "name": "id", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + } + ], + "returns": { + "collection": false, + "type": [ + { + "collection": false, + "type": "BrowserWindow" + }, + { + "type": "null", + "collection": false + } + ] + }, + "additionalTags": [], + "urlFragment": "#browserwindowfromidid" + } + ], + "staticProperties": [], + "instanceMethods": [ + { + "name": "destroy", + "signature": "()", + "description": "Force closing the window, the `unload` and `beforeunload` event won't be emitted for the web page, and `close` event will also not be emitted for this window, but it guarantees the `closed` event will be emitted.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#windestroy" + }, + { + "name": "close", + "signature": "()", + "description": "Try to close the window. This has the same effect as a user manually clicking the close button of the window. The web page may cancel the close though. See the close event.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winclose" + }, + { + "name": "focus", + "signature": "()", + "description": "Focuses on the window.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winfocus" + }, + { + "name": "blur", + "signature": "()", + "description": "Removes focus from the window.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winblur" + }, + { + "name": "isFocused", + "signature": "()", + "description": "Whether the window is focused.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisfocused" + }, + { + "name": "isDestroyed", + "signature": "()", + "description": "Whether the window is destroyed.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisdestroyed" + }, + { + "name": "show", + "signature": "()", + "description": "Shows and gives focus to the window.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winshow" + }, + { + "name": "showInactive", + "signature": "()", + "description": "Shows the window but doesn't focus on it.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winshowinactive" + }, + { + "name": "hide", + "signature": "()", + "description": "Hides the window.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winhide" + }, + { + "name": "isVisible", + "signature": "()", + "description": "Whether the window is visible to the user in the foreground of the app.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisvisible" + }, + { + "name": "isModal", + "signature": "()", + "description": "Whether current window is a modal window.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winismodal" + }, + { + "name": "maximize", + "signature": "()", + "description": "Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winmaximize" + }, + { + "name": "unmaximize", + "signature": "()", + "description": "Unmaximizes the window.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winunmaximize" + }, + { + "name": "isMaximized", + "signature": "()", + "description": "Whether the window is maximized.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winismaximized" + }, + { + "name": "minimize", + "signature": "()", + "description": "Minimizes the window. On some platforms the minimized window will be shown in the Dock.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winminimize" + }, + { + "name": "restore", + "signature": "()", + "description": "Restores the window from minimized state to its previous state.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winrestore" + }, + { + "name": "isMinimized", + "signature": "()", + "description": "Whether the window is minimized.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisminimized" + }, + { + "name": "setFullScreen", + "signature": "(flag)", + "description": "Sets whether the window should be in fullscreen mode.\n\n**Note:** On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the 'enter-full-screen' or 'leave-full-screen' events.", + "parameters": [ + { + "name": "flag", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetfullscreenflag" + }, + { + "name": "isFullScreen", + "signature": "()", + "description": "Whether the window is in fullscreen mode.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisfullscreen" + }, + { + "name": "setSimpleFullScreen", + "signature": "(flag)", + "description": "Enters or leaves simple fullscreen mode.\n\nSimple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).", + "parameters": [ + { + "name": "flag", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetsimplefullscreenflag-macos" + }, + { + "name": "isSimpleFullScreen", + "signature": "()", + "description": "Whether the window is in simple (pre-Lion) fullscreen mode.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winissimplefullscreen-macos" + }, + { + "name": "isNormal", + "signature": "()", + "description": "Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisnormal" + }, + { + "name": "setAspectRatio", + "signature": "(aspectRatio[, extraSize])", + "description": "This will make a window maintain an aspect ratio. The extra size allows a developer to have space, specified in pixels, not included within the aspect ratio calculations. This API already takes into account the difference between a window's size and its content size.\n\nConsider a normal window with an HD video player and associated controls. Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and { width: 40, height: 50 }. The second argument doesn't care where the extra width and height are within the content view--only that they exist. Sum any extra width and height areas you have within the overall content view.\n\nThe aspect ratio is not respected when window is resized programmatically with APIs like `win.setSize`.\n\nTo reset an aspect ratio, pass 0 as the `aspectRatio` value: `win.setAspectRatio(0)`.", + "parameters": [ + { + "name": "aspectRatio", + "description": "The aspect ratio to maintain for some portion of the content view.", + "required": true, + "collection": false, + "type": "Float" + }, + { + "name": "extraSize", + "description": "The extra size not to be included while maintaining the aspect ratio.", + "required": false, + "collection": false, + "type": "Size" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetaspectratioaspectratio-extrasize" + }, + { + "name": "setBackgroundColor", + "signature": "(backgroundColor)", + "description": "Examples of valid `backgroundColor` values:\n\n* Hex\n * #fff (shorthand RGB)\n * #ffff (shorthand ARGB)\n * #ffffff (RGB)\n * #ffffffff (ARGB)\n* RGB\n * `rgb\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+)\\)`\n * e.g. rgb(255, 255, 255)\n* RGBA\n * `rgba\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+),\\s*([\\d.]+)\\)`\n * e.g. rgba(255, 255, 255, 1.0)\n* HSL\n * `hsl\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)`\n * e.g. hsl(200, 20%, 50%)\n* HSLA\n * `hsla\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)`\n * e.g. hsla(200, 20%, 50%, 0.5)\n* Color name\n * Options are listed in SkParseColor.cpp\n * Similar to CSS Color Module Level 3 keywords, but case-sensitive.\n * e.g. `blueviolet` or `red`\n\nSets the background color of the window. See Setting `backgroundColor`.", + "parameters": [ + { + "name": "backgroundColor", + "description": "Color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. The alpha channel is optional for the hex type.", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetbackgroundcolorbackgroundcolor" + }, + { + "name": "previewFile", + "signature": "(path[, displayName])", + "description": "Uses Quick Look to preview a file at a given path.", + "parameters": [ + { + "name": "path", + "description": "The absolute path to the file to preview with QuickLook. This is important as Quick Look uses the file name and file extension on the path to determine the content type of the file to open.", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "displayName", + "description": "The name of the file to display on the Quick Look modal view. This is purely visual and does not affect the content type of the file. Defaults to `path`.", + "required": false, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winpreviewfilepath-displayname-macos" + }, + { + "name": "closeFilePreview", + "signature": "()", + "description": "Closes the currently open Quick Look panel.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winclosefilepreview-macos" + }, + { + "name": "setBounds", + "signature": "(bounds[, animate])", + "description": "Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.\n\n**Note:** On macOS, the y-coordinate value cannot be smaller than the Tray height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.", + "parameters": [ + { + "name": "bounds", + "description": "", + "required": true, + "collection": false, + "type": "Partial", + "innerTypes": [ + { + "collection": false, + "type": "Rectangle" + } + ] + }, + { + "name": "animate", + "description": "", + "required": false, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetboundsbounds-animate" + }, + { + "name": "getBounds", + "signature": "()", + "description": "The `bounds` of the window as `Object`.\n\n**Note:** On macOS, the y-coordinate value returned will be at minimum the Tray height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.", + "parameters": [], + "returns": { + "collection": false, + "type": "Rectangle" + }, + "additionalTags": [], + "urlFragment": "#wingetbounds" + }, + { + "name": "getBackgroundColor", + "signature": "()", + "description": "Gets the background color of the window in Hex (`#RRGGBB`) format.\n\nSee Setting `backgroundColor`.\n\n**Note:** The alpha value is _not_ returned alongside the red, green, and blue values.", + "parameters": [], + "returns": { + "collection": false, + "type": "String", + "possibleValues": null + }, + "additionalTags": [], + "urlFragment": "#wingetbackgroundcolor" + }, + { + "name": "setContentBounds", + "signature": "(bounds[, animate])", + "description": "Resizes and moves the window's client area (e.g. the web page) to the supplied bounds.", + "parameters": [ + { + "name": "bounds", + "description": "", + "required": true, + "collection": false, + "type": "Rectangle" + }, + { + "name": "animate", + "description": "", + "required": false, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetcontentboundsbounds-animate" + }, + { + "name": "getContentBounds", + "signature": "()", + "description": "The `bounds` of the window's client area as `Object`.", + "parameters": [], + "returns": { + "collection": false, + "type": "Rectangle" + }, + "additionalTags": [], + "urlFragment": "#wingetcontentbounds" + }, + { + "name": "getNormalBounds", + "signature": "()", + "description": "Contains the window bounds of the normal state\n\n**Note:** whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same `Rectangle`.", + "parameters": [], + "returns": { + "collection": false, + "type": "Rectangle" + }, + "additionalTags": [], + "urlFragment": "#wingetnormalbounds" + }, + { + "name": "setEnabled", + "signature": "(enable)", + "description": "Disable or enable the window.", + "parameters": [ + { + "name": "enable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetenabledenable" + }, + { + "name": "isEnabled", + "signature": "()", + "description": "whether the window is enabled.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisenabled" + }, + { + "name": "setSize", + "signature": "(width, height[, animate])", + "description": "Resizes the window to `width` and `height`. If `width` or `height` are below any set minimum size constraints the window will snap to its minimum size.", + "parameters": [ + { + "name": "width", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "height", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "animate", + "description": "", + "required": false, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetsizewidth-height-animate" + }, + { + "name": "getSize", + "signature": "()", + "description": "Contains the window's width and height.", + "parameters": [], + "returns": { + "collection": true, + "type": "Integer" + }, + "additionalTags": [], + "urlFragment": "#wingetsize" + }, + { + "name": "setContentSize", + "signature": "(width, height[, animate])", + "description": "Resizes the window's client area (e.g. the web page) to `width` and `height`.", + "parameters": [ + { + "name": "width", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "height", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "animate", + "description": "", + "required": false, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetcontentsizewidth-height-animate" + }, + { + "name": "getContentSize", + "signature": "()", + "description": "Contains the window's client area's width and height.", + "parameters": [], + "returns": { + "collection": true, + "type": "Integer" + }, + "additionalTags": [], + "urlFragment": "#wingetcontentsize" + }, + { + "name": "setMinimumSize", + "signature": "(width, height)", + "description": "Sets the minimum size of window to `width` and `height`.", + "parameters": [ + { + "name": "width", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "height", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetminimumsizewidth-height" + }, + { + "name": "getMinimumSize", + "signature": "()", + "description": "Contains the window's minimum width and height.", + "parameters": [], + "returns": { + "collection": true, + "type": "Integer" + }, + "additionalTags": [], + "urlFragment": "#wingetminimumsize" + }, + { + "name": "setMaximumSize", + "signature": "(width, height)", + "description": "Sets the maximum size of window to `width` and `height`.", + "parameters": [ + { + "name": "width", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "height", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetmaximumsizewidth-height" + }, + { + "name": "getMaximumSize", + "signature": "()", + "description": "Contains the window's maximum width and height.", + "parameters": [], + "returns": { + "collection": true, + "type": "Integer" + }, + "additionalTags": [], + "urlFragment": "#wingetmaximumsize" + }, + { + "name": "setResizable", + "signature": "(resizable)", + "description": "Sets whether the window can be manually resized by the user.", + "parameters": [ + { + "name": "resizable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetresizableresizable" + }, + { + "name": "isResizable", + "signature": "()", + "description": "Whether the window can be manually resized by the user.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisresizable" + }, + { + "name": "setMovable", + "signature": "(movable)", + "description": "Sets whether the window can be moved by user. On Linux does nothing.", + "parameters": [ + { + "name": "movable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetmovablemovable-macos-windows" + }, + { + "name": "isMovable", + "signature": "()", + "description": "Whether the window can be moved by user.\n\nOn Linux always returns `true`.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winismovable-macos-windows" + }, + { + "name": "setMinimizable", + "signature": "(minimizable)", + "description": "Sets whether the window can be manually minimized by user. On Linux does nothing.", + "parameters": [ + { + "name": "minimizable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetminimizableminimizable-macos-windows" + }, + { + "name": "isMinimizable", + "signature": "()", + "description": "Whether the window can be manually minimized by the user.\n\nOn Linux always returns `true`.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winisminimizable-macos-windows" + }, + { + "name": "setMaximizable", + "signature": "(maximizable)", + "description": "Sets whether the window can be manually maximized by user. On Linux does nothing.", + "parameters": [ + { + "name": "maximizable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetmaximizablemaximizable-macos-windows" + }, + { + "name": "isMaximizable", + "signature": "()", + "description": "Whether the window can be manually maximized by user.\n\nOn Linux always returns `true`.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winismaximizable-macos-windows" + }, + { + "name": "setFullScreenable", + "signature": "(fullscreenable)", + "description": "Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.", + "parameters": [ + { + "name": "fullscreenable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetfullscreenablefullscreenable" + }, + { + "name": "isFullScreenable", + "signature": "()", + "description": "Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisfullscreenable" + }, + { + "name": "setClosable", + "signature": "(closable)", + "description": "Sets whether the window can be manually closed by user. On Linux does nothing.", + "parameters": [ + { + "name": "closable", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetclosableclosable-macos-windows" + }, + { + "name": "isClosable", + "signature": "()", + "description": "Whether the window can be manually closed by user.\n\nOn Linux always returns `true`.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winisclosable-macos-windows" + }, + { + "name": "setHiddenInMissionControl", + "signature": "(hidden)", + "description": "Sets whether the window will be hidden when the user toggles into mission control.", + "parameters": [ + { + "name": "hidden", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsethiddeninmissioncontrolhidden-macos" + }, + { + "name": "isHiddenInMissionControl", + "signature": "()", + "description": "Whether the window will be hidden when the user toggles into mission control.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winishiddeninmissioncontrol-macos" + }, + { + "name": "setAlwaysOnTop", + "signature": "(flag[, level][, relativeLevel])", + "description": "Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.", + "parameters": [ + { + "name": "flag", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + }, + { + "name": "level", + "description": "Values include `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, `screen-saver`, and ~~`dock`~~ (Deprecated). The default is `floating` when `flag` is true. The `level` is reset to `normal` when the flag is false. Note that from `floating` to `status` included, the window is placed below the Dock on macOS and below the taskbar on Windows. From `pop-up-menu` to a higher it is shown above the Dock on macOS and above the taskbar on Windows. See the macOS docs for more details.", + "required": false, + "collection": false, + "type": "String", + "possibleValues": [ + { + "value": "normal", + "description": "" + }, + { + "value": "floating", + "description": "" + }, + { + "value": "torn-off-menu", + "description": "" + }, + { + "value": "modal-panel", + "description": "" + }, + { + "value": "main-menu", + "description": "" + }, + { + "value": "status", + "description": "" + }, + { + "value": "pop-up-menu", + "description": "" + }, + { + "value": "screen-saver", + "description": "" + } + ] + }, + { + "name": "relativeLevel", + "description": "The number of layers higher to set this window relative to the given `level`. The default is `0`. Note that Apple discourages setting levels higher than 1 above `screen-saver`.", + "required": false, + "collection": false, + "type": "Integer" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetalwaysontopflag-level-relativelevel" + }, + { + "name": "isAlwaysOnTop", + "signature": "()", + "description": "Whether the window is always on top of other windows.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winisalwaysontop" + }, + { + "name": "moveAbove", + "signature": "(mediaSourceId)", + "description": "Moves window above the source window in the sense of z-order. If the `mediaSourceId` is not of type window or if the window does not exist then this method throws an error.", + "parameters": [ + { + "name": "mediaSourceId", + "description": "Window id in the format of DesktopCapturerSource's id. For example \"window:1869:0\".", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winmoveabovemediasourceid" + }, + { + "name": "moveTop", + "signature": "()", + "description": "Moves window to top(z-order) regardless of focus", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winmovetop" + }, + { + "name": "center", + "signature": "()", + "description": "Moves window to the center of the screen.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#wincenter" + }, + { + "name": "setPosition", + "signature": "(x, y[, animate])", + "description": "Moves window to `x` and `y`.", + "parameters": [ + { + "name": "x", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "y", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "animate", + "description": "", + "required": false, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetpositionx-y-animate" + }, + { + "name": "getPosition", + "signature": "()", + "description": "Contains the window's current position.", + "parameters": [], + "returns": { + "collection": true, + "type": "Integer" + }, + "additionalTags": [], + "urlFragment": "#wingetposition" + }, + { + "name": "setTitle", + "signature": "(title)", + "description": "Changes the title of native window to `title`.", + "parameters": [ + { + "name": "title", + "description": "", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsettitletitle" + }, + { + "name": "getTitle", + "signature": "()", + "description": "The title of the native window.\n\n**Note:** The title of the web page can be different from the title of the native window.", + "parameters": [], + "returns": { + "collection": false, + "type": "String", + "possibleValues": null + }, + "additionalTags": [], + "urlFragment": "#wingettitle" + }, + { + "name": "setSheetOffset", + "signature": "(offsetY[, offsetX])", + "description": "Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. For example:", + "parameters": [ + { + "name": "offsetY", + "description": "", + "required": true, + "collection": false, + "type": "Float" + }, + { + "name": "offsetX", + "description": "", + "required": false, + "collection": false, + "type": "Float" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetsheetoffsetoffsety-offsetx-macos" + }, + { + "name": "flashFrame", + "signature": "(flag)", + "description": "Starts or stops flashing the window to attract user's attention.", + "parameters": [ + { + "name": "flag", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winflashframeflag" + }, + { + "name": "setSkipTaskbar", + "signature": "(skip)", + "description": "Makes the window not show in the taskbar.", + "parameters": [ + { + "name": "skip", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos", + "os_windows" + ], + "urlFragment": "#winsetskiptaskbarskip-macos-windows" + }, + { + "name": "setKiosk", + "signature": "(flag)", + "description": "Enters or leaves kiosk mode.", + "parameters": [ + { + "name": "flag", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#winsetkioskflag" + }, + { + "name": "isKiosk", + "signature": "()", + "description": "Whether the window is in kiosk mode.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [], + "urlFragment": "#winiskiosk" + }, + { + "name": "isTabletMode", + "signature": "()", + "description": "Whether the window is in Windows 10 tablet mode.\n\nSince Windows 10 users can use their PC as tablet, under this mode apps can choose to optimize their UI for tablets, such as enlarging the titlebar and hiding titlebar buttons.\n\nThis API returns whether the window is in tablet mode, and the `resize` event can be be used to listen to changes to tablet mode.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winistabletmode-windows" + }, + { + "name": "getMediaSourceId", + "signature": "()", + "description": "Window id in the format of DesktopCapturerSource's id. For example \"window:1324:0\".\n\nMore precisely the format is `window:id:other_id` where `id` is `HWND` on Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on Linux. `other_id` is used to identify web contents (tabs) so within the same top level window.", + "parameters": [], + "returns": { + "collection": false, + "type": "String", + "possibleValues": null + }, + "additionalTags": [], + "urlFragment": "#wingetmediasourceid" + }, + { + "name": "getNativeWindowHandle", + "signature": "()", + "description": "The platform-specific handle of the window.\n\nThe native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Window` (`unsigned long`) on Linux.", + "parameters": [], + "returns": { + "collection": false, + "type": "Buffer" + }, + "additionalTags": [], + "urlFragment": "#wingetnativewindowhandle" + }, + { + "name": "hookWindowMessage", + "signature": "(message, callback)", + "description": "Hooks a windows message. The `callback` is called when the message is received in the WndProc.", + "parameters": [ + { + "name": "message", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + }, + { + "name": "callback", + "description": "", + "required": true, + "collection": false, + "type": "Function", + "parameters": [ + { + "name": "wParam", + "description": "The `wParam` provided to the WndProc", + "required": true, + "collection": false, + "type": "Buffer" + }, + { + "name": "lParam", + "description": "The `lParam` provided to the WndProc", + "required": true, + "collection": false, + "type": "Buffer" + } + ], + "returns": null + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winhookwindowmessagemessage-callback-windows" + }, + { + "name": "isWindowMessageHooked", + "signature": "(message)", + "description": "`true` or `false` depending on whether the message is hooked.", + "parameters": [ + { + "name": "message", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + } + ], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winiswindowmessagehookedmessage-windows" + }, + { + "name": "unhookWindowMessage", + "signature": "(message)", + "description": "Unhook the window message.", + "parameters": [ + { + "name": "message", + "description": "", + "required": true, + "collection": false, + "type": "Integer" + } + ], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winunhookwindowmessagemessage-windows" + }, + { + "name": "unhookAllWindowMessages", + "signature": "()", + "description": "Unhooks all of the window messages.", + "parameters": [], + "returns": null, + "additionalTags": [ + "os_windows" + ], + "urlFragment": "#winunhookallwindowmessages-windows" + }, + { + "name": "setRepresentedFilename", + "signature": "(filename)", + "description": "Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar.", + "parameters": [ + { + "name": "filename", + "description": "", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetrepresentedfilenamefilename-macos" + }, + { + "name": "getRepresentedFilename", + "signature": "()", + "description": "The pathname of the file the window represents.", + "parameters": [], + "returns": { + "collection": false, + "type": "String", + "possibleValues": null + }, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#wingetrepresentedfilename-macos" + }, + { + "name": "setDocumentEdited", + "signature": "(edited)", + "description": "Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to `true`.", + "parameters": [ + { + "name": "edited", + "description": "", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winsetdocumenteditededited-macos" + }, + { + "name": "isDocumentEdited", + "signature": "()", + "description": "Whether the window's document has been edited.", + "parameters": [], + "returns": { + "collection": false, + "type": "boolean" + }, + "additionalTags": [ + "os_macos" + ], + "urlFragment": "#winisdocumentedited-macos" + }, + { + "name": "focusOnWebView", + "signature": "()", + "description": "", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winfocusonwebview" + }, + { + "name": "blurWebView", + "signature": "()", + "description": "", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winblurwebview" + }, + { + "name": "capturePage", + "signature": "([rect, opts])", + "description": "Resolves with a NativeImage\n\nCaptures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. The page is considered visible when its browser window is hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.", + "parameters": [ + { + "name": "rect", + "description": "The bounds to capture", + "required": false, + "collection": false, + "type": "Rectangle" + }, + { + "name": "opts", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "stayHidden", + "description": " Keep the page hidden instead of visible. Default is `false`.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "boolean" + }, + { + "name": "stayAwake", + "description": " Keep the system awake instead of allowing it to sleep. Default is `false`.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "boolean" + } + ] + } + ], + "returns": { + "collection": false, + "type": "Promise", + "innerTypes": [ + { + "collection": false, + "type": "NativeImage" + } + ] + }, + "additionalTags": [], + "urlFragment": "#wincapturepagerect-opts" + }, + { + "name": "loadURL", + "signature": "(url[, options])", + "description": "the promise will resolve when the page has finished loading (see `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).\n\nSame as `webContents.loadURL(url[, options])`.\n\nThe `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol.\n\nTo ensure that file URLs are properly formatted, it is recommended to use Node's `url.format` method:\n\nYou can load a URL using a `POST` request with URL-encoded data by doing the following:", + "parameters": [ + { + "name": "url", + "description": "", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "httpReferrer", + "description": "An HTTP Referrer URL.", + "required": false, + "additionalTags": [], + "collection": false, + "type": [ + { + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "collection": false, + "type": "Referrer" + } + ] + }, + { + "name": "userAgent", + "description": "A user agent originating the request.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "extraHeaders", + "description": "Extra headers separated by \"\\n\"", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "postData", + "description": "", + "required": false, + "additionalTags": [], + "collection": true, + "type": [ + { + "collection": false, + "type": "UploadRawData" + }, + { + "collection": false, + "type": "UploadFile" + } + ] + }, + { + "name": "baseURLForDataURL", + "description": "Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + } + ] + } + ], + "returns": { + "collection": false, + "type": "Promise", + "innerTypes": [ + { + "collection": false, + "type": "void" + } + ] + }, + "additionalTags": [], + "urlFragment": "#winloadurlurl-options" + }, + { + "name": "loadFile", + "signature": "(filePath[, options])", + "description": "the promise will resolve when the page has finished loading (see `did-finish-load`), and rejects if the page fails to load (see `did-fail-load`).\n\nSame as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information.", + "parameters": [ + { + "name": "filePath", + "description": "", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "query", + "description": "Passed to `url.format()`.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "Record", + "innerTypes": [ + { + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "collection": false, + "type": "String", + "possibleValues": null + } + ] + }, + { + "name": "search", + "description": "Passed to `url.format()`.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + }, + { + "name": "hash", + "description": "Passed to `url.format()`.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "String", + "possibleValues": null + } + ] + } + ], + "returns": { + "collection": false, + "type": "Promise", + "innerTypes": [ + { + "collection": false, + "type": "void" + } + ] + }, + "additionalTags": [], + "urlFragment": "#winloadfilefilepath-options" + }, + { + "name": "reload", + "signature": "()", + "description": "Same as `webContents.reload`.", + "parameters": [], + "returns": null, + "additionalTags": [], + "urlFragment": "#winreload" + }, { "name": "setMenu", "signature": "(menu)", @@ -6219,7 +9361,7 @@ { "name": "setBrowserView", "signature": "(browserView)", - "description": "", + "description": "> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.", "parameters": [ { "name": "browserView", @@ -6240,14 +9382,15 @@ ], "returns": null, "additionalTags": [ - "stability_experimental" + "stability_experimental", + "stability_deprecated" ], - "urlFragment": "#winsetbrowserviewbrowserview-experimental" + "urlFragment": "#winsetbrowserviewbrowserview-experimental-deprecated" }, { "name": "getBrowserView", "signature": "()", - "description": "The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached.", + "description": "The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached.\n\n> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.", "parameters": [], "returns": { "collection": false, @@ -6263,14 +9406,15 @@ ] }, "additionalTags": [ - "stability_experimental" + "stability_experimental", + "stability_deprecated" ], - "urlFragment": "#wingetbrowserview-experimental" + "urlFragment": "#wingetbrowserview-experimental-deprecated" }, { "name": "addBrowserView", "signature": "(browserView)", - "description": "Replacement API for setBrowserView supporting work with multi browser views.", + "description": "Replacement API for setBrowserView supporting work with multi browser views.\n\n> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.", "parameters": [ { "name": "browserView", @@ -6282,14 +9426,15 @@ ], "returns": null, "additionalTags": [ - "stability_experimental" + "stability_experimental", + "stability_deprecated" ], - "urlFragment": "#winaddbrowserviewbrowserview-experimental" + "urlFragment": "#winaddbrowserviewbrowserview-experimental-deprecated" }, { "name": "removeBrowserView", "signature": "(browserView)", - "description": "", + "description": "> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.", "parameters": [ { "name": "browserView", @@ -6301,14 +9446,15 @@ ], "returns": null, "additionalTags": [ - "stability_experimental" + "stability_experimental", + "stability_deprecated" ], - "urlFragment": "#winremovebrowserviewbrowserview-experimental" + "urlFragment": "#winremovebrowserviewbrowserview-experimental-deprecated" }, { "name": "setTopBrowserView", "signature": "(browserView)", - "description": "Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`.", + "description": "Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`.\n\n> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.", "parameters": [ { "name": "browserView", @@ -6320,23 +9466,25 @@ ], "returns": null, "additionalTags": [ - "stability_experimental" + "stability_experimental", + "stability_deprecated" ], - "urlFragment": "#winsettopbrowserviewbrowserview-experimental" + "urlFragment": "#winsettopbrowserviewbrowserview-experimental-deprecated" }, { "name": "getBrowserViews", "signature": "()", - "description": "a sorted by z-index array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.\n\n**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases.", + "description": "a sorted by z-index array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.\n\n> **Note** The `BrowserView` class is deprecated, and replaced by the new `WebContentsView` class.", "parameters": [], "returns": { "collection": true, "type": "BrowserView" }, "additionalTags": [ - "stability_experimental" + "stability_experimental", + "stability_deprecated" ], - "urlFragment": "#wingetbrowserviews-experimental" + "urlFragment": "#wingetbrowserviews-experimental-deprecated" }, { "name": "setTitleBarOverlay", @@ -7104,8 +10252,8 @@ "description": "> Make HTTP/HTTPS requests.\n\nProcess: Main, Utility
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._\n\n`ClientRequest` implements the Writable Stream interface and is therefore an EventEmitter.", "slug": "client-request", "websiteUrl": "https://electronjs.org/docs/api/client-request", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/client-request.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/client-request.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -7799,8 +10947,8 @@ "description": "> Perform copy and paste operations on the system clipboard.\n\nProcess: Main, Renderer (non-sandboxed only)\n\nOn Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method:", "slug": "clipboard", "websiteUrl": "https://electronjs.org/docs/api/clipboard", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/clipboard.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/clipboard.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -8466,8 +11614,8 @@ "description": "", "slug": "command-line", "websiteUrl": "https://electronjs.org/docs/api/command-line", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/command-line.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/command-line.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -8594,8 +11742,8 @@ "description": "> Collect tracing data from Chromium to find performance bottlenecks and slow operations.\n\nProcess: Main\n\nThis module does not include a web interface. To view recorded traces, use trace viewer, available at `chrome://tracing` in Chrome.\n\n**Note:** You should not use this module until the `ready` event of the app module is emitted.", "slug": "content-tracing", "websiteUrl": "https://electronjs.org/docs/api/content-tracing", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/content-tracing.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/content-tracing.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -8732,8 +11880,8 @@ "description": "> Create a safe, bi-directional, synchronous bridge across isolated contexts\n\nProcess: Renderer\n\nAn example of exposing an API to a renderer from an isolated preload script is given below:\n\n```\n// Preload (Isolated World)\nconst { contextBridge, ipcRenderer } = require('electron')\n\ncontextBridge.exposeInMainWorld(\n 'electron',\n {\n doThing: () => ipcRenderer.send('do-a-thing')\n }\n)\n```\n\n### Glossary\n\n\n\n### Main World\n\nThe \"Main World\" is the JavaScript context that your main renderer code runs in. By default, the page you load in your renderer executes code in this world.\n\n### Isolated World\n\nWhen `contextIsolation` is enabled in your `webPreferences` (this is the default behavior since Electron 12.0.0), your `preload` scripts run in an \"Isolated World\". You can read more about context isolation and what it affects in the security docs.", "slug": "context-bridge", "websiteUrl": "https://electronjs.org/docs/api/context-bridge", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/context-bridge.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/context-bridge.md", + "version": "30.0.1", "type": "Module", "process": { "main": false, @@ -8809,8 +11957,8 @@ "description": "", "slug": "cookies", "websiteUrl": "https://electronjs.org/docs/api/cookies", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/cookies.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/cookies.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -9159,8 +12307,8 @@ "description": "> Submit crash reports to a remote server.\n\nProcess: Main, Renderer\n\nThe following is an example of setting up Electron to automatically submit crash reports to a remote server:\n\n```\nconst { crashReporter } = require('electron')\n\ncrashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })\n```\n\nFor setting up a server to accept and process crash reports, you can use following projects:\n\n* socorro\n* mini-breakpad-server\n\n> **Note:** Electron uses Crashpad, not Breakpad, to collect and upload crashes, but for the time being, the upload protocol is the same.\n\nOr use a 3rd party hosted solution:\n\n* Backtrace\n* Sentry\n* BugSplat\n* Bugsnag\n\nCrash reports are stored temporarily before being uploaded in a directory underneath the app's user data directory, called 'Crashpad'. You can override this directory by calling `app.setPath('crashDumps', '/path/to/crashes')` before starting the crash reporter.\n\nElectron uses crashpad to monitor and report crashes.", "slug": "crash-reporter", "websiteUrl": "https://electronjs.org/docs/api/crash-reporter", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/crash-reporter.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/crash-reporter.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -9432,8 +12580,8 @@ "description": "", "slug": "debugger", "websiteUrl": "https://electronjs.org/docs/api/debugger", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/debugger.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/debugger.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -9604,8 +12752,8 @@ "description": "> Access information about media sources that can be used to capture audio and video from the desktop using the `navigator.mediaDevices.getUserMedia` API.\n\nProcess: Main\n\nThe following example shows how to capture video from a desktop window whose title is `Electron`:\n\n```\n// In the main process.\nconst { BrowserWindow, desktopCapturer } = require('electron')\n\nconst mainWindow = new BrowserWindow()\n\ndesktopCapturer.getSources({ types: ['window', 'screen'] }).then(async sources => {\n for (const source of sources) {\n if (source.name === 'Electron') {\n mainWindow.webContents.send('SET_SOURCE', source.id)\n return\n }\n }\n})\n```\n\n```\n// In the preload script.\nconst { ipcRenderer } = require('electron')\n\nipcRenderer.on('SET_SOURCE', async (event, sourceId) => {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n mandatory: {\n chromeMediaSource: 'desktop',\n chromeMediaSourceId: sourceId,\n minWidth: 1280,\n maxWidth: 1280,\n minHeight: 720,\n maxHeight: 720\n }\n }\n })\n handleStream(stream)\n } catch (e) {\n handleError(e)\n }\n})\n\nfunction handleStream (stream) {\n const video = document.querySelector('video')\n video.srcObject = stream\n video.onloadedmetadata = (e) => video.play()\n}\n\nfunction handleError (e) {\n console.log(e)\n}\n```\n\nTo capture video from a source provided by `desktopCapturer` the constraints passed to `navigator.mediaDevices.getUserMedia` must include `chromeMediaSource: 'desktop'`, and `audio: false`.\n\nTo capture both audio and video from the entire desktop the constraints passed to `navigator.mediaDevices.getUserMedia` must include `chromeMediaSource: 'desktop'`, for both `audio` and `video`, but should not include a `chromeMediaSourceId` constraint.", "slug": "desktop-capturer", "websiteUrl": "https://electronjs.org/docs/api/desktop-capturer", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/desktop-capturer.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/desktop-capturer.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -9686,8 +12834,8 @@ "description": "> Display native system dialogs for opening and saving files, alerting, etc.\n\nProcess: Main\n\nAn example of showing a dialog to select multiple files:", "slug": "dialog", "websiteUrl": "https://electronjs.org/docs/api/dialog", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/dialog.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/dialog.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -10778,8 +13926,8 @@ "description": "", "slug": "dock", "websiteUrl": "https://electronjs.org/docs/api/dock", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/dock.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/dock.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -11023,8 +14171,8 @@ "description": "", "slug": "download-item", "websiteUrl": "https://electronjs.org/docs/api/download-item", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/download-item.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/download-item.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -11410,8 +14558,8 @@ "description": "> Detect keyboard events when the application does not have keyboard focus.\n\nProcess: Main\n\nThe `globalShortcut` module can register/unregister a global keyboard shortcut with the operating system so that you can customize the operations for various shortcuts.\n\n**Note:** The shortcut is global; it will work even if the app does not have the keyboard focus. This module cannot be used before the `ready` event of the app module is emitted.", "slug": "global-shortcut", "websiteUrl": "https://electronjs.org/docs/api/global-shortcut", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/global-shortcut.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/global-shortcut.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -11531,8 +14679,8 @@ "description": "> In-app purchases on Mac App Store.\n\nProcess: Main", "slug": "in-app-purchase", "websiteUrl": "https://electronjs.org/docs/api/in-app-purchase", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/in-app-purchase.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/in-app-purchase.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -11709,8 +14857,8 @@ "description": "", "slug": "incoming-message", "websiteUrl": "https://electronjs.org/docs/api/incoming-message", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/incoming-message.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/incoming-message.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -11858,8 +15006,8 @@ "description": "\n\n### ipcMain\n\n> Communicate asynchronously from the main process to renderer processes.\n\nProcess: Main\n\nThe `ipcMain` module is an Event Emitter. When used in the main process, it handles asynchronous and synchronous messages sent from a renderer process (web page). Messages sent from a renderer will be emitted to this module.\n\nFor usage examples, check out the IPC tutorial.\n\n### Sending messages\n\nIt is also possible to send messages from the main process to the renderer process, see webContents.send for more information.\n\n* When sending a message, the event name is the `channel`.\n* To reply to a synchronous message, you need to set `event.returnValue`.\n* To send an asynchronous message back to the sender, you can use `event.reply(...)`. This helper method will automatically handle messages coming from frames that aren't the main frame (e.g. iframes) whereas `event.sender.send(...)` will always send to the main frame.", "slug": "ipc-main", "websiteUrl": "https://electronjs.org/docs/api/ipc-main", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/ipc-main.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/ipc-main.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -12153,8 +15301,8 @@ "description": "\n\n### ipcRenderer\n\n> Communicate asynchronously from a renderer process to the main process.\n\nProcess: Renderer\n\nThe `ipcRenderer` module is an EventEmitter. It provides a few methods so you can send synchronous and asynchronous messages from the render process (web page) to the main process. You can also receive replies from the main process.\n\nSee IPC tutorial for code examples.", "slug": "ipc-renderer", "websiteUrl": "https://electronjs.org/docs/api/ipc-renderer", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/ipc-renderer.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/ipc-renderer.md", + "version": "30.0.1", "type": "Module", "process": { "main": false, @@ -12545,8 +15693,8 @@ "description": "> Add items to native application menus and context menus.\n\nProcess: Main\n\nSee `Menu` for examples.", "slug": "menu-item", "websiteUrl": "https://electronjs.org/docs/api/menu-item", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/menu-item.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/menu-item.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -12975,7 +16123,7 @@ }, { "name": "before", - "description": "Inserts this item before the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu. Also implies that the menu item in question should be placed in the same “group” as the item.", + "description": "Inserts this item before the item with the specified id. If the referenced item doesn't exist the item will be inserted at the end of the menu. Also implies that the menu item in question should be placed in the same “group” as the item.", "required": false, "additionalTags": [], "collection": true, @@ -12984,7 +16132,7 @@ }, { "name": "after", - "description": "Inserts this item after the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu.", + "description": "Inserts this item after the item with the specified id. If the referenced item doesn't exist the item will be inserted at the end of the menu.", "required": false, "additionalTags": [], "collection": true, @@ -12993,7 +16141,7 @@ }, { "name": "beforeGroupContaining", - "description": "Provides a means for a single context menu to declare the placement of their containing group before the containing group of the item with the specified label.", + "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 id.", "required": false, "additionalTags": [], "collection": true, @@ -13002,7 +16150,7 @@ }, { "name": "afterGroupContaining", - "description": "Provides a means for a single context menu to declare the placement of their containing group after the containing group of the item with the specified label.", + "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 id.", "required": false, "additionalTags": [], "collection": true, @@ -13442,8 +16590,8 @@ "description": "\n\n### Class: Menu\n\n> Create native application menus and context menus.\n\nProcess: Main", "slug": "menu", "websiteUrl": "https://electronjs.org/docs/api/menu", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/menu.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/menu.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -13816,8 +16964,8 @@ "description": "", "slug": "message-channel-main", "websiteUrl": "https://electronjs.org/docs/api/message-channel-main", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/message-channel-main.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/message-channel-main.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -13857,8 +17005,8 @@ "description": "", "slug": "message-port-main", "websiteUrl": "https://electronjs.org/docs/api/message-port-main", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/message-port-main.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/message-port-main.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -13964,8 +17112,8 @@ "description": "> Create tray, dock, and application icons using PNG or JPG files.\n\nProcess: Main, Renderer\n\nThe `nativeImage` module provides a unified interface for manipulating system images. These can be handy if you want to provide multiple scaled versions of the same icon or take advantage of macOS template images.\n\nElectron APIs that take image files accept either file paths or `NativeImage` instances. An empty and transparent image will be used when `null` is passed.\n\nFor example, when creating a Tray or setting a BrowserWindow's icon, you can either pass an image file path as a string:\n\n```\nconst { BrowserWindow, Tray } = require('electron')\n\nconst tray = new Tray('/Users/somebody/images/icon.png')\nconst win = new BrowserWindow({ icon: '/Users/somebody/images/window.png' })\n```\n\nor generate a `NativeImage` instance from the same file:\n\n### Supported Formats\n\nCurrently, `PNG` and `JPEG` image formats are supported across all platforms. `PNG` is recommended because of its support for transparency and lossless compression.\n\nOn Windows, you can also load `ICO` icons from file paths. For best visual quality, we recommend including at least the following sizes:\n\n* Small icon\n * 16x16 (100% DPI scale)\n * 20x20 (125% DPI scale)\n * 24x24 (150% DPI scale)\n * 32x32 (200% DPI scale)\n* Large icon\n * 32x32 (100% DPI scale)\n * 40x40 (125% DPI scale)\n * 48x48 (150% DPI scale)\n * 64x64 (200% DPI scale)\n * 256x256\n\nCheck the _Icon Scaling_ section in the Windows App Icon Construction reference.\n\n:::note\n\nEXIF metadata is currently not supported and will not be taken into account during image encoding and decoding.\n\n:::\n\n### High Resolution Image\n\nOn platforms that support high pixel density displays (such as Apple Retina), you can append `@2x` after image's base filename to mark it as a 2x scale high resolution image.\n\nFor example, if `icon.png` is a normal image that has standard resolution, then `icon@2x.png` will be treated as a high resolution image that has double Dots per Inch (DPI) density.\n\nIf you want to support displays with different DPI densities at the same time, you can put images with different sizes in the same folder and use the filename without DPI suffixes within Electron. For example:\n\n```\nimages/\n├── icon.png\n├── icon@2x.png\n└── icon@3x.png\n```\n\n```\nconst { Tray } = require('electron')\nconst appTray = new Tray('/Users/somebody/images/icon.png')\n```\n\nThe following suffixes for DPI are also supported:\n\n* `@1x`\n* `@1.25x`\n* `@1.33x`\n* `@1.4x`\n* `@1.5x`\n* `@1.8x`\n* `@2x`\n* `@2.5x`\n* `@3x`\n* `@4x`\n* `@5x`\n\n### Template Image _macOS_\n\nOn macOS, template images consist of black and an alpha channel. Template images are not intended to be used as standalone images and are usually mixed with other content to create the desired final appearance.\n\nThe most common case is to use template images for a menu bar (Tray) icon, so it can adapt to both light and dark menu bars.\n\nTo mark an image as a template image, its base filename should end with the word `Template` (e.g. `xxxTemplate.png`). You can also specify template images at different DPI densities (e.g. `xxxTemplate@2x.png`).", "slug": "native-image", "websiteUrl": "https://electronjs.org/docs/api/native-image", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/native-image.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/native-image.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -14211,8 +17359,8 @@ "description": "", "slug": "native-image", "websiteUrl": "https://electronjs.org/docs/api/native-image", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/native-image.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/native-image.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -14634,8 +17782,8 @@ "description": "> Read and respond to changes in Chromium's native color theme.\n\nProcess: Main", "slug": "native-theme", "websiteUrl": "https://electronjs.org/docs/api/native-theme", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/native-theme.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/native-theme.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -14734,8 +17882,8 @@ "description": "", "slug": "navigation-history", "websiteUrl": "https://electronjs.org/docs/api/navigation-history", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/navigation-history.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/navigation-history.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -14821,8 +17969,8 @@ "description": "> Logging network events for a session.\n\nProcess: Main\n\n```\nconst { app, netLog } = require('electron')\n\napp.whenReady().then(async () => {\n await netLog.startLogging('/path/to/net-log')\n // After some network events\n const path = await netLog.stopLogging()\n console.log('Net-logs written to', path)\n})\n```\n\nSee `--log-net-log` to log network events throughout the app's lifecycle.\n\n**Note:** All methods unless specified can only be used after the `ready` event of the `app` module gets emitted.", "slug": "net-log", "websiteUrl": "https://electronjs.org/docs/api/net-log", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/net-log.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/net-log.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -14937,8 +18085,8 @@ "description": "> Issue HTTP/HTTPS requests using Chromium's native networking library\n\nProcess: Main, Utility\n\nThe `net` module is a client-side API for issuing HTTP(S) requests. It is similar to the HTTP and HTTPS modules of Node.js but uses Chromium's native networking library instead of the Node.js implementation, offering better support for web proxies. It also supports checking network status.\n\nThe following is a non-exhaustive list of why you may consider using the `net` module instead of the native Node.js modules:\n\n* Automatic management of system proxy configuration, support of the wpad protocol and proxy pac configuration files.\n* Automatic tunneling of HTTPS requests.\n* Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate authentication schemes.\n* Support for traffic monitoring proxies: Fiddler-like proxies used for access control and monitoring.\n\nThe API components (including classes, methods, properties and event names) are similar to those used in Node.js.\n\nExample usage:\n\n```\nconst { app } = require('electron')\napp.whenReady().then(() => {\n const { net } = require('electron')\n const request = net.request('https://github.com')\n request.on('response', (response) => {\n console.log(`STATUS: ${response.statusCode}`)\n console.log(`HEADERS: ${JSON.stringify(response.headers)}`)\n response.on('data', (chunk) => {\n console.log(`BODY: ${chunk}`)\n })\n response.on('end', () => {\n console.log('No more data in response.')\n })\n })\n request.end()\n})\n```\n\nThe `net` API can be used only after the application emits the `ready` event. Trying to use the module before the `ready` event will throw an error.", "slug": "net", "websiteUrl": "https://electronjs.org/docs/api/net", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/net.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/net.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -15178,8 +18326,8 @@ "description": "> Create OS desktop notifications\n\nProcess: Main\n\n:::info Renderer process notifications\n\nIf you want to show notifications from a renderer process you should use the web Notifications API\n\n:::\n\n### Class: Notification\n\n> Create OS desktop notifications\n\nProcess: Main\n\n`Notification` is an EventEmitter.\n\nIt creates a new `Notification` with native properties as set by the `options`.\n\n### Static Methods\n\nThe `Notification` class has the following static methods:\n\n### `Notification.isSupported()`\n\nReturns `boolean` - Whether or not desktop notifications are supported on the current system", "slug": "notification", "websiteUrl": "https://electronjs.org/docs/api/notification", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/notification.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/notification.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -15685,8 +18833,8 @@ "description": "> Interface for communication with parent process.\n\nProcess: Utility\n\n`parentPort` is an EventEmitter. _This object is not exported from the `'electron'` module. It is only available as a property of the process object in the Electron API._", "slug": "parent-port", "websiteUrl": "https://electronjs.org/docs/api/parent-port", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/parent-port.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/parent-port.md", + "version": "30.0.1", "type": "Module", "process": { "main": false, @@ -15757,8 +18905,8 @@ "description": "> Monitor power state changes.\n\nProcess: Main", "slug": "power-monitor", "websiteUrl": "https://electronjs.org/docs/api/power-monitor", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/power-monitor.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/power-monitor.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -15986,8 +19134,8 @@ "description": "> Block the system from entering low-power (sleep) mode.\n\nProcess: Main\n\nFor example:", "slug": "power-save-blocker", "websiteUrl": "https://electronjs.org/docs/api/power-save-blocker", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/power-save-blocker.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/power-save-blocker.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -16073,11 +19221,11 @@ }, { "name": "process", - "description": "> Extensions to process object.\n\nProcess: Main, Renderer\n\nElectron's `process` object is extended from the Node.js `process` object. It adds the following events, properties, and methods:\n\n### Sandbox\n\nIn sandboxed renderers the `process` object contains only a subset of the APIs:\n\n* `crash()`\n* `hang()`\n* `getCreationTime()`\n* `getHeapStatistics()`\n* `getBlinkMemoryInfo()`\n* `getProcessMemoryInfo()`\n* `getSystemMemoryInfo()`\n* `getSystemVersion()`\n* `getCPUUsage()`\n* `getIOCounters()`\n* `uptime()`\n* `argv`\n* `execPath`\n* `env`\n* `pid`\n* `arch`\n* `platform`\n* `sandboxed`\n* `contextIsolated`\n* `type`\n* `version`\n* `versions`\n* `mas`\n* `windowsStore`\n* `contextId`", + "description": "> Extensions to process object.\n\nProcess: Main, Renderer\n\nElectron's `process` object is extended from the Node.js `process` object. It adds the following events, properties, and methods:\n\n### Sandbox\n\nIn sandboxed renderers the `process` object contains only a subset of the APIs:\n\n* `crash()`\n* `hang()`\n* `getCreationTime()`\n* `getHeapStatistics()`\n* `getBlinkMemoryInfo()`\n* `getProcessMemoryInfo()`\n* `getSystemMemoryInfo()`\n* `getSystemVersion()`\n* `getCPUUsage()`\n* `uptime()`\n* `argv`\n* `execPath`\n* `env`\n* `pid`\n* `arch`\n* `platform`\n* `sandboxed`\n* `contextIsolated`\n* `type`\n* `version`\n* `versions`\n* `mas`\n* `windowsStore`\n* `contextId`", "slug": "process", "websiteUrl": "https://electronjs.org/docs/api/process", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/process.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/process.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -16128,21 +19276,6 @@ "additionalTags": [], "urlFragment": "#processgetcpuusage" }, - { - "name": "getIOCounters", - "signature": "()", - "description": "", - "parameters": [], - "returns": { - "collection": false, - "type": "IOCounters" - }, - "additionalTags": [ - "os_windows", - "os_linux" - ], - "urlFragment": "#processgetiocounters-windows-linux" - }, { "name": "getHeapStatistics", "signature": "()", @@ -16608,8 +19741,8 @@ "description": "> Register a custom protocol and intercept existing protocol requests.\n\nProcess: Main\n\nAn example of implementing a protocol that has the same effect as the `file://` protocol:\n\n```\nconst { app, protocol, net } = require('electron')\n\napp.whenReady().then(() => {\n protocol.handle('atom', (request) =>\n net.fetch('file://' + request.url.slice('atom://'.length)))\n})\n```\n\n**Note:** All methods unless specified can only be used after the `ready` event of the `app` module gets emitted.\n\n### Using `protocol` with a custom `partition` or `session`\n\nA protocol is registered to a specific Electron `session` object. If you don't specify a session, then your `protocol` will be applied to the default session that Electron uses. However, if you define a `partition` or `session` on your `browserWindow`'s `webPreferences`, then that window will use a different session and your custom protocol will not work if you just use `electron.protocol.XXX`.\n\nTo have your custom protocol work in combination with a custom session, you need to register it to that session explicitly.\n\n```\nconst { app, BrowserWindow, net, protocol, session } = require('electron')\nconst path = require('node:path')\nconst url = require('url')\n\napp.whenReady().then(() => {\n const partition = 'persist:example'\n const ses = session.fromPartition(partition)\n\n ses.protocol.handle('atom', (request) => {\n const filePath = request.url.slice('atom://'.length)\n return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())\n })\n\n const mainWindow = new BrowserWindow({ webPreferences: { partition } })\n})\n```", "slug": "protocol", "websiteUrl": "https://electronjs.org/docs/api/protocol", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/protocol.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/protocol.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -17475,8 +20608,8 @@ "description": "Process: Main\n\n> Register for and receive notifications from remote push notification services\n\nFor example, when registering for push notifications via Apple push notification services (APNS):", "slug": "push-notifications", "websiteUrl": "https://electronjs.org/docs/api/push-notifications", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/push-notifications.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/push-notifications.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -17565,8 +20698,8 @@ "description": "> Allows access to simple encryption and decryption of strings for storage on the local machine.\n\nProcess: Main\n\nThis module protects data stored on disk from being accessed by other applications or users with full disk access.\n\nNote that on Mac, access to the system Keychain is required and these calls can block the current thread to collect user input. The same is true for Linux, if a password management tool is available.", "slug": "safe-storage", "websiteUrl": "https://electronjs.org/docs/api/safe-storage", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/safe-storage.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/safe-storage.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -17696,8 +20829,8 @@ "description": "> Retrieve information about screen size, displays, cursor position, etc.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n`screen` is an EventEmitter.\n\n**Note:** In the renderer / DevTools, `window.screen` is a reserved DOM property, so writing `let { screen } = require('electron')` will not work.\n\nAn example of creating a window that fills the whole screen:\n\n```\n// Retrieve information about screen size, displays, cursor position, etc.\n//\n// For more info, see:\n// https://www.electronjs.org/docs/latest/api/screen\n\nconst { app, BrowserWindow, screen } = require('electron/main')\n\nlet mainWindow = null\n\napp.whenReady().then(() => {\n // Create a window that fills the screen's available work area.\n const primaryDisplay = screen.getPrimaryDisplay()\n const { width, height } = primaryDisplay.workAreaSize\n\n mainWindow = new BrowserWindow({ width, height })\n mainWindow.loadURL('https://electronjs.org')\n})\n```\n\nAnother example of creating a window in the external display:", "slug": "screen", "websiteUrl": "https://electronjs.org/docs/api/screen", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/screen.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/screen.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -17994,8 +21127,8 @@ "description": "", "slug": "service-workers", "websiteUrl": "https://electronjs.org/docs/api/service-workers", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/service-workers.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/service-workers.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -18225,8 +21358,8 @@ "description": "> Manage browser sessions, cookies, cache, proxy settings, etc.\n\nProcess: Main\n\nThe `session` module can be used to create new `Session` objects.\n\nYou can also access the `session` of existing pages by using the `session` property of `WebContents`, or from the `session` module.", "slug": "session", "websiteUrl": "https://electronjs.org/docs/api/session", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/session.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/session.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -18331,8 +21464,8 @@ "description": "", "slug": "session", "websiteUrl": "https://electronjs.org/docs/api/session", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/session.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/session.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -19046,6 +22179,18 @@ "value": "openExternal", "description": "Request to open links in external applications." }, + { + "value": "speaker-selection", + "description": "Request to enumerate and select audio output devices via the speaker-selection permissions policy." + }, + { + "value": "storage-access", + "description": "Allows content loaded in a third-party context to request access to third-party cookies using the Storage Access API." + }, + { + "value": "top-level-storage-access", + "description": " Allow top-level sites to request third-party cookie access on behalf of embedded content originating from another site in the same related website set using the Storage Access API." + }, { "value": "window-management", "description": "Request access to enumerate screens using the `getScreenDetails` API." @@ -19053,6 +22198,10 @@ { "value": "unknown", "description": "An unrecognized permission request." + }, + { + "value": "fileSystem", + "description": "Request access to read, write, and file management capabilities using the File System API." } ] }, @@ -19075,63 +22224,25 @@ }, { "name": "details", - "description": "Some properties are only available on certain permission types.", + "description": "Additional information about the permission being requested.", "required": true, "collection": false, - "type": "Object", - "properties": [ + "type": [ { - "name": "externalURL", - "description": "The url of the `openExternal` request.", - "required": false, - "additionalTags": [], "collection": false, - "type": "String", - "possibleValues": null + "type": "PermissionRequest" }, { - "name": "securityOrigin", - "description": "The security origin of the `media` request.", - "required": false, - "additionalTags": [], "collection": false, - "type": "String", - "possibleValues": null + "type": "FilesystemPermissionRequest" }, { - "name": "mediaTypes", - "description": "The types of media access being requested, elements can be `video` or `audio`", - "required": false, - "additionalTags": [], - "collection": true, - "type": "String", - "possibleValues": [ - { - "value": "video", - "description": "" - }, - { - "value": "audio", - "description": "" - } - ] - }, - { - "name": "requestingUrl", - "description": "The last URL the requesting frame loaded", - "required": true, - "additionalTags": [], "collection": false, - "type": "String", - "possibleValues": null + "type": "MediaAccessPermissionRequest" }, { - "name": "isMainFrame", - "description": "Whether the frame making the request is the main frame", - "required": true, - "additionalTags": [], "collection": false, - "type": "boolean" + "type": "OpenExternalPermissionRequest" } ] } @@ -19243,6 +22354,14 @@ "value": "serial", "description": "Read from and write to serial devices with the Web Serial API." }, + { + "value": "storage-access", + "description": "Allows content loaded in a third-party context to request access to third-party cookies using the Storage Access API." + }, + { + "value": "top-level-storage-access", + "description": " Allow top-level sites to request third-party cookie access on behalf of embedded content originating from another site in the same related website set using the Storage Access API." + }, { "value": "usb", "description": "Expose non-standard Universal Serial Bus (USB) compatible devices services to the web with the WebUSB API." @@ -21383,8 +24502,8 @@ "description": "The `ShareMenu` class creates Share Menu on macOS, which can be used to share information from the current context to apps, social media accounts, and other services.\n\nFor including the share menu as a submenu of other menus, please use the `shareMenu` role of `MenuItem`.\n\n### Class: ShareMenu\n\n> Create share menu on macOS.\n\nProcess: Main", "slug": "share-menu", "websiteUrl": "https://electronjs.org/docs/api/share-menu", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/share-menu.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/share-menu.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -21451,8 +24570,8 @@ "description": "> Manage files and URLs using their default applications.\n\nProcess: Main, Renderer (non-sandboxed only)\n\nThe `shell` module provides functions related to desktop integration.\n\nAn example of opening a URL in the user's default browser:\n\n```\nconst { shell } = require('electron')\n\nshell.openExternal('https://github.com')\n```\n\n**Note:** While the `shell` module can be used in the renderer process, it will not function in a sandboxed renderer.", "slug": "shell", "websiteUrl": "https://electronjs.org/docs/api/shell", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/shell.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/shell.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -21694,8 +24813,8 @@ "description": "> Get system preferences.\n\nProcess: Main", "slug": "system-preferences", "websiteUrl": "https://electronjs.org/docs/api/system-preferences", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/system-preferences.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/system-preferences.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -22941,8 +26060,8 @@ "description": "> Create a button in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-button", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-button", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-button.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-button.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23133,8 +26252,8 @@ "description": "> Create a color picker in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-color-picker", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-color-picker", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-color-picker.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-color-picker.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23226,8 +26345,8 @@ "description": "> Create a group in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-group", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-group", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-group.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-group.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23269,8 +26388,8 @@ "description": "> Create a label in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-label", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-label", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-label.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-label.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23362,8 +26481,8 @@ "description": "> Instantiates a special \"other items proxy\", which nests TouchBar elements inherited from Chromium at the space indicated by the proxy. By default, this proxy is added to each TouchBar at the end of the input. For more information, see the AppKit docs on NSTouchBarItemIdentifierOtherItemsProxy\n\nNote: Only one instance of this class can be added per TouchBar.\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-other-items-proxy", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-other-items-proxy", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-other-items-proxy.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-other-items-proxy.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23387,8 +26506,8 @@ "description": "> Create a popover in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-popover", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-popover", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-popover.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-popover.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23475,8 +26594,8 @@ "description": "> Create a scrubber (a scrollable selector)\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-scrubber", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-scrubber", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-scrubber.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-scrubber.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23725,8 +26844,8 @@ "description": "> Create a segmented control (a button group) where one button has a selected state\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-segmented-control", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-segmented-control", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-segmented-control.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-segmented-control.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -23917,8 +27036,8 @@ "description": "> Create a slider in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-slider", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-slider", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-slider.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-slider.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -24041,8 +27160,8 @@ "description": "> Create a spacer between two items in the touch bar for native macOS applications\n\nProcess: Main
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._", "slug": "touch-bar-spacer", "websiteUrl": "https://electronjs.org/docs/api/touch-bar-spacer", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar-spacer.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar-spacer.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -24122,8 +27241,8 @@ "description": "\n\n### Class: TouchBar\n\n> Create TouchBar layouts for native macOS applications\n\nProcess: Main", "slug": "touch-bar", "websiteUrl": "https://electronjs.org/docs/api/touch-bar", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/touch-bar.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/touch-bar.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -24352,8 +27471,8 @@ "description": "\n\n### Class: Tray\n\n> Add icons and context menus to the system's notification area.\n\nProcess: Main\n\n`Tray` is an EventEmitter.\n\n```\nconst { app, Menu, Tray } = require('electron')\n\nlet tray = null\napp.whenReady().then(() => {\n tray = new Tray('/path/to/my/icon')\n const contextMenu = Menu.buildFromTemplate([\n { label: 'Item1', type: 'radio' },\n { label: 'Item2', type: 'radio' },\n { label: 'Item3', type: 'radio', checked: true },\n { label: 'Item4', type: 'radio' }\n ])\n tray.setToolTip('This is my application.')\n tray.setContextMenu(contextMenu)\n})\n```\n\n**Platform Considerations**\n\n**Linux**\n\n* Tray icon uses StatusNotifierItem by default, when it is not available in user's desktop environment the `GtkStatusIcon` will be used instead.\n* The `click` event is emitted when the tray icon receives activation from user, however the StatusNotifierItem spec does not specify which action would cause an activation, for some environments it is left mouse click, but for some it might be double left mouse click.\n* In order for changes made to individual `MenuItem`s to take effect, you have to call `setContextMenu` again. For example:\n\n```\nconst { app, Menu, Tray } = require('electron')\n\nlet appIcon = null\napp.whenReady().then(() => {\n appIcon = new Tray('/path/to/my/icon')\n const contextMenu = Menu.buildFromTemplate([\n { label: 'Item1', type: 'radio' },\n { label: 'Item2', type: 'radio' }\n ])\n\n // Make a change to the context menu\n contextMenu.items[1].checked = false\n\n // Call this again for Linux because we modified the context menu\n appIcon.setContextMenu(contextMenu)\n})\n```\n\n**MacOS**\n\n* Icons passed to the Tray constructor should be Template Images.\n* To make sure your icon isn't grainy on retina monitors, be sure your `@2x` image is 144dpi.\n* If you are bundling your application (e.g., with webpack for development), be sure that the file names are not being mangled or hashed. The filename needs to end in Template, and the `@2x` image needs to have the same filename as the standard image, or MacOS will not magically invert your image's colors or use the high density image.\n* 16x16 (72dpi) and 32x32@2x (144dpi) work well for most icons.\n\n**Windows**\n\n* It is recommended to use `ICO` icons to get best visual effects.", "slug": "tray", "websiteUrl": "https://electronjs.org/docs/api/tray", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/tray.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/tray.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -25170,8 +28289,8 @@ "description": "`utilityProcess` creates a child process with Node.js and Message ports enabled. It provides the equivalent of `child_process.fork` API from Node.js but instead uses Services API from Chromium to launch the child process.\n\nProcess: Main
", "slug": "utility-process", "websiteUrl": "https://electronjs.org/docs/api/utility-process", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/utility-process.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/utility-process.md", + "version": "30.0.1", "type": "Module", "process": { "main": true, @@ -25306,8 +28425,8 @@ "description": "", "slug": "utility-process", "websiteUrl": "https://electronjs.org/docs/api/utility-process", - "repoUrl": "https://github.com/electron/electron/blob/v29.3.0/docs/api/utility-process.md", - "version": "29.3.0", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/utility-process.md", + "version": "30.0.1", "type": "Class", "process": { "main": true, @@ -25455,13 +28574,220 @@ ], "instanceName": "child" }, + { + "name": "View", + "description": "> Create and layout native views.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Class: View\n\n> A basic native view.\n\nProcess: Main\n\n`View` is an EventEmitter.", + "slug": "view", + "websiteUrl": "https://electronjs.org/docs/api/view", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/view.md", + "version": "30.0.1", + "type": "Class", + "process": { + "main": true, + "renderer": false, + "utility": false, + "exported": true + }, + "constructorMethod": { + "signature": "()", + "parameters": [] + }, + "staticMethods": [], + "staticProperties": [], + "instanceMethods": [ + { + "name": "addChildView", + "signature": "(view[, index])", + "description": "", + "parameters": [ + { + "name": "view", + "description": "Child view to add.", + "required": true, + "collection": false, + "type": "View" + }, + { + "name": "index", + "description": "Index at which to insert the child view. Defaults to adding the child at the end of the child list.", + "required": false, + "collection": false, + "type": "Integer" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#viewaddchildviewview-index" + }, + { + "name": "removeChildView", + "signature": "(view)", + "description": "", + "parameters": [ + { + "name": "view", + "description": "Child view to remove.", + "required": true, + "collection": false, + "type": "View" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#viewremovechildviewview" + }, + { + "name": "setBounds", + "signature": "(bounds)", + "description": "", + "parameters": [ + { + "name": "bounds", + "description": "New bounds of the View.", + "required": true, + "collection": false, + "type": "Rectangle" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#viewsetboundsbounds" + }, + { + "name": "getBounds", + "signature": "()", + "description": "The bounds of this View, relative to its parent.", + "parameters": [], + "returns": { + "collection": false, + "type": "Rectangle" + }, + "additionalTags": [], + "urlFragment": "#viewgetbounds" + }, + { + "name": "setBackgroundColor", + "signature": "(color)", + "description": "Examples of valid `color` values:\n\n* Hex\n * `#fff` (RGB)\n * `#ffff` (ARGB)\n * `#ffffff` (RRGGBB)\n * `#ffffffff` (AARRGGBB)\n* RGB\n * `rgb\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+)\\)`\n * e.g. `rgb(255, 255, 255)`\n* RGBA\n * `rgba\\(([\\d]+),\\s*([\\d]+),\\s*([\\d]+),\\s*([\\d.]+)\\)`\n * e.g. `rgba(255, 255, 255, 1.0)`\n* HSL\n * `hsl\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)`\n * e.g. `hsl(200, 20%, 50%)`\n* HSLA\n * `hsla\\((-?[\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)`\n * e.g. `hsla(200, 20%, 50%, 0.5)`\n* Color name\n * Options are listed in SkParseColor.cpp\n * Similar to CSS Color Module Level 3 keywords, but case-sensitive.\n * e.g. `blueviolet` or `red`\n\n**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or `RGB`.", + "parameters": [ + { + "name": "color", + "description": "Color in Hex, RGB, ARGB, HSL, HSLA or named CSS color format. The alpha channel is optional for the hex type.", + "required": true, + "collection": false, + "type": "String", + "possibleValues": null + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#viewsetbackgroundcolorcolor" + }, + { + "name": "setVisible", + "signature": "(visible)", + "description": "", + "parameters": [ + { + "name": "visible", + "description": "If false, the view will be hidden from display.", + "required": true, + "collection": false, + "type": "boolean" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#viewsetvisiblevisible" + } + ], + "instanceProperties": [ + { + "name": "children", + "description": "A `View[]` property representing the child views of this view.", + "required": true, + "additionalTags": [ + "availability_readonly" + ], + "urlFragment": "#viewchildren-readonly", + "collection": true, + "type": "View" + } + ], + "instanceEvents": [ + { + "name": "bounds-changed", + "description": "Emitted when the view's bounds have changed in response to being laid out. The new bounds can be retrieved with `view.getBounds()`.", + "parameters": [], + "additionalTags": [], + "urlFragment": "#event-bounds-changed" + } + ], + "instanceName": "view" + }, + { + "name": "WebContentsView", + "extends": "View", + "description": "> A View that displays a WebContents.\n\nProcess: Main\n\nThis module cannot be used until the `ready` event of the `app` module is emitted.\n\n### Class: WebContentsView extends `View`\n\n> A View that displays a WebContents.\n\nProcess: Main\n\n`WebContentsView` inherits from `View`.\n\n`WebContentsView` is an EventEmitter.", + "slug": "web-contents-view", + "websiteUrl": "https://electronjs.org/docs/api/web-contents-view", + "repoUrl": "https://github.com/electron/electron/blob/v30.0.1/docs/api/web-contents-view.md", + "version": "30.0.1", + "type": "Class", + "process": { + "main": true, + "renderer": false, + "utility": false, + "exported": true + }, + "constructorMethod": { + "signature": "([options])", + "parameters": [ + { + "name": "options", + "description": "", + "required": false, + "collection": false, + "type": "Object", + "properties": [ + { + "name": "webPreferences", + "description": "Settings of web page's features.", + "required": false, + "additionalTags": [], + "collection": false, + "type": "WebPreferences" + } + ] + } + ] + }, + "staticMethods": [], + "staticProperties": [], + "instanceMethods": [], + "instanceProperties": [ + { + "name": "webContents", + "description": "A `WebContents` property containing a reference to the displayed `WebContents`. Use this to interact with the `WebContents`, for instance to load a URL.", + "required": true, + "additionalTags": [ + "availability_readonly" + ], + "urlFragment": "#viewwebcontents-readonly", + "collection": false, + "type": "WebContents" + } + ], + "instanceEvents": [], + "instanceName": "view" + }, { "name": "webContents", "description": "> Render and control web pages.\n\nProcess: Main\n\n`webContents` is an EventEmitter. It is responsible for rendering and controlling a web page and is a property of the `BrowserWindow` object. An example of accessing the `webContents` object:\n\n### Navigation Events\n\nSeveral events can be used to monitor navigations as they occur within a `webContents`.\n\n### Document Navigations\n\nWhen a `webContents` navigates to another page (as opposed to an in-page navigation), the following events will be fired.\n\n* `did-start-navigation`\n* `will-frame-navigate`\n* `will-navigate` (only fired when main frame navigates)\n* `will-redirect` (only fired when a redirect happens during navigation)\n* `did-redirect-navigation` (only fired when a redirect happens during navigation)\n* `did-frame-navigate`\n* `did-navigate` (only fired when main frame navigates)\n\nSubsequent events will not fire if `event.preventDefault()` is called on any of the cancellable events.\n\n### In-page Navigation\n\nIn-page navigations don't cause the page to reload, but instead navigate to a location within the current page. These events are not cancellable. For an in-page navigations, the following events will fire in this order:\n\n* `did-start-navigation`\n* `did-navigate-in-page`\n\n### Frame Navigation\n\nThe `will-navigate` and `did-navigate` events only fire when the mainFrame navigates. If you want to also observe navigations in `