From d88d6007c292446c9164cf1df7d6487ca198e490 Mon Sep 17 00:00:00 2001 From: tong Date: Thu, 14 Mar 2024 17:22:50 +0100 Subject: [PATCH] Upgrade to electron v29.1.4 --- demo/package-lock.json | 14 +- demo/package.json | 2 +- electron-api.json | 745 ++++++++++++++++++--------------- haxelib.json | 2 +- src/electron/NativeImage.hx | 20 +- src/electron/ProxyConfig.hx | 65 +++ src/electron/main/App.hx | 5 + src/electron/main/Session.hx | 58 +-- src/electron/remote/App.hx | 5 + src/electron/remote/Session.hx | 58 +-- 10 files changed, 494 insertions(+), 480 deletions(-) create mode 100644 src/electron/ProxyConfig.hx diff --git a/demo/package-lock.json b/demo/package-lock.json index c2b0fb8..01a74b7 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -9,7 +9,7 @@ "version": "0.3.0", "license": "MIT", "devDependencies": { - "electron": "v29.0.1" + "electron": "v29.1.4" } }, "node_modules/@electron/get": { @@ -245,9 +245,9 @@ "optional": true }, "node_modules/electron": { - "version": "29.0.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-29.0.1.tgz", - "integrity": "sha512-hsQr9clm8NCAMv4uhHlXThHn52UAgrHgyz3ubBAxZIPuUcpKVDtg4HPmx4hbmHIbYICI5OyLN3Ztp7rS+Dn4Lw==", + "version": "29.1.4", + "resolved": "https://registry.npmjs.org/electron/-/electron-29.1.4.tgz", + "integrity": "sha512-IWXys0SqgmIfrqXusUGQC0gGG7CCqA5vfmNsUMj8dFkAnK3lisKyjSESStWlrsste/OX/AAC5wsVlf23reUNnw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -997,9 +997,9 @@ "optional": true }, "electron": { - "version": "29.0.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-29.0.1.tgz", - "integrity": "sha512-hsQr9clm8NCAMv4uhHlXThHn52UAgrHgyz3ubBAxZIPuUcpKVDtg4HPmx4hbmHIbYICI5OyLN3Ztp7rS+Dn4Lw==", + "version": "29.1.4", + "resolved": "https://registry.npmjs.org/electron/-/electron-29.1.4.tgz", + "integrity": "sha512-IWXys0SqgmIfrqXusUGQC0gGG7CCqA5vfmNsUMj8dFkAnK3lisKyjSESStWlrsste/OX/AAC5wsVlf23reUNnw==", "dev": true, "requires": { "@electron/get": "^2.0.0", diff --git a/demo/package.json b/demo/package.json index bc4ae3e..33f3558 100644 --- a/demo/package.json +++ b/demo/package.json @@ -13,6 +13,6 @@ "start": "electron ." }, "devDependencies": { - "electron": "v29.0.1" + "electron": "v29.1.4" } } diff --git a/electron-api.json b/electron-api.json index 48c9b92..cb3b229 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.0.1/docs/api/app.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/app.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -1898,6 +1898,50 @@ "os_macos" ], "urlFragment": "#appsetsecurekeyboardentryenabledenabled-macos" + }, + { + "name": "setProxy", + "signature": "(config)", + "description": "", + "parameters": [ + { + "name": "config", + "description": "", + "required": true, + "collection": false, + "type": "ProxyConfig" + } + ], + "returns": null, + "additionalTags": [], + "urlFragment": "#appsetproxyconfig" + }, + { + "name": "resolveProxy", + "signature": "(url)", + "description": "Resolves with the proxy information for `url` that will be used when attempting to make requests using Net in the utility process.", + "parameters": [ + { + "name": "url", + "description": "", + "required": true, + "collection": false, + "type": "URL" + } + ], + "returns": { + "collection": false, + "type": "Promise", + "innerTypes": [ + { + "collection": false, + "type": "String", + "possibleValues": null + } + ] + }, + "additionalTags": [], + "urlFragment": "#appresolveproxyurl" } ], "properties": [ @@ -3061,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.0.1/docs/api/auto-updater.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/auto-updater.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -3278,8 +3322,8 @@ "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.0.1/docs/api/browser-view.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/browser-view.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -3440,8 +3484,8 @@ "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.0.1/docs/api/browser-window.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/browser-window.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -7060,8 +7104,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.0.1/docs/api/client-request.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/client-request.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -7725,8 +7769,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.0.1/docs/api/clipboard.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/clipboard.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -8392,8 +8436,8 @@ "description": "", "slug": "command-line", "websiteUrl": "https://electronjs.org/docs/api/command-line", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/command-line.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/command-line.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -8520,8 +8564,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.0.1/docs/api/content-tracing.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/content-tracing.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -8658,8 +8702,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.0.1/docs/api/context-bridge.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/context-bridge.md", + "version": "29.1.4", "type": "Module", "process": { "main": false, @@ -8735,8 +8779,8 @@ "description": "", "slug": "cookies", "websiteUrl": "https://electronjs.org/docs/api/cookies", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/cookies.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/cookies.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -9085,8 +9129,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.0.1/docs/api/crash-reporter.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/crash-reporter.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -9358,8 +9402,8 @@ "description": "", "slug": "debugger", "websiteUrl": "https://electronjs.org/docs/api/debugger", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/debugger.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/debugger.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -9530,8 +9574,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.0.1/docs/api/desktop-capturer.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/desktop-capturer.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -9612,8 +9656,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.0.1/docs/api/dialog.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/dialog.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -10704,8 +10748,8 @@ "description": "", "slug": "dock", "websiteUrl": "https://electronjs.org/docs/api/dock", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/dock.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/dock.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -10949,8 +10993,8 @@ "description": "", "slug": "download-item", "websiteUrl": "https://electronjs.org/docs/api/download-item", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/download-item.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/download-item.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -11336,8 +11380,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.0.1/docs/api/global-shortcut.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/global-shortcut.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -11457,8 +11501,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.0.1/docs/api/in-app-purchase.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/in-app-purchase.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -11635,8 +11679,8 @@ "description": "", "slug": "incoming-message", "websiteUrl": "https://electronjs.org/docs/api/incoming-message", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/incoming-message.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/incoming-message.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -11784,8 +11828,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.0.1/docs/api/ipc-main.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/ipc-main.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -12079,8 +12123,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.0.1/docs/api/ipc-renderer.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/ipc-renderer.md", + "version": "29.1.4", "type": "Module", "process": { "main": false, @@ -12471,8 +12515,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.0.1/docs/api/menu-item.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/menu-item.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -13368,8 +13412,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.0.1/docs/api/menu.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/menu.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -13742,8 +13786,8 @@ "description": "", "slug": "message-channel-main", "websiteUrl": "https://electronjs.org/docs/api/message-channel-main", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/message-channel-main.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/message-channel-main.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -13783,8 +13827,8 @@ "description": "", "slug": "message-port-main", "websiteUrl": "https://electronjs.org/docs/api/message-port-main", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/message-port-main.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/message-port-main.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -13887,11 +13931,11 @@ }, { "name": "nativeImage", - "description": "> Create tray, dock, and application icons using PNG or JPG files.\n\nProcess: Main, Renderer\n\nIn Electron, for the APIs that take images, you can pass either file paths or `NativeImage` instances. An empty image will be used when `null` is passed.\n\nFor example, when creating a tray or setting a window's icon, you can pass an image file path as a `string`:\n\n```\nconst { BrowserWindow, Tray } = require('electron')\n\nconst appIcon = new Tray('/Users/somebody/images/icon.png')\nconst win = new BrowserWindow({ icon: '/Users/somebody/images/window.png' })\nconsole.log(appIcon, win)\n```\n\nOr read the image from the clipboard, which returns a `NativeImage`:\n\n### Supported Formats\n\nCurrently `PNG` and `JPEG` image formats are supported. `PNG` is recommended because of its support for transparency and lossless compression.\n\nOn Windows, you can also load `ICO` icons from file paths. For best visual quality, it is recommended to include at least the following sizes in the:\n\n* Small icon\n * 16x16 (100% DPI scale)\n * 20x20 (125% DPI scale)\n * 24x24 (150% DPI scale)\n * 32x32 (200% DPI scale)\n* Large icon\n * 32x32 (100% DPI scale)\n * 40x40 (125% DPI scale)\n * 48x48 (150% DPI scale)\n * 64x64 (200% DPI scale)\n * 256x256\n\nCheck the _Size requirements_ section in this article.\n\n:::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 have high-DPI support such as Apple Retina displays, you can append `@2x` after image's base filename to mark it as a high resolution image.\n\nFor example, if `icon.png` is a normal image that has standard resolution, then `icon@2x.png` will be treated as a high resolution image that has double DPI density.\n\nIf you want to support displays with different DPI densities at the same time, you can put images with different sizes in the same folder and use the filename without DPI suffixes. For example:\n\n```\nimages/\n├── icon.png\n├── icon@2x.png\n└── icon@3x.png\n```\n\n```\nconst { Tray } = require('electron')\nconst appIcon = new Tray('/Users/somebody/images/icon.png')\nconsole.log(appIcon)\n```\n\nThe following suffixes for DPI are also supported:\n\n* `@1x`\n* `@1.25x`\n* `@1.33x`\n* `@1.4x`\n* `@1.5x`\n* `@1.8x`\n* `@2x`\n* `@2.5x`\n* `@3x`\n* `@4x`\n* `@5x`\n\n### Template Image\n\nTemplate images consist of black and an alpha channel. Template images are not intended to be used as standalone images and are usually mixed with other content to create the desired final appearance.\n\nThe most common case is to use template images for a menu bar icon, so it can adapt to both light and dark menu bars.\n\n**Note:** Template image is only supported on macOS.\n\nTo mark an image as a template image, its filename should end with the word `Template`. For example:\n\n* `xxxTemplate.png`\n* `xxxTemplate@2x.png`", + "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.0.1/docs/api/native-image.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/native-image.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -13956,7 +14000,7 @@ "parameters": [ { "name": "path", - "description": "", + "description": "path to a file that we intend to construct an image out of.", "required": true, "collection": false, "type": "String", @@ -14079,7 +14123,7 @@ { "name": "createFromDataURL", "signature": "(dataURL)", - "description": "Creates a new `NativeImage` instance from `dataURL`.", + "description": "Creates a new `NativeImage` instance from `dataUrl`, a base 64 encoded Data URL string.", "parameters": [ { "name": "dataURL", @@ -14100,7 +14144,7 @@ { "name": "createFromNamedImage", "signature": "(imageName[, hslShift])", - "description": "Creates a new `NativeImage` instance from the NSImage that maps to the given image name. See `System Icons` for a list of possible values.\n\nThe `hslShift` is applied to the image with the following rules:\n\n* `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0 and 360 on the hue color wheel (red).\n* `hsl_shift[1]` (saturation): A saturation shift for the image, with the following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully saturate the image.\n* `hsl_shift[2]` (lightness): A lightness shift for the image, with the following key values: 0 = remove all lightness (make all pixels black). 0.5 = leave unchanged. 1 = full lightness (make all pixels white).\n\nThis means that `[-1, 0, 1]` will make the image completely white and `[-1, 1, 0]` will make the image completely black.\n\nIn some cases, the `NSImageName` doesn't match its string representation; one example of this is `NSFolderImageName`, whose string representation would actually be `NSFolder`. Therefore, you'll need to determine the correct string representation for your image before passing it in. This can be done with the following:\n\n`echo -e '#import \\nint main() { NSLog(@\"%@\", SYSTEM_IMAGE_NAME); }' | clang -otest -x objective-c -framework Cocoa - && ./test`\n\nwhere `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.", + "description": "Creates a new `NativeImage` instance from the `NSImage` that maps to the given image name. See Apple's `NSImageName` documentation for a list of possible values.\n\nThe `hslShift` is applied to the image with the following rules:\n\n* `hsl_shift[0]` (hue): The absolute hue value for the image - 0 and 1 map to 0 and 360 on the hue color wheel (red).\n* `hsl_shift[1]` (saturation): A saturation shift for the image, with the following key values: 0 = remove all color. 0.5 = leave unchanged. 1 = fully saturate the image.\n* `hsl_shift[2]` (lightness): A lightness shift for the image, with the following key values: 0 = remove all lightness (make all pixels black). 0.5 = leave unchanged. 1 = full lightness (make all pixels white).\n\nThis means that `[-1, 0, 1]` will make the image completely white and `[-1, 1, 0]` will make the image completely black.\n\nIn some cases, the `NSImageName` doesn't match its string representation; one example of this is `NSFolderImageName`, whose string representation would actually be `NSFolder`. Therefore, you'll need to determine the correct string representation for your image before passing it in. This can be done with the following:\n\nwhere `SYSTEM_IMAGE_NAME` should be replaced with any value from this list.", "parameters": [ { "name": "imageName", @@ -14137,8 +14181,8 @@ "description": "", "slug": "native-image", "websiteUrl": "https://electronjs.org/docs/api/native-image", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/native-image.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/native-image.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -14233,7 +14277,7 @@ { "name": "toDataURL", "signature": "([options])", - "description": "The data URL of the image.", + "description": "The Data URL of the image.", "parameters": [ { "name": "options", @@ -14294,7 +14338,7 @@ { "name": "getNativeHandle", "signature": "()", - "description": "A Buffer that stores C pointer to underlying native handle of the image. On macOS, a pointer to `NSImage` instance would be returned.\n\nNotice that the returned pointer is a weak pointer to the underlying native image instead of a copy, so you _must_ ensure that the associated `nativeImage` instance is kept around.", + "description": "A Buffer that stores C pointer to underlying native handle of the image. On macOS, a pointer to `NSImage` instance is returned.\n\nNotice that the returned pointer is a weak pointer to the underlying native image instead of a copy, so you _must_ ensure that the associated `nativeImage` instance is kept around.", "parameters": [], "returns": { "collection": false, @@ -14340,7 +14384,7 @@ { "name": "setTemplateImage", "signature": "(option)", - "description": "Marks the image as a template image.", + "description": "Marks the image as a macOS template image.", "parameters": [ { "name": "option", @@ -14357,7 +14401,7 @@ { "name": "isTemplateImage", "signature": "()", - "description": "Whether the image is a template image.", + "description": "Whether the image is a macOS template image.", "parameters": [], "returns": { "collection": false, @@ -14449,7 +14493,7 @@ { "name": "getAspectRatio", "signature": "([scaleFactor])", - "description": "The image's aspect ratio.\n\nIf `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.", + "description": "The image's aspect ratio (width divided by height).\n\nIf `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.", "parameters": [ { "name": "scaleFactor", @@ -14469,7 +14513,7 @@ { "name": "getScaleFactors", "signature": "()", - "description": "An array of all scale factors corresponding to representations for a given nativeImage.", + "description": "An array of all scale factors corresponding to representations for a given `NativeImage`.", "parameters": [], "returns": { "collection": true, @@ -14481,7 +14525,7 @@ { "name": "addRepresentation", "signature": "(options)", - "description": "Add an image representation for a specific scale factor. This can be used to explicitly add different scale factor representations to an image. This can be called on empty images.", + "description": "Add an image representation for a specific scale factor. This can be used to programmatically add different scale factor representations to an image. This can be called on empty images.", "parameters": [ { "name": "options", @@ -14560,8 +14604,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.0.1/docs/api/native-theme.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/native-theme.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -14660,8 +14704,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.0.1/docs/api/net-log.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/net-log.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -14776,8 +14820,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.0.1/docs/api/net.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/net.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -15017,8 +15061,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.0.1/docs/api/notification.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/notification.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -15524,8 +15568,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.0.1/docs/api/parent-port.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/parent-port.md", + "version": "29.1.4", "type": "Module", "process": { "main": false, @@ -15596,8 +15640,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.0.1/docs/api/power-monitor.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/power-monitor.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -15825,8 +15869,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.0.1/docs/api/power-save-blocker.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/power-save-blocker.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -15915,8 +15959,8 @@ "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`", "slug": "process", "websiteUrl": "https://electronjs.org/docs/api/process", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/process.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/process.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -16447,8 +16491,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.0.1/docs/api/protocol.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/protocol.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -17314,8 +17358,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.0.1/docs/api/push-notifications.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/push-notifications.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -17404,8 +17448,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.0.1/docs/api/safe-storage.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/safe-storage.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -17535,8 +17579,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.0.1/docs/api/screen.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/screen.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -17833,8 +17877,8 @@ "description": "", "slug": "service-workers", "websiteUrl": "https://electronjs.org/docs/api/service-workers", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/service-workers.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/service-workers.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -18064,8 +18108,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.0.1/docs/api/session.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/session.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -18170,8 +18214,8 @@ "description": "", "slug": "session", "websiteUrl": "https://electronjs.org/docs/api/session", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/session.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/session.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -18328,73 +18372,14 @@ { "name": "setProxy", "signature": "(config)", - "description": "Resolves when the proxy setting process is complete.\n\nSets the proxy settings.\n\nWhen `mode` is unspecified, `pacScript` and `proxyRules` are provided together, the `proxyRules` option is ignored and `pacScript` configuration is applied.\n\nYou may need `ses.closeAllConnections` to close currently in flight connections to prevent pooled sockets using previous proxy from being reused by future requests.\n\nThe `proxyRules` has to follow the rules below:\n\nFor example:\n\n* `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and HTTP proxy `foopy2:80` for `ftp://` URLs.\n* `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.\n* `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing over to `bar` if `foopy:80` is unavailable, and after that using no proxy.\n* `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.\n* `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.\n* `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no proxy if `foopy` is unavailable.\n* `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use `socks4://foopy2` for all other URLs.\n\nThe `proxyBypassRules` is a comma separated list of rules described below:\n\n* `[ URL_SCHEME \"://\" ] HOSTNAME_PATTERN [ \":\" ]`\n\nMatch all hostnames that match the pattern HOSTNAME_PATTERN.\n\nExamples: \"foobar.com\", \"*foobar.com\", \"*.foobar.com\", \"*foobar.com:99\", \"https://x.*.y.com:99\"\n* `\".\" HOSTNAME_SUFFIX_PATTERN [ \":\" PORT ]`\n\nMatch a particular domain suffix.\n\nExamples: \".google.com\", \".com\", \"http://.google.com\"\n* `[ SCHEME \"://\" ] IP_LITERAL [ \":\" PORT ]`\n\nMatch URLs which are IP address literals.\n\nExamples: \"127.0.1\", \"[0:0::1]\", \"[::1]\", \"http://[::1]:99\"\n* `IP_LITERAL \"/\" PREFIX_LENGTH_IN_BITS`\n\nMatch any URL that is to an IP literal that falls between the given range. IP range is specified using CIDR notation.\n\nExamples: \"192.168.1.1/16\", \"fefe:13::abc/33\".\n* ``\n\nMatch local addresses. The meaning of `` is whether the host matches one of: \"127.0.0.1\", \"::1\", \"localhost\".", + "description": "Resolves when the proxy setting process is complete.\n\nSets the proxy settings.\n\nYou may need `ses.closeAllConnections` to close currently in flight connections to prevent pooled sockets using previous proxy from being reused by future requests.", "parameters": [ { "name": "config", "description": "", "required": true, "collection": false, - "type": "Object", - "properties": [ - { - "name": "mode", - "description": "The proxy mode. Should be one of `direct`, `auto_detect`, `pac_script`, `fixed_servers` or `system`. If it's unspecified, it will be automatically determined based on other specified options.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": [ - { - "value": "direct", - "description": "" - }, - { - "value": "auto_detect", - "description": "" - }, - { - "value": "pac_script", - "description": "" - }, - { - "value": "fixed_servers", - "description": "" - }, - { - "value": "system", - "description": "line options influence the proxy configuration." - } - ] - }, - { - "name": "pacScript", - "description": "The URL associated with the PAC file.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "proxyRules", - "description": "Rules indicating which proxies to use.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - }, - { - "name": "proxyBypassRules", - "description": "Rules indicating which URLs should bypass the proxy settings.", - "required": false, - "additionalTags": [], - "collection": false, - "type": "String", - "possibleValues": null - } - ] + "type": "ProxyConfig" } ], "returns": { @@ -21281,8 +21266,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.0.1/docs/api/share-menu.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/share-menu.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -21349,8 +21334,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.0.1/docs/api/shell.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/shell.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -21592,8 +21577,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.0.1/docs/api/system-preferences.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/system-preferences.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -22839,8 +22824,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.0.1/docs/api/touch-bar-button.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-button.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23031,8 +23016,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.0.1/docs/api/touch-bar-color-picker.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-color-picker.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23124,8 +23109,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.0.1/docs/api/touch-bar-group.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-group.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23167,8 +23152,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.0.1/docs/api/touch-bar-label.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-label.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23260,8 +23245,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.0.1/docs/api/touch-bar-other-items-proxy.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-other-items-proxy.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23285,8 +23270,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.0.1/docs/api/touch-bar-popover.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-popover.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23373,8 +23358,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.0.1/docs/api/touch-bar-scrubber.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-scrubber.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23623,8 +23608,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.0.1/docs/api/touch-bar-segmented-control.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-segmented-control.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23815,8 +23800,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.0.1/docs/api/touch-bar-slider.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-slider.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -23939,8 +23924,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.0.1/docs/api/touch-bar-spacer.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar-spacer.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -24020,8 +24005,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.0.1/docs/api/touch-bar.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/touch-bar.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -24250,8 +24235,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.0.1/docs/api/tray.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/tray.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -25068,8 +25053,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.0.1/docs/api/utility-process.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/utility-process.md", + "version": "29.1.4", "type": "Module", "process": { "main": true, @@ -25204,8 +25189,8 @@ "description": "", "slug": "utility-process", "websiteUrl": "https://electronjs.org/docs/api/utility-process", - "repoUrl": "https://github.com/electron/electron/blob/v29.0.1/docs/api/utility-process.md", - "version": "29.0.1", + "repoUrl": "https://github.com/electron/electron/blob/v29.1.4/docs/api/utility-process.md", + "version": "29.1.4", "type": "Class", "process": { "main": true, @@ -25358,8 +25343,8 @@ "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 `