From e4779eeed993e232f16a477203bfa9f35662b8fd Mon Sep 17 00:00:00 2001 From: tong Date: Wed, 27 Dec 2023 14:28:25 +0100 Subject: [PATCH] Upgrade to electron v28.1.0 --- demo/package-lock.json | 14 +- demo/package.json | 2 +- electron-api.json | 556 ++++++++++++++++---------------- haxelib.json | 2 +- src/electron/CustomScheme.hx | 6 +- src/electron/main/Protocol.hx | 2 +- src/electron/main/Session.hx | 2 + src/electron/remote/Protocol.hx | 2 +- src/electron/remote/Session.hx | 2 + 9 files changed, 302 insertions(+), 286 deletions(-) diff --git a/demo/package-lock.json b/demo/package-lock.json index ea488ef..ae93088 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -9,7 +9,7 @@ "version": "0.3.0", "license": "MIT", "devDependencies": { - "electron": "v28.0.0" + "electron": "v28.1.0" } }, "node_modules/@electron/get": { @@ -242,9 +242,9 @@ "optional": true }, "node_modules/electron": { - "version": "28.0.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-28.0.0.tgz", - "integrity": "sha512-eDhnCFBvG0PGFVEpNIEdBvyuGUBsFdlokd+CtuCe2ER3P+17qxaRfWRxMmksCOKgDHb5Wif5UxqOkZSlA4snlw==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/electron/-/electron-28.1.0.tgz", + "integrity": "sha512-82Y7o4PSWPn1o/aVwYPsgmBw6Gyf2lVHpaBu3Ef8LrLWXxytg7ZRZr/RtDqEMOzQp3+mcuy3huH84MyjdmP50Q==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -985,9 +985,9 @@ "optional": true }, "electron": { - "version": "28.0.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-28.0.0.tgz", - "integrity": "sha512-eDhnCFBvG0PGFVEpNIEdBvyuGUBsFdlokd+CtuCe2ER3P+17qxaRfWRxMmksCOKgDHb5Wif5UxqOkZSlA4snlw==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/electron/-/electron-28.1.0.tgz", + "integrity": "sha512-82Y7o4PSWPn1o/aVwYPsgmBw6Gyf2lVHpaBu3Ef8LrLWXxytg7ZRZr/RtDqEMOzQp3+mcuy3huH84MyjdmP50Q==", "dev": true, "requires": { "@electron/get": "^2.0.0", diff --git a/demo/package.json b/demo/package.json index 664cdc9..a1c311c 100644 --- a/demo/package.json +++ b/demo/package.json @@ -13,6 +13,6 @@ "start": "electron ." }, "devDependencies": { - "electron": "v28.0.0" + "electron": "v28.1.0" } } diff --git a/electron-api.json b/electron-api.json index 26b0a1f..7837e16 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/v28.0.0/docs/api/app.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/app.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -3043,8 +3043,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/v28.0.0/docs/api/auto-updater.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/auto-updater.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -3259,8 +3259,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/v28.0.0/docs/api/browser-view.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/browser-view.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -3420,8 +3420,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/v28.0.0/docs/api/browser-window.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/browser-window.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -7039,8 +7039,8 @@ "description": "> Make HTTP/HTTPS requests.\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._\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/v28.0.0/docs/api/client-request.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/client-request.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -7703,8 +7703,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/v28.0.0/docs/api/clipboard.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/clipboard.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -8369,8 +8369,8 @@ "description": "", "slug": "command-line", "websiteUrl": "https://electronjs.org/docs/api/command-line", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/command-line.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/command-line.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -8496,8 +8496,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/v28.0.0/docs/api/content-tracing.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/content-tracing.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -8633,8 +8633,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/v28.0.0/docs/api/context-bridge.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/context-bridge.md", + "version": "28.1.0", "type": "Module", "process": { "main": false, @@ -8709,8 +8709,8 @@ "description": "", "slug": "cookies", "websiteUrl": "https://electronjs.org/docs/api/cookies", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/cookies.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/cookies.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -9058,8 +9058,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/v28.0.0/docs/api/crash-reporter.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/crash-reporter.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -9321,8 +9321,8 @@ "description": "", "slug": "debugger", "websiteUrl": "https://electronjs.org/docs/api/debugger", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/debugger.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/debugger.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -9492,8 +9492,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/v28.0.0/docs/api/desktop-capturer.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/desktop-capturer.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -9573,8 +9573,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/v28.0.0/docs/api/dialog.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/dialog.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -10664,8 +10664,8 @@ "description": "", "slug": "dock", "websiteUrl": "https://electronjs.org/docs/api/dock", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/dock.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/dock.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -10908,8 +10908,8 @@ "description": "", "slug": "download-item", "websiteUrl": "https://electronjs.org/docs/api/download-item", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/download-item.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/download-item.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -11294,8 +11294,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/v28.0.0/docs/api/global-shortcut.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/global-shortcut.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -11414,8 +11414,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/v28.0.0/docs/api/in-app-purchase.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/in-app-purchase.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -11591,8 +11591,8 @@ "description": "", "slug": "incoming-message", "websiteUrl": "https://electronjs.org/docs/api/incoming-message", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/incoming-message.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/incoming-message.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -11739,8 +11739,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/v28.0.0/docs/api/ipc-main.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/ipc-main.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -12033,8 +12033,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/v28.0.0/docs/api/ipc-renderer.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/ipc-renderer.md", + "version": "28.1.0", "type": "Module", "process": { "main": false, @@ -12424,8 +12424,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/v28.0.0/docs/api/menu-item.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/menu-item.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -13320,8 +13320,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/v28.0.0/docs/api/menu.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/menu.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -13693,8 +13693,8 @@ "description": "", "slug": "message-channel-main", "websiteUrl": "https://electronjs.org/docs/api/message-channel-main", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/message-channel-main.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/message-channel-main.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -13733,8 +13733,8 @@ "description": "", "slug": "message-port-main", "websiteUrl": "https://electronjs.org/docs/api/message-port-main", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/message-port-main.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/message-port-main.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -13839,8 +13839,8 @@ "description": "> Create tray, dock, and application icons using PNG or JPG files.\n\nProcess: Main, Renderer\n\nIn Electron, for the APIs that take images, you can pass either file paths or `NativeImage` instances. An empty image will be used when `null` is passed.\n\nFor example, when creating a tray or setting a window's icon, you can pass an image file path as a `string`:\n\n```\nconst { BrowserWindow, Tray } = require('electron')\n\nconst appIcon = new Tray('/Users/somebody/images/icon.png')\nconst win = new BrowserWindow({ icon: '/Users/somebody/images/window.png' })\nconsole.log(appIcon, win)\n```\n\nOr read the image from the clipboard, which returns a `NativeImage`:\n\n### Supported Formats\n\nCurrently `PNG` and `JPEG` image formats are supported. `PNG` is recommended because of its support for transparency and lossless compression.\n\nOn Windows, you can also load `ICO` icons from file paths. For best visual quality, it is recommended to include at least the following sizes in the:\n\n* Small icon\n * 16x16 (100% DPI scale)\n * 20x20 (125% DPI scale)\n * 24x24 (150% DPI scale)\n * 32x32 (200% DPI scale)\n* Large icon\n * 32x32 (100% DPI scale)\n * 40x40 (125% DPI scale)\n * 48x48 (150% DPI scale)\n * 64x64 (200% DPI scale)\n * 256x256\n\nCheck the _Size requirements_ section in this article.\n\n### High Resolution Image\n\nOn platforms that have high-DPI support such as Apple Retina displays, you can append `@2x` after image's base filename to mark it as a high resolution image.\n\nFor example, if `icon.png` is a normal image that has standard resolution, then `icon@2x.png` will be treated as a high resolution image that has double DPI density.\n\nIf you want to support displays with different DPI densities at the same time, you can put images with different sizes in the same folder and use the filename without DPI suffixes. For example:\n\n```\nimages/\n├── icon.png\n├── icon@2x.png\n└── icon@3x.png\n```\n\n```\nconst { Tray } = require('electron')\nconst appIcon = new Tray('/Users/somebody/images/icon.png')\nconsole.log(appIcon)\n```\n\nThe following suffixes for DPI are also supported:\n\n* `@1x`\n* `@1.25x`\n* `@1.33x`\n* `@1.4x`\n* `@1.5x`\n* `@1.8x`\n* `@2x`\n* `@2.5x`\n* `@3x`\n* `@4x`\n* `@5x`\n\n### Template Image\n\nTemplate images consist of black and an alpha channel. Template images are not intended to be used as standalone images and are usually mixed with other content to create the desired final appearance.\n\nThe most common case is to use template images for a menu bar icon, so it can adapt to both light and dark menu bars.\n\n**Note:** Template image is only supported on macOS.\n\nTo mark an image as a template image, its filename should end with the word `Template`. For example:\n\n* `xxxTemplate.png`\n* `xxxTemplate@2x.png`", "slug": "native-image", "websiteUrl": "https://electronjs.org/docs/api/native-image", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/native-image.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/native-image.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -14085,8 +14085,8 @@ "description": "", "slug": "native-image", "websiteUrl": "https://electronjs.org/docs/api/native-image", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/native-image.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/native-image.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -14507,8 +14507,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/v28.0.0/docs/api/native-theme.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/native-theme.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -14606,8 +14606,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/v28.0.0/docs/api/net-log.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/net-log.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -14721,8 +14721,8 @@ "description": "> Issue HTTP/HTTPS requests using Chromium's native networking library\n\nProcess: Main\n\nThe `net` module is a client-side API for issuing HTTP(S) requests. It is similar to the HTTP and HTTPS modules of Node.js but uses Chromium's native networking library instead of the Node.js implementation, offering better support for web proxies. It also supports checking network status.\n\nThe following is a non-exhaustive list of why you may consider using the `net` module instead of the native Node.js modules:\n\n* Automatic management of system proxy configuration, support of the wpad protocol and proxy pac configuration files.\n* Automatic tunneling of HTTPS requests.\n* Support for authenticating proxies using basic, digest, NTLM, Kerberos or negotiate authentication schemes.\n* Support for traffic monitoring proxies: Fiddler-like proxies used for access control and monitoring.\n\nThe API components (including classes, methods, properties and event names) are similar to those used in Node.js.\n\nExample usage:\n\n```\nconst { app } = require('electron')\napp.whenReady().then(() => {\n const { net } = require('electron')\n const request = net.request('https://github.com')\n request.on('response', (response) => {\n console.log(`STATUS: ${response.statusCode}`)\n console.log(`HEADERS: ${JSON.stringify(response.headers)}`)\n response.on('data', (chunk) => {\n console.log(`BODY: ${chunk}`)\n })\n response.on('end', () => {\n console.log('No more data in response.')\n })\n })\n request.end()\n})\n```\n\nThe `net` API can be used only after the application emits the `ready` event. Trying to use the module before the `ready` event will throw an error.", "slug": "net", "websiteUrl": "https://electronjs.org/docs/api/net", - "repoUrl": "https://github.com/electron/electron/blob/v28.0.0/docs/api/net.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/net.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -14961,8 +14961,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/v28.0.0/docs/api/notification.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/notification.md", + "version": "28.1.0", "type": "Class", "process": { "main": true, @@ -15467,8 +15467,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/v28.0.0/docs/api/parent-port.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/parent-port.md", + "version": "28.1.0", "type": "Module", "process": { "main": false, @@ -15538,8 +15538,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/v28.0.0/docs/api/power-monitor.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/power-monitor.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -15766,8 +15766,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/v28.0.0/docs/api/power-save-blocker.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/power-save-blocker.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -15855,8 +15855,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/v28.0.0/docs/api/process.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/process.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -16386,8 +16386,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/v28.0.0/docs/api/protocol.md", - "version": "28.0.0", + "repoUrl": "https://github.com/electron/electron/blob/v28.1.0/docs/api/protocol.md", + "version": "28.1.0", "type": "Module", "process": { "main": true, @@ -16398,7 +16398,7 @@ { "name": "registerSchemesAsPrivileged", "signature": "(customSchemes)", - "description": "**Note:** This method can only be used before the `ready` event of the `app` module gets emitted and can be called only once.\n\nRegisters the `scheme` as standard, secure, bypasses content security policy for resources, allows registering ServiceWorker, supports fetch API, and streaming video/audio. Specify a privilege with the value of `true` to enable the capability.\n\nAn example of registering a privileged scheme, that bypasses Content Security Policy:\n\nA standard scheme adheres to what RFC 3986 calls generic URI syntax. For example `http` and `https` are standard schemes, while `file` is not.\n\nRegistering a scheme as standard allows relative and absolute resources to be resolved correctly when served. Otherwise the scheme will behave like the `file` protocol, but without the ability to resolve relative URLs.\n\nFor example when you load following page with custom protocol without registering it as standard scheme, the image will not be loaded because non-standard schemes can not recognize relative URLs:\n\nRegistering a scheme as standard will allow access to files through the FileSystem API. Otherwise the renderer will throw a security error for the scheme.\n\nBy default web storage apis (localStorage, sessionStorage, webSQL, indexedDB, cookies) are disabled for non standard schemes. So in general if you want to register a custom protocol to replace the `http` protocol, you have to register it as a standard scheme.\n\nProtocols that use streams (http and stream protocols) should set `stream: true`. The `