Compare commits

...

152 Commits

Author SHA1 Message Date
trop[bot]
a6649ffb61 fix: instantiate tab video tracks from BrowserCaptureMediaStreamTrack (#39618)
return BrowserCaptureMediaStreamTrack instead of MediaStreamTrack

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: brhenrique <bruno.d@miro.com>
2023-08-23 09:54:54 -04:00
trop[bot]
5da1b91546 fix: chrome.tabs 'url' and 'title' are privileged information (#39607)
fix: tabs url and title are privileged information

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-22 17:28:57 +02:00
trop[bot]
1047532f1d fix: dangling raw_ptr in ElectronBrowserMainParts dtor (#39594)
* fix: dangling raw_ptr in ElectronBrowserMainParts dtor

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! fix: dangling raw_ptr in ElectronBrowserMainParts dtor

Browser::WhenReady() holds a reference to JsEnv isolate so must come after

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-08-21 15:54:27 +02:00
trop[bot]
054b99634c fix: chrome://gpu failing to load (#39584)
fix: chrome://gpu failing to load

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-21 13:48:40 +02:00
trop[bot]
6838404ecb fix: explorer restart does not recreated thumbnail toolbar buttons (#39587)
fix: explorer restart does not recreated thumbnail toolbar buttons.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: harada <harada@thinkridge.com>
2023-08-21 17:03:02 +09:00
trop[bot]
ee01054bb5 fix: use tiled edges to calculate frame inset sizes in Linux (#39571)
Adapt to the window frame size calculation changes in CL 3970920 by
setting the inset sizes to 0 for tiled edges.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
2023-08-21 10:50:46 +09:00
trop[bot]
51b074eb5e docs: note macOS bounds Tray offset (#39554)
* docs: note macOS bounds Tray offset

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* Update docs/api/browser-window.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-17 10:58:12 -04:00
trop[bot]
2e27e273ed fix: destruction order of js env fields (#39548)
isolate_ depends on isolate_holder_ and so must be destroyed first.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-08-17 11:03:15 +02:00
Keeley Hammond
86fc724d97 chore: cherry-pick 11 changes from Release-1-M115 (#39516)
* chore: [26-x-y] cherry-pick 11 changes from Release-1-M115

* d0c1b8954a1b from chromium
* 96fc6d931c97 from v8
* abb3ebd3d2ef from chromium
* fa181f8768c9 from chromium
* 896deb576574 from v8
* 337124b13aaa from chromium
* 83b0bdb696d8 from chromium
* 8d60b1d3b1be from v8
* 285c7712c506 from angle
* 2bf945775fe6 from angle
* cafe56b591ed from angle

* chore: remove patches already made in upstream

* 1459124: 311802: Prevent SDP munging of duplicate SSRCs | https://webrtc-review.googlesource.com/c/src/+/311802
2023-08-17 10:51:16 +02:00
trop[bot]
c676293bf4 docs: add missing webview render-process-gone event (#39545)
docs: add mising webview 'render-process-gone' event

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-08-16 23:05:00 -05:00
electron-roller[bot]
1afcffef53 chore: bump chromium to 116.0.5845.97 (26-x-y) (#39530)
chore: bump chromium in DEPS to 116.0.5845.97

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2023-08-16 22:22:51 +02:00
trop[bot]
04994de9e6 feat: support dns-result-order Node.js cli flag (#39501)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-08-16 14:07:15 -04:00
trop[bot]
9dea18c1db fix: crash when calling BrowserWindow.moveTop() on modal children (#39527)
fix: crash when calling moveTop() on modal children

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-16 09:56:33 -05:00
trop[bot]
ad76ef17f0 docs: update timelines for E27 (#39508)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2023-08-16 13:14:32 +02:00
trop[bot]
3d760afa36 refactor: clean up Node.js cli arg parsing (#39510)
* refactor: clean up Node.js arg parsing

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: feedback from review

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-16 09:45:06 +02:00
electron-roller[bot]
0f2df2bf9b chore: bump chromium to 116.0.5845.96 (26-x-y) (#39502)
chore: bump chromium in DEPS to 116.0.5845.96

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2023-08-15 12:28:33 -04:00
trop[bot]
64c5505b36 refactor: update WebContentsZoomController (#39495)
refactor: update WebContentsZoomController

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-15 12:18:37 +02:00
David Sanders
ad385bf1ce chore: document deprecated systemPreferences APIs (#39492)
chore: document deprecated systemPreferences APIs (#39343)

* chore: document deprecated systemPreferences APIs

* chore: forgot systemPreferences.appLevelAppearance

* test: expect deprecation messages
2023-08-14 11:19:06 -07:00
electron-roller[bot]
0a478f9ef0 chore: bump chromium to 116.0.5845.82 (26-x-y) (#39458)
* chore: bump chromium in DEPS to 116.0.5845.82

* chore: update patches

* fix: set allowFileAccess on devtools extensions correctly

Ref: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4714725

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-08-14 16:37:11 +02:00
trop[bot]
92c4697662 fix: avoid package.json check on built-in modules (#39422)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-08-14 15:01:08 +02:00
trop[bot]
ceb5230395 fix: use nested run loop in clipboard.readImage (#39487)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2023-08-14 14:49:17 +02:00
David Sanders
c09ebeac14 chore: document deprecated webContents.getPrinters API (#39459)
chore: document deprecated webContents.getPrinters API (#39356)

* chore: document deprecated webContents.getPrinters API

* chore: remove duplicate deprecation warning
2023-08-14 10:34:40 +02:00
trop[bot]
5f1ada46f5 feat: support minimum_chrome_version manifest key (#39357)
feat: support minimum_chrome_version extension key

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-14 10:06:41 +02:00
trop[bot]
ca899eb3cb feat: add support for chrome.tabs.query (#39431)
* feat: add support for tabs.query

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: scope to webContents in current session

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* test: add test for session behavior

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-14 10:05:59 +02:00
trop[bot]
c709e04bed chore: update _api_features manifest requirements (#39436)
chore: update api_resources manifest requirements

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-14 10:03:52 +02:00
trop[bot]
f9e35e4aaa feat: allow more Node.js cli flags in main process (#39373)
* feat: allow more Node.js cli flags in main process

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* docs: update cli switch documentation

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-09 19:27:22 -04:00
Shelley Vohr
d2ca670f3f fix: macOS tray button selection with VoiceOver (#39439) 2023-08-09 21:41:43 +02:00
trop[bot]
4930f71a76 chore: update chrome.runtime.getPlatformInfo impl (#39416)
chore: update chrome.runtime.getPlatformInfo impl

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-09 19:03:12 +02:00
trop[bot]
1c458c5eaf chore: remove i18n JSON spec (#39414)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-09 09:36:46 -04:00
trop[bot]
9c028cd279 test: helper to expect deprecation warnings (#39429)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-08-09 14:47:01 +02:00
trop[bot]
fd8d4a8b94 fix: crash when closing active macOS native tab (#39410)
fix: crash when closing current active macOS native tab

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-08-08 22:28:38 +02:00
trop[bot]
35126e06b6 fix: removeBrowserView draggable region removal (#39406)
fix: removeBrowserView draggable region removal

Closes https://github.com/electron/electron/issues/39377.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-08 13:49:14 +02:00
John Kleinschmidt
3e239efd99 ci: fix hang when validating AppVeyor artifacts (#39362) (#39397)
(cherry picked from commit 1eb6e45a36)
2023-08-07 15:40:01 -04:00
trop[bot]
66f42b3256 fix: chrome.tabs.update return value (#39389)
fix: chrome.tabs.update return value

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-07 12:38:19 +02:00
electron-roller[bot]
4586a40bfd chore: bump chromium to 116.0.5845.62 (26-x-y) (#39366)
* chore: bump chromium in DEPS to 116.0.5845.62

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-08-07 11:21:21 +02:00
trop[bot]
3c467224d5 fix: destroy message port backend when JS env exits (#39346)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-08-03 17:53:38 -04:00
trop[bot]
759329dc62 test: add some environment variables for controlling tests (#39361)
chore: add some environment variables for controlling tests

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2023-08-03 17:51:37 -04:00
trop[bot]
ac867a1b95 fix: update chrome.tabs for Manifest v3 (#39360)
fix: update chrome.tabs for Manifest v3

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-03 21:58:00 +02:00
trop[bot]
75b1fd5b4c docs: clean up removed systemPreferences methods (#39347)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-08-03 11:32:05 -04:00
trop[bot]
a800965ef6 fix: update chrome.i18n for Manifest v3 (#39328)
fix: update chrome.i18n for Manifest v3

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-02 14:53:55 +02:00
trop[bot]
53cb8f5e01 docs: correct powerSaveBlocker.stop(id) return type (#39332)
doc: correct powerSaveBlocker.stop return type

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-02 13:16:55 +02:00
trop[bot]
7c434a11e4 fix: potential crash calling tray.popUpContextMenu() (#39313)
fix: potential crash calling tray.popUpContextMenu

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-01 13:04:19 +02:00
trop[bot]
c5faab7a0d docs: fix return type for ipcMain handle functions (#39315)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-08-01 13:04:01 +02:00
trop[bot]
abd3acd380 fix: Chrome Extensions service worker host registration (#39310)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-08-01 12:29:18 +02:00
trop[bot]
76a9aab8b5 fix: initial dark mode title bar on Windows 10 (#39309)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-08-01 16:48:54 +09:00
Athul Iddya
63a60b8eaa chore: cherry-pick 8fcc6df from webrtc (#39264) 2023-07-31 17:28:13 -04:00
Shelley Vohr
9a49ac1454 fix: reparenting after BrowserWindow.destroy() (#39297)
fix: reparenting after BrowserWindow.destroy()
2023-07-31 17:03:40 -04:00
trop[bot]
102eb176d9 fix: skip artifact validation for doc-only PRs (#39301)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-31 13:48:11 -04:00
Shelley Vohr
87dfd83bf8 fix: pageVisibility state when backgroundThrottling disabled (#39298)
fix: pageVisibility state when backgroundThrottling disabled
2023-07-31 17:45:50 +02:00
electron-roller[bot]
784b288de0 chore: bump chromium to 116.0.5845.49 (26-x-y) (#39259)
* chore: bump chromium in DEPS to 116.0.5845.49

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-07-31 14:21:49 +02:00
trop[bot]
ef8c90a50a docs: fix some string union type (#39293)
* docs: fix some string union types

Improve Type Union Typings in the Docs

Co-authored-by: mhli <mhli@hillinsight.com>

* test: add smoke tests

Co-authored-by: mhli <mhli@hillinsight.com>

* test: update `ses.clearStorageData` test case

Co-authored-by: mhli <mhli@hillinsight.com>

* test: update `ses.clearStorageData` test case

Co-authored-by: mhli <mhli@hillinsight.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: mhli <mhli@hillinsight.com>
2023-07-31 12:47:15 +02:00
trop[bot]
6771299fc2 feat: add senderIsMainFrame to messages sent via ipcRenderer.sendTo() (#39206)
feat: add `senderIsMainFrame` to messages sent via `ipcRenderer.sendTo()` (#38868)

* feat: add isMainFrame to events emitted via ipcRenderer.sendTo()

* chore: rename isMainFrame to senderIsMainFrame

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-07-27 22:59:46 +02:00
trop[bot]
b656337b43 fix: do not resolve electron entrypoints on disk (#39252)
* fix: do not resolve electron entrypoints on disk

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* chore: update .patches after trop

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-07-27 12:53:35 -07:00
trop[bot]
fbfef19768 fix: use generic capturer to list both screens and windows when possible (#39189)
* fix: use generic capturer to list both screens and windows when possible

Screensharing with PipeWire via XDG Desktop Portal requires explicit
user permission via permission dialogs. Chromium has separate tabs for
screens and windows and thus its portal implementation requests
permissions separately for each. However, the screencast portal has no
such limitation and supports both screens and windows in a single
request.

WebRTC now supports this type of capture in a new method called
called `CreateGenericCapturer`. The `desktopCapturer` implementation has
been modified to use it. Additionally, Chromium has been patched to use
same generic capturer to ensure that the source IDs remain valid for
`getUserMedia`.

Co-authored-by: Athul Iddya <athul@iddya.com>

* build: clean up incorrectly backported patches

* chore: cherry-pick 0e9556a90cec from webrtc

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-07-26 18:45:41 +02:00
trop[bot]
6b61917d4b fix: delete desktop capturers when they're not needed (#39246)
* fix: delete desktop capturers when they're not needed

Delete desktop capturer objects by resetting the DesktopMediaList
objects that own them after the sources have been collected. Capturers
that are not delegated are already being reset via a patch on
NativeDesktopMediaList. That is not safe for delegated capturers as
thumbnail generation depends on user events. Deleting the
DesktopMediaList operation is safe for all capturers and releases OS
capture resources as soon as possible.

Co-authored-by: Athul Iddya <athul@iddya.com>

* fix: add a patch to clean up PipeWire resources

Adding a patch to workaround a Chromium issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=1467060

The patch can be removed when the issue is resolved.

Co-authored-by: Athul Iddya <athul@iddya.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
2023-07-26 09:27:47 -04:00
trop[bot]
d47fa5f787 fix: traffic lights not working when child windows are restored via parent window (#39242)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-26 13:49:45 +02:00
Milan Burda
9ee4cb49bc fix: asar integration for require('node:child_process') (#39234)
fix: asar integration for require('node:child_process') (#38742)
2023-07-26 10:14:14 +02:00
trop[bot]
6a4bb4f6fd fix: resizable: false should disable fullscreen button at start (#39229)
fix: resizable should disable fullscreen button at start

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-26 10:10:37 +02:00
trop[bot]
95855906d0 docs: update @electron/fuses code examples (#39203)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-07-25 12:10:04 -04:00
electron-roller[bot]
f184603992 chore: bump chromium to 116.0.5845.42 (26-x-y) (#39106)
* chore: bump chromium in DEPS to 116.0.5845.32

* chore: update patches

* 4641991: Support automatic beacons on Android context menu navigations.

https://chromium-review.googlesource.com/c/chromium/src/+/4641991

* chore: bump chromium in DEPS to 116.0.5845.42

* chore: update patches

* chore: add include guard patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4628373

h/t @jkleinsc

(cherry picked from commit 3d45f58619)

* fixup: cherry-pick patch

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-07-25 12:06:46 -04:00
trop[bot]
26aa910d43 chore: add dependencies upgrade policy to readme (#39224)
* chore: add dependencies upgrade policy to readme

as per wg-releases july 19 meeting

https://docs.google.com/document/d/1XWdD4uAu9m8Gcpiw1j5fLwwZ_hU4rce9JyTpuKU6uM8/edit?pli=1

Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-07-25 12:06:14 -04:00
trop[bot]
8655990d83 ci: fail appveyor build if artifacts are missing (#39215)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-07-25 11:59:20 +02:00
trop[bot]
a175e1f69a docs: document idleDetector permissions (#39214)
doc: document idleDetector permissions

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-25 11:51:12 +02:00
trop[bot]
038147b6bc docs: update window-open.md to include target (#39204)
Update window-open.md to include target

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2023-07-25 11:50:45 +02:00
trop[bot]
03ed9531d4 docs: document idleDetector permissions (#39214)
doc: document idleDetector permissions

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-25 11:50:29 +02:00
trop[bot]
24f2379892 docs: fill in Node.js version for v25 release (#39200)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-07-24 14:32:04 +02:00
trop[bot]
9d5a25bf37 docs: remove redundant IPC event sections (#39174)
* docs: use correct names for IPC events

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* docs: remove redundant IPC event sections

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-07-24 12:40:45 +02:00
trop[bot]
35a9d76531 build: fix Appveyor test workflow checkout (#39170)
* build: fix Appveyor test workflow checkout

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: +refs/pull/num/merge -> +refs/pull/num/head

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: add to appveyor-woa as well

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-20 14:03:27 +02:00
Brad Parham
54cd8e4827 chore: bump node 18.16.1 (26-x-y) (#39066)
chore: bump node to v18.16.1 (main) (#38869)

* chore: bump node in DEPS to v18.16.1

* chore: update patches

* deps: update c-ares to 1.19.1

https://github.com/nodejs/node/pull/48115

* chore: fix -Wunreachable-code,-Werror FTBFS in c-ares

* chore: disable x509 bssl test

new test added in bf3e2c892

* fixup! chore: fix -Wunreachable-code,-Werror FTBFS in c-ares

also fix related -Werror,-Wunused-function FTBFS

* fixup! chore: fix -Wunreachable-code,-Werror FTBFS in c-ares

also fix another related -Werror,-Wunused-function FTBFS

* fixup! chore: disable x509 bssl test

fix yet another -Werror,-Wunused-function FTBFS

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-07-20 13:24:10 +02:00
trop[bot]
a374f41528 docs: fix casing of _Deprecated_ (#39168)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-07-20 13:22:47 +02:00
trop[bot]
a99fc5e40f feat: expose safestorage backend information on linux (#39155)
* feat: expose safestorage backend information on linux

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Remove gnome-keyring

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4609704

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-07-20 13:22:29 +02:00
trop[bot]
77bfa2ad65 perf: small perf changes in HidChooserController (#39159)
* perf: avoid string temporary in HidChooserController::PhysicalDeviceIdFromDeviceInfo()

return a const ref instead of a new string

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: avoid second map lookup in HidChooserController::AddDeviceInfo()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-07-20 10:06:01 +02:00
trop[bot]
b7eb26c4df fix: BrowserWindow.moveAbove() not working for child windows (#39070)
fix: BrowserWindow.moveAbove() not working for child windows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-19 15:34:26 +02:00
Robo
25c18637ed chore: revert 459fe0e from 26-x-y (#39119)
Revert "feat: expose safestorage backend information on linux (#39107)"

This reverts commit 459fe0e68d.
2023-07-19 15:06:57 +02:00
trop[bot]
534cdbd538 build: fixup Codespaces build-tools setup (#39142)
* build: fixup Codespaces build-tools setup

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* oops evm.testing1.json -> evm.testing.json

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-19 10:56:43 +02:00
trop[bot]
689e3868cc build: correct codespaces devcontainer extensions settings (#39144)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-19 10:56:14 +02:00
trop[bot]
6656001a62 docs: update stable dates (#39139)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2023-07-18 15:34:47 -07:00
trop[bot]
6930ecea68 docs: fix a capitalization problem in messagePort tutorial (#39130)
fix a capitalization problem

For a rookie, this little mistake took a long time to find out.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: ZWJKFLC <71260863+ZWJKFLC@users.noreply.github.com>
2023-07-18 09:56:12 +02:00
trop[bot]
97825a3f09 fix: clipboard.readImage() should be synchronous (#39101)
* feat: clipboard.readImage returns a Promise

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: update breaking changes doc

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: make function synchronous

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* Update docs/api/native-image.md

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-17 09:38:25 +02:00
trop[bot]
459fe0e68d feat: expose safestorage backend information on linux (#39107)
* feat: expose safestorage backend information on linux

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Remove gnome-keyring

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4609704

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-07-17 14:04:30 +09:00
trop[bot]
bd66a58fa7 perf: avoid redundant lookup in BluetoothChooser::AddOrUpdateDevice() (#39084)
perf: avoid redundant map lookup in BluetoothChooser::AddOrUpdateDevice()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-07-13 22:51:00 +02:00
trop[bot]
db581a204d perf: avoid redundant map lookup in NativeImage::GetHICON() (#39082)
perf: avoid double map lookup in NativeImage::GetHICON()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-07-13 10:25:01 +02:00
trop[bot]
e7928ce519 fix: protocol.handle not intercepting file protocol (#39065)
fix: protocol.handle not intercepting file protocol

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-13 15:33:36 +09:00
trop[bot]
5ab5427b6e fix: use StartUpdating method for PipeWire capturer (#39049)
* fix: use StartUpdating method for PipeWire capturer

Fixed a crash related to PipeWire capturer by adapting to Chromium's
interface changes. Chromium expects a call to
`NativeDesktopMediaList::StartUpdating` with an implementation of
`DesktopMediaListObserver` for delegated capturers like PipeWire. This
interface allows listening to user permission events and listing
sources only after the user has made a choice on the permission dialog.

The interface has been implemented by an inner class to allow listening
to screen and window capture permissions concurrently using two
instances of the class. A patch that was resetting the capturer on the
first refresh has been changed to exclude PipeWire. PipeWire capturer
object will follow the lifecycle of `NativeDesktopMediaList`, as is the
case in Chromium.

Fixes #37463

Co-authored-by: Athul Iddya <athul@iddya.com>

* fix: wait for thumbnails from PipeWire when necessary

The PipeWire stream starts after the dialog is dismissed. If the sources
are listed immediately afterwards, the thumbnail may not have been
generated by that time. Explicitly wait for both thumbnail generation
and a selection on the source dialog before listing sources.

Co-authored-by: Athul Iddya <athul@iddya.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
2023-07-11 09:44:01 -07:00
trop[bot]
d463bf9c16 fix: remove types from GTK CSS selectors (#39045)
Remove types from GTK CSS selectors similar to Chromium's changes in CL
4289229.

Fixes #38786

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
2023-07-11 10:19:41 +02:00
trop[bot]
4ba0fc8630 fix: printing optional access crash on Windows (#39039)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-10 15:30:27 -04:00
trop[bot]
33376fba39 fix: set prototype names on gin::Constructible classes (#39036)
* fix: set prototype names on gin::Constructible classes

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* test: add tests

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-10 15:58:18 +02:00
trop[bot]
b0b87b098e revert: compensate for title bar height when setting bounds on BrowserView (#39004)
This reverts commit 75f9573e53.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-10 15:57:55 +02:00
trop[bot]
13d224e816 fix: webview crash when removing in close event (#39007)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-10 13:42:21 +02:00
trop[bot]
96b2422f95 build: disable unneeded depot_tools update on Windows CI (#39019)
build: disable unneeded depot_tools update

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-07-09 18:35:48 -07:00
trop[bot]
3cdd3d6518 fix: Notification 'Show' button visible when no actions exist (#39013)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-07-07 09:58:38 +02:00
trop[bot]
2bab77a4e1 fix: menu border being created properly on Windows 11 (#39010)
* fix: menu border being created properly on Windows 11

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-07-07 09:58:13 +02:00
trop[bot]
7ce73b5989 docs: Improved the Documentation on BrowserWindow type attribute (#39002)
* docs: Documentation changes

Co-authored-by: Varun Sood <soodvarun2003@gmail.com>

* made the required changes in the docs

Co-authored-by: Varun Sood <soodvarun2003@gmail.com>

* made the toolbar type text correction

Co-authored-by: Varun Sood <soodvarun2003@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Varun Sood <soodvarun2003@gmail.com>
2023-07-06 15:46:06 +02:00
trop[bot]
2b254b1d6d feat: add support for keyboard initialized menu popup (#38954)
* feat: add support for keyboard initialized menu popup

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* Update docs/api/menu.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

Co-authored-by: Samuel Attard <sam@electronjs.org>

* fix: add patch to chromium for keyboard accessibility menu behavior

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* refactor: s/initiatedByKeyboard/sourceType

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* fix: ignore initial mouse event to retain keyboard initiated focus

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* Update docs/api/menu.md

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>

Co-authored-by: Samuel Attard <sam@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2023-07-05 16:30:19 -04:00
trop[bot]
6452e5c992 docs: fix misleading code sample for handling deeplinks on Linux (#38972)
Fix misleading docs for handling deeplinks in Linux

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Sergei Chestakov <me@sergei.com>
2023-07-04 10:07:31 +02:00
electron-roller[bot]
28604db7a0 chore: bump chromium to 116.0.5845.14 (26-x-y) (#38963)
* chore: bump chromium in DEPS to 116.0.5845.14

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-07-03 10:20:05 +02:00
Charles Kerr
236272bf9f refactor: more constexpr lookup tables (#38895)
* refactor: more constexpr lookup tables (#38886)

* refactor: use constexpr lookup table in electron_api_web_contents.cc

* refactor: make KeyboardCodeFromStr() private

it is only used as a helper to KeyboardCodeFromStr()

* chore: savepoint

* chore: make lint happy

* fixup! refactor: make KeyboardCodeFromStr() private

* refactor: use constexpr lookup table in electron_url_loader_factory

* refactor: use constexpr lookup table in electron_api_tray

* refactor: use constexpr lookup table in web_contents_preferences.cc

* refactor: use constexpr lookup table in content_converter

* chore: fix clang-format

clang-format gets confused by ifdefs in the middle of an initializer list
2023-06-27 15:49:32 +09:00
trop[bot]
26e6252ac8 fix: child window may have opener removed (#38930)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2023-06-27 15:48:06 +09:00
trop[bot]
548f84df40 docs: document e27 breaking change of dropping macOS 10.13, 10.14 (#38925)
docs: document e27 breaking change of dropping macOS 10.13, 10.14 support

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-26 15:39:01 -04:00
electron-roller[bot]
779a4e700d chore: bump chromium to 116.0.5845.4 (26-x-y) (#38826)
* chore: bump chromium in DEPS to 116.0.5845.3

* chore: bump chromium in DEPS to 116.0.5845.4

* Potential fix for flaky DesktopCaptureApiTest.Delegation unittest

https://chromium-review.googlesource.com/c/chromium/src/+/4632824

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-06-26 15:07:07 -04:00
trop[bot]
76f4291130 feat: allow headers to be sent with session.downloadURL() (#38871)
* feat: allow headers to be sent with session.downloadURL

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* Update shell/browser/api/electron_api_session.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-22 14:40:11 -04:00
trop[bot]
16aac6da13 chore: bump chromium to 116.0.5845.0 (26-x-y) (#38893)
* chore: bump chromium in DEPS to 116.0.5835.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 116.0.5837.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 116.0.5839.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 116.0.5841.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 116.0.5843.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* Update patches

CLs that affected printing.patch:
- 4616791: Refactor PrintViewManagerBase::PrintNow()
  https://chromium-review.googlesource.com/c/chromium/src/+/4616791
- 4602776: Make PrintNodeUnderContextMenu operation go through PrintViewManager
  https://chromium-review.googlesource.com/c/chromium/src/+/4602776

Co-authored-by: clavin <clavin@electronjs.org>

* 4506614: geolocation: Add LocationProvider::FillDiagnostics https://chromium-review.googlesource.com/c/chromium/src/+/4506614

Co-authored-by: clavin <clavin@electronjs.org>

* chore: bump chromium in DEPS to 116.0.5845.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* fixup! 4506614: geolocation: Add LocationProvider::FillDiagnostics https://chromium-review.googlesource.com/c/chromium/src/+/4506614

Co-authored-by: clavin <clavin@electronjs.org>

* 4609704: Remove gnome-keyring https://chromium-review.googlesource.com/c/chromium/src/+/4609704

Co-authored-by: clavin <clavin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
2023-06-22 13:57:04 -04:00
trop[bot]
479c2d8d4a fix: crash calling BrowserWindow.removeBrowserView() with destroyed webContents (#38885)
fix: crash calling removeBrowserView() with destroyed webContents

https://github.com/electron/electron/issues/37642

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-22 12:56:33 +02:00
trop[bot]
6c05422a61 fix: set supported scale factors on startup (#38861)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-21 10:19:41 +02:00
trop[bot]
a6d76efc9e refactor: use constexpr lookup tables in gin helper (#38835)
* feat: add gin_helper::FromV8WithLookup()

feat: add gin_helper::FromV8WithLowerLookup()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use constexpr lookup table in gin Converters

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-20 14:38:30 +02:00
trop[bot]
88408358ed fix: crash on nativeTheme change during context menu close (#38840)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-19 14:46:30 +02:00
trop[bot]
1e3837f4c3 refactor: remove unused InspectableWebContentsView::GetWebView() (#38820)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-16 12:43:28 -05:00
trop[bot]
f8ed70b613 fix: webContents.print({ silent: true }) not working correctly (#38812)
fix: webContents.print({ silent: true }) not working correctly

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-15 22:40:34 +02:00
electron-roller[bot]
c2e362d2d3 chore: bump chromium to 116.0.5833.0 (26-x-y) (#38808)
* chore: bump chromium in DEPS to 116.0.5833.0

* chore: update patches

* 4530656: Add DeviceLoginScreenWebHidAllowDevicesForUrls policy

https://chromium-review.googlesource.com/c/chromium/src/+/4530656
(cherry picked from commit 2c376c7f1a)

* Split CertDatabase notifications between trust changes and client cert changes

https://chromium-review.googlesource.com/c/chromium/src/+/4596317
(cherry picked from commit 1e2f7ef605)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-06-15 16:37:27 -04:00
electron-roller[bot]
b3a5ef767b chore: bump chromium to 116.0.5831.0 (26-x-y) (#38783)
* chore: bump chromium in DEPS to 116.0.5831.0

* chore: update patches

(cherry picked from commit 0be644a8ae)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-06-15 12:02:59 +02:00
trop[bot]
94dba56d2c feat: support node: prefixed requires in sandboxed renderer preloads (#38728)
feat: support node: prefixed requires in sandboxed renderer preloads

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-06-15 11:59:57 +02:00
trop[bot]
7ad80e414a refactor: constexpr lookup tables (#38797)
* refactor: use a constexpr lookup table in GetPathConstant()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use a constexpr lookup table in SystemPreferences::GetColor()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use a constexpr lookup table in SimpleURLLoaderWrapper::Create()

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-14 22:08:54 -05:00
trop[bot]
e5419bcf5a chore: remove unused std includes (#38795)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-14 17:35:49 -04:00
trop[bot]
8eeaacfafe fix: preferCSSPageSize error type (#38793)
fix: preferCSSPageSize error type

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-14 11:05:49 -07:00
trop[bot]
582844c537 build: update typescript-generator and docs-parser (#38777)
* build: update typescript-generator and docs-parser

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* again...

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* build: handle more specific pageSize types

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-06-14 10:47:24 -04:00
trop[bot]
77d4ab0701 chore: bump chromium to 116.0.5829.0 (26-x-y) (#38765)
* chore: bump chromium in DEPS to 116.0.5823.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 116.0.5825.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 116.0.5827.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* 4568811: Integrate Search Prefetch with Extensions.

https://chromium-review.googlesource.com/c/chromium/src/+/4568811

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* 4567511: [DevTools] Add recordCountHistogram API.

https://chromium-review.googlesource.com/c/chromium/src/+/4567511

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* 4507692: Delete base/guid.h

https://chromium-review.googlesource.com/c/chromium/src/+/4507692

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* 4589551: Convert some of /base to use ARC

https://chromium-review.googlesource.com/c/chromium/src/+/4589551
Also:
4601769: Convert immersive mode controllers to use ARC
https://chromium-review.googlesource.com/c/chromium/src/+/4601769

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* Convert MaybeSizeInBytes() to take in SharedImageFormat

https://chromium-review.googlesource.com/c/chromium/src/+/4594677

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* 4564108: [BRP] Enable check_raw_ptr_fields for Mac

https://chromium-review.googlesource.com/c/chromium/src/+/4564108

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* chore: bump chromium in DEPS to 116.0.5828.0

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* chore: bump chromium in DEPS to 116.0.5829.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-06-14 07:47:10 -04:00
trop[bot]
923ae840e1 docs: add missing isSameDocument property to will-frame-navigate event details (#38766)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-13 21:07:13 -05:00
trop[bot]
50014e593f build: move chrome_lib_arc to chromium_src/BUILD.gn (#38772)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2023-06-13 16:23:09 -07:00
trop[bot]
3a7e8d6a24 refactor: use compile-time cli arg sets. (#38769)
We're currently building these on the heap with `std::set<std::string>`
but this can be a very small compile-time container instead.

Marking as 'refactor' rather than 'perf' since this isn't called often,
but moving from heap to compile-time is good and using this container
makes the code more readable.
2023-06-13 17:23:23 -05:00
trop[bot]
a55410576a docs: clarify supported accelerator punctuation (#38756)
doc: clarify supported accelerator punctuation

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-13 16:24:02 -04:00
electron-roller[bot]
cddfdf3ba2 chore: bump chromium to 116.0.5817.0 (26-x-y) (#38546)
* chore: bump chromium in DEPS to 116.0.5805.2

* chore: bump chromium in DEPS to 116.0.5807.0

* chore: update patches

* chore: bump chromium in DEPS to 116.0.5809.2

* chore: bump chromium in DEPS to 116.0.5811.0

* chore: bump chromium in DEPS to 116.0.5813.0

* chore: bump chromium in DEPS to 116.0.5815.0

* chore: bump chromium in DEPS to 116.0.5817.0

* chore: bump chromium in DEPS to 116.0.5819.0

* chore: bump chromium in DEPS to 116.0.5821.0

* chore: bump chromium in DEPS to 116.0.5823.0

* chore: bump chromium in DEPS to 116.0.5825.0

* chore: bump chromium in DEPS to 116.0.5827.0

* chore: bump chromium to 116.0.5817.0

cherry picked from fd5e6fbc14

* refactor: add ARC scaffolding for macOS (#38621)

(cherry picked from commit 9a9d8ae5ea)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-12 18:29:28 -04:00
trop[bot]
e6a631f078 perf: prefer base::StringPiece over std::string for build-time strings (#38738)
* perf: use base::StringPiece in InclusionStatusToString()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::StringPiece in ErrorCodeToString()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::StringPiece in MessageSourceToString()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::StringPiece in CursorTypeToString()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::StringPiece in MediaStreamTypeToString()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::StringPiece in ModifiersToArray()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::StringPiece in WebFrameRenderer::MaybeGetRenderFrame()

The strings are all build-time constants and this is a private function

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-12 12:21:08 -05:00
trop[bot]
9d4debb791 fix: webContents.print() cancellation callback (#38735)
fix: webContents.print() cancellation callback

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-12 16:17:34 +02:00
trop[bot]
0b181e7977 fix: webContents.print parameter validation error (#38721)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-11 09:56:35 +02:00
trop[bot]
29d776400a refactor: api web contents ownership (#38723)
* refactor: aggregate api::WebContents::exclusive_access_manager_ directly

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make WebContents::devtools_file_system_indexer_ scoped_refptr const

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make WebContents::file_task_runner_ scoped_refptr const

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make WebContents::print_task_runner_ scoped_refptr const

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-09 18:57:32 -05:00
trop[bot]
0b7e2b6d91 build: move uploadIndexJson to just before publishRelease (#38698)
* build: move uploadIndexJson to just before publishRelease

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* chore: move uploadNodeShasums as well

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* build: upload node checksums before validating them

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-06-09 12:22:35 -07:00
trop[bot]
744b8dfc31 refactor: add SessionPreferences::CreateForBrowserContext() (#38713)
Copy the NativeWindowRelay::CreateForWebContents() idiom
to simplify SessionPreferences's constructor and lifecycle.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-09 12:21:30 -07:00
trop[bot]
9a64d47132 fix: WCO transparent background (#38716)
* fix: WCO transparency

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>

* doc: wco color transparency

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>

* fix: transparent buttons when calling setTitleBarOverlay

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2023-06-09 12:19:31 -07:00
trop[bot]
7acdcae772 fix: menu bar visibility when exiting full screen (#38683)
* fix:visibility of menu bar when exiting full screen

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* format code

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* format code

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* Modify comments

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* add menu bar visibility test

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* format code

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* change code

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

* platform related in test

Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: wugaosheng <wugaosheng@kylinos.cn>
2023-06-09 13:59:15 +02:00
Erick Zhao
b8d9a80dbb docs: use local img for contents.adjustSelection api (#38697)
docs: use local img for contents.adjustSelection api (#38655)

* docs: use local img for contents.adjustSelection api

* fixup
2023-06-08 13:42:43 -07:00
trop[bot]
67f9b1f88d fix: dangling pointer warning when updating menus (#38690)
fix: dangling raw_ptr warning when updating menus

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-08 16:40:52 -04:00
trop[bot]
fc241977fe fix: reparenting UAF crash on macOS (#38679)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-08 13:29:17 -04:00
trop[bot]
01faeef36a build: use upstream's presubmit cpplint filters. (#38686)
* build: use upstream's presubmit cpplint filters.

Our list of filters has fallen out-of-sync with upstream tests and so
our checks don't match those in the Google + Chromium guides.

The checks in this PR come from depot_tools and are copied manually
since the depot_tools code is python but our linter is js. 🤷
Perhaps we should rewrite in python?

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! build: use upstream's presubmit cpplint filters.

chore: make linter happy with my linter changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-08 13:28:37 -04:00
trop[bot]
9d3c1d993a chore: clean up ElectronPermissionManager (#38669)
chore: clean up ElectronPermissionManager

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-08 12:19:01 +02:00
trop[bot]
95f8fa8732 fix: bad error passing webContents.print(null) (#38641)
fix: bad error passing webContents.print(null)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-07 23:53:02 -07:00
trop[bot]
53b398d7c3 refactor: remove unused OffScreenRenderWidgetHostView fields (#38649)
* refactor: remove unused field OffScreenRenderWidgetHostView::last_time_

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove unused field OffScreenRenderWidgetHostView::last_scroll_offset_

Unused since 1a9e253

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove unused field OffScreenRenderWidgetHostView::paint_callback_running_

assigned to, but unread, since 81bf158

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-07 23:51:07 -07:00
trop[bot]
4d4191ed1a build: improve error output in release.js (#38660)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-06-07 23:47:55 -07:00
trop[bot]
1facc6d304 fix: validate response in protocol.handle() (#38635)
fix: validate response in protocol.handle()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-07 10:44:54 -05:00
trop[bot]
455458ace8 fix: sync api::Screen wrapper method sigs to upstream (#38633)
refactor: sync api::Screen getter sigs to upstream

ui::Display GetAllDisplays(), GetPrimaryDisplay(), GetDisplayMatching(),
and GetDisplayNearestPoint() methods are all const, so make our wrappers
const too.

ui::Display GetAllDisplays() returns a const reference, so make our
wrapper return a const reference too. This avoids creating a new
std::vector<display::Display> each time it's called.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-07 12:09:23 +02:00
trop[bot]
0e2fd41733 refactor: remove redundant resizing strategy equality check (#38617)
* refactor: remove redundant resizing strategy equality check

Upstream already checks this.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove devtools_settings.h from iwc header

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove unused <vectro> from iwc header

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-07 09:28:42 +02:00
trop[bot]
dbc4e2d8d7 docs: removed outdated Appveyor doc (#38626)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-06-06 19:57:16 -07:00
trop[bot]
3f3435bea7 fix: account for BrowserView bounds in setting autofill popup bounds (#38610)
fix: account for BrowserView bounds in setting autofill popup bounds

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-06 21:50:52 +02:00
trop[bot]
d142292485 refactor: use process_util.h helpers (#38606)
refactor: use process_util.h helpers

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-06-06 15:48:33 -04:00
trop[bot]
42a5affba8 fix: file selection when disallowed on macOS (#38590)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-05 16:21:41 +02:00
trop[bot]
f89974fe4b refactor: use direct aggregation in NativeWindowViews (#38576)
* refactor: in NativeWindowViews, aggregate root_view_ directly

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: in NativeWindowViews, aggregate keyboard_event_handler_ directly

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make NativeWindowClientView::window_ a raw_ref

Xref: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md\#non_owning-pointers-in-class-fields

Prefer const raw_ref<T> whenever the held pointer will never be null

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: make lint happy

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-05 15:42:25 +02:00
trop[bot]
c62a32df72 chore: type check JS in docs (#38584)
* build(deps): update @electron/lint-roller

* chore: type check JS in docs

* docs: add @ts-check and @ts-expect-error to code blocks

* chore: fix type check errors in docs

* chore: add ts-type to blocks

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-06-05 14:08:01 +02:00
trop[bot]
75981c1e9a docs: clarify which electron modules are exposed in sandboxed renderers (#38579)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-06-05 11:56:16 +02:00
trop[bot]
d9935276dd docs: fix SerialPort typing (#38583)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-06-05 11:33:46 +02:00
trop[bot]
b9453eb6d8 chore: remove unused electron::api::View code (#38569)
chore: remove unused electron::api::View methods

Remove code that was added in 2c8dc9e never got used.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-06-03 16:18:27 -05:00
trop[bot]
e12b30b6ce perf: avoid unnecessary base value clone (#38564) 2023-06-02 17:04:19 -05:00
trop[bot]
9bbd85c2ba build: fix doc-only early exit on Appveyor (#38552)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-06-01 15:44:52 -04:00
trop[bot]
665823596c refactor: remove unused switches (#38530) 2023-06-01 14:17:29 +02:00
460 changed files with 7499 additions and 3579 deletions

View File

@@ -4,37 +4,6 @@
"onCreateCommand": ".devcontainer/on-create-command.sh",
"updateContentCommand": ".devcontainer/update-content-command.sh",
"workspaceFolder": "/workspaces/gclient/src/electron",
"extensions": [
"joeleinbinder.mojom-language",
"rafaelmaiolla.diff",
"surajbarkale.ninja",
"ms-vscode.cpptools",
"mutantdino.resourcemonitor",
"dbaeumer.vscode-eslint",
"shakram02.bash-beautify",
"marshallofsound.gnls-electron",
"CircleCI.circleci"
],
"settings": {
"editor.tabSize": 2,
"bashBeautify.tabSize": 2,
"typescript.tsdk": "node_modules/typescript/lib",
"[gn]": {
"editor.formatOnSave": true
},
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single"
},
"forwardPorts": [8088, 6080, 5901],
"portsAttributes": {
"8088": {
@@ -60,6 +29,38 @@
"openFiles": [
".devcontainer/README.md"
]
},
"vscode": {
"extensions": ["joeleinbinder.mojom-language",
"rafaelmaiolla.diff",
"surajbarkale.ninja",
"ms-vscode.cpptools",
"mutantdino.resourcemonitor",
"dbaeumer.vscode-eslint",
"shakram02.bash-beautify",
"marshallofsound.gnls-electron",
"CircleCI.circleci"
],
"settings": {
"editor.tabSize": 2,
"bashBeautify.tabSize": 2,
"typescript.tsdk": "node_modules/typescript/lib",
"[gn]": {
"editor.formatOnSave": true
},
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single"
}
}
}
}

View File

@@ -16,6 +16,8 @@ ln -s $buildtools_configs $buildtools/configs
# Write the gclient config if it does not already exist
if [ ! -f $gclient_root/.gclient ]; then
echo "Creating gclient config"
echo "solutions = [
{ \"name\" : \"src/electron\",
\"url\" : \"https://github.com/electron/electron\",
@@ -32,6 +34,8 @@ fi
# Write the default buildtools config file if it does
# not already exist
if [ ! -f $buildtools/configs/evm.testing.json ]; then
echo "Creating build-tools testing config"
write_config() {
echo "
{
@@ -53,7 +57,7 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
},
\"$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\"
\"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\"
}
" >$buildtools/configs/evm.testing.json
}
@@ -67,10 +71,12 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
# if it works we can use the goma cluster
export NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN
if e d goma_auth login; then
echo "$GITHUB_USER has GOMA access - switching to cluster mode"
write_config cluster
fi
else
# Even if the config file existed we still need to re-auth with the goma
# cluster
echo "build-tools testing config already exists"
# Re-auth with the goma cluster regardless.
NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN e d goma_auth login || true
fi

View File

@@ -544,6 +544,7 @@ source_set("electron_lib") {
if (is_mac) {
deps += [
":electron_lib_arc",
"//components/remote_cocoa/app_shim",
"//components/remote_cocoa/browser",
"//content/browser:mac_helpers",
@@ -778,6 +779,27 @@ source_set("electron_lib") {
}
}
if (is_mac) {
source_set("electron_lib_arc") {
include_dirs = [ "." ]
sources = [
"shell/browser/mac/dict_util.h",
"shell/browser/mac/dict_util.mm",
"shell/browser/mac/electron_application_delegate.h",
"shell/browser/mac/electron_application_delegate.mm",
]
deps = [
"//base",
"//skia",
"//third_party/electron_node:node_lib",
"//v8",
]
configs += [ "//build/config/compiler:enable_arc" ]
}
}
electron_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/electron_repack"

View File

@@ -60,6 +60,10 @@ dependencies, and tools contained in the `electron/electron` repository.
* [Step 11: Landing](https://electronjs.org/docs/development/pull-requests#step-11-landing)
* [Continuous Integration Testing](https://electronjs.org/docs/development/pull-requests#continuous-integration-testing)
### Dependencies Upgrades Policy
Dependencies in Electron's `package.json` or `yarn.lock` files should only be altered by maintainers. For security reasons, we will not accept PRs that alter our `package.json` or `yarn.lock` files. We invite contributors to make requests updating these files in our issue tracker. If the change is significantly complicated, draft PRs are welcome, with the understanding that these PRs will be closed in favor of a duplicate PR submitted by an Electron maintainer.
## Style Guides
See [Coding Style](https://electronjs.org/docs/development/coding-style) for information about which standards Electron adheres to in different parts of its codebase.

4
DEPS
View File

@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'116.0.5791.0',
'116.0.5845.97',
'node_version':
'v18.16.0',
'v18.16.1',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':

View File

@@ -49,6 +49,11 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: base-woa
APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa
clone_script:
- ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER
- ps: if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env:APPVEYOR_REPO_COMMIT)}
- ps: if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env:APPVEYOR_PULL_REQUEST_NUMBER)/head; git checkout -qf FETCH_HEAD}
clone_folder: C:\projects\src\electron
skip_branch_with_pr: true
@@ -67,10 +72,14 @@ for:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
Write-warning "Skipping build for doc-only change"
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
$global:LASTEXITCODE = 0
- cd ..
- ps: Write-Host "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
@@ -83,6 +92,8 @@ for:
Remove-Item -Recurse -Force $pwd\build-tools
}
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
- depot_tools\bootstrap\win_tools.bat
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {
@@ -176,6 +187,30 @@ for:
7z a pdb.zip out\Default\*.pdb
}
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- ps: |
cd C:\projects\src
$missing_artifacts = $false
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only PR"
} else {
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
foreach($artifact_name in $artifacts_to_validate) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif ($artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
}
if (-not(Test-Path $artifact_file)) {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
}
}
}
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
deploy_script:
- cd electron
@@ -201,7 +236,7 @@ for:
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
@@ -222,9 +257,11 @@ for:
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
Write-warning "Skipping build for doc only change"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
$global:LASTEXITCODE = 0
- cd ..
- mkdir out\Default
- cd ..
@@ -232,7 +269,7 @@ for:
# Download build artifacts
$apiUrl = 'https://ci.appveyor.com/api'
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
$artifacts_to_download = @('dist.zip','ffmpeg.zip','node_headers.zip','pdb.zip','electron.lib')
$artifacts_to_download = @('dist.zip','ffmpeg.zip','node_headers.zip','electron.lib')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build Arm on X64 Windows") {
$jobId = $job.jobId
@@ -244,10 +281,13 @@ for:
}
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
}
# Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing
# Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip
# 7z x -y -osrc pdb.zip
}
}
- ps: |
$out_default_zips = @('dist.zip','pdb.zip')
$out_default_zips = @('dist.zip')
foreach($zip_name in $out_default_zips) {
7z x -y -osrc\out\Default $zip_name
}

View File

@@ -47,6 +47,11 @@ environment:
- job_name: Test
job_depends_on: Build
clone_script:
- ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER
- ps: if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env:APPVEYOR_REPO_COMMIT)}
- ps: if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env:APPVEYOR_PULL_REQUEST_NUMBER)/head; git checkout -qf FETCH_HEAD}
clone_folder: C:\projects\src\electron
skip_branch_with_pr: true
@@ -65,10 +70,14 @@ for:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
Write-warning "Skipping build for doc-only change"
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
$global:LASTEXITCODE = 0
- cd ..
- ps: Write-Host "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
@@ -81,6 +90,8 @@ for:
Remove-Item -Recurse -Force $pwd\build-tools
}
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
- depot_tools\bootstrap\win_tools.bat
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {
@@ -174,6 +185,30 @@ for:
7z a pdb.zip out\Default\*.pdb
}
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- ps: |
cd C:\projects\src
$missing_artifacts = $false
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only PR"
} else {
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
foreach($artifact_name in $artifacts_to_validate) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif ($artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
}
if (-not(Test-Path $artifact_file)) {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
}
}
}
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
deploy_script:
- cd electron
@@ -199,7 +234,7 @@ for:
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
@@ -218,9 +253,11 @@ for:
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
Write-warning "Skipping build for doc only change"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
$global:LASTEXITCODE = 0
- cd ..
- mkdir out\Default
- cd ..
@@ -240,6 +277,9 @@ for:
}
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
}
# Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing
# Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip
# 7z x -y -osrc pdb.zip
}
}
- ps: |

View File

@@ -105,16 +105,6 @@ static_library("chrome") {
if (is_mac) {
sources += [
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
"//chrome/browser/icon_loader_mac.mm",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm",
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
"//chrome/browser/platform_util_mac.mm",
"//chrome/browser/process_singleton_mac.mm",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm",
]
@@ -154,6 +144,7 @@ static_library("chrome") {
public_deps = [
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser/resources/accessibility:resources",
"//chrome/browser/ui/color:mixers",
"//chrome/common",
"//chrome/common:version_header",
@@ -200,6 +191,10 @@ static_library("chrome") {
public_deps += [ "//chrome/services/util_win:lib" ]
}
if (is_mac) {
public_deps += [ ":chrome_lib_arc" ]
}
if (enable_widevine) {
sources += [
"//chrome/renderer/media/chrome_key_systems.cc",
@@ -348,6 +343,34 @@ static_library("chrome") {
}
}
if (is_mac) {
source_set("chrome_lib_arc") {
include_dirs = [ "." ]
sources = [
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
"//chrome/browser/icon_loader_mac.mm",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm",
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
"//chrome/browser/platform_util_mac.mm",
"//chrome/browser/process_singleton_mac.mm",
]
deps = [
"//base",
"//skia",
"//third_party/electron_node:node_lib",
"//third_party/webrtc_overrides:webrtc_component",
"//v8",
]
configs += [ "//build/config/compiler:enable_arc" ]
}
}
source_set("plugins") {
sources = []
deps = []

View File

@@ -55,7 +55,7 @@ The `Super` (or `Meta`) key is mapped to the `Windows` key on Windows and Linux
* `0` to `9`
* `A` to `Z`
* `F1` to `F24`
* Punctuation like `~`, `!`, `@`, `#`, `$`, etc.
* Various Punctuation: `)`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `:`, `;`, `:`, `+`, `=`, `<`, `,`, `_`, `-`, `>`, `.`, `?`, `/`, `~`, `` ` ``, `{`, `]`, `[`, `|`, `\`, `}`, `"`
* `Plus`
* `Space`
* `Tab`

View File

@@ -413,18 +413,7 @@ Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `details` Object
* `reason` string - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Integer - The exit code of the process, unless `reason` is
`launch-failed`, in which case `exitCode` will be a platform-specific
launch failure error code.
* `details` [RenderProcessGoneDetails](structures/render-process-gone-details.md)
Emitted when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
@@ -971,7 +960,7 @@ app.setJumpList([
title: 'Tool A',
program: process.execPath,
args: '--run-tool-a',
icon: process.execPath,
iconPath: process.execPath,
iconIndex: 0,
description: 'Runs Tool A'
},
@@ -980,7 +969,7 @@ app.setJumpList([
title: 'Tool B',
program: process.execPath,
args: '--run-tool-b',
icon: process.execPath,
iconPath: process.execPath,
iconIndex: 0,
description: 'Runs Tool B'
}
@@ -1418,8 +1407,8 @@ const fs = require('fs')
let filepath
let bookmark
dialog.showOpenDialog(null, { securityScopedBookmarks: true }, (filepaths, bookmarks) => {
filepath = filepaths[0]
dialog.showOpenDialog(null, { securityScopedBookmarks: true }).then(({ filePaths, bookmarks }) => {
filepath = filePaths[0]
bookmark = bookmarks[0]
fs.readFileSync(filepath)
})

View File

@@ -104,6 +104,7 @@ window, you have to set both `parent` and `modal` options:
```javascript
const { BrowserWindow } = require('electron')
const top = new BrowserWindow()
const child = new BrowserWindow({ parent: top, modal: true, show: false })
child.loadURL('https://github.com')
child.once('ready-to-show', () => {
@@ -597,7 +598,7 @@ On Linux the setter is a no-op, although the getter returns `true`.
A `boolean` property that determines whether the window is excluded from the applications Windows menu. `false` by default.
```js
```js @ts-expect-error=[11]
const win = new BrowserWindow({ height: 600, width: 600 })
const template = [
@@ -819,10 +820,14 @@ win.setBounds({ width: 100 })
console.log(win.getBounds())
```
**Note:** On macOS, the y-coordinate value cannot be smaller than the [Tray](tray.md) height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.
#### `win.getBounds()`
Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`.
**Note:** On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
#### `win.getBackgroundColor()`
Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) format.
@@ -1200,6 +1205,9 @@ Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject)
method:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
const url = require('url').format({
protocol: 'file',
slashes: true,
@@ -1213,6 +1221,9 @@ You can load a URL using a `POST` request with URL-encoded data by doing
the following:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
win.loadURL('http://localhost:8000/post', {
postData: [{
type: 'rawData',

View File

@@ -104,7 +104,7 @@ The `callback` function is expected to be called back with user credentials:
* `username` string
* `password` string
```javascript
```javascript @ts-type={request:Electron.ClientRequest}
request.on('login', (authInfo, callback) => {
callback('username', 'password')
})
@@ -113,7 +113,7 @@ request.on('login', (authInfo, callback) => {
Providing empty credentials will cancel the request and report an authentication
error on the response object:
```javascript
```javascript @ts-type={request:Electron.ClientRequest}
request.on('response', (response) => {
console.log(`STATUS: ${response.statusCode}`)
response.on('error', (error) => {

View File

@@ -148,10 +148,7 @@ clipboard.
```js
const { clipboard } = require('electron')
clipboard.writeBookmark({
text: 'https://electronjs.org',
bookmark: 'Electron Homepage'
})
clipboard.writeBookmark('Electron Homepage', 'https://electronjs.org')
```
### `clipboard.readFindText()` _macOS_

View File

@@ -116,14 +116,20 @@ Ignore the connections limit for `domains` list separated by `,`.
### --js-flags=`flags`
Specifies the flags passed to the Node.js engine. It has to be passed when starting
Electron if you want to enable the `flags` in the main process.
Specifies the flags passed to the [V8 engine](https://v8.dev). In order to enable the `flags` in the main process,
this switch must be passed on startup.
```sh
$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
```
See the [Node.js documentation][node-cli] or run `node --help` in your terminal for a list of available flags. Additionally, run `node --v8-options` to see a list of flags that specifically refer to Node.js's V8 JavaScript engine.
Run `node --v8-options` or `electron --js-flags="--help"` in your terminal for the list of available flags. These can be used to enable early-stage JavaScript features, or log and manipulate garbage collection, among other things.
For example, to trace V8 optimization and deoptimization:
```sh
$ electron --js-flags="--trace-opt --trace-deopt" your-app
```
### --lang
@@ -241,19 +247,25 @@ Electron supports some of the [CLI flags][node-cli] supported by Node.js.
**Note:** Passing unsupported command line switches to Electron when it is not running in `ELECTRON_RUN_AS_NODE` will have no effect.
### --inspect-brk\[=\[host:]port]
### `--inspect-brk\[=\[host:]port]`
Activate inspector on host:port and break at start of user script. Default host:port is 127.0.0.1:9229.
Aliased to `--debug-brk=[host:]port`.
### --inspect-port=\[host:]port
#### `--inspect-brk-node[=[host:]port]`
Activate inspector on `host:port` and break at start of the first internal
JavaScript script executed when the inspector is available.
Default `host:port` is `127.0.0.1:9229`.
### `--inspect-port=\[host:]port`
Set the `host:port` to be used when the inspector is activated. Useful when activating the inspector by sending the SIGUSR1 signal. Default host is `127.0.0.1`.
Aliased to `--debug-port=[host:]port`.
### --inspect\[=\[host:]port]
### `--inspect\[=\[host:]port]`
Activate inspector on `host:port`. Default is `127.0.0.1:9229`.
@@ -263,12 +275,37 @@ See the [Debugging the Main Process][debugging-main-process] guide for more deta
Aliased to `--debug[=[host:]port`.
### --inspect-publish-uid=stderr,http
### `--inspect-publish-uid=stderr,http`
Specify ways of the inspector web socket url exposure.
By default inspector websocket url is available in stderr and under /json/list endpoint on http://host:port/json/list.
### `--no-deprecation`
Silence deprecation warnings.
### `--throw-deprecation`
Throw errors for deprecations.
### `--trace-deprecation`
Print stack traces for deprecations.
### `--trace-warnings`
Print stack traces for process warnings (including deprecations).
### `--dns-result-order=order`
Set the default value of the `verbatim` parameter in the Node.js [`dns.lookup()`](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback) and [`dnsPromises.lookup()`](https://nodejs.org/api/dns.html#dnspromiseslookuphostname-options) functions. The value could be:
* `ipv4first`: sets default `verbatim` `false`.
* `verbatim`: sets default `verbatim` `true`.
The default is `verbatim` and `dns.setDefaultResultOrder()` have higher priority than `--dns-result-order`.
[app]: app.md
[append-switch]: command-line.md#commandlineappendswitchswitch-value
[debugging-main-process]: ../tutorial/debugging-main-process.md

View File

@@ -18,7 +18,7 @@ contextBridge.exposeInMainWorld(
)
```
```javascript
```javascript @ts-nocheck
// Renderer (Main World)
window.electron.doThing()
@@ -104,7 +104,7 @@ contextBridge.exposeInIsolatedWorld(
)
```
```javascript
```javascript @ts-nocheck
// Renderer (In isolated world id1004)
window.electron.doThing()

View File

@@ -10,7 +10,9 @@ title is `Electron`:
```javascript
// In the main process.
const { desktopCapturer } = require('electron')
const { BrowserWindow, desktopCapturer } = require('electron')
const mainWindow = new BrowserWindow()
desktopCapturer.getSources({ types: ['window', 'screen'] }).then(async sources => {
for (const source of sources) {
@@ -22,7 +24,7 @@ desktopCapturer.getSources({ types: ['window', 'screen'] }).then(async sources =
})
```
```javascript
```javascript @ts-nocheck
// In the preload script.
const { ipcRenderer } = require('electron')
@@ -89,7 +91,7 @@ The `desktopCapturer` module has the following methods:
* `options` Object
* `types` string[] - An array of strings that lists the types of desktop sources
to be captured, available types are `screen` and `window`.
to be captured, available types can be `screen` and `window`.
* `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail
should be scaled to. Default is `150` x `150`. Set width or height to 0 when you do not need
the thumbnails. This will save the processing time required for capturing the content of each

View File

@@ -72,7 +72,7 @@ and a directory selector, so if you set `properties` to
`['openFile', 'openDirectory']` on these platforms, a directory selector will be
shown.
```js
```js @ts-type={mainWindow:Electron.BrowserWindow}
dialog.showOpenDialogSync(mainWindow, {
properties: ['openFile', 'openDirectory']
})
@@ -139,7 +139,7 @@ and a directory selector, so if you set `properties` to
`['openFile', 'openDirectory']` on these platforms, a directory selector will be
shown.
```js
```js @ts-type={mainWindow:Electron.BrowserWindow}
dialog.showOpenDialog(mainWindow, {
properties: ['openFile', 'openDirectory']
}).then(result => {

View File

@@ -91,8 +91,9 @@ The following events of `chrome.runtime` are supported:
### `chrome.storage`
Only `chrome.storage.local` is supported; `chrome.storage.sync` and
`chrome.storage.managed` are not.
The following methods of `chrome.storage` are supported:
- `chrome.storage.local`
### `chrome.tabs`
@@ -101,6 +102,8 @@ The following methods of `chrome.tabs` are supported:
- `chrome.tabs.sendMessage`
- `chrome.tabs.reload`
- `chrome.tabs.executeScript`
- `chrome.tabs.query` (partial support)
- supported properties: `url`, `title`, `audible`, `active`, `muted`.
- `chrome.tabs.update` (partial support)
- supported properties: `url`, `muted`.
@@ -117,6 +120,9 @@ The following methods of `chrome.management` are supported:
- `chrome.management.getSelf`
- `chrome.management.getPermissionWarningsById`
- `chrome.management.getPermissionWarningsByManifest`
The following events of `chrome.management` are supported:
- `chrome.management.onEnabled`
- `chrome.management.onDisabled`

View File

@@ -89,7 +89,7 @@ tuples. So, the even-numbered offsets are key values, and the odd-numbered
offsets are the associated values. Header names are not lowercased, and
duplicates are not merged.
```javascript
```javascript @ts-type={response:Electron.IncomingMessage}
// Prints something like:
//
// [ 'user-agent',
@@ -100,5 +100,5 @@ duplicates are not merged.
// '127.0.0.1:8000',
// 'ACCEPT',
// '*/*' ]
console.log(request.rawHeaders)
console.log(response.rawHeaders)
```

View File

@@ -72,7 +72,7 @@ Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`
* `channel` string
* `listener` Function<Promise\<void&#62; | any&#62;
* `listener` Function<Promise\<any&#62; | any&#62;
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
* `...args` any[]
@@ -83,14 +83,14 @@ If `listener` returns a Promise, the eventual result of the promise will be
returned as a reply to the remote caller. Otherwise, the return value of the
listener will be used as the value of the reply.
```js title='Main Process'
```js title='Main Process' @ts-type={somePromise:(...args:unknown[])=>Promise<unknown>}
ipcMain.handle('my-invokable-ipc', async (event, ...args) => {
const result = await somePromise(...args)
return result
})
```
```js title='Renderer Process'
```js title='Renderer Process' @ts-type={arg1:unknown} @ts-type={arg2:unknown}
async () => {
const result = await ipcRenderer.invoke('my-invokable-ipc', arg1, arg2)
// ...
@@ -109,8 +109,8 @@ provided to the renderer process. Please refer to
### `ipcMain.handleOnce(channel, listener)`
* `channel` string
* `listener` Function<Promise\<void&#62; | any&#62;
* `event` IpcMainInvokeEvent
* `listener` Function<Promise\<any&#62; | any&#62;
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
* `...args` any[]
Handles a single `invoke`able IPC message, then removes the listener. See
@@ -122,17 +122,6 @@ Handles a single `invoke`able IPC message, then removes the listener. See
Removes any handler for `channel`, if present.
## IpcMainEvent object
The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-main-event`][ipc-main-event] structure docs.
## IpcMainInvokeEvent object
The documentation for the `event` object passed to `handle` callbacks can be
found in the [`ipc-main-invoke-event`][ipc-main-invoke-event]
structure docs.
[IPC tutorial]: ../tutorial/ipc.md
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[web-contents-send]: ../api/web-contents.md#contentssendchannel-args

View File

@@ -26,7 +26,7 @@ The `ipcRenderer` module has the following method to listen for events and send
* `channel` string
* `listener` Function
* `event` IpcRendererEvent
* `event` [IpcRendererEvent][ipc-renderer-event]
* `...args` any[]
Listens to `channel`, when a new message arrives `listener` would be called with
@@ -36,7 +36,7 @@ Listens to `channel`, when a new message arrives `listener` would be called with
* `channel` string
* `listener` Function
* `event` IpcRendererEvent
* `event` [IpcRendererEvent][ipc-renderer-event]
* `...args` any[]
Adds a one time `listener` function for the event. This `listener` is invoked
@@ -101,7 +101,7 @@ The main process should listen for `channel` with
For example:
```javascript
```javascript @ts-type={someArgument:unknown} @ts-type={doSomeWork:(arg:unknown)=>Promise<unknown>}
// Renderer process
ipcRenderer.invoke('some-name', someArgument).then((result) => {
// ...
@@ -208,12 +208,8 @@ Sends a message to a window with `webContentsId` via `channel`.
Like `ipcRenderer.send` but the event will be sent to the `<webview>` element in
the host page instead of the main process.
## Event object
The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-renderer-event`](./structures/ipc-renderer-event.md) structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`window.postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
[`MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
[ipc-renderer-event]: ./structures/ipc-renderer-event.md

View File

@@ -80,6 +80,10 @@ The `menu` object has the following instance methods:
* `positioningItem` number (optional) _macOS_ - The index of the menu item to
be positioned under the mouse cursor at the specified coordinates. Default
is -1.
* `sourceType` string (optional) _Windows_ _Linux_ - This should map to the `menuSourceType`
provided by the `context-menu` event. It is not recommended to set this value manually,
only provide values you receive from other APIs or leave it `undefined`.
Can be `none`, `mouse`, `keyboard`, `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`, `adjustSelection`, or `adjustSelectionReset`.
* `callback` Function (optional) - Called when menu is closed.
Pops up this menu as a context menu in the [`BrowserWindow`](browser-window.md).
@@ -147,7 +151,7 @@ can have a submenu.
An example of creating the application menu with the simple template API:
```javascript
```javascript @ts-expect-error=[107]
const { app, Menu } = require('electron')
const isMac = process.platform === 'darwin'
@@ -267,7 +271,7 @@ menu on behalf of the renderer.
Below is an example of showing a menu when the user right clicks the page:
```js
```js @ts-expect-error=[21]
// renderer
window.addEventListener('contextmenu', (e) => {
e.preventDefault()
@@ -289,7 +293,7 @@ ipcMain.on('show-context-menu', (event) => {
{ label: 'Menu Item 2', type: 'checkbox', checked: true }
]
const menu = Menu.buildFromTemplate(template)
menu.popup(BrowserWindow.fromWebContents(event.sender))
menu.popup({ window: BrowserWindow.fromWebContents(event.sender) })
})
```

View File

@@ -17,7 +17,8 @@ Example:
```js
// Main process
const { MessageChannelMain } = require('electron')
const { BrowserWindow, MessageChannelMain } = require('electron')
const w = new BrowserWindow()
const { port1, port2 } = new MessageChannelMain()
w.webContents.postMessage('port', null, [port2])
port1.postMessage({ some: 'message' })
@@ -26,9 +27,9 @@ port1.postMessage({ some: 'message' })
const { ipcRenderer } = require('electron')
ipcRenderer.on('port', (e) => {
// e.ports is a list of ports sent along with this message
e.ports[0].on('message', (messageEvent) => {
e.ports[0].onmessage = (messageEvent) => {
console.log(messageEvent.data)
})
}
})
```

View File

@@ -306,7 +306,7 @@ Returns `NativeImage` - The cropped image.
* `width` Integer (optional) - Defaults to the image's width.
* `height` Integer (optional) - Defaults to the image's height.
* `quality` string (optional) - The desired quality of the resize image.
Possible values are `good`, `better`, or `best`. The default is `best`.
Possible values include `good`, `better`, or `best`. The default is `best`.
These values express a desired quality/speed tradeoff. They are translated
into an algorithm-specific method that depends on the capabilities
(CPU, GPU) of the underlying platform. It is possible for all three methods

View File

@@ -5,7 +5,7 @@
Process: [Main](../glossary.md#main-process)
```javascript
const { netLog } = require('electron')
const { app, netLog } = require('electron')
app.whenReady().then(async () => {
await netLog.startLogging('/path/to/net-log')

View File

@@ -49,6 +49,8 @@ is used.
Stops the specified power save blocker.
Returns `boolean` - Whether the specified `powerSaveBlocker` has been stopped.
### `powerSaveBlocker.isStarted(id)`
* `id` Integer - The power save blocker id returned by `powerSaveBlocker.start`.

View File

@@ -32,7 +32,7 @@ To have your custom protocol work in combination with a custom session, you need
to register it to that session explicitly.
```javascript
const { session, app, protocol } = require('electron')
const { app, BrowserWindow, net, protocol, session } = require('electron')
const path = require('path')
const url = require('url')
@@ -41,11 +41,11 @@ app.whenReady().then(() => {
const ses = session.fromPartition(partition)
ses.protocol.handle('atom', (request) => {
const path = request.url.slice('atom://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, path)))
const filePath = request.url.slice('atom://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
})
mainWindow = new BrowserWindow({ webPreferences: { partition } })
const mainWindow = new BrowserWindow({ webPreferences: { partition } })
})
```
@@ -121,9 +121,9 @@ Either a `Response` or a `Promise<Response>` can be returned.
Example:
```js
import { app, protocol } from 'electron'
import { join } from 'path'
import { pathToFileURL } from 'url'
const { app, net, protocol } = require('electron')
const { join } = require('path')
const { pathToFileURL } = require('url')
protocol.registerSchemesAsPrivileged([
{
@@ -131,7 +131,7 @@ protocol.registerSchemesAsPrivileged([
privileges: {
standard: true,
secure: true,
supportsFetchAPI: true
supportFetchAPI: true
}
}
])
@@ -147,7 +147,7 @@ app.whenReady().then(() => {
}
// NB, this does not check for paths that escape the bundle, e.g.
// app://bundle/../../secret_file.txt
return net.fetch(pathToFileURL(join(__dirname, pathname)))
return net.fetch(pathToFileURL(join(__dirname, pathname)).toString())
} else if (host === 'api') {
return net.fetch('https://api.my-server.com/' + pathname, {
method: req.method,

View File

@@ -38,3 +38,28 @@ Returns `string` - the decrypted string. Decrypts the encrypted buffer
obtained with `safeStorage.encryptString` back into a string.
This function will throw an error if decryption fails.
### `safeStorage.setUsePlainTextEncryption(usePlainText)`
* `usePlainText` boolean
This function on Linux will force the module to use an in memory password for creating
symmetric key that is used for encrypt/decrypt functions when a valid OS password
manager cannot be determined for the current active desktop environment. This function
is a no-op on Windows and MacOS.
### `safeStorage.getSelectedStorageBackend()` _Linux_
Returns `string` - User friendly name of the password manager selected on Linux.
This function will return one of the following values:
* `basic_text` - When the desktop environment is not recognised or if the following
command line flag is provided `--password-store="basic"`.
* `gnome_libsecret` - When the desktop environment is `X-Cinnamon`, `Deepin`, `GNOME`, `Pantheon`, `XFCE`, `UKUI`, `unity` or if the following command line flag is provided `--password-store="gnome-libsecret"`.
* `kwallet` - When the desktop session is `kde4` or if the following command line flag
is provided `--password-store="kwallet"`.
* `kwallet5` - When the desktop session is `kde5` or if the following command line flag
is provided `--password-store="kwallet5"`.
* `kwallet6` - When the desktop session is `kde6`.
* `unknown` - When the function is called before app has emitted the `ready` event.

View File

@@ -98,7 +98,7 @@ Emitted when Electron is about to download `item` in `webContents`.
Calling `event.preventDefault()` will cancel the download and `item` will not be
available from next tick of the process.
```javascript
```javascript @ts-expect-error=[4]
const { session } = require('electron')
session.defaultSession.on('will-download', (event, item, webContents) => {
event.preventDefault()
@@ -214,7 +214,7 @@ cancel the request. Additionally, permissioning on `navigator.hid` can
be further managed by using [`ses.setPermissionCheckHandler(handler)`](#sessetpermissioncheckhandlerhandler)
and [`ses.setDevicePermissionHandler(handler)`](#sessetdevicepermissionhandlerhandler).
```javascript
```javascript @ts-type={fetchGrantedDevices:()=>(Array<Electron.DevicePermissionHandlerHandlerDetails['device']>)}
const { app, BrowserWindow } = require('electron')
let win = null
@@ -253,7 +253,7 @@ app.whenReady().then(() => {
win.webContents.session.on('select-hid-device', (event, details, callback) => {
event.preventDefault()
const selectedDevice = details.deviceList.find((device) => {
return device.vendorId === '9025' && device.productId === '67'
return device.vendorId === 9025 && device.productId === 67
})
callback(selectedDevice?.deviceId)
})
@@ -320,7 +320,7 @@ cancel the request. Additionally, permissioning on `navigator.serial` can
be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler)
with the `serial` permission.
```javascript
```javascript @ts-type={fetchGrantedDevices:()=>(Array<Electron.DevicePermissionHandlerHandlerDetails['device']>)}
const { app, BrowserWindow } = require('electron')
let win = null
@@ -463,7 +463,7 @@ cancel the request. Additionally, permissioning on `navigator.usb` can
be further managed by using [`ses.setPermissionCheckHandler(handler)`](#sessetpermissioncheckhandlerhandler)
and [`ses.setDevicePermissionHandler(handler)`](#sessetdevicepermissionhandlerhandler).
```javascript
```javascript @ts-type={fetchGrantedDevices:()=>(Array<Electron.DevicePermissionHandlerHandlerDetails['device']>)} @ts-type={updateGrantedDevices:(devices:Array<Electron.DevicePermissionHandlerHandlerDetails['device']>)=>void}
const { app, BrowserWindow } = require('electron')
let win = null
@@ -502,7 +502,7 @@ app.whenReady().then(() => {
win.webContents.session.on('select-usb-device', (event, details, callback) => {
event.preventDefault()
const selectedDevice = details.deviceList.find((device) => {
return device.vendorId === '9025' && device.productId === '67'
return device.vendorId === 9025 && device.productId === 67
})
if (selectedDevice) {
// Optionally, add this to the persisted devices (updateGrantedDevices needs to be implemented by developer to persist permissions)
@@ -574,11 +574,11 @@ Clears the sessions HTTP cache.
* `options` Object (optional)
* `origin` string (optional) - Should follow `window.location.origin`s representation
`scheme://host:port`.
* `storages` string[] (optional) - The types of storages to clear, can contain:
* `storages` string[] (optional) - The types of storages to clear, can be
`cookies`, `filesystem`, `indexdb`, `localstorage`,
`shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not
specified, clear all storage types.
* `quotas` string[] (optional) - The types of quotas to clear, can contain:
* `quotas` string[] (optional) - The types of quotas to clear, can be
`temporary`, `syncable`. If not specified, clear all quotas.
Returns `Promise<void>` - resolves when the storage data has been cleared.
@@ -755,15 +755,17 @@ Sets download saving directory. By default, the download directory will be the
Emulates network with the given configuration for the `session`.
```javascript
const win = new BrowserWindow()
// To emulate a GPRS connection with 50kbps throughput and 500 ms latency.
window.webContents.session.enableNetworkEmulation({
win.webContents.session.enableNetworkEmulation({
latency: 500,
downloadThroughput: 6400,
uploadThroughput: 6400
})
// To emulate a network outage.
window.webContents.session.enableNetworkEmulation({ offline: true })
win.webContents.session.enableNetworkEmulation({ offline: true })
```
#### `ses.preconnect(options)`
@@ -889,18 +891,19 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `permission` string - The type of requested permission.
* `clipboard-read` - Request access to read from the clipboard.
* `clipboard-sanitized-write` - Request access to write to the clipboard.
* `display-capture` - Request access to capture the screen via the [Screen Capture API](https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API).
* `fullscreen` - Request control of the app's fullscreen state via the [Fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API).
* `geolocation` - Request access to the user's location via the [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API)
* `idle-detection` - Request access to the user's idle state via the [IdleDetector API](https://developer.mozilla.org/en-US/docs/Web/API/IdleDetector).
* `media` - Request access to media devices such as camera, microphone and speakers.
* `display-capture` - Request access to capture the screen.
* `mediaKeySystem` - Request access to DRM protected content.
* `geolocation` - Request access to user's current location.
* `notifications` - Request notification creation and the ability to display them in the user's system tray.
* `midi` - Request MIDI access in the `webmidi` API.
* `midiSysex` - Request the use of system exclusive messages in the `webmidi` API.
* `pointerLock` - Request to directly interpret mouse movements as an input method. Click [here](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) to know more. These requests always appear to originate from the main frame.
* `fullscreen` - Request for the app to enter fullscreen mode.
* `midi` - Request MIDI access in the [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API).
* `midiSysex` - Request the use of system exclusive messages in the [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API).
* `notifications` - Request notification creation and the ability to display them in the user's system tray using the [Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/notification)
* `pointerLock` - Request to directly interpret mouse movements as an input method via the [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API). These requests always appear to originate from the main frame.
* `openExternal` - Request to open links in external applications.
* `window-management` - Request access to enumerate screens using the [`getScreenDetails`](https://developer.chrome.com/en/articles/multi-screen-window-placement/) API.
* `unknown` - An unrecognized permission request
* `unknown` - An unrecognized permission request.
* `callback` Function
* `permissionGranted` boolean - Allow or deny the permission.
* `details` Object - Some properties are only available on certain permission types.
@@ -932,7 +935,22 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
* `handler` Function\<boolean> | null
* `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively.
* `permission` string - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, `hid`, `serial`, or `usb`.
* `permission` string - Type of permission check.
* `clipboard-read` - Request access to read from the clipboard.
* `clipboard-sanitized-write` - Request access to write to the clipboard.
* `geolocation` - Access the user's geolocation data via the [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API)
* `fullscreen` - Control of the app's fullscreen state via the [Fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API).
* `hid` - Access the HID protocol to manipulate HID devices via the [WebHID API](https://developer.mozilla.org/en-US/docs/Web/API/WebHID_API).
* `idle-detection` - Access the user's idle state via the [IdleDetector API](https://developer.mozilla.org/en-US/docs/Web/API/IdleDetector).
* `media` - Access to media devices such as camera, microphone and speakers.
* `mediaKeySystem` - Access to DRM protected content.
* `midi` - Enable MIDI access in the [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API).
* `midiSysex` - Use system exclusive messages in the [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API).
* `notifications` - Configure and display desktop notifications to the user with the [Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/notification).
* `openExternal` - Open links in external applications.
* `pointerLock` - Directly interpret mouse movements as an input method via the [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API). These requests always appear to originate from the main frame.
* `serial` - Read from and write to serial devices with the [Web Serial API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API).
* `usb` - Expose non-standard Universal Serial Bus (USB) compatible devices services to the web with the [WebUSB API](https://developer.mozilla.org/en-US/docs/Web/API/WebUSB_API).
* `requestingOrigin` string - The origin URL of the permission check
* `details` Object - Some properties are only available on certain permission types.
* `embeddingOrigin` string (optional) - The origin of the frame embedding the frame that made the permission check. Only set for cross-origin sub frames making permission checks.
@@ -1036,7 +1054,7 @@ Additionally, the default behavior of Electron is to store granted device permis
If longer term storage is needed, a developer can store granted device
permissions (eg when handling the `select-hid-device` event) and then read from that storage with `setDevicePermissionHandler`.
```javascript
```javascript @ts-type={fetchGrantedDevices:()=>(Array<Electron.DevicePermissionHandlerHandlerDetails['device']>)}
const { app, BrowserWindow } = require('electron')
let win = null
@@ -1084,9 +1102,9 @@ app.whenReady().then(() => {
win.webContents.session.on('select-hid-device', (event, details, callback) => {
event.preventDefault()
const selectedDevice = details.deviceList.find((device) => {
return device.vendorId === '9025' && device.productId === '67'
return device.vendorId === 9025 && device.productId === 67
})
callback(selectedPort?.deviceId)
callback(selectedDevice?.deviceId)
})
})
```
@@ -1095,7 +1113,7 @@ app.whenReady().then(() => {
* `handler` Function\<string[]> | null
* `details` Object
* `protectedClasses` string[] - The current list of protected USB classes. Possible class values are:
* `protectedClasses` string[] - The current list of protected USB classes. Possible class values include:
* `audio`
* `audio-video`
* `hid`
@@ -1174,32 +1192,32 @@ macOS does not require a handler because macOS handles the pairing
automatically. To clear the handler, call `setBluetoothPairingHandler(null)`.
```javascript
const { app, BrowserWindow, ipcMain, session } = require('electron')
let bluetoothPinCallback = null
const { app, BrowserWindow, session } = require('electron')
const path = require('path')
function createWindow () {
let bluetoothPinCallback = null
const mainWindow = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
bluetoothPinCallback = callback
// Send a IPC message to the renderer to prompt the user to confirm the pairing.
// Note that this will require logic in the renderer to handle this message and
// display a prompt to the user.
mainWindow.webContents.send('bluetooth-pairing-request', details)
})
// Listen for an IPC message from the renderer to get the response for the Bluetooth pairing.
mainWindow.webContents.ipc.on('bluetooth-pairing-response', (event, response) => {
bluetoothPinCallback(response)
})
}
// Listen for an IPC message from the renderer to get the response for the Bluetooth pairing.
ipcMain.on('bluetooth-pairing-response', (event, response) => {
bluetoothPinCallback(response)
})
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
bluetoothPinCallback = callback
// Send a IPC message to the renderer to prompt the user to confirm the pairing.
// Note that this will require logic in the renderer to handle this message and
// display a prompt to the user.
mainWindow.webContents.send('bluetooth-pairing-request', details)
})
app.whenReady().then(() => {
createWindow()
})
@@ -1282,9 +1300,11 @@ reused for new connections.
Returns `Promise<Buffer>` - resolves with blob data.
#### `ses.downloadURL(url)`
#### `ses.downloadURL(url[, options])`
* `url` string
* `options` Object (optional)
* `headers` Record<string, string> (optional) - HTTP request headers.
Initiates a download of the resource at `url`.
The API will generate a [DownloadItem](download-item.md) that can be accessed

View File

@@ -140,6 +140,16 @@ Possible values are:
* On Linux, possible types are `desktop`, `dock`, `toolbar`, `splash`,
`notification`.
* The `desktop` type places the window at the desktop background window level
(kCGDesktopWindowLevel - 1). However, note that a desktop window will not
receive focus, keyboard, or mouse events. You can still use globalShortcut to
receive input sparingly.
* The `dock` type creates a dock-like window behavior.
* The `toolbar` type creates a window with a toolbar appearance.
* The `splash` type behaves in a specific way. It is not
draggable, even if the CSS styling of the window's body contains
-webkit-app-region: drag. This type is commonly used for splash screens.
* The `notification` type creates a window that behaves like a system notification.
* On macOS, possible types are `desktop`, `textured`, `panel`.
* The `textured` type adds metal gradient appearance
(`NSWindowStyleMaskTexturedBackground`).

View File

@@ -2,6 +2,7 @@
* `sender` [IpcRenderer](../ipc-renderer.md) - The `IpcRenderer` instance that emitted the event originally
* `senderId` Integer - The `webContents.id` that sent the message, you can call `event.sender.sendTo(event.senderId, ...)` to reply to the message, see [ipcRenderer.sendTo][ipc-renderer-sendto] for more information. This only applies to messages sent from a different renderer. Messages sent directly from the main process set `event.senderId` to `0`.
* `senderIsMainFrame` boolean (optional) - Whether the message sent via [ipcRenderer.sendTo][ipc-renderer-sendto] was sent by the main frame. This is relevant when `nodeIntegrationInSubFrames` is enabled in the originating `webContents`.
* `ports` [MessagePort][][] - A list of MessagePorts that were transferred with this message
[ipc-renderer-sendto]: ../ipc-renderer.md#ipcrenderersendtowebcontentsid-channel-args

View File

@@ -0,0 +1,13 @@
# RenderProcessGoneDetails Object
* `reason` string - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Integer - The exit code of the process, unless `reason` is
`launch-failed`, in which case `exitCode` will be a platform-specific
launch failure error code.

View File

@@ -2,9 +2,9 @@
* `portId` string - Unique identifier for the port.
* `portName` string - Name of the port.
* `displayName` string - A string suitable for display to the user for describing this device.
* `vendorId` string - Optional USB vendor ID.
* `productId` string - Optional USB product ID.
* `serialNumber` string - The USB device serial number.
* `usbDriverName` string (optional) - Represents a single serial port on macOS can be enumerated by multiple drivers.
* `deviceInstanceId` string (optional) - A stable identifier on Windows that can be used for device permissions.
* `displayName` string (optional) - A string suitable for display to the user for describing this device.
* `vendorId` string (optional) - The USB vendor ID.
* `productId` string (optional) - The USB product ID.
* `serialNumber` string (optional) - The USB device serial number.
* `usbDriverName` string (optional) _macOS_ - Represents a single serial port on macOS can be enumerated by multiple drivers.
* `deviceInstanceId` string (optional) _Windows_ - A stable identifier on Windows that can be used for device permissions.

View File

@@ -6,7 +6,7 @@ Process: [Main](../glossary.md#main-process)
```javascript
const { systemPreferences } = require('electron')
console.log(systemPreferences.isDarkMode())
console.log(systemPreferences.isAeroGlassEnabled())
```
## Events
@@ -47,12 +47,6 @@ Returns:
## Methods
### `systemPreferences.isDarkMode()` _macOS_ _Windows_ _Deprecated_
Returns `boolean` - Whether the system is in Dark Mode.
**Deprecated:** Should use the new [`nativeTheme.shouldUseDarkColors`](native-theme.md#nativethemeshouldusedarkcolors-readonly) API.
### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_
Returns `boolean` - Whether the Swipe between pages setting is on.
@@ -297,7 +291,7 @@ This API is only available on macOS 10.14 Mojave or newer.
* `window-frame` - Window frame.
* `window-text` - Text in windows.
* On **macOS**
* `alternate-selected-control-text` - The text on a selected surface in a list or table. _deprecated_
* `alternate-selected-control-text` - The text on a selected surface in a list or table. _Deprecated_
* `control-background` - The background of a large interface element, such as a browser or table.
* `control` - The surface of a control.
* `control-text` -The text of a control that isnt disabled.
@@ -356,18 +350,6 @@ Returns `string` - The standard system color formatted as `#RRGGBBAA`.
Returns one of several standard system colors that automatically adapt to vibrancy and changes in accessibility settings like 'Increase contrast' and 'Reduce transparency'. See [Apple Documentation](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#system-colors) for more details.
### `systemPreferences.isInvertedColorScheme()` _Windows_ _Deprecated_
Returns `boolean` - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is active, `false` otherwise.
**Deprecated:** Should use the new [`nativeTheme.shouldUseInvertedColorScheme`](native-theme.md#nativethemeshoulduseinvertedcolorscheme-macos-windows-readonly) API.
### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_ _Deprecated_
Returns `boolean` - `true` if a high contrast theme is active, `false` otherwise.
**Deprecated:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API.
### `systemPreferences.getEffectiveAppearance()` _macOS_
Returns `string` - Can be `dark`, `light` or `unknown`.
@@ -453,7 +435,7 @@ Returns an object with system animation settings.
## Properties
### `systemPreferences.appLevelAppearance` _macOS_
### `systemPreferences.appLevelAppearance` _macOS_ _Deprecated_
A `string` property that can be `dark`, `light` or `unknown`. It determines the macOS appearance setting for
your application. This maps to values in: [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc). Setting this will override the

View File

@@ -87,12 +87,12 @@ const { TouchBarLabel, TouchBarButton, TouchBarSpacer } = TouchBar
let spinning = false
// Reel labels
const reel1 = new TouchBarLabel()
const reel2 = new TouchBarLabel()
const reel3 = new TouchBarLabel()
const reel1 = new TouchBarLabel({ label: '' })
const reel2 = new TouchBarLabel({ label: '' })
const reel3 = new TouchBarLabel({ label: '' })
// Spin result label
const result = new TouchBarLabel()
const result = new TouchBarLabel({ label: '' })
// Spin button
const spin = new TouchBarButton({

View File

@@ -98,7 +98,7 @@ async function lookupTargetId (browserWindow) {
await wc.debugger.attach('1.3')
const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo')
const { targetId } = targetInfo
const targetWebContents = await webContents.fromDevToolsTargetId(targetId)
const targetWebContents = await wc.fromDevToolsTargetId(targetId)
}
```
@@ -239,9 +239,8 @@ Returns:
* `details` Event<>
* `url` string - The URL the frame is navigating to.
* `isSameDocument` boolean - Whether the navigation happened without changing
document. Examples of same document navigations are reference fragment
navigations, pushState/replaceState, and same page history navigation.
* `isSameDocument` boolean - This event does not fire for same document navigations using window.history api and reference fragment navigations.
This property is always set to `false` for this event.
* `isMainFrame` boolean - True if the navigation is taking place in a main frame.
* `frame` WebFrameMain - The frame to be navigated.
* `initiator` WebFrameMain (optional) - The frame which initiated the
@@ -273,6 +272,8 @@ Returns:
* `details` Event<>
* `url` string - The URL the frame is navigating to.
* `isSameDocument` boolean - This event does not fire for same document navigations using window.history api and reference fragment navigations.
This property is always set to `false` for this event.
* `isMainFrame` boolean - True if the navigation is taking place in a main frame.
* `frame` WebFrameMain - The frame to be navigated.
* `initiator` WebFrameMain (optional) - The frame which initiated the
@@ -478,18 +479,7 @@ checking `reason === 'killed'` when you switch to that event.
Returns:
* `event` Event
* `details` Object
* `reason` string - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Integer - The exit code of the process, unless `reason` is
`launch-failed`, in which case `exitCode` will be a platform-specific
launch failure error code.
* `details` [RenderProcessGoneDetails](structures/render-process-gone-details.md)
Emitted when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
@@ -794,7 +784,7 @@ Returns:
* `frameCharset` string - The character encoding of the frame on which the
menu was invoked.
* `inputFieldType` string - If the context menu was invoked on an input
field, the type of that field. Possible values are `none`, `plainText`,
field, the type of that field. Possible values include `none`, `plainText`,
`password`, `other`.
* `spellcheckEnabled` boolean - If the context is editable, whether or not spellchecking is enabled.
* `menuSourceType` string - Input source that invoked the context menu.
@@ -1020,9 +1010,9 @@ e.g. the `http://` or `file://`. If the load should bypass http cache then
use the `pragma` header to achieve it.
```javascript
const { webContents } = require('electron')
const win = new BrowserWindow()
const options = { extraHeaders: 'pragma: no-cache\n' }
webContents.loadURL('https://github.com', options)
win.webContents.loadURL('https://github.com', options)
```
#### `contents.loadFile(filePath[, options])`
@@ -1052,6 +1042,7 @@ an app structure like this:
Would require code like this
```js
const win = new BrowserWindow()
win.loadFile('src/index.html')
```
@@ -1188,7 +1179,9 @@ when this process is unstable or unusable, for instance in order to recover
from the `unresponsive` event.
```js
contents.on('unresponsive', async () => {
const win = new BrowserWindow()
win.webContents.on('unresponsive', async () => {
const { response } = await dialog.showMessageBox({
message: 'App X has become unresponsive',
title: 'Do you want to try forcefully reloading the app?',
@@ -1196,8 +1189,8 @@ contents.on('unresponsive', async () => {
cancelId: 1
})
if (response === 0) {
contents.forcefullyCrashRenderer()
contents.reload()
win.webContents.forcefullyCrashRenderer()
win.webContents.reload()
}
})
```
@@ -1224,8 +1217,9 @@ Injects CSS into the current web page and returns a unique key for the inserted
stylesheet.
```js
contents.on('did-finish-load', () => {
contents.insertCSS('html, body { background-color: #f00; }')
const win = new BrowserWindow()
win.webContents.on('did-finish-load', () => {
win.webContents.insertCSS('html, body { background-color: #f00; }')
})
```
@@ -1239,9 +1233,11 @@ Removes the inserted CSS from the current web page. The stylesheet is identified
by its key, which is returned from `contents.insertCSS(css)`.
```js
contents.on('did-finish-load', async () => {
const key = await contents.insertCSS('html, body { background-color: #f00; }')
contents.removeInsertedCSS(key)
const win = new BrowserWindow()
win.webContents.on('did-finish-load', async () => {
const key = await win.webContents.insertCSS('html, body { background-color: #f00; }')
win.webContents.removeInsertedCSS(key)
})
```
@@ -1262,7 +1258,9 @@ this limitation.
Code execution will be suspended until web page stop loading.
```js
contents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1").then(resp => resp.json())', true)
const win = new BrowserWindow()
win.webContents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1").then(resp => resp.json())', true)
.then((result) => {
console.log(result) // Will be the JSON object from the fetch call
})
@@ -1373,7 +1371,8 @@ Sets the maximum and minimum pinch-to-zoom level.
> **NOTE**: Visual zoom is disabled by default in Electron. To re-enable it, call:
>
> ```js
> contents.setVisualZoomLevelLimits(1, 3)
> const win = new BrowserWindow()
> win.webContents.setVisualZoomLevelLimits(1, 3)
> ```
#### `contents.undo()`
@@ -1457,11 +1456,11 @@ For a call of `win.webContents.adjustSelection({ start: 1, end: 5 })`
Before:
<img width="487" alt="Image Before Text Selection Adjustment" src="https://user-images.githubusercontent.com/2036040/231761306-cd4e7b15-c2ed-46cf-8e80-10811f6de83e.png">
<img width="487" alt="Image Before Text Selection Adjustment" src="../images/web-contents-text-selection-before.png"/>
After:
<img width="487" alt="Image After Text Selection Adjustment" src="https://user-images.githubusercontent.com/2036040/231761169-887eb8ef-06fb-46e4-9efa-898bcb0d6a2b.png">
<img width="487" alt="Image After Text Selection Adjustment" src="../images/web-contents-text-selection-after.png"/>
#### `contents.replace(text)`
@@ -1508,12 +1507,12 @@ can be obtained by subscribing to [`found-in-page`](web-contents.md#event-found-
Stops any `findInPage` request for the `webContents` with the provided `action`.
```javascript
const { webContents } = require('electron')
webContents.on('found-in-page', (event, result) => {
if (result.finalUpdate) webContents.stopFindInPage('clearSelection')
const win = new BrowserWindow()
win.webContents.on('found-in-page', (event, result) => {
if (result.finalUpdate) win.webContents.stopFindInPage('clearSelection')
})
const requestId = webContents.findInPage('api')
const requestId = win.webContents.findInPage('api')
console.log(requestId)
```
@@ -1593,6 +1592,7 @@ Use `page-break-before: always;` CSS style to force to print to a new page.
Example usage:
```js
const win = new BrowserWindow()
const options = {
silent: true,
deviceName: 'My-Printer',
@@ -1889,8 +1889,9 @@ For example:
```js
// Main process
const win = new BrowserWindow()
const { port1, port2 } = new MessageChannelMain()
webContents.postMessage('port', { message: 'hello' }, [port1])
win.webContents.postMessage('port', { message: 'hello' }, [port1])
// Renderer process
ipcRenderer.on('port', (e, msg) => {

View File

@@ -128,8 +128,9 @@ For example:
```js
// Main process
const win = new BrowserWindow()
const { port1, port2 } = new MessageChannelMain()
webContents.mainFrame.postMessage('port', { message: 'hello' }, [port1])
win.webContents.mainFrame.postMessage('port', { message: 'hello' }, [port1])
// Renderer process
ipcRenderer.on('port', (e, msg) => {

View File

@@ -96,13 +96,12 @@ with an array of misspelt words when complete.
An example of using [node-spellchecker][spellchecker] as provider:
```javascript
```javascript @ts-expect-error=[2,6]
const { webFrame } = require('electron')
const spellChecker = require('spellchecker')
webFrame.setSpellCheckProvider('en-US', {
spellCheck (words, callback) {
setTimeout(() => {
const spellchecker = require('spellchecker')
const misspelled = words.filter(x => spellchecker.isMisspelled(x))
callback(misspelled)
}, 0)

View File

@@ -255,7 +255,7 @@ The `webview` tag has the following methods:
**Example**
```javascript
```javascript @ts-expect-error=[3]
const webview = document.querySelector('webview')
webview.addEventListener('dom-ready', () => {
webview.openDevTools()
@@ -799,7 +799,7 @@ Fired when the guest window logs a console message.
The following example code forwards all log messages to the embedder's console
without regard for log level or other properties.
```javascript
```javascript @ts-expect-error=[3]
const webview = document.querySelector('webview')
webview.addEventListener('console-message', (e) => {
console.log('Guest page logged a message:', e.message)
@@ -820,7 +820,7 @@ Returns:
Fired when a result is available for
[`webview.findInPage`](#webviewfindinpagetext-options) request.
```javascript
```javascript @ts-expect-error=[3,6]
const webview = document.querySelector('webview')
webview.addEventListener('found-in-page', (e) => {
webview.stopFindInPage('keepSelection')
@@ -945,7 +945,7 @@ Fired when the guest page attempts to close itself.
The following example code navigates the `webview` to `about:blank` when the
guest attempts to close itself.
```javascript
```javascript @ts-expect-error=[3]
const webview = document.querySelector('webview')
webview.addEventListener('close', () => {
webview.src = 'about:blank'
@@ -965,7 +965,7 @@ Fired when the guest page has sent an asynchronous message to embedder page.
With `sendToHost` method and `ipc-message` event you can communicate
between guest page and embedder page:
```javascript
```javascript @ts-expect-error=[4,7]
// In embedder page.
const webview = document.querySelector('webview')
webview.addEventListener('ipc-message', (event) => {
@@ -983,9 +983,22 @@ ipcRenderer.on('ping', () => {
})
```
### Event: 'crashed'
### Event: 'crashed' _Deprecated_
Fired when the renderer process is crashed.
Fired when the renderer process crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process disappeared. It
isn't always because it crashed.
### Event: 'render-process-gone'
Returns:
* `details` [RenderProcessGoneDetails](structures/render-process-gone-details.md)
Fired when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
### Event: 'plugin-crashed'
@@ -1091,7 +1104,7 @@ Returns:
* `frameCharset` string - The character encoding of the frame on which the
menu was invoked.
* `inputFieldType` string - If the context menu was invoked on an input
field, the type of that field. Possible values are `none`, `plainText`,
field, the type of that field. Possible values include `none`, `plainText`,
`password`, `other`.
* `spellcheckEnabled` boolean - If the context is editable, whether or not spellchecking is enabled.
* `menuSourceType` string - Input source that invoked the context menu.

View File

@@ -59,7 +59,7 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn
* Non-standard features (that are not handled by Chromium or Electron) given in
`features` will be passed to any registered `webContents`'s
`did-create-window` event handler in the `options` argument.
* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters).
* `frameName` follows the specification of `target` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters).
* When opening `about:blank`, the child window's [`WebPreferences`](structures/web-preferences.md) will be copied
from the parent window, and there is no way to override it because Chromium
skips browser side navigation in this case.

View File

@@ -12,6 +12,68 @@ This document uses the following convention to categorize breaking changes:
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (27.0)
### Removed: macOS 10.13 / 10.14 support
macOS 10.13 (High Sierra) and macOS 10.14 (Mojave) are no longer supported by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/4629466).
Older versions of Electron will continue to run on these operating systems, but macOS 10.15 (Catalina)
or later will be required to run Electron v27.0.0 and higher.
## Planned Breaking API Changes (26.0)
### Deprecated: `webContents.getPrinters`
The `webContents.getPrinters` method has been deprecated. Use
`webContents.getPrintersAsync` instead.
```js
const w = new BrowserWindow({ show: false })
// Deprecated
console.log(w.webContents.getPrinters())
// Replace with
w.webContents.getPrintersAsync().then((printers) => {
console.log(printers)
})
```
### Deprecated: `systemPreferences.{get,set}AppLevelAppearance` and `systemPreferences.appLevelAppearance`
The `systemPreferences.getAppLevelAppearance` and `systemPreferences.setAppLevelAppearance`
methods have been deprecated, as well as the `systemPreferences.appLevelAppearance` property.
Use the `nativeTheme` module instead.
```js
// Deprecated
systemPreferences.getAppLevelAppearance()
// Replace with
nativeTheme.shouldUseDarkColors
// Deprecated
systemPreferences.appLevelAppearance
// Replace with
nativeTheme.shouldUseDarkColors
// Deprecated
systemPreferences.setAppLevelAppearance('dark')
// Replace with
nativeTheme.themeSource = 'dark'
```
### Deprecated: `alternate-selected-control-text` value for `systemPreferences.getColor`
The `alternate-selected-control-text` value for `systemPreferences.getColor`
has been deprecated. Use `selected-content-background` instead.
```js
// Deprecated
systemPreferences.getColor('alternate-selected-control-text')
// Replace with
systemPreferences.getColor('selected-content-background')
```
## Planned Breaking API Changes (25.0)
### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol`

View File

@@ -1,62 +0,0 @@
# Updating an Appveyor Azure Image
Electron CI on Windows uses AppVeyor, which in turn uses Azure VM images to run. Occasionally, these VM images need to be updated due to changes in Chromium requirements. In order to update you will need [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3&viewFallbackFrom=powershell-6) and the [Azure PowerShell module](https://learn.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-9.5.0&viewFallbackFrom=azps-1.8.0).
Occasionally we need to update these images owing to changes in Chromium or other miscellaneous build requirement changes.
Example Use Case:
* We need `VS15.9` and we have `VS15.7` installed; this would require us to update an Azure image.
1. Identify the image you wish to modify.
* In [appveyor.yml](https://github.com/electron/electron/blob/main/appveyor.yml), the image is identified by the property _image_.
* The names used correspond to the _"images"_ defined for a build cloud, eg the [libcc-20 cloud](https://windows-ci.electronjs.org/build-clouds/8).
* Find the image you wish to modify in the build cloud and make note of the **VHD Blob Path** for that image, which is the value for that corresponding key.
* You will need this URI path to copy into a new image.
* You will also need the storage account name which is labeled in AppVeyor as the **Disk Storage Account Name**
2. Get the Azure storage account key
* Log into Azure using credentials stored in LastPass (under Azure Enterprise) and then find the storage account corresponding to the name found in AppVeyor.
* Example, for `appveyorlibccbuilds` **Disk Storage Account Name** you'd look for `appveyorlibccbuilds` in the list of storage accounts @ Home < Storage Accounts
* Click into it and look for `Access Keys`, and then you can use any of the keys present in the list.
3. Get the full virtual machine image URI from Azure
* Navigate to Home < Storage Accounts < `$ACCT_NAME` < Blobs < Images
* In the following list, look for the VHD path name you got from Appveyor and then click on it.
* Copy the whole URL from the top of the subsequent window.
4. Copy the image using the [Copy Master Image PowerShell script](https://github.com/appveyor/ci/blob/master/scripts/enterprise/copy-master-image-azure.ps1).
* It is essential to copy the VM because if you spin up a VM against an image that image cannot at the same time be used by AppVeyor.
* Use the storage account name, key, and URI obtained from Azure to run this script.
* See Step 3 for URI & when prompted, press enter to use same storage account as destination.
* Use default destination container name `(images)`
* Also, when naming the copy, use a name that indicates what the new image will contain (if that has changed) and date stamp.
* Ex. `libcc-20core-vs2017-15.9-2019-04-15.vhd`
* Go into Azure and get the URI for the newly created image as described in a previous step
5. Spin up a new VM using the [Create Master VM from VHD PowerShell](https://github.com/appveyor/ci/blob/master/scripts/enterprise/create_master_vm_from_vhd.ps1).
* From PowerShell, execute `ps1` file with `./create_master_vm_from_vhd.ps1`
* You will need the credential information available in the AppVeyor build cloud definition.
* This includes:
* Client ID
* Client Secret
* Tenant ID
* Subscription ID
* Resource Group
* Virtual Network
* You will also need to specify
* Master VM name - just a unique name to identify the temporary VM
* Master VM size - use `Standard_F32s_v2`
* Master VHD URI - use URI obtained @ end of previous step
* Location use `East US`
6. Log back into Azure and find the VM you just created in Home < Virtual Machines < `$YOUR_NEW_VM`
* You can download a RDP (Remote Desktop) file to access the VM.
7. Using Microsoft Remote Desktop, click `Connect` to connect to the VM.
* Credentials for logging into the VM are found in LastPass under the `AppVeyor Enterprise master VM` credentials.
8. Modify the VM as required.
9. Shut down the VM and then delete it in Azure.
10. Add the new image to the Appveyor Cloud settings or modify an existing image to point to the new VHD.

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -55,7 +55,7 @@ fs.readdirSync('/path/to/example.asar')
Use a module from the archive:
```javascript
```javascript @ts-nocheck
require('./path/to/example.asar/dir/module.js')
```

View File

@@ -40,8 +40,10 @@ Valid `algorithm` values are currently `SHA256` only. The `hash` is a hash of t
ASAR integrity checking is currently disabled by default and can be enabled by toggling a fuse. See [Electron Fuses](fuses.md) for more information on what Electron Fuses are and how they work. When enabling this fuse you typically also want to enable the `onlyLoadAppFromAsar` fuse otherwise the validity checking can be bypassed via the Electron app code search path.
```js
require('@electron/fuses').flipFuses(
```js @ts-nocheck
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses')
flipFuses(
// E.g. /a/b/Foo.app
pathToPackagedApp,
{

View File

@@ -90,7 +90,7 @@ Usage of `selenium-webdriver` with Electron is the same as with
normal websites, except that you have to manually specify how to connect
ChromeDriver and where to find the binary of your Electron app:
```js title='test.js'
```js title='test.js' @ts-expect-error=[1]
const webdriver = require('selenium-webdriver')
const driver = new webdriver.Builder()
// The "9515" is the port opened by ChromeDriver.
@@ -155,7 +155,7 @@ Playwright launches your app in development mode through the `_electron.launch`
To point this API to your Electron app, you can pass the path to your main process
entry point (here, it is `main.js`).
```js {5}
```js {5} @ts-nocheck
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
@@ -169,7 +169,7 @@ test('launch app', async () => {
After that, you will access to an instance of Playwright's `ElectronApp` class. This
is a powerful class that has access to main process modules for example:
```js {6-11}
```js {6-11} @ts-nocheck
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
@@ -189,7 +189,7 @@ test('get isPackaged', async () => {
It can also create individual [Page][playwright-page] objects from Electron BrowserWindow instances.
For example, to grab the first BrowserWindow and save a screenshot:
```js {6-7}
```js {6-7} @ts-nocheck
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
@@ -205,7 +205,7 @@ test('save screenshot', async () => {
Putting all this together using the PlayWright Test runner, let's create a `example.spec.js`
test file with a single test and assertion:
```js title='example.spec.js'
```js title='example.spec.js' @ts-nocheck
const { _electron: electron } = require('playwright')
const { test, expect } = require('@playwright/test')
@@ -259,7 +259,7 @@ expose custom methods to your test suite.
To create a custom driver, we'll use Node.js' [`child_process`](https://nodejs.org/api/child_process.html) API.
The test suite will spawn the Electron process, then establish a simple messaging protocol:
```js title='testDriver.js'
```js title='testDriver.js' @ts-nocheck
const childProcess = require('child_process')
const electronPath = require('electron')
@@ -296,7 +296,7 @@ For convenience, you may want to wrap `appProcess` in a driver object that provi
high-level functions. Here is an example of how you can do this. Let's start by creating
a `TestDriver` class:
```js title='testDriver.js'
```js title='testDriver.js' @ts-nocheck
class TestDriver {
constructor ({ path, args, env }) {
this.rpcCalls = []
@@ -378,7 +378,7 @@ framework of your choosing. The following example uses
[`ava`](https://www.npmjs.com/package/ava), but other popular choices like Jest
or Mocha would work as well:
```js title='test.js'
```js title='test.js' @ts-nocheck
const test = require('ava')
const electronPath = require('electron')
const { TestDriver } = require('./testDriver')

View File

@@ -67,7 +67,7 @@ are likely using [`electron-packager`][], which includes [`@electron/osx-sign`][
If you're using Packager's API, you can pass [in configuration that both signs
and notarizes your application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html).
```js
```js @ts-nocheck
const packager = require('electron-packager')
packager({
@@ -116,7 +116,7 @@ Electron app. This is the tool used under the hood by Electron Forge's
`electron-winstaller` directly, use the `certificateFile` and `certificatePassword` configuration
options when creating your installer.
```js {10-11}
```js {10-11} @ts-nocheck
const electronInstaller = require('electron-winstaller')
// NB: Use this syntax within an async function, Node does not have support for
// top-level await as of Node 12.
@@ -146,7 +146,7 @@ If you're not using Electron Forge and want to use `electron-wix-msi` directly,
`certificateFile` and `certificatePassword` configuration options
or pass in parameters directly to [SignTool.exe][] with the `signWithParams` option.
```js {12-13}
```js {12-13} @ts-nocheck
import { MSICreator } from 'electron-wix-msi'
// Step 1: Instantiate the MSICreator

View File

@@ -16,7 +16,7 @@ Context isolation has been enabled by default since Electron 12, and it is a rec
Exposing APIs from your preload script to a loaded website in the renderer process is a common use-case. With context isolation disabled, your preload script would share a common global `window` object with the renderer. You could then attach arbitrary properties to a preload script:
```javascript title='preload.js'
```javascript title='preload.js' @ts-nocheck
// preload with contextIsolation disabled
window.myAPI = {
doAThing: () => {}
@@ -25,7 +25,7 @@ window.myAPI = {
The `doAThing()` function could then be used directly in the renderer process:
```javascript title='renderer.js'
```javascript title='renderer.js' @ts-nocheck
// use the exposed API in the renderer
window.myAPI.doAThing()
```
@@ -43,7 +43,7 @@ contextBridge.exposeInMainWorld('myAPI', {
})
```
```javascript title='renderer.js'
```javascript title='renderer.js' @ts-nocheck
// use the exposed API in the renderer
window.myAPI.doAThing()
```
@@ -98,7 +98,7 @@ declare global {
Doing so will ensure that the TypeScript compiler will know about the `electronAPI` property on your global `window` object when writing scripts in your renderer process:
```typescript title='renderer.ts'
```typescript title='renderer.ts' @ts-nocheck
window.electronAPI.loadPreferences()
```

View File

@@ -116,7 +116,7 @@ Now the renderer process can communicate with the main process securely and perf
The `renderer.js` file is responsible for controlling the `<button>` functionality.
```js title='renderer.js'
```js title='renderer.js' @ts-expect-error=[2,7]
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
const isDarkMode = await window.darkMode.toggle()
document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'

View File

@@ -9,10 +9,11 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
| 26.0.0 | 2023-Jun-01 | 2023-Jun-27 | 2023-Aug-08 | TBD | M116 | TBD | ✅ |
| 25.0.0 | 2023-Apr-10 | 2023-May-02 | 2023-May-30 | 2023-Dec-05 | M114 | TBD | ✅ |
| 24.0.0 | 2022-Feb-09 | 2023-Mar-07 | 2023-Apr-04 | 2023-Oct-03 | M112 | v18.14 | ✅ |
| 23.0.0 | 2022-Dec-01 | 2023-Jan-10 | 2023-Feb-07 | 2023-Aug-08 | M110 | v18.12 | ✅ |
| 27.0.0 | 2023-Aug-17 | 2023-Sep-13 | 2023-Oct-10 | TBD | M118 | TBD | ✅ |
| 26.0.0 | 2023-Jun-01 | 2023-Jun-27 | 2023-Aug-15 | 2024-Feb-27 | M116 | v18.16 | ✅ |
| 25.0.0 | 2023-Apr-10 | 2023-May-02 | 2023-May-30 | 2024-Jan-02 | M114 | v18.15 | ✅ |
| 24.0.0 | 2022-Feb-09 | 2023-Mar-07 | 2023-Apr-04 | 2023-Oct-10 | M112 | v18.14 | ✅ |
| 23.0.0 | 2022-Dec-01 | 2023-Jan-10 | 2023-Feb-07 | 2023-Aug-15 | M110 | v18.12 | 🚫 |
| 22.0.0 | 2022-Sep-29 | 2022-Oct-25 | 2022-Nov-29 | 2023-Oct-10 | M108 | v16.17 | ✅ |
| 21.0.0 | 2022-Aug-04 | 2022-Aug-30 | 2022-Sep-27 | 2023-Apr-04 | M106 | v16.16 | 🚫 |
| 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | 2023-Feb-07 | M104 | v16.15 | 🚫 |

View File

@@ -67,8 +67,10 @@ The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is
We've made a handy module, [`@electron/fuses`](https://npmjs.com/package/@electron/fuses), to make flipping these fuses easy. Check out the README of that module for more details on usage and potential error cases.
```js
require('@electron/fuses').flipFuses(
```js @ts-nocheck
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses')
flipFuses(
// Path to electron
require('electron'),
// Fuses to flip
@@ -82,7 +84,7 @@ require('@electron/fuses').flipFuses(
You can validate the fuses have been flipped or check the fuse status of an arbitrary Electron app using the fuses CLI.
```bash
npx @electron/fuses read --app /Applications/Foo.app
npx @electron/fuses read --app /Applications/Foo.app
```
### The hard way

View File

@@ -66,7 +66,7 @@ You can use environment variables to override the base URL, the path at which to
look for Electron binaries, and the binary filename. The URL used by `@electron/get`
is composed as follows:
```javascript
```javascript @ts-nocheck
url = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME
```

View File

@@ -138,7 +138,7 @@ To make these elements interactive, we'll be adding a few lines of code in the i
`renderer.js` file that leverages the `window.electronAPI` functionality exposed from the preload
script:
```javascript title='renderer.js (Renderer Process)'
```javascript title='renderer.js (Renderer Process)' @ts-expect-error=[4,5]
const setButton = document.getElementById('btn')
const titleInput = document.getElementById('title')
setButton.addEventListener('click', () => {
@@ -182,13 +182,13 @@ provided to the renderer process. Please refer to
:::
```javascript {6-13,25} title='main.js (Main Process)'
const { BrowserWindow, dialog, ipcMain } = require('electron')
const { app, BrowserWindow, dialog, ipcMain } = require('electron')
const path = require('path')
// ...
async function handleFileOpen () {
const { canceled, filePaths } = await dialog.showOpenDialog()
const { canceled, filePaths } = await dialog.showOpenDialog({})
if (!canceled) {
return filePaths[0]
}
@@ -203,7 +203,7 @@ function createWindow () {
mainWindow.loadFile('index.html')
}
app.whenReady(() => {
app.whenReady().then(() => {
ipcMain.handle('dialog:openFile', handleFileOpen)
createWindow()
})
@@ -263,7 +263,7 @@ The UI consists of a single `#btn` button element that will be used to trigger o
a `#filePath` element that will be used to display the path of the selected file. Making these
pieces work will take a few lines of code in the renderer process script:
```javascript title='renderer.js (Renderer Process)'
```javascript title='renderer.js (Renderer Process)' @ts-expect-error=[5]
const btn = document.getElementById('btn')
const filePathElement = document.getElementById('filePath')
@@ -412,7 +412,7 @@ function createWindow () {
For the purposes of the tutorial, it's important to note that the `click` handler
sends a message (either `1` or `-1`) to the renderer process through the `update-counter` channel.
```javascript
```javascript @ts-nocheck
click: () => mainWindow.webContents.send('update-counter', -1)
```
@@ -486,7 +486,7 @@ To tie it all together, we'll create an interface in the loaded HTML file that c
Finally, to make the values update in the HTML document, we'll add a few lines of DOM manipulation
so that the value of the `#counter` element is updated whenever we fire an `update-counter` event.
```javascript title='renderer.js (Renderer Process)'
```javascript title='renderer.js (Renderer Process)' @ts-nocheck
const counter = document.getElementById('counter')
window.electronAPI.onUpdateCounter((_event, value) => {
@@ -509,7 +509,7 @@ We can demonstrate this with slight modifications to the code from the previous
renderer process, use the `event` parameter to send a reply back to the main process through the
`counter-value` channel.
```javascript title='renderer.js (Renderer Process)'
```javascript title='renderer.js (Renderer Process)' @ts-nocheck
const counter = document.getElementById('counter')
window.electronAPI.onUpdateCounter((event, value) => {

View File

@@ -56,7 +56,7 @@ Starting with a working application from the
[Quick Start Guide](quick-start.md), update the `main.js` file with the
following lines:
```javascript fiddle='docs/fiddles/features/keyboard-shortcuts/global'
```javascript fiddle='docs/fiddles/features/keyboard-shortcuts/global' @ts-type={createWindow:()=>void}
const { app, globalShortcut } = require('electron')
app.whenReady().then(() => {
@@ -131,7 +131,7 @@ If you don't want to do manual shortcut parsing, there are libraries that do
advanced key detection, such as [mousetrap][]. Below are examples of usage of the
`mousetrap` running in the Renderer process:
```js
```js @ts-nocheck
Mousetrap.bind('4', () => { console.log('4') })
Mousetrap.bind('?', () => { console.log('show shortcuts!') })
Mousetrap.bind('esc', () => { console.log('escape') }, 'keyup')

View File

@@ -45,6 +45,8 @@ if (process.defaultApp) {
We will now define the function in charge of creating our browser window and load our application's `index.html` file.
```javascript
let mainWindow
const createWindow = () => {
// Create the browser window.
mainWindow = new BrowserWindow({
@@ -61,11 +63,11 @@ const createWindow = () => {
In this next step, we will create our `BrowserWindow` and tell our application how to handle an event in which an external protocol is clicked.
This code will be different in Windows compared to MacOS and Linux. This is due to Windows requiring additional code in order to open the contents of the protocol link within the same Electron instance. Read more about this [here](../api/app.md#apprequestsingleinstancelockadditionaldata).
This code will be different in Windows and Linux compared to MacOS. This is due to both platforms emitting the `second-instance` event rather than the `open-url` event and Windows requiring additional code in order to open the contents of the protocol link within the same Electron instance. Read more about this [here](../api/app.md#apprequestsingleinstancelockadditionaldata).
#### Windows code:
#### Windows and Linux code:
```javascript
```javascript @ts-type={mainWindow:Electron.BrowserWindow} @ts-type={createWindow:()=>void}
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
@@ -78,8 +80,7 @@ if (!gotTheLock) {
mainWindow.focus()
}
// the commandLine is array of strings in which last element is deep link url
// the url str ends with /
dialog.showErrorBox('Welcome Back', `You arrived from: ${commandLine.pop().slice(0, -1)}`)
dialog.showErrorBox('Welcome Back', `You arrived from: ${commandLine.pop()}`)
})
// Create mainWindow, load the rest of the app, etc...
@@ -89,9 +90,9 @@ if (!gotTheLock) {
}
```
#### MacOS and Linux code:
#### MacOS code:
```javascript
```javascript @ts-type={createWindow:()=>void}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
@@ -166,7 +167,7 @@ If you're using Electron Packager's API, adding support for protocol handlers is
Electron Forge is handled, except
`protocols` is part of the Packager options passed to the `packager` function.
```javascript
```javascript @ts-nocheck
const packager = require('electron-packager')
packager({

View File

@@ -126,7 +126,7 @@ app.whenReady().then(async () => {
Then, in your preload scripts you receive the port through IPC and set up the
listeners.
```js title='preloadMain.js and preloadSecondary.js (Preload scripts)'
```js title='preloadMain.js and preloadSecondary.js (Preload scripts)' @ts-nocheck
const { ipcRenderer } = require('electron')
ipcRenderer.on('port', e => {
@@ -148,9 +148,9 @@ That means window.electronMessagePort is globally available and you can call
`postMessage` on it from anywhere in your app to send a message to the other
renderer.
```js title='renderer.js (Renderer Process)'
```js title='renderer.js (Renderer Process)' @ts-nocheck
// elsewhere in your code to send a message to the other renderers message handler
window.electronMessagePort.postmessage('ping')
window.electronMessagePort.postMessage('ping')
```
### Worker process
@@ -181,7 +181,7 @@ app.whenReady().then(async () => {
// We can't use ipcMain.handle() here, because the reply needs to transfer a
// MessagePort.
// Listen for message sent from the top-level frame
mainWindow.webContents.mainFrame.on('request-worker-channel', (event) => {
mainWindow.webContents.mainFrame.ipc.on('request-worker-channel', (event) => {
// Create a new channel ...
const { port1, port2 } = new MessageChannelMain()
// ... send one end to the worker ...
@@ -245,7 +245,7 @@ Electron's built-in IPC methods only support two modes: fire-and-forget
can implement a "response stream", where a single request responds with a
stream of data.
```js title='renderer.js (Renderer Process)'
```js title='renderer.js (Renderer Process)' @ts-expect-error=[18]
const makeStreamingRequest = (element, callback) => {
// MessageChannels are lightweight--it's cheap to create a new one for each
// request.

View File

@@ -42,7 +42,7 @@ safe.
The only way to load a native module safely for now, is to make sure the app
loads no native modules after the Web Workers get started.
```javascript
```javascript @ts-expect-error=[1]
process.dlopen = () => {
throw new Error('Load native module is not safe')
}

View File

@@ -22,6 +22,7 @@ In `preload.js` use the [`contextBridge`][] to inject a method `window.electron.
```js
const { contextBridge, ipcRenderer } = require('electron')
const path = require('path')
contextBridge.exposeInMainWorld('electron', {
startDrag: (fileName) => {
@@ -43,7 +44,7 @@ Add a draggable element to `index.html`, and reference your renderer script:
In `renderer.js` set up the renderer process to handle drag events by calling the method you added via the [`contextBridge`][] above.
```javascript
```javascript @ts-expect-error=[3]
document.getElementById('drag').ondragstart = (event) => {
event.preventDefault()
window.electron.startDrag('drag-and-drop.md')

View File

@@ -172,7 +172,7 @@ in the fictitious `.foo` format. In order to do that, it relies on the
equally fictitious `foo-parser` module. In traditional Node.js development,
you might write code that eagerly loads dependencies:
```js title='parser.js'
```js title='parser.js' @ts-expect-error=[2]
const fs = require('fs')
const fooParser = require('foo-parser')
@@ -195,7 +195,7 @@ In the above example, we're doing a lot of work that's being executed as soon
as the file is loaded. Do we need to get parsed files right away? Could we
do this work a little later, when `getParsedFiles()` is actually called?
```js title='parser.js'
```js title='parser.js' @ts-expect-error=[20]
// "fs" is likely already being loaded, so the `require()` call is cheap
const fs = require('fs')
@@ -204,7 +204,7 @@ class Parser {
// Touch the disk as soon as `getFiles` is called, not sooner.
// Also, ensure that we're not blocking other operations by using
// the asynchronous version.
this.files = this.files || await fs.readdir('.')
this.files = this.files || await fs.promises.readdir('.')
return this.files
}

View File

@@ -175,13 +175,13 @@ Although preload scripts share a `window` global with the renderer they're attac
you cannot directly attach any variables from the preload script to `window` because of
the [`contextIsolation`][context-isolation] default.
```js title='preload.js'
```js title='preload.js' @ts-nocheck
window.myAPI = {
desktop: true
}
```
```js title='renderer.js'
```js title='renderer.js' @ts-nocheck
console.log(window.myAPI)
// => undefined
```
@@ -200,7 +200,7 @@ contextBridge.exposeInMainWorld('myAPI', {
})
```
```js title='renderer.js'
```js title='renderer.js' @ts-nocheck
console.log(window.myAPI)
// => { desktop: true }
```

View File

@@ -182,7 +182,7 @@ In Electron, browser windows can only be created after the `app` module's
[`app.whenReady()`][app-when-ready] API. Call `createWindow()` after `whenReady()`
resolves its Promise.
```js
```js @ts-type={createWindow:()=>void}
app.whenReady().then(() => {
createWindow()
})
@@ -239,7 +239,7 @@ from within your existing `whenReady()` callback.
[activate]: ../api/app.md#event-activate-macos
```js
```js @ts-type={createWindow:()=>void}
app.whenReady().then(() => {
createWindow()
@@ -290,6 +290,7 @@ To attach this script to your renderer process, pass in the path to your preload
to the `webPreferences.preload` option in your existing `BrowserWindow` constructor.
```js
const { app, BrowserWindow } = require('electron')
// include the Node.js 'path' module at the top of your file
const path = require('path')

View File

@@ -46,11 +46,17 @@ scripts attached to sandboxed renderers will still have a polyfilled subset of N
APIs available. A `require` function similar to Node's `require` module is exposed,
but can only import a subset of Electron and Node's built-in modules:
* `electron` (only renderer process modules)
* `electron` (following renderer process modules: `contextBridge`, `crashReporter`, `ipcRenderer`, `nativeImage`, `webFrame`)
* [`events`](https://nodejs.org/api/events.html)
* [`timers`](https://nodejs.org/api/timers.html)
* [`url`](https://nodejs.org/api/url.html)
[node: imports](https://nodejs.org/api/esm.html#node-imports) are supported as well:
* [`node:events`](https://nodejs.org/api/events.html)
* [`node:timers`](https://nodejs.org/api/timers.html)
* [`node:url`](https://nodejs.org/api/url.html)
In addition, the preload script also polyfills certain Node.js primitives as globals:
* [`Buffer`](https://nodejs.org/api/buffer.html)

View File

@@ -141,7 +141,7 @@ like `HTTP`. Similarly, we recommend the use of `WSS` over `WS`, `FTPS` over
#### How?
```js title='main.js (Main Process)'
```js title='main.js (Main Process)' @ts-type={browserWindow:Electron.BrowserWindow}
// Bad
browserWindow.loadURL('http://example.com')
@@ -278,7 +278,7 @@ security-conscious developers might want to assume the very opposite.
```js title='main.js (Main Process)'
const { session } = require('electron')
const URL = require('url').URL
const { URL } = require('url')
session
.fromPartition('some-partition')
@@ -608,7 +608,8 @@ sometimes be fooled - a `startsWith('https://example.com')` test would let
`https://example.com.attacker.com` through.
```js title='main.js (Main Process)'
const URL = require('url').URL
const { URL } = require('url')
const { app } = require('electron')
app.on('web-contents-created', (event, contents) => {
contents.on('will-navigate', (event, navigationUrl) => {
@@ -647,8 +648,8 @@ receive, amongst other parameters, the `url` the window was requested to open
and the options used to create it. We recommend that you register a handler to
monitor the creation of windows, and deny any unexpected window creation.
```js title='main.js (Main Process)'
const { shell } = require('electron')
```js title='main.js (Main Process)' @ts-type={isSafeForExternalOpen:(url:string)=>boolean}
const { app, shell } = require('electron')
app.on('web-contents-created', (event, contents) => {
contents.setWindowOpenHandler(({ url }) => {
@@ -683,7 +684,7 @@ leveraged to execute arbitrary commands.
#### How?
```js title='main.js (Main Process)'
```js title='main.js (Main Process)' @ts-type={USER_CONTROLLED_DATA_HERE:string}
// Bad
const { shell } = require('electron')
shell.openExternal(USER_CONTROLLED_DATA_HERE)
@@ -739,7 +740,7 @@ You should be validating the `sender` of **all** IPC messages by default.
#### How?
```js title='main.js (Main Process)'
```js title='main.js (Main Process)' @ts-type={getSecrets:()=>unknown}
// Bad
ipcMain.handle('get-secrets', () => {
return getSecrets()

View File

@@ -72,7 +72,7 @@ npx electron-installer-snap --src=out/myappname-linux-x64
If you have an existing build pipeline, you can use `electron-installer-snap`
programmatically. For more information, see the [Snapcraft API docs][snapcraft-syntax].
```js
```js @ts-nocheck
const snap = require('electron-installer-snap')
snap(options)

View File

@@ -20,12 +20,12 @@ On macOS as we use the native APIs there is no way to set the language that the
For Windows and Linux there are a few Electron APIs you should use to set the languages for the spellchecker.
```js
```js @ts-type={myWindow:Electron.BrowserWindow}
// Sets the spellchecker to check English US and French
myWindow.session.setSpellCheckerLanguages(['en-US', 'fr'])
myWindow.webContents.session.setSpellCheckerLanguages(['en-US', 'fr'])
// An array of all available language codes
const possibleLanguages = myWindow.session.availableSpellCheckerLanguages
const possibleLanguages = myWindow.webContents.session.availableSpellCheckerLanguages
```
By default the spellchecker will enable the language matching the current OS locale.
@@ -35,7 +35,7 @@ By default the spellchecker will enable the language matching the current OS loc
All the required information to generate a context menu is provided in the [`context-menu`](../api/web-contents.md#event-context-menu) event on each `webContents` instance. A small example
of how to make a context menu with this information is provided below.
```js
```js @ts-type={myWindow:Electron.BrowserWindow}
const { Menu, MenuItem } = require('electron')
myWindow.webContents.on('context-menu', (event, params) => {
@@ -45,7 +45,7 @@ myWindow.webContents.on('context-menu', (event, params) => {
for (const suggestion of params.dictionarySuggestions) {
menu.append(new MenuItem({
label: suggestion,
click: () => mainWindow.webContents.replaceMisspelling(suggestion)
click: () => myWindow.webContents.replaceMisspelling(suggestion)
}))
}
@@ -54,7 +54,7 @@ myWindow.webContents.on('context-menu', (event, params) => {
menu.append(
new MenuItem({
label: 'Add to dictionary',
click: () => mainWindow.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord)
click: () => myWindow.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord)
})
)
}
@@ -67,8 +67,8 @@ myWindow.webContents.on('context-menu', (event, params) => {
Although the spellchecker itself does not send any typings, words or user input to Google services the hunspell dictionary files are downloaded from a Google CDN by default. If you want to avoid this you can provide an alternative URL to download the dictionaries from.
```js
myWindow.session.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')
```js @ts-type={myWindow:Electron.BrowserWindow}
myWindow.webContents.session.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')
```
Check out the docs for [`session.setSpellCheckerDictionaryDownloadURL`](../api/session.md#sessetspellcheckerdictionarydownloadurlurl) for more information on where to get the dictionary files from and how you need to host them.

View File

@@ -51,7 +51,7 @@ app.whenReady().then(() => {
Great! Now we can start attaching a context menu to our Tray, like so:
```js
```js @ts-expect-error=[8]
const contextMenu = Menu.buildFromTemplate([
{ label: 'Item1', type: 'radio' },
{ label: 'Item2', type: 'radio' },
@@ -68,7 +68,7 @@ To read more about constructing native menus, click
Finally, let's give our tray a tooltip and a title.
```js
```js @ts-type={tray:Electron.Tray}
tray.setToolTip('This is my application')
tray.setTitle('This is my title')
```

View File

@@ -256,7 +256,7 @@ const createWindow = () => {
### Calling your function when the app is ready
```js title='main.js (Lines 12-14)'
```js title='main.js (Lines 12-14)' @ts-type={createWindow:()=>void}
app.whenReady().then(() => {
createWindow()
})
@@ -336,7 +336,7 @@ Because windows cannot be created before the `ready` event, you should only list
`activate` events after your app is initialized. Do this by only listening for activate
events inside your existing `whenReady()` callback.
```js
```js @ts-type={createWindow:()=>void}
app.whenReady().then(() => {
createWindow()

View File

@@ -118,7 +118,7 @@ information in the window. This variable can be accessed via `window.versions` o
`versions`. Create a `renderer.js` script that uses the [`document.getElementById`][]
DOM API to replace the displayed text for the HTML element with `info` as its `id` property.
```js title="renderer.js"
```js title="renderer.js" @ts-nocheck
const information = document.getElementById('info')
information.innerText = `This app is using Chrome (v${versions.chrome()}), Node.js (v${versions.node()}), and Electron (v${versions.electron()})`
```
@@ -225,7 +225,7 @@ app.whenReady().then(() => {
Once you have the sender and receiver set up, you can now send messages from the renderer
to the main process through the `'ping'` channel you just defined.
```js title='renderer.js'
```js title='renderer.js' @ts-expect-error=[2]
const func = async () => {
const response = await window.versions.ping()
console.log(response) // prints out 'pong'

View File

@@ -188,7 +188,7 @@ npm install update-electron-app
Then, import the module and call it immediately in the main process.
```js title='main.js'
```js title='main.js' @ts-nocheck
require('update-electron-app')()
```

View File

@@ -32,7 +32,7 @@ npm install update-electron-app
Then, invoke the updater from your app's main process file:
```js title="main.js"
```js title="main.js" @ts-nocheck
require('update-electron-app')()
```
@@ -113,7 +113,7 @@ Now that you've configured the basic update mechanism for your application, you
need to ensure that the user will get notified when there's an update. This
can be achieved using the [autoUpdater API events](../api/auto-updater.md#events):
```javascript title="main.js"
```javascript title="main.js" @ts-expect-error=[11]
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',

View File

@@ -115,7 +115,7 @@ const win = new BrowserWindow({
})
```
On either platform `titleBarOverlay` can also be an object. On both macOS and Windows, the height of the overlay can be specified with the `height` property. On Windows, the color of the overlay and its symbols can be specified using the `color` and `symbolColor` properties respectively.
On either platform `titleBarOverlay` can also be an object. On both macOS and Windows, the height of the overlay can be specified with the `height` property. On Windows, the color of the overlay and its symbols can be specified using the `color` and `symbolColor` properties respectively. `rgba()`, `hsla()`, and `#RRGGBBAA` color formats are supported to apply transparency.
If a color option is not specified, the color will default to its system color for the window control buttons. Similarly, if the height option is not specified it will default to the default height:
@@ -136,10 +136,6 @@ const win = new BrowserWindow({
> color and dimension values from a renderer using a set of readonly
> [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars].
### Limitations
* Transparent colors are currently not supported. Progress updates for this feature can be found in PR [#33567](https://github.com/electron/electron/issues/33567).
## Create transparent windows
By setting the `transparent` option to `true`, you can make a fully transparent window.
@@ -196,9 +192,9 @@ const win = new BrowserWindow({
}
})
ipcMain.on('set-ignore-mouse-events', (event, ...args) => {
ipcMain.on('set-ignore-mouse-events', (event, ignore, options) => {
const win = BrowserWindow.fromWebContents(event.sender)
win.setIgnoreMouseEvents(...args)
win.setIgnoreMouseEvents(ignore, options)
})
```

View File

@@ -125,7 +125,7 @@ Starting with a working application from the
following lines:
```javascript
const { BrowserWindow } = require('electron')
const { BrowserWindow, nativeImage } = require('electron')
const path = require('path')
const win = new BrowserWindow()
@@ -133,11 +133,11 @@ const win = new BrowserWindow()
win.setThumbarButtons([
{
tooltip: 'button1',
icon: path.join(__dirname, 'button1.png'),
icon: nativeImage.createFromPath(path.join(__dirname, 'button1.png')),
click () { console.log('button1 clicked') }
}, {
tooltip: 'button2',
icon: path.join(__dirname, 'button2.png'),
icon: nativeImage.createFromPath(path.join(__dirname, 'button2.png')),
flags: ['enabled', 'dismissonclick'],
click () { console.log('button2 clicked.') }
}
@@ -189,11 +189,11 @@ Starting with a working application from the
following lines:
```javascript
const { BrowserWindow } = require('electron')
const { BrowserWindow, nativeImage } = require('electron')
const win = new BrowserWindow()
win.setOverlayIcon('path/to/overlay.png', 'Description for overlay')
win.setOverlayIcon(nativeImage.createFromPath('path/to/overlay.png'), 'Description for overlay')
```
[msdn-icon-overlay]: https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#icon-overlays

View File

@@ -52,6 +52,7 @@ template("electron_extra_paks") {
])
output = "${invoker.output_dir}/resources.pak"
sources = [
"$root_gen_dir/chrome/accessibility_resources.pak",
"$root_gen_dir/chrome/browser_resources.pak",
"$root_gen_dir/chrome/common_resources.pak",
"$root_gen_dir/chrome/dev_ui_browser_resources.pak",
@@ -60,6 +61,7 @@ template("electron_extra_paks") {
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/gpu_resources.pak",
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
@@ -69,9 +71,11 @@ template("electron_extra_paks") {
deps = [
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser:resources",
"//chrome/browser/resources/accessibility:resources",
"//chrome/common:resources",
"//components/resources",
"//content:content_resources",
"//content/browser/resources/gpu:resources",
"//content/browser/resources/media:resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
@@ -172,6 +176,7 @@ template("electron_paks") {
}
source_patterns = [
"${root_gen_dir}/chrome/chromium_strings_",
"${root_gen_dir}/chrome/locale_settings_",
"${root_gen_dir}/chrome/platform_locale_settings_",
"${root_gen_dir}/chrome/generated_resources_",
@@ -187,6 +192,7 @@ template("electron_paks") {
"${root_gen_dir}/ui/strings/ui_strings_",
]
deps = [
"//chrome/app:chromium_strings",
"//chrome/app:generated_resources",
"//chrome/app/resources:locale_settings",
"//chrome/app/resources:platform_locale_settings",

View File

@@ -115,6 +115,7 @@ auto_filenames = {
"docs/api/structures/protocol-response.md",
"docs/api/structures/rectangle.md",
"docs/api/structures/referrer.md",
"docs/api/structures/render-process-gone-details.md",
"docs/api/structures/resolved-endpoint.md",
"docs/api/structures/resolved-host.md",
"docs/api/structures/scrubber-item.md",

View File

@@ -129,10 +129,6 @@ filenames = {
"shell/browser/auto_updater_mac.mm",
"shell/browser/browser_mac.mm",
"shell/browser/electron_browser_main_parts_mac.mm",
"shell/browser/mac/dict_util.h",
"shell/browser/mac/dict_util.mm",
"shell/browser/mac/electron_application_delegate.h",
"shell/browser/mac/electron_application_delegate.mm",
"shell/browser/mac/electron_application.h",
"shell/browser/mac/electron_application.mm",
"shell/browser/mac/in_app_purchase_observer.h",
@@ -512,6 +508,7 @@ filenames = {
"shell/browser/web_contents_preferences.h",
"shell/browser/web_contents_zoom_controller.cc",
"shell/browser/web_contents_zoom_controller.h",
"shell/browser/web_contents_zoom_observer.h",
"shell/browser/web_view_guest_delegate.cc",
"shell/browser/web_view_guest_delegate.h",
"shell/browser/web_view_manager.cc",

View File

@@ -838,7 +838,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
const originalModuleLoad = Module._load;
Module._load = (request: string, ...args: any[]) => {
const loadResult = originalModuleLoad(request, ...args);
if (request === 'child_process') {
if (request === 'child_process' || request === 'node:child_process') {
if (!asarReady.has(loadResult)) {
asarReady.add(loadResult);
// Just to make it obvious what we are dealing with here

View File

@@ -69,7 +69,7 @@ Menu.prototype.popup = function (options = {}) {
if (options == null || typeof options !== 'object') {
throw new TypeError('Options must be an object');
}
let { window, x, y, positioningItem, callback } = options;
let { window, x, y, positioningItem, sourceType, callback } = options;
// no callback passed
if (!callback || typeof callback !== 'function') callback = () => {};
@@ -78,6 +78,7 @@ Menu.prototype.popup = function (options = {}) {
if (typeof x !== 'number') x = -1;
if (typeof y !== 'number') y = -1;
if (typeof positioningItem !== 'number') positioningItem = -1;
if (typeof sourceType !== 'string' || !sourceType) sourceType = 'mouse';
// find which window to use
const wins = BaseWindow.getAllWindows();
@@ -91,7 +92,7 @@ Menu.prototype.popup = function (options = {}) {
}
}
this.popupAt(window as unknown as BaseWindow, x, y, positioningItem, callback);
this.popupAt(window as unknown as BaseWindow, x, y, positioningItem, sourceType, callback);
return { browserWindow: window, x, y, position: positioningItem };
};

View File

@@ -9,7 +9,7 @@ const { registerSchemesAsPrivileged, getStandardSchemes, Protocol } = process._l
const ERR_FAILED = -2;
const ERR_UNEXPECTED = -9;
const isBuiltInScheme = (scheme: string) => scheme === 'http' || scheme === 'https';
const isBuiltInScheme = (scheme: string) => ['http', 'https', 'file'].includes(scheme);
function makeStreamFromPipe (pipe: any): ReadableStream {
const buf = new Uint8Array(1024 * 1024 /* 1 MB */);
@@ -60,6 +60,26 @@ function convertToRequestBody (uploadData: ProtocolRequest['uploadData']): Reque
}) as RequestInit['body'];
}
// TODO(codebytere): Use Object.hasOwn() once we update to ECMAScript 2022.
function validateResponse (res: Response) {
if (!res || typeof res !== 'object') return false;
if (res.type === 'error') return true;
const exists = (key: string) => Object.prototype.hasOwnProperty.call(res, key);
if (exists('status') && typeof res.status !== 'number') return false;
if (exists('statusText') && typeof res.statusText !== 'string') return false;
if (exists('headers') && typeof res.headers !== 'object') return false;
if (exists('body')) {
if (typeof res.body !== 'object') return false;
if (res.body !== null && !(res.body instanceof ReadableStream)) return false;
}
return true;
}
Protocol.prototype.handle = function (this: Electron.Protocol, scheme: string, handler: (req: Request) => Response | Promise<Response>) {
const register = isBuiltInScheme(scheme) ? this.interceptProtocol : this.registerProtocol;
const success = register.call(this, scheme, async (preq: ProtocolRequest, cb: any) => {
@@ -73,13 +93,14 @@ Protocol.prototype.handle = function (this: Electron.Protocol, scheme: string, h
duplex: body instanceof ReadableStream ? 'half' : undefined
} as any);
const res = await handler(req);
if (!res || typeof res !== 'object') {
if (!validateResponse(res)) {
return cb({ error: ERR_UNEXPECTED });
}
if (res.type === 'error') { cb({ error: ERR_FAILED }); } else {
} else if (res.type === 'error') {
cb({ error: ERR_FAILED });
} else {
cb({
data: res.body ? Readable.fromWeb(res.body as ReadableStream<ArrayBufferView>) : null,
headers: Object.fromEntries(res.headers),
headers: res.headers ? Object.fromEntries(res.headers) : {},
statusCode: res.status,
statusText: res.statusText,
mimeType: (res as any).__original_resp?._responseHead?.mimeType

View File

@@ -1,12 +1,31 @@
import * as deprecate from '@electron/internal/common/deprecate';
const { systemPreferences } = process._linkedBinding('electron_browser_system_preferences');
if ('getAppLevelAppearance' in systemPreferences) {
const nativeALAGetter = systemPreferences.getAppLevelAppearance;
const nativeALASetter = systemPreferences.setAppLevelAppearance;
const warnALA = deprecate.warnOnce('appLevelAppearance');
const warnALAGetter = deprecate.warnOnce('getAppLevelAppearance function');
const warnALASetter = deprecate.warnOnce('setAppLevelAppearance function');
Object.defineProperty(systemPreferences, 'appLevelAppearance', {
get: () => nativeALAGetter.call(systemPreferences),
set: (appearance) => nativeALASetter.call(systemPreferences, appearance)
get: () => {
warnALA();
return nativeALAGetter.call(systemPreferences);
},
set: (appearance) => {
warnALA();
nativeALASetter.call(systemPreferences, appearance);
}
});
systemPreferences.getAppLevelAppearance = () => {
warnALAGetter();
return nativeALAGetter.call(systemPreferences);
};
systemPreferences.setAppLevelAppearance = (appearance) => {
warnALASetter();
nativeALASetter.call(systemPreferences, appearance);
};
}
if ('getEffectiveAppearance' in systemPreferences) {

View File

@@ -317,7 +317,7 @@ WebContents.prototype.printToPDF = async function (options) {
if (options.preferCSSPageSize !== undefined) {
if (typeof options.preferCSSPageSize !== 'boolean') {
return Promise.reject(new Error('footerTemplate must be a String'));
return Promise.reject(new Error('preferCSSPageSize must be a Boolean'));
}
printSettings.preferCSSPageSize = options.preferCSSPageSize;
}
@@ -335,36 +335,44 @@ WebContents.prototype.printToPDF = async function (options) {
}
};
WebContents.prototype.print = function (options: ElectronInternal.WebContentsPrintOptions = {}, callback) {
// TODO(codebytere): deduplicate argument sanitization by moving rest of
// print param logic into new file shared between printToPDF and print
// TODO(codebytere): deduplicate argument sanitization by moving rest of
// print param logic into new file shared between printToPDF and print
WebContents.prototype.print = function (options: ElectronInternal.WebContentsPrintOptions, callback) {
if (typeof options === 'object') {
// Optionally set size for PDF.
if (options.pageSize !== undefined) {
const pageSize = options.pageSize;
if (typeof pageSize === 'object') {
if (!pageSize.height || !pageSize.width) {
throw new Error('height and width properties are required for pageSize');
}
// Dimensions in Microns - 1 meter = 10^6 microns
const height = Math.ceil(pageSize.height);
const width = Math.ceil(pageSize.width);
if (!isValidCustomPageSize(width, height)) {
throw new Error('height and width properties must be minimum 352 microns.');
}
options.mediaSize = {
name: 'CUSTOM',
custom_display_name: 'Custom',
height_microns: height,
width_microns: width
};
} else if (PDFPageSizes[pageSize]) {
options.mediaSize = PDFPageSizes[pageSize];
} else {
throw new Error(`Unsupported pageSize: ${pageSize}`);
const pageSize = options.pageSize ?? 'A4';
if (typeof pageSize === 'object') {
if (!pageSize.height || !pageSize.width) {
throw new Error('height and width properties are required for pageSize');
}
// Dimensions in Microns - 1 meter = 10^6 microns
const height = Math.ceil(pageSize.height);
const width = Math.ceil(pageSize.width);
if (!isValidCustomPageSize(width, height)) {
throw new Error('height and width properties must be minimum 352 microns.');
}
options.mediaSize = {
name: 'CUSTOM',
custom_display_name: 'Custom',
height_microns: height,
width_microns: width,
imageable_area_left_microns: 0,
imageable_area_bottom_microns: 0,
imageable_area_right_microns: width,
imageable_area_top_microns: height
};
} else if (typeof pageSize === 'string' && PDFPageSizes[pageSize]) {
const mediaSize = PDFPageSizes[pageSize];
options.mediaSize = {
...mediaSize,
imageable_area_left_microns: 0,
imageable_area_bottom_microns: 0,
imageable_area_right_microns: mediaSize.width_microns,
imageable_area_top_microns: mediaSize.height_microns
};
} else {
throw new Error(`Unsupported pageSize: ${pageSize}`);
}
}

View File

@@ -17,13 +17,13 @@ const isWebView = mainFrame.getWebPreference('isWebView');
// ElectronApiServiceImpl will look for the "ipcNative" hidden object when
// invoking the 'onMessage' callback.
v8Util.setHiddenValue(global, 'ipcNative', {
onMessage (internal: boolean, channel: string, ports: MessagePort[], args: any[], senderId: number) {
onMessage (internal: boolean, channel: string, ports: MessagePort[], args: any[], senderId: number, senderIsMainFrame: boolean) {
if (internal && senderId !== 0) {
console.error(`Message ${channel} sent by unexpected WebContents (${senderId})`);
return;
}
const sender = internal ? ipcRendererInternal : ipcRenderer;
sender.emit(channel, { sender, senderId, ports }, ...args);
sender.emit(channel, { sender, senderId, ...(senderId ? { senderIsMainFrame } : {}), ports }, ...args);
}
});

View File

@@ -38,12 +38,15 @@ const loadedModules = new Map<string, any>([
['electron', electron],
['electron/common', electron],
['electron/renderer', electron],
['events', events]
['events', events],
['node:events', events]
]);
const loadableModules = new Map<string, Function>([
['timers', () => require('timers')],
['url', () => require('url')]
['node:timers', () => require('timers')],
['url', () => require('url')],
['node:url', () => require('url')]
]);
// Pass different process object to the preload script.

View File

@@ -6,11 +6,11 @@
"devDependencies": {
"@azure/storage-blob": "^12.9.0",
"@electron/asar": "^3.2.1",
"@electron/docs-parser": "^1.1.0",
"@electron/docs-parser": "^1.1.1",
"@electron/fiddle-core": "^1.0.4",
"@electron/github-app-auth": "^2.0.0",
"@electron/lint-roller": "^1.2.1",
"@electron/typescript-definitions": "^8.14.0",
"@electron/lint-roller": "^1.5.0",
"@electron/typescript-definitions": "^8.14.5",
"@octokit/rest": "^19.0.7",
"@primer/octicons": "^10.0.0",
"@types/basic-auth": "^1.1.3",
@@ -30,6 +30,7 @@
"@types/stream-json": "^1.5.1",
"@types/temp": "^0.8.34",
"@types/uuid": "^3.4.6",
"@types/w3c-web-serial": "^1.0.3",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^5.59.7",
@@ -87,10 +88,11 @@
"lint:objc": "node ./script/lint.js --objc",
"lint:py": "node ./script/lint.js --py",
"lint:gn": "node ./script/lint.js --gn",
"lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-fiddles && npm run lint:docs-relative-links && npm run lint:markdownlint",
"lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:ts-check-js-in-markdown && npm run lint:docs-fiddles && npm run lint:docs-relative-links && npm run lint:markdownlint",
"lint:docs-fiddles": "standard \"docs/fiddles/**/*.js\"",
"lint:docs-relative-links": "electron-lint-markdown-links --root docs \"**/*.md\"",
"lint:markdownlint": "electron-markdownlint \"*.md\" \"docs/**/*.md\"",
"lint:ts-check-js-in-markdown": "electron-lint-markdown-ts-check --root docs \"**/*.md\" --ignore \"breaking-changes.md\"",
"lint:js-in-markdown": "electron-lint-markdown-standard --root docs \"**/*.md\"",
"create-api-json": "node script/create-api-json.js",
"create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --api=electron-api.json && node spec/ts-smoke/runner.js",

3
patches/angle/.patches Normal file
View File

@@ -0,0 +1,3 @@
cherry-pick-285c7712c506.patch
cherry-pick-2bf945775fe6.patch
cherry-pick-cafe56b591ed.patch

View File

@@ -0,0 +1,153 @@
From 285c7712c50654e3d7238b059c4631bc91285514 Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Thu, 13 Jul 2023 15:23:49 -0400
Subject: [PATCH] M116: Translator: Unconditionally limit variable sizes
... instead of just for WebGL. This is to avoid hitting driver bugs
that were prevented with this check for WebGL on a compromised renderer
that can create non-WebGL contexts.
Bug: chromium:1464682
Change-Id: I2b1c5a8c51f06225f5f850109d30778d97e574c7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4717371
Reviewed-by: Roman Lavrov <romanl@google.com>
---
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 7b1ac4e..383feeb 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -397,9 +397,10 @@
bool TCompiler::shouldLimitTypeSizes() const
{
- // WebGL shaders limit the size of variables' types in shaders,
- // including arrays, structs and interface blocks.
- return IsWebGLBasedSpec(mShaderSpec);
+ // Prevent unrealistically large variable sizes in shaders. This works around driver bugs
+ // around int-size limits (such as 2GB). The limits are generously large enough that no real
+ // shader should ever hit it.
+ return true;
}
bool TCompiler::Init(const ShBuiltInResources &resources)
diff --git a/src/compiler/translator/ValidateTypeSizeLimitations.cpp b/src/compiler/translator/ValidateTypeSizeLimitations.cpp
index 2a033ad..19a4821 100644
--- a/src/compiler/translator/ValidateTypeSizeLimitations.cpp
+++ b/src/compiler/translator/ValidateTypeSizeLimitations.cpp
@@ -23,10 +23,10 @@
// Arbitrarily enforce that all types declared with a size in bytes of over 2 GB will cause
// compilation failure.
//
-// For local and global variables, the limit is much lower (1MB) as that much memory won't fit in
+// For local and global variables, the limit is much lower (16MB) as that much memory won't fit in
// the GPU registers anyway.
constexpr size_t kMaxVariableSizeInBytes = static_cast<size_t>(2) * 1024 * 1024 * 1024;
-constexpr size_t kMaxPrivateVariableSizeInBytes = static_cast<size_t>(1) * 1024 * 1024;
+constexpr size_t kMaxPrivateVariableSizeInBytes = static_cast<size_t>(16) * 1024 * 1024;
// Traverses intermediate tree to ensure that the shader does not
// exceed certain implementation-defined limits on the sizes of types.
diff --git a/src/compiler/translator/util.cpp b/src/compiler/translator/util.cpp
index a91f8b0..a866b25 100644
--- a/src/compiler/translator/util.cpp
+++ b/src/compiler/translator/util.cpp
@@ -282,6 +282,9 @@
return kBoolGLType[type.getNominalSize() - 1];
+ case EbtYuvCscStandardEXT:
+ return GL_UNSIGNED_INT;
+
case EbtSampler2D:
return GL_SAMPLER_2D;
case EbtSampler3D:
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index 9ae56f5..a8d2ce4 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -5284,8 +5284,8 @@
constexpr char kVSArrayTooLarge[] =
R"(varying vec4 color;
-// 1 MB / 32 aligned bytes per mat2 = 32768
-const int array_size = 32769;
+// 16 MB / 32 aligned bytes per mat2 = 524288
+const int array_size = 524289;
void main()
{
mat2 array[array_size];
@@ -5297,7 +5297,7 @@
constexpr char kVSArrayMuchTooLarge[] =
R"(varying vec4 color;
-const int array_size = 55600;
+const int array_size = 757000;
void main()
{
mat2 array[array_size];
@@ -5361,9 +5361,9 @@
constexpr char kTooLargeGlobalMemory1[] =
R"(precision mediump float;
-// 1 MB / 16 bytes per vec4 = 65536
-vec4 array[32768];
-vec4 array2[32769];
+// 16 MB / 16 bytes per vec4 = 1048576
+vec4 array[524288];
+vec4 array2[524289];
void main()
{
@@ -5376,9 +5376,9 @@
constexpr char kTooLargeGlobalMemory2[] =
R"(precision mediump float;
-// 1 MB / 16 bytes per vec4 = 65536
-vec4 array[32767];
-vec4 array2[32767];
+// 16 MB / 16 bytes per vec4 = 1048576
+vec4 array[524287];
+vec4 array2[524287];
vec4 x, y, z;
void main()
@@ -5392,12 +5392,12 @@
constexpr char kTooLargeGlobalAndLocalMemory1[] =
R"(precision mediump float;
-// 1 MB / 16 bytes per vec4 = 65536
-vec4 array[32768];
+// 16 MB / 16 bytes per vec4 = 1048576
+vec4 array[524288];
void main()
{
- vec4 array2[32769];
+ vec4 array2[524289];
if (array[0].x + array[1].x == 2.0)
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
else
@@ -5408,18 +5408,18 @@
constexpr char kTooLargeGlobalAndLocalMemory2[] =
R"(precision mediump float;
-// 1 MB / 16 bytes per vec4 = 65536
-vec4 array[32768];
+// 16 MB / 16 bytes per vec4 = 1048576
+vec4 array[524288];
float f()
{
- vec4 array2[16384];
+ vec4 array2[524288];
return array2[0].x;
}
float g()
{
- vec4 array3[16383];
+ vec4 array3[524287];
return array3[0].x;
}

View File

@@ -0,0 +1,197 @@
From 2bf945775fe634eb9e420c2263dae6043bbb5ece Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Fri, 14 Jul 2023 12:30:15 -0400
Subject: [PATCH] M116: Translator: Limit variable sizes vs uint overflow
Bug: chromium:1464680
Change-Id: Iee41a2da7a7a330e6cc4d6da59a6e9836ee9dd36
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4717372
Reviewed-by: Roman Lavrov <romanl@google.com>
---
diff --git a/src/compiler/translator/ValidateTypeSizeLimitations.cpp b/src/compiler/translator/ValidateTypeSizeLimitations.cpp
index 19a4821..f0ff9cb 100644
--- a/src/compiler/translator/ValidateTypeSizeLimitations.cpp
+++ b/src/compiler/translator/ValidateTypeSizeLimitations.cpp
@@ -7,6 +7,7 @@
#include "compiler/translator/ValidateTypeSizeLimitations.h"
#include "angle_gl.h"
+#include "common/mathutil.h"
#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/Symbol.h"
#include "compiler/translator/SymbolTable.h"
@@ -113,7 +114,8 @@
void validateTotalPrivateVariableSize()
{
- if (mTotalPrivateVariablesSize > kMaxPrivateVariableSizeInBytes)
+ if (mTotalPrivateVariablesSize.ValueOrDefault(std::numeric_limits<size_t>::max()) >
+ kMaxPrivateVariableSizeInBytes)
{
mDiagnostics->error(
TSourceLoc{},
@@ -231,7 +233,7 @@
TDiagnostics *mDiagnostics;
std::vector<int> mLoopSymbolIds;
- size_t mTotalPrivateVariablesSize;
+ angle::base::CheckedNumeric<size_t> mTotalPrivateVariablesSize;
};
} // namespace
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index a8d2ce4..542d49f 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -5426,7 +5426,7 @@
float h()
{
vec4 value;
- float value2
+ float value2;
return value.x + value2;
}
@@ -5438,6 +5438,131 @@
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
})";
+ constexpr char kTooLargeGlobalMemoryOverflow[] =
+ R"(precision mediump float;
+
+// 16 MB / 16 bytes per vec4 = 1048576
+// Create 256 arrays so each is small, but the total overflows a 32-bit number
+vec4 array[1048576], array2[1048576], array3[1048576], array4[1048576], array5[1048576];
+vec4 array6[1048576], array7[1048576], array8[1048576], array9[1048576], array10[1048576];
+vec4 array11[1048576], array12[1048576], array13[1048576], array14[1048576], array15[1048576];
+vec4 array16[1048576], array17[1048576], array18[1048576], array19[1048576], array20[1048576];
+vec4 array21[1048576], array22[1048576], array23[1048576], array24[1048576], array25[1048576];
+vec4 array26[1048576], array27[1048576], array28[1048576], array29[1048576], array30[1048576];
+vec4 array31[1048576], array32[1048576], array33[1048576], array34[1048576], array35[1048576];
+vec4 array36[1048576], array37[1048576], array38[1048576], array39[1048576], array40[1048576];
+vec4 array41[1048576], array42[1048576], array43[1048576], array44[1048576], array45[1048576];
+vec4 array46[1048576], array47[1048576], array48[1048576], array49[1048576], array50[1048576];
+vec4 array51[1048576], array52[1048576], array53[1048576], array54[1048576], array55[1048576];
+vec4 array56[1048576], array57[1048576], array58[1048576], array59[1048576], array60[1048576];
+vec4 array61[1048576], array62[1048576], array63[1048576], array64[1048576], array65[1048576];
+vec4 array66[1048576], array67[1048576], array68[1048576], array69[1048576], array70[1048576];
+vec4 array71[1048576], array72[1048576], array73[1048576], array74[1048576], array75[1048576];
+vec4 array76[1048576], array77[1048576], array78[1048576], array79[1048576], array80[1048576];
+vec4 array81[1048576], array82[1048576], array83[1048576], array84[1048576], array85[1048576];
+vec4 array86[1048576], array87[1048576], array88[1048576], array89[1048576], array90[1048576];
+vec4 array91[1048576], array92[1048576], array93[1048576], array94[1048576], array95[1048576];
+vec4 array96[1048576], array97[1048576], array98[1048576], array99[1048576], array100[1048576];
+vec4 array101[1048576], array102[1048576], array103[1048576], array104[1048576], array105[1048576];
+vec4 array106[1048576], array107[1048576], array108[1048576], array109[1048576], array110[1048576];
+vec4 array111[1048576], array112[1048576], array113[1048576], array114[1048576], array115[1048576];
+vec4 array116[1048576], array117[1048576], array118[1048576], array119[1048576], array120[1048576];
+vec4 array121[1048576], array122[1048576], array123[1048576], array124[1048576], array125[1048576];
+vec4 array126[1048576], array127[1048576], array128[1048576], array129[1048576], array130[1048576];
+vec4 array131[1048576], array132[1048576], array133[1048576], array134[1048576], array135[1048576];
+vec4 array136[1048576], array137[1048576], array138[1048576], array139[1048576], array140[1048576];
+vec4 array141[1048576], array142[1048576], array143[1048576], array144[1048576], array145[1048576];
+vec4 array146[1048576], array147[1048576], array148[1048576], array149[1048576], array150[1048576];
+vec4 array151[1048576], array152[1048576], array153[1048576], array154[1048576], array155[1048576];
+vec4 array156[1048576], array157[1048576], array158[1048576], array159[1048576], array160[1048576];
+vec4 array161[1048576], array162[1048576], array163[1048576], array164[1048576], array165[1048576];
+vec4 array166[1048576], array167[1048576], array168[1048576], array169[1048576], array170[1048576];
+vec4 array171[1048576], array172[1048576], array173[1048576], array174[1048576], array175[1048576];
+vec4 array176[1048576], array177[1048576], array178[1048576], array179[1048576], array180[1048576];
+vec4 array181[1048576], array182[1048576], array183[1048576], array184[1048576], array185[1048576];
+vec4 array186[1048576], array187[1048576], array188[1048576], array189[1048576], array190[1048576];
+vec4 array191[1048576], array192[1048576], array193[1048576], array194[1048576], array195[1048576];
+vec4 array196[1048576], array197[1048576], array198[1048576], array199[1048576], array200[1048576];
+vec4 array201[1048576], array202[1048576], array203[1048576], array204[1048576], array205[1048576];
+vec4 array206[1048576], array207[1048576], array208[1048576], array209[1048576], array210[1048576];
+vec4 array211[1048576], array212[1048576], array213[1048576], array214[1048576], array215[1048576];
+vec4 array216[1048576], array217[1048576], array218[1048576], array219[1048576], array220[1048576];
+vec4 array221[1048576], array222[1048576], array223[1048576], array224[1048576], array225[1048576];
+vec4 array226[1048576], array227[1048576], array228[1048576], array229[1048576], array230[1048576];
+vec4 array231[1048576], array232[1048576], array233[1048576], array234[1048576], array235[1048576];
+vec4 array236[1048576], array237[1048576], array238[1048576], array239[1048576], array240[1048576];
+vec4 array241[1048576], array242[1048576], array243[1048576], array244[1048576], array245[1048576];
+vec4 array246[1048576], array247[1048576], array248[1048576], array249[1048576], array250[1048576];
+vec4 array251[1048576], array252[1048576], array253[1048576], array254[1048576], array255[1048576];
+vec4 array256[1048576];
+
+void main()
+{
+ float f = array[0].x; f += array2[0].x; f += array3[0].x; f += array4[0].x; f += array5[0].x;
+ f += array6[0].x; f += array7[0].x; f += array8[0].x; f += array9[0].x; f += array10[0].x;
+ f += array11[0].x; f += array12[0].x; f += array13[0].x; f += array14[0].x; f += array15[0].x;
+ f += array16[0].x; f += array17[0].x; f += array18[0].x; f += array19[0].x; f += array20[0].x;
+ f += array21[0].x; f += array22[0].x; f += array23[0].x; f += array24[0].x; f += array25[0].x;
+ f += array26[0].x; f += array27[0].x; f += array28[0].x; f += array29[0].x; f += array30[0].x;
+ f += array31[0].x; f += array32[0].x; f += array33[0].x; f += array34[0].x; f += array35[0].x;
+ f += array36[0].x; f += array37[0].x; f += array38[0].x; f += array39[0].x; f += array40[0].x;
+ f += array41[0].x; f += array42[0].x; f += array43[0].x; f += array44[0].x; f += array45[0].x;
+ f += array46[0].x; f += array47[0].x; f += array48[0].x; f += array49[0].x; f += array50[0].x;
+ f += array51[0].x; f += array52[0].x; f += array53[0].x; f += array54[0].x; f += array55[0].x;
+ f += array56[0].x; f += array57[0].x; f += array58[0].x; f += array59[0].x; f += array60[0].x;
+ f += array61[0].x; f += array62[0].x; f += array63[0].x; f += array64[0].x; f += array65[0].x;
+ f += array66[0].x; f += array67[0].x; f += array68[0].x; f += array69[0].x; f += array70[0].x;
+ f += array71[0].x; f += array72[0].x; f += array73[0].x; f += array74[0].x; f += array75[0].x;
+ f += array76[0].x; f += array77[0].x; f += array78[0].x; f += array79[0].x; f += array80[0].x;
+ f += array81[0].x; f += array82[0].x; f += array83[0].x; f += array84[0].x; f += array85[0].x;
+ f += array86[0].x; f += array87[0].x; f += array88[0].x; f += array89[0].x; f += array90[0].x;
+ f += array91[0].x; f += array92[0].x; f += array93[0].x; f += array94[0].x; f += array95[0].x;
+ f += array96[0].x; f += array97[0].x; f += array98[0].x; f += array99[0].x; f += array100[0].x;
+ f += array101[0].x; f += array102[0].x; f += array103[0].x; f += array104[0].x;
+ f += array105[0].x; f += array106[0].x; f += array107[0].x; f += array108[0].x;
+ f += array109[0].x; f += array110[0].x; f += array111[0].x; f += array112[0].x;
+ f += array113[0].x; f += array114[0].x; f += array115[0].x; f += array116[0].x;
+ f += array117[0].x; f += array118[0].x; f += array119[0].x; f += array120[0].x;
+ f += array121[0].x; f += array122[0].x; f += array123[0].x; f += array124[0].x;
+ f += array125[0].x; f += array126[0].x; f += array127[0].x; f += array128[0].x;
+ f += array129[0].x; f += array130[0].x; f += array131[0].x; f += array132[0].x;
+ f += array133[0].x; f += array134[0].x; f += array135[0].x; f += array136[0].x;
+ f += array137[0].x; f += array138[0].x; f += array139[0].x; f += array140[0].x;
+ f += array141[0].x; f += array142[0].x; f += array143[0].x; f += array144[0].x;
+ f += array145[0].x; f += array146[0].x; f += array147[0].x; f += array148[0].x;
+ f += array149[0].x; f += array150[0].x; f += array151[0].x; f += array152[0].x;
+ f += array153[0].x; f += array154[0].x; f += array155[0].x; f += array156[0].x;
+ f += array157[0].x; f += array158[0].x; f += array159[0].x; f += array160[0].x;
+ f += array161[0].x; f += array162[0].x; f += array163[0].x; f += array164[0].x;
+ f += array165[0].x; f += array166[0].x; f += array167[0].x; f += array168[0].x;
+ f += array169[0].x; f += array170[0].x; f += array171[0].x; f += array172[0].x;
+ f += array173[0].x; f += array174[0].x; f += array175[0].x; f += array176[0].x;
+ f += array177[0].x; f += array178[0].x; f += array179[0].x; f += array180[0].x;
+ f += array181[0].x; f += array182[0].x; f += array183[0].x; f += array184[0].x;
+ f += array185[0].x; f += array186[0].x; f += array187[0].x; f += array188[0].x;
+ f += array189[0].x; f += array190[0].x; f += array191[0].x; f += array192[0].x;
+ f += array193[0].x; f += array194[0].x; f += array195[0].x; f += array196[0].x;
+ f += array197[0].x; f += array198[0].x; f += array199[0].x; f += array200[0].x;
+ f += array201[0].x; f += array202[0].x; f += array203[0].x; f += array204[0].x;
+ f += array205[0].x; f += array206[0].x; f += array207[0].x; f += array208[0].x;
+ f += array209[0].x; f += array210[0].x; f += array211[0].x; f += array212[0].x;
+ f += array213[0].x; f += array214[0].x; f += array215[0].x; f += array216[0].x;
+ f += array217[0].x; f += array218[0].x; f += array219[0].x; f += array220[0].x;
+ f += array221[0].x; f += array222[0].x; f += array223[0].x; f += array224[0].x;
+ f += array225[0].x; f += array226[0].x; f += array227[0].x; f += array228[0].x;
+ f += array229[0].x; f += array230[0].x; f += array231[0].x; f += array232[0].x;
+ f += array233[0].x; f += array234[0].x; f += array235[0].x; f += array236[0].x;
+ f += array237[0].x; f += array238[0].x; f += array239[0].x; f += array240[0].x;
+ f += array241[0].x; f += array242[0].x; f += array243[0].x; f += array244[0].x;
+ f += array245[0].x; f += array246[0].x; f += array247[0].x; f += array248[0].x;
+ f += array249[0].x; f += array250[0].x; f += array251[0].x; f += array252[0].x;
+ f += array253[0].x; f += array254[0].x; f += array255[0].x; f += array256[0].x;
+ if (f == 2.0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+})";
+
GLuint program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalMemory1);
EXPECT_EQ(0u, program);
@@ -5449,6 +5574,9 @@
program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalAndLocalMemory2);
EXPECT_EQ(0u, program);
+
+ program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalMemoryOverflow);
+ EXPECT_EQ(0u, program);
}
// Linking should fail when corresponding vertex/fragment uniform blocks have different precision

View File

@@ -0,0 +1,286 @@
From cafe56b591edb77f041be70b58cac3a61565644a Mon Sep 17 00:00:00 2001
From: Geoff Lang <geofflang@chromium.org>
Date: Fri, 23 Jun 2023 14:46:28 -0400
Subject: [PATCH] M116: GL: Ensure all instanced attributes have a buffer with data
Apple OpenGL drivers sometimes crash when given an instanced draw with
a buffer that has never been given data.
It's not efficient to check if the attribute is both zero-sized and
instanced so just ensure that every time a zero-sized buffer is bound
to an attribute, it gets initialized with some data.
Bug: chromium:1456243
Change-Id: I66b7c7017843153db2df3bc50010cba765d03c5f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4642048
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
(cherry picked from commit 4e6124dae892690204f8e5996aeaad14f45e0a97)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4727452
---
diff --git a/include/platform/FeaturesGL_autogen.h b/include/platform/FeaturesGL_autogen.h
index aa0565c..2f6e094 100644
--- a/include/platform/FeaturesGL_autogen.h
+++ b/include/platform/FeaturesGL_autogen.h
@@ -501,6 +501,12 @@
"supportsShaderPixelLocalStorageEXT", FeatureCategory::OpenGLFeatures,
"Backend GL context supports EXT_shader_pixel_local_storage extension", &members,
"http://anglebug.com/7279"};
+
+ FeatureInfo ensureNonEmptyBufferIsBoundForDraw = {
+ "ensureNonEmptyBufferIsBoundForDraw", FeatureCategory::OpenGLFeatures,
+ "Apple OpenGL drivers crash when drawing with a zero-sized buffer bound using a non-zero "
+ "divisor.",
+ &members, "http://crbug.com/1456243"};
};
inline FeaturesGL::FeaturesGL() = default;
diff --git a/include/platform/gl_features.json b/include/platform/gl_features.json
index 032f29a..b358cea 100644
--- a/include/platform/gl_features.json
+++ b/include/platform/gl_features.json
@@ -699,6 +699,14 @@
"Backend GL context supports EXT_shader_pixel_local_storage extension"
],
"issue": "http://anglebug.com/7279"
+ },
+ {
+ "name": "ensure_non_empty_buffer_is_bound_for_draw",
+ "category": "Features",
+ "description": [
+ "Apple OpenGL drivers crash when drawing with a zero-sized buffer bound using a non-zero divisor."
+ ],
+ "issue": "http://crbug.com/1456243"
}
]
}
diff --git a/scripts/code_generation_hashes/ANGLE_features.json b/scripts/code_generation_hashes/ANGLE_features.json
index d4576c2..503001c 100644
--- a/scripts/code_generation_hashes/ANGLE_features.json
+++ b/scripts/code_generation_hashes/ANGLE_features.json
@@ -2,7 +2,7 @@
"include/platform/FeaturesD3D_autogen.h":
"9923fb44d0a6f31948d0c8f46ee1d9e2",
"include/platform/FeaturesGL_autogen.h":
- "a795a806d71b0e6d1f9e6d95c6e11971",
+ "fef16ab3946346a2a7d5b76bb39471a4",
"include/platform/FeaturesMtl_autogen.h":
"407426c8874de9295482ace9c94bd812",
"include/platform/FeaturesVk_autogen.h":
@@ -16,13 +16,13 @@
"include/platform/gen_features.py":
"062989f7a8f3ff3b383f98fc8908dc33",
"include/platform/gl_features.json":
- "3335055a70e35ebb7bf74c6d7c58897b",
+ "c9aead89696e7fd0c8bfe5c5ca85ca63",
"include/platform/mtl_features.json":
"c66d170e7a8eb3448030f4c423ed0133",
"include/platform/vk_features.json":
"416bbb28b9fa1a3c4ef141f243c0a9e6",
"util/angle_features_autogen.cpp":
- "73169f63c755192c3b4bd27d6f4096ca",
+ "288daaec490eb816883d744f108d74c9",
"util/angle_features_autogen.h":
- "7aa8120eb8f8fd335946b8c27074745d"
+ "daf25d3e4ffea143d1c082416513f7e7"
}
\ No newline at end of file
diff --git a/src/libANGLE/renderer/gl/BufferGL.cpp b/src/libANGLE/renderer/gl/BufferGL.cpp
index c99fd5d..9651838 100644
--- a/src/libANGLE/renderer/gl/BufferGL.cpp
+++ b/src/libANGLE/renderer/gl/BufferGL.cpp
@@ -296,6 +296,11 @@
return angle::Result::Continue;
}
+size_t BufferGL::getBufferSize() const
+{
+ return mBufferSize;
+}
+
GLuint BufferGL::getBufferID() const
{
return mBufferID;
diff --git a/src/libANGLE/renderer/gl/BufferGL.h b/src/libANGLE/renderer/gl/BufferGL.h
index 7b57594..fe9138e 100644
--- a/src/libANGLE/renderer/gl/BufferGL.h
+++ b/src/libANGLE/renderer/gl/BufferGL.h
@@ -56,6 +56,7 @@
bool primitiveRestartEnabled,
gl::IndexRange *outRange) override;
+ size_t getBufferSize() const;
GLuint getBufferID() const;
private:
diff --git a/src/libANGLE/renderer/gl/VertexArrayGL.cpp b/src/libANGLE/renderer/gl/VertexArrayGL.cpp
index dc981de..fda9099 100644
--- a/src/libANGLE/renderer/gl/VertexArrayGL.cpp
+++ b/src/libANGLE/renderer/gl/VertexArrayGL.cpp
@@ -646,6 +646,7 @@
angle::Result VertexArrayGL::updateAttribPointer(const gl::Context *context, size_t attribIndex)
{
+ const angle::FeaturesGL &features = GetFeaturesGL(context);
const VertexAttribute &attrib = mState.getVertexAttribute(attribIndex);
@@ -687,8 +688,16 @@
// is not NULL.
StateManagerGL *stateManager = GetStateManagerGL(context);
- GLuint bufferId = GetNativeBufferID(arrayBuffer);
+ BufferGL *bufferGL = GetImplAs<BufferGL>(arrayBuffer);
+ GLuint bufferId = bufferGL->getBufferID();
stateManager->bindBuffer(gl::BufferBinding::Array, bufferId);
+ if (features.ensureNonEmptyBufferIsBoundForDraw.enabled && bufferGL->getBufferSize() == 0)
+ {
+ constexpr uint32_t data = 0;
+ ANGLE_TRY(bufferGL->setData(context, gl::BufferBinding::Array, &data, sizeof(data),
+ gl::BufferUsage::StaticDraw));
+ ASSERT(bufferGL->getBufferSize() > 0);
+ }
ANGLE_TRY(callVertexAttribPointer(context, static_cast<GLuint>(attribIndex), attrib,
binding.getStride(), binding.getOffset()));
diff --git a/src/libANGLE/renderer/gl/renderergl_utils.cpp b/src/libANGLE/renderer/gl/renderergl_utils.cpp
index 6911247..ab2a608 100644
--- a/src/libANGLE/renderer/gl/renderergl_utils.cpp
+++ b/src/libANGLE/renderer/gl/renderergl_utils.cpp
@@ -2465,6 +2465,9 @@
// EXT_shader_pixel_local_storage
ANGLE_FEATURE_CONDITION(features, supportsShaderPixelLocalStorageEXT,
functions->hasGLESExtension("GL_EXT_shader_pixel_local_storage"));
+
+ // http://crbug.com/1456243
+ ANGLE_FEATURE_CONDITION(features, ensureNonEmptyBufferIsBoundForDraw, IsApple() || IsAndroid());
}
void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
diff --git a/src/tests/angle_end2end_tests_expectations.txt b/src/tests/angle_end2end_tests_expectations.txt
index 59ec7c2..44ff3e4 100644
--- a/src/tests/angle_end2end_tests_expectations.txt
+++ b/src/tests/angle_end2end_tests_expectations.txt
@@ -380,6 +380,7 @@
7294 WIN D3D11 : StateChangeTestES3.StencilWriteMask/* = SKIP
7316 WIN D3D11 : StateChangeTestES3.StencilTestAndFunc/* = SKIP
7329 WIN D3D11 : StateChangeTestES3.PrimitiveRestart/* = SKIP
+1456243 WIN D3D11 : WebGL2CompatibilityTest.DrawWithZeroSizedBuffer/* = SKIP
// Android
6095 ANDROID GLES : GLSLTest_ES3.InitGlobalComplexConstant/* = SKIP
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index 7dc56cd..bd7ecd1 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -1632,10 +1632,10 @@
constexpr GLuint kMaxIntAsGLuint = static_cast<GLuint>(std::numeric_limits<GLint>::max());
constexpr GLuint kIndexData[] = {
- kMaxIntAsGLuint,
- kMaxIntAsGLuint + 1,
- kMaxIntAsGLuint + 2,
- kMaxIntAsGLuint + 3,
+ kMaxIntAsGLuint,
+ kMaxIntAsGLuint + 1,
+ kMaxIntAsGLuint + 2,
+ kMaxIntAsGLuint + 3,
};
GLBuffer indexBuffer;
@@ -3687,8 +3687,8 @@
constexpr float readPixelsData[] = {-5000.0f, 0.0f, 0.0f, 1.0f};
const GLushort textureData[] = {
- gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
- gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
+ gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
+ gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
for (auto extension : FloatingPointTextureExtensions)
{
@@ -3748,8 +3748,8 @@
constexpr float readPixelsData[] = {7108.0f, -10.0f, 0.0f, 1.0f};
const GLushort textureData[] = {
- gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
- gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
+ gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
+ gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
for (auto extension : FloatingPointTextureExtensions)
{
@@ -3811,8 +3811,8 @@
constexpr float readPixelsData[] = {7000.0f, 100.0f, 33.0f, 1.0f};
const GLushort textureData[] = {
- gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
- gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
+ gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
+ gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
for (auto extension : FloatingPointTextureExtensions)
{
@@ -3874,8 +3874,8 @@
constexpr float readPixelsData[] = {7000.0f, 100.0f, 33.0f, -1.0f};
const GLushort textureData[] = {
- gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
- gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
+ gl::float32ToFloat16(readPixelsData[0]), gl::float32ToFloat16(readPixelsData[1]),
+ gl::float32ToFloat16(readPixelsData[2]), gl::float32ToFloat16(readPixelsData[3])};
for (auto extension : FloatingPointTextureExtensions)
{
@@ -5803,6 +5803,26 @@
}
}
+// Test for a mishandling of instanced vertex attributes with zero-sized buffers bound on Apple
+// OpenGL drivers.
+TEST_P(WebGL2CompatibilityTest, DrawWithZeroSizedBuffer)
+{
+ ANGLE_GL_PROGRAM(program, essl3_shaders::vs::Simple(), essl3_shaders::fs::Red());
+ glUseProgram(program);
+
+ GLBuffer buffer;
+ glBindBuffer(GL_ARRAY_BUFFER, buffer);
+
+ GLint posLocation = glGetAttribLocation(program, essl3_shaders::PositionAttrib());
+ glEnableVertexAttribArray(posLocation);
+
+ glVertexAttribDivisor(posLocation, 1);
+ glVertexAttribPointer(posLocation, 1, GL_UNSIGNED_BYTE, GL_FALSE, 9,
+ reinterpret_cast<void *>(0x41424344));
+
+ glDrawArrays(GL_TRIANGLES, 0, 6);
+}
+
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(WebGLCompatibilityTest);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WebGL2CompatibilityTest);
diff --git a/util/angle_features_autogen.cpp b/util/angle_features_autogen.cpp
index adb9610..a060dd2 100644
--- a/util/angle_features_autogen.cpp
+++ b/util/angle_features_autogen.cpp
@@ -118,6 +118,7 @@
{Feature::EnablePrecisionQualifiers, "enablePrecisionQualifiers"},
{Feature::EnablePreRotateSurfaces, "enablePreRotateSurfaces"},
{Feature::EnableProgramBinaryForCapture, "enableProgramBinaryForCapture"},
+ {Feature::EnsureNonEmptyBufferIsBoundForDraw, "ensureNonEmptyBufferIsBoundForDraw"},
{Feature::ExpandIntegerPowExpressions, "expandIntegerPowExpressions"},
{Feature::ExplicitlyEnablePerSampleShading, "explicitlyEnablePerSampleShading"},
{Feature::ExposeNonConformantExtensionsAndVersions, "exposeNonConformantExtensionsAndVersions"},
diff --git a/util/angle_features_autogen.h b/util/angle_features_autogen.h
index 3d8c47f..4064425 100644
--- a/util/angle_features_autogen.h
+++ b/util/angle_features_autogen.h
@@ -112,6 +112,7 @@
EnablePrecisionQualifiers,
EnablePreRotateSurfaces,
EnableProgramBinaryForCapture,
+ EnsureNonEmptyBufferIsBoundForDraw,
ExpandIntegerPowExpressions,
ExplicitlyEnablePerSampleShading,
ExposeNonConformantExtensionsAndVersions,

View File

@@ -20,7 +20,7 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
case ssl_open_record_error:
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
index 838761af5cb8498d8bcb66b1a7a6f9c1a233cac7..b9bda24dd4d372485622ff99873ee34ee4bd9684 100644
index d7b5be3ddeec762a3353baefc67d659c9aba68f5..82bf00311b36bdbc948ae14f808c78fd2f71ca54 100644
--- a/ssl/ssl_lib.cc
+++ b/ssl/ssl_lib.cc
@@ -1333,7 +1333,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
@@ -32,7 +32,7 @@ index 838761af5cb8498d8bcb66b1a7a6f9c1a233cac7..b9bda24dd4d372485622ff99873ee34e
return SSL_ERROR_ZERO_RETURN;
}
// An EOF was observed which violates the protocol, and the underlying
@@ -2622,13 +2622,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
@@ -2695,13 +2695,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
}

View File

@@ -127,3 +127,8 @@ chore_defer_usb_service_getdevices_request_until_usb_service_is.patch
fix_remove_profiles_from_spellcheck_service.patch
chore_patch_out_profile_methods_in_chrome_browser_pdf.patch
chore_patch_out_profile_methods_in_titlebar_config.patch
fix_crash_on_nativetheme_change_during_context_menu_close.patch
potential_fix_for_flaky_desktopcaptureapitest_delegation_unittest.patch
fix_select_the_first_menu_item_when_opened_via_keyboard.patch
chore_add_buildflag_guard_around_new_include.patch
fix_use_delegated_generic_capturer_when_available.patch

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index c641da1b1f096a41c708737435140691a501c431..4e9940c00bad3f0ba72c0b32833a0d0df095c61e 100644
index 280c8b9d08a35c7fbe9e352f2f71ed104cbde955..12bbcb8518110a5f4873e4f4a89e43c8920ec7b6 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -258,6 +258,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -260,6 +260,10 @@ int GpuMain(MainFunctionParams parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,7 +24,7 @@ index c641da1b1f096a41c708737435140691a501c431..4e9940c00bad3f0ba72c0b32833a0d0d
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -342,7 +346,6 @@ int GpuMain(MainFunctionParams parameters) {
@@ -344,7 +348,6 @@ int GpuMain(MainFunctionParams parameters) {
const_cast<base::CommandLine*>(&command_line), gpu_preferences);
const bool dead_on_arrival = !init_success;

View File

@@ -23,10 +23,10 @@ index 103a9d9fb17e954ecaf0acecaa3eeafc23e39c94..de299316216dba204decba3b0eb57f5c
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1a0e197b5fe5b698671ddcb0660b69669939ebc2..b1978947e3dc568ea3badcd21dfdb4d089c791e5 100644
index 68cc76c0f63f3f828ab582dab88f893453144b2a..5547fb35630d2f2c24b21640a90b8c0858f604ce 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4416,6 +4416,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4438,6 +4438,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -67,7 +67,7 @@ index 93acf68fbb7ff9b3bfc414a33fa1cdda4fe73bb1..90ec3437c2c94e87cfd0b25b200729c1
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index 62b35b9fa47f0b99f2b7b6bc712b3a4b2c1c8e4e..4a0fdbb120edc76647560fb86d95613c95ae7094 100644
index 1cada05806cb35a82822507f708d43979d97de61..f8e063397b161b7501308945a7df9fb89ea7d165 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -198,6 +198,7 @@ void LocalWindowProxy::Initialize() {
@@ -79,10 +79,10 @@ index 62b35b9fa47f0b99f2b7b6bc712b3a4b2c1c8e4e..4a0fdbb120edc76647560fb86d95613c
if (World().IsMainWorld()) {
probe::DidCreateMainWorldContext(GetFrame());
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index 6068419926ed24e8269905c7cfe89c429071fb9c..d48eb2cec03dd3186377d23b0e93097719ab0298 100644
index 62e611ec3ac95eac88d4665d2640429e9d833594..7bf646d6cd8eaf29267b6136de0952e2545ec503 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -321,6 +321,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -319,6 +319,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
@@ -92,7 +92,7 @@ index 6068419926ed24e8269905c7cfe89c429071fb9c..d48eb2cec03dd3186377d23b0e930977
int32_t world_id) = 0;
virtual bool AllowScriptExtensions() = 0;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
index feed61542c8cd66744c1fbc0ba412879f3696035..1bf7b85147499b185189eab49bd6e2786751c0b1 100644
index dbf7fd73a855f7d45eeeeff17582696aac66ff0d..9b489f661f524f380523e38518345e9b22eb8dec 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -110,7 +110,7 @@ index feed61542c8cd66744c1fbc0ba412879f3696035..1bf7b85147499b185189eab49bd6e278
v8::Local<v8::Context> context,
int32_t world_id) {
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
index 8ea11a5c27365a234cae9ec00eaa83ad2d2aa69a..3d2eed6318fe899e1b7e9625c7b3e2781aa2e65d 100644
index 28e1c00e05e74d5a79f32897e57a854ff14ce7a9..1cd704b1bb53eaf226d1c72c97e3f765a4b1f10e 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -84,6 +84,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -123,7 +123,7 @@ index 8ea11a5c27365a234cae9ec00eaa83ad2d2aa69a..3d2eed6318fe899e1b7e9625c7b3e278
int32_t world_id) override;
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
index bd4592a4f10d1370c72caf5c153cf831d5a55d7b..cc4d49cb14f5b259777a9b8023388175825ce8cf 100644
index 1934ca82e3e26e0f5c4f2f7b417df6bcd6e66abf..1277b858f2d5b4b0a0dd1c97282eff0d763cdc2b 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -403,6 +403,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {

View File

@@ -7,10 +7,10 @@ Ensure that licenses for the dependencies introduced by Electron
are included in `LICENSES.chromium.html`
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
index d775931a09f38db3eb472d095d461b50c5ef76f0..9d844edc8f7c2f526fa99804e8a072da1f47c656 100755
index 2a6a4733128dfc5916163c1c91c26f27da1d2f0a..f248f68e22d94b5762f0a64e0fe6804eef1d61d1 100755
--- a/tools/licenses/licenses.py
+++ b/tools/licenses/licenses.py
@@ -383,6 +383,31 @@ SPECIAL_CASES = {
@@ -413,6 +413,31 @@ SPECIAL_CASES = {
"License": "Apache 2.0",
"License File": "/third_party/selenium-atoms/LICENSE.closure",
},
@@ -41,4 +41,4 @@ index d775931a09f38db3eb472d095d461b50c5ef76f0..9d844edc8f7c2f526fa99804e8a072da
+ },
}
# Special value for 'License File' field used to indicate that the license file
# Soon-to-be-deprecated special value for 'License File' field used to indicate

View File

@@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView
This allows us to disable throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 3b059b6121562dba8ec7c4483388408100d8ef26..0eb07c514883975f39b1a98ccfe65028e4c2ad75 100644
index 421a0b8ba291a944db62507d1004210555a1200c..09dd63d9f9a59d32dc9dd569aaa176a94dbfdfaa 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -700,6 +700,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -710,6 +710,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -33,6 +33,21 @@ index 180abdc9f983887c83fd9d4a596472222e9ab472..00842717a7570561ee9e3eca11190ab5
void SendWebPreferencesToRenderer();
void SendRendererPreferencesToRenderer(
const blink::RendererPreferences& preferences);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 9716c8f8a5fe15ffabe4eeedb7b5b35a57b61bac..75796596daeda51d303856ae767e2bae9b9d2d18 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -554,8 +554,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
// OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
// which updates `visibility_`, unless the host is hidden. Make sure no update
// is needed.
- DCHECK(host_->is_hidden() || visibility_ == Visibility::VISIBLE);
- OnShowWithPageVisibility(page_visibility);
+ if (host_->is_hidden() || visibility_ == Visibility::VISIBLE)
+ OnShowWithPageVisibility(page_visibility);
}
void RenderWidgetHostViewAura::NotifyHostAndDelegateOnWasShown(
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
index 9979c25ecd57e68331b628a518368635db5c2027..32733bf951af3eff7da5fd5758bbcbaa49ff0e3c 100644
--- a/content/public/browser/render_view_host.h
@@ -47,14 +62,26 @@ index 9979c25ecd57e68331b628a518368635db5c2027..32733bf951af3eff7da5fd5758bbcbaa
private:
// This interface should only be implemented inside content.
friend class RenderViewHostImpl;
diff --git a/content/test/test_page_broadcast.h b/content/test/test_page_broadcast.h
index 73c0f64aa84061381a98ba60906835258f881468..41bdf7e231eca4617dbe53737a3925039bf77c4f 100644
--- a/content/test/test_page_broadcast.h
+++ b/content/test/test_page_broadcast.h
@@ -45,6 +45,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast {
override;
void UpdatePageBrowsingContextGroup(const blink::BrowsingContextGroupInfo&
browsing_context_group_info) override;
+ void SetSchedulerThrottling(bool allowed) override {}
mojo::AssociatedReceiver<blink::mojom::PageBroadcast> receiver_;
};
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
index d18c66114870de83c7eef21578e9e2b8d5606a8b..e1defb3992289427df85963f44a705e3d9257342 100644
index d3877e946b1d65eba5bb45efe786fbcc7925ca6e..73bd5056baf7e4278b7260e550e2b8516be72f20 100644
--- a/third_party/blink/public/mojom/page/page.mojom
+++ b/third_party/blink/public/mojom/page/page.mojom
@@ -149,4 +149,7 @@ interface PageBroadcast {
mojo_base.mojom.UnguessableToken devtools_frame_token,
RemoteFrameInterfacesFromBrowser remote_frame_interfaces,
RemoteMainFrameInterfaces remote_main_frame_interfaces);
@@ -155,4 +155,7 @@ interface PageBroadcast {
// in `browsing_context_group_info`.
UpdatePageBrowsingContextGroup(
blink.mojom.BrowsingContextGroupInfo browsing_context_group_info);
+
+ // Whether to enable the Renderer scheduler background throttling.
+ SetSchedulerThrottling(bool allowed);
@@ -72,10 +99,20 @@ index 8a18ecf567cd3a6a2fb1627083a5544a93198bf4..8b6436f3ba6c8bfc2cba054e77ab8886
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index a1bcdb3b7ceb5bed96b4c442268e3b7ddb490fa4..acda9f8ea1789d3febc0386ae855c009ea462816 100644
index 3fd94156edd9868f0d46746227ae40da604bbc2c..6ce650e2fc879ae135e5bb731750f8929b592f17 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3833,13 +3833,21 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -2386,6 +2386,9 @@ void WebViewImpl::SetPageLifecycleStateInternal(
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
"old_state", old_state, "new_state", new_state);
+ if (!scheduler_throttling_allowed_)
+ new_state->visibility = mojom::blink::PageVisibilityState::kVisible;
+
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
!old_state->is_in_back_forward_cache;
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
@@ -3847,17 +3850,30 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -90,19 +127,34 @@ index a1bcdb3b7ceb5bed96b4c442268e3b7ddb490fa4..acda9f8ea1789d3febc0386ae855c009
mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) {
DCHECK(GetPage());
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
GetPage()->GetPageScheduler()->SetPageVisible(
- GetPage()->SetVisibilityState(visibility_state, is_initial_state);
- GetPage()->GetPageScheduler()->SetPageVisible(
- visibility_state == mojom::blink::PageVisibilityState::kVisible);
+ scheduler_throttling_allowed_ ?
+ (visibility_state == mojom::blink::PageVisibilityState::kVisible) : true);
// Notify observers of the change.
if (!is_initial_state) {
for (auto& observer : observers_)
- // Notify observers of the change.
- if (!is_initial_state) {
- for (auto& observer : observers_)
- observer.OnPageVisibilityChanged(visibility_state);
+ // If backgroundThrottling is disabled, the page is always visible.
+ if (!scheduler_throttling_allowed_) {
+ GetPage()->SetVisibilityState(mojom::blink::PageVisibilityState::kVisible, is_initial_state);
+ GetPage()->GetPageScheduler()->SetPageVisible(true);
+ } else {
+ bool is_visible = visibility_state == mojom::blink::PageVisibilityState::kVisible;
+ GetPage()->SetVisibilityState(visibility_state, is_initial_state);
+ GetPage()->GetPageScheduler()->SetPageVisible(is_visible);
+ // Notify observers of the change.
+ if (!is_initial_state) {
+ for (auto& observer : observers_)
+ observer.OnPageVisibilityChanged(visibility_state);
+ }
}
}
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index cce09d720fda1929cd5202841305ea564ebdecaf..63bb7c62a8a6abf32fd8e29861018b0c9c80d471 100644
index 6a180620e00c77d0f4be346d1296f62feb714abb..c0ccf14faa52ab190c5848e8e9b597bcf637d4c0 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -443,6 +443,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -445,6 +445,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -110,7 +162,7 @@ index cce09d720fda1929cd5202841305ea564ebdecaf..63bb7c62a8a6abf32fd8e29861018b0c
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -907,6 +908,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -909,6 +910,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// If true, we send IPC messages when |preferred_size_| changes.
bool send_preferred_size_changes_ = false;

View File

@@ -6,10 +6,10 @@ Subject: Allow setting secondary label via SimpleMenuModel
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index c058edaf6ea40746228da569a8739c50f958500d..2d4306d16ce8e354dcdf3da8c5afce8546349fcd 100644
index 73bdc6d0788463ef7a8656e8902fde62cbbb5464..7d49d9928fcbb23361a63eb458d6841e4adcbf41 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -52,6 +52,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId(
@@ -48,6 +48,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId(
return std::u16string();
}
@@ -21,7 +21,7 @@ index c058edaf6ea40746228da569a8739c50f958500d..2d4306d16ce8e354dcdf3da8c5afce85
ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
int command_id) const {
return ImageModel();
@@ -310,6 +315,11 @@ void SimpleMenuModel::SetLabel(size_t index, const std::u16string& label) {
@@ -313,6 +318,11 @@ void SimpleMenuModel::SetLabel(size_t index, const std::u16string& label) {
MenuItemsChanged();
}
@@ -33,7 +33,7 @@ index c058edaf6ea40746228da569a8739c50f958500d..2d4306d16ce8e354dcdf3da8c5afce85
void SimpleMenuModel::SetMinorText(size_t index,
const std::u16string& minor_text) {
items_[ValidateItemIndex(index)].minor_text = minor_text;
@@ -403,6 +413,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
@@ -406,6 +416,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
return items_[ValidateItemIndex(index)].label;
}
@@ -47,7 +47,7 @@ index c058edaf6ea40746228da569a8739c50f958500d..2d4306d16ce8e354dcdf3da8c5afce85
return items_[ValidateItemIndex(index)].minor_text;
}
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index 3f2ae4cb1347a8bac7df6d993d5b70b4212fdc66..72d70e3f94f990f8f9f5e4268f6186762e409d15 100644
index 5ffe7891e71c24a0f31f758c1f467eff645bb658..7c4d37c8b05c64866bc41b38596ffb06e16d69f4 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -50,6 +50,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -58,7 +58,7 @@ index 3f2ae4cb1347a8bac7df6d993d5b70b4212fdc66..72d70e3f94f990f8f9f5e4268f618676
// Gets the icon for the item with the specified id.
virtual ImageModel GetIconForCommandId(int command_id) const;
@@ -167,6 +168,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -168,6 +169,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Sets the label for the item at |index|.
void SetLabel(size_t index, const std::u16string& label);
@@ -68,7 +68,7 @@ index 3f2ae4cb1347a8bac7df6d993d5b70b4212fdc66..72d70e3f94f990f8f9f5e4268f618676
// Sets the minor text for the item at |index|.
void SetMinorText(size_t index, const std::u16string& minor_text);
@@ -206,6 +210,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -207,6 +211,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(size_t index) const override;
int GetCommandIdAt(size_t index) const override;
std::u16string GetLabelAt(size_t index) const override;

View File

@@ -49,10 +49,10 @@ index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a0
// its owning reference back to our owning LocalFrame.
client_->Detached(type);
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index c01a916555d1fe5dbf972cba3b7ce248c80df371..d7ba7113f69e23b0fe47d135a4f51b9d50fa45b2 100644
index 51ac02abf2f2e61538b26fcbbaa437567310c164..f91a1af51c01e29ee6ec734eee368e04bf714311 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -636,10 +636,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -665,10 +665,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index c01a916555d1fe5dbf972cba3b7ce248c80df371..d7ba7113f69e23b0fe47d135a4f51b9d
if (!Client())
return false;
@@ -687,6 +683,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -716,6 +712,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -8,13 +8,14 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index caf0822f9c14c4be6b9454a1ba006f7bc59086be..8e361bf1796bafbb4682d1bdd4feda98fcc7cbb0 100644
index da966a58b11be318770fccdd14986efd2a92ccf8..2a7ea1edd970a205ec5f16c66b5722282f2bcf59 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -80,6 +80,7 @@
@@ -80,6 +80,8 @@
X("drm") \
X("drmcursor") \
X("dwrite") \
X("DXVA_Decoding") \
+ X("DXVA_Decoding") \
+ X("electron") \
X("evdev") \
X("event") \

View File

@@ -33,10 +33,10 @@ index 884bccba58c66861b43b3b50a7535cba543302e2..82e7bf534aa6b998cee8df53be3ca7db
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 2c6b04487112395646469cc077993c6b293fbefa..8a18b4acf613089afbd208fba3a6c8db0268f684 100644
index 01194da83fe3f14c5f84671a186ed01fdbd2dc1e..191766f5e9cf2a0f3c43a6abb2d7e0139d1b666c 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4638,7 +4638,7 @@ static_library("browser") {
@@ -4618,7 +4618,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@@ -46,10 +46,10 @@ index 2c6b04487112395646469cc077993c6b293fbefa..8a18b4acf613089afbd208fba3a6c8db
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 6c55b5fc4cfba94942305f81ad15a83d1c5412c4..f037e4150aef12d2db1d0bd8773e55bcaf723114 100644
index fcd0db1b08e08663e59d1426fb888f5b8d7cf3f5..9cccf671e8f5a804365c68dfdc1aade0de28d1c0 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6584,7 +6584,6 @@ test("unit_tests") {
@@ -6588,7 +6588,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index 6c55b5fc4cfba94942305f81ad15a83d1c5412c4..f037e4150aef12d2db1d0bd8773e55bc
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -6610,6 +6609,10 @@ test("unit_tests") {
@@ -6614,6 +6613,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index 6c55b5fc4cfba94942305f81ad15a83d1c5412c4..f037e4150aef12d2db1d0bd8773e55bc
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -7559,7 +7562,6 @@ test("unit_tests") {
@@ -7541,7 +7544,6 @@ test("unit_tests") {
}
deps += [
@@ -76,7 +76,7 @@ index 6c55b5fc4cfba94942305f81ad15a83d1c5412c4..f037e4150aef12d2db1d0bd8773e55bc
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:test_support",
@@ -7645,6 +7647,10 @@ test("unit_tests") {
@@ -7628,6 +7630,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]

View File

@@ -6,10 +6,18 @@ Subject: build: only use the mas build config in the required components
Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 4925a756be531749e3fe1fd6f1c081b060c28a4f..b7596e0d06f07bcb950fadb0775cec5479af4c0e 100644
index 304223b58a7062e3a6ae466d54b9e877708e5cb3..e9efa7f9d44977982fdf72153623e423753f0386 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1031,6 +1031,7 @@ component("base") {
@@ -228,6 +228,7 @@ if (is_apple) {
]
defines = [ "BASE_IMPLEMENTATION" ]
configs += [ "//build/config/compiler:enable_arc" ]
+ configs += [ "//electron/build/config:mas_build" ]
deps = [
"//base:base_static",
"//base/numerics:base_numerics",
@@ -1082,6 +1083,7 @@ component("base") {
"//build/config/compiler:prevent_unsafe_narrowing",
"//build/config/compiler:wexit_time_destructors",
"//build/config/compiler:wglobal_constructors",
@@ -30,10 +38,10 @@ index 63b32e52a11af599dbc5154ed353e2bf7250e9d3..fc6ed0cdbe211cb29dd5a1dded36b3b0
if (is_win) {
diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn
index a20e1b68ebd112d66ad82e5753b756218e457c9e..65c7170d1c2dbe4ecfc75c4fed92d6e7ff8efb27 100644
index 7ed10085264af6f50b05e51dd93c49e3828d5b3b..d8c77f52376a13af7636e64ff0b5cf58f4fbcf97 100644
--- a/components/os_crypt/sync/BUILD.gn
+++ b/components/os_crypt/sync/BUILD.gn
@@ -71,6 +71,8 @@ component("os_crypt") {
@@ -48,6 +48,8 @@ component("os_crypt") {
"os_crypt_mac.mm",
]
configs += [ "//build/config/compiler:enable_arc" ]
@@ -43,10 +51,18 @@ index a20e1b68ebd112d66ad82e5753b756218e457c9e..65c7170d1c2dbe4ecfc75c4fed92d6e7
if (is_win) {
diff --git a/components/remote_cocoa/app_shim/BUILD.gn b/components/remote_cocoa/app_shim/BUILD.gn
index 0625f07f317de46af619fdb279be78d9ecdc0029..5897820839d6d57ada22a83fe753e3a6b3d752de 100644
index 3bc799978ea24e2f6e566dcc7f8638789e18d61d..cd8910dbc57813d41cd0fa28bb2ad61aaa014bc9 100644
--- a/components/remote_cocoa/app_shim/BUILD.gn
+++ b/components/remote_cocoa/app_shim/BUILD.gn
@@ -16,6 +16,7 @@ component("app_shim") {
@@ -17,6 +17,7 @@ source_set("app_shim_arc") {
configs += [
":app_shim_warnings",
"//build/config/compiler:enable_arc",
+ "//electron/build/config:mas_build"
]
sources = [
"immersive_mode_controller.h",
@@ -56,6 +57,7 @@ component("app_shim") {
assert(is_mac)
configs += [ ":app_shim_warnings" ]
@@ -55,10 +71,10 @@ index 0625f07f317de46af619fdb279be78d9ecdc0029..5897820839d6d57ada22a83fe753e3a6
"alert.h",
"alert.mm",
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 9551e3ea2e5f3de9bff158fc0f443df69a27f93a..e8c192bfbe5a2688e8c767443edbe7fb573ed509 100644
index 488abc9ed0d61a4b73f4bec34cbca416abfbf715..7b1b36d6ab787e2c43d7556b1e4bb1d39c279879 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -332,6 +332,7 @@ viz_component("service") {
@@ -331,6 +331,7 @@ viz_component("service") {
"frame_sinks/external_begin_frame_source_mac.h",
]
}
@@ -66,7 +82,7 @@ index 9551e3ea2e5f3de9bff158fc0f443df69a27f93a..e8c192bfbe5a2688e8c767443edbe7fb
}
if (is_android || use_ozone) {
@@ -588,6 +589,8 @@ viz_source_set("unit_tests") {
@@ -587,6 +588,8 @@ viz_source_set("unit_tests") {
"display_embedder/software_output_device_mac_unittest.mm",
]
frameworks = [ "IOSurface.framework" ]
@@ -76,7 +92,7 @@ index 9551e3ea2e5f3de9bff158fc0f443df69a27f93a..e8c192bfbe5a2688e8c767443edbe7fb
if (is_win) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index caf1b4ee59a75c3ea1363b592e12b6b58d637c01..b554ce1be61de41088c21fced4b9b2dd01e9dc7a 100644
index abc33d4abffaff80f6c23f63e206505ffacade86..6e6fe7a75ae6ec87e1f4f13d28ffdffc1bb0e7ea 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -56,6 +56,7 @@ source_set("browser") {
@@ -88,10 +104,10 @@ index caf1b4ee59a75c3ea1363b592e12b6b58d637c01..b554ce1be61de41088c21fced4b9b2dd
libs = []
frameworks = []
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index d38bd551f8bafbc3be22ca0bedb508e4a74ffbb5..9e17dd2484a633301e684dc091b4800d635e5a20 100644
index aa1ae523aee045fb1db412a42af8aadb97e9ee2a..e5fe6c0212721a67d67b17ee8871eb92e339f845 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -170,6 +170,7 @@ source_set("common") {
@@ -174,6 +174,7 @@ source_set("common") {
"//content:content_implementation",
"//build/config:precompiled_headers",
]
@@ -100,7 +116,7 @@ index d38bd551f8bafbc3be22ca0bedb508e4a74ffbb5..9e17dd2484a633301e684dc091b4800d
public_deps = [
":mojo_bindings",
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 34636a58846e2b250e423dde76e4e6ea1f686676..899b75f2be91e86c526f550718e22221eea604f3 100644
index 65714a5dca013794527640645d8eb2ce36049ac6..b2df50b4cd64816ddf9c5b7e222c47b60304f01e 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -228,6 +228,7 @@ target(link_target_type, "renderer") {
@@ -111,14 +127,39 @@ index 34636a58846e2b250e423dde76e4e6ea1f686676..899b75f2be91e86c526f550718e22221
defines = []
public_deps = [
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 027fa679e34298ec627282796355b6284876520f..14fc5a7c899145872d0df98d7eab019a320da984 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -475,6 +475,7 @@ static_library("test_support") {
configs += [
"//build/config:precompiled_headers",
"//v8:external_startup_data",
+ "//electron/build/config:mas_build",
]
public_deps = [
diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn
index 9d47887dd255187ffe49f5d9dbd01aff5b1de15e..7cde88462e0fc57f9f19badbf1042153708ed423 100644
--- a/content/web_test/BUILD.gn
+++ b/content/web_test/BUILD.gn
@@ -143,6 +143,8 @@ static_library("web_test_browser") {
"browser/web_test_tts_platform.h",
]
+ configs += ["//electron/build/config:mas_build"]
+
if (is_apple) {
configs += [ "//build/config/compiler:enable_arc" ]
}
diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn
index 642afd72cc0f98fe2590cef0c470f378eabb939e..894769a5de698767117339cab0fc2942d1a20b90 100644
index 52940b9bc43aa96dc0a7f90e63ec123ca41c5fab..7c71b07ca2d4b1418b305e876b6be51921b3ea66 100644
--- a/device/bluetooth/BUILD.gn
+++ b/device/bluetooth/BUILD.gn
@@ -240,6 +240,7 @@ component("bluetooth") {
"IOKit.framework",
@@ -241,6 +241,7 @@ component("bluetooth") {
"Foundation.framework",
]
configs += [ "//build/config/compiler:enable_arc" ]
+ configs += ["//electron/build/config:mas_build"]
}
@@ -136,10 +177,10 @@ index ed977f540a2920858a05292f823bf49c669aa6d2..9acd66a086654d77f2a2f84b91779519
if (is_ios) {
sources += [
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index 93cf87a37792691f41d7c611104a378d9af45195..2d3a0f923f4991be41534e7f951fe5dfcceda5c9 100644
index fbed855d14713ec3507b62d86d37b7be9969581e..b08bdea30ad4e5caf26f59c66c34fd63cd6207e4 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -199,6 +199,7 @@ source_set("audio") {
@@ -203,6 +203,7 @@ source_set("audio") {
"mac/coreaudio_dispatch_override.h",
]
frameworks += [ "AudioUnit.framework" ]
@@ -148,10 +189,10 @@ index 93cf87a37792691f41d7c611104a378d9af45195..2d3a0f923f4991be41534e7f951fe5df
if (is_ios) {
diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn
index a8193d411da14f4ff0087fba81e63809832d1806..94c410b59ab7b40654fb214a6a9d828170fe2095 100644
index 6eb142954e6a9b2a3937dbf3ae733f330865c9da..f4061586471b23762ba898766ae16b6c46b5a90e 100644
--- a/net/dns/BUILD.gn
+++ b/net/dns/BUILD.gn
@@ -173,6 +173,8 @@ source_set("dns") {
@@ -177,6 +177,8 @@ source_set("dns") {
":host_resolver_manager",
":mdns_client",
]
@@ -189,10 +230,10 @@ index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a980
source_set("sandbox_unittests") {
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
index 2c9080001cf8e8b4da54a4744f6754e3d5aac5a0..e08a38e5f9ea9c15fc5ceba1a38af682055389b7 100644
index d1ab6d45d519dd131a854b01b90295b5e7316d71..7086774c980636b160f5152ac2c3c6b737217dd1 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -304,6 +304,7 @@ component("core") {
@@ -308,6 +308,7 @@ component("core") {
configs -= core_config_remove
configs += core_config_add
configs += [ "//v8:external_startup_data" ]
@@ -214,10 +255,10 @@ index 7637db0ce03b9e8d242e47f5aff85c21967a541f..e66fdb98adb035a917942432806e0dfa
sources += [ "ca_layer_frame_sink_provider.h" ]
}
diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn
index c9777e07fdd311213db325da44573ed09080856e..76a7ca0545b69baf19c6c89088fb277468cb424d 100644
index cb282e3a526fb724b25c0d4c6a2af3da30ee0a20..d4275f68211f5a0cddfd2bcbc0f620e8f8b6c7aa 100644
--- a/ui/accessibility/platform/BUILD.gn
+++ b/ui/accessibility/platform/BUILD.gn
@@ -250,6 +250,7 @@ component("platform") {
@@ -247,6 +247,7 @@ component("platform") {
weak_frameworks = [
"Accessibility.framework", # macOS 11
]
@@ -226,11 +267,11 @@ index c9777e07fdd311213db325da44573ed09080856e..76a7ca0545b69baf19c6c89088fb2774
if (use_atk) {
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index 9ffa8129d29ecda50f91355ffd01ce9926a70b11..5ebf5ea4db7c692b3288110945d470831e7797e2 100644
index e6a0ca42d0fa2446b300714372986da7e2013f16..fd651028ead9103dabcbb3686e412c12ba8e7952 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -359,6 +359,7 @@ component("base") {
"l10n/l10n_util_mac.mm",
@@ -355,6 +355,7 @@ component("base") {
"interaction/element_tracker_mac.mm",
"resource/resource_bundle_mac.mm",
]
+ configs += ["//electron/build/config:mas_build"]
@@ -238,7 +279,7 @@ index 9ffa8129d29ecda50f91355ffd01ce9926a70b11..5ebf5ea4db7c692b3288110945d47083
if (is_apple) {
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
index 4fb4a862d285fababc67d4f2fe38036ea83bd8a9..fa71bc82342412d85fb05312b441cecbfd9da778 100644
index e7e52516cec15d41abb9f9c9458c5f3420de7dc0..2e13ca6442c616944577b3374fae082554e585c0 100644
--- a/ui/display/BUILD.gn
+++ b/ui/display/BUILD.gn
@@ -67,6 +67,10 @@ component("display") {
@@ -253,10 +294,10 @@ index 4fb4a862d285fababc67d4f2fe38036ea83bd8a9..fa71bc82342412d85fb05312b441cecb
if (is_win) {
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index c7a777df6803678108952185a40b590bbf419859..76303e25a06ed2123bf9ac6b93b8a1e0a91273e9 100644
index f5038c6478eeccc17e061681dbee0f384dac4911..bf23c3576bb7b2d10a840e6eb2a420b739b4f4d7 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -192,6 +192,7 @@ component("gfx") {
@@ -193,6 +193,7 @@ component("gfx") {
"scoped_ns_graphics_context_save_gstate_mac.h",
"scoped_ns_graphics_context_save_gstate_mac.mm",
]
@@ -265,10 +306,10 @@ index c7a777df6803678108952185a40b590bbf419859..76303e25a06ed2123bf9ac6b93b8a1e0
if (is_win) {
sources += [
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 01bbf457bc079c266e6110f7ad7c1ba701343312..0718cc10706de5e4b12a891eff696c80352fb9cd 100644
index a4072a85236ad029ecb292be0085e537a7c482bb..d9250541ab197f625c42feb96d94aca4cd791195 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -675,6 +675,7 @@ component("views") {
@@ -682,6 +682,7 @@ component("views") {
"IOSurface.framework",
"QuartzCore.framework",
]
@@ -276,8 +317,17 @@ index 01bbf457bc079c266e6110f7ad7c1ba701343312..0718cc10706de5e4b12a891eff696c80
}
if (is_win) {
@@ -1098,6 +1099,8 @@ source_set("test_support") {
"//testing/gtest",
]
+ configs += ["//electron/build/config:mas_build"]
+
if (is_win) {
sources += [
"test/desktop_window_tree_host_win_test_api.cc",
diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn
index f37a5a881ac6ac432a4672c5738b7f49b75b5523..1764117f539c2423ebe8bb4c3fe70afcdd0883e8 100644
index e3dd4fab3a1cac0138f8dac60247e0ea3343e87e..61ce57a66ec9d686816446c7f05ce82ee7ee442e 100644
--- a/ui/views/controls/webview/BUILD.gn
+++ b/ui/views/controls/webview/BUILD.gn
@@ -19,6 +19,7 @@ component("webview") {

View File

@@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 12b9553587d04990afe25c8e1cc96ce295838498..fba8faa8c1a060a9a8874acd87d259e626c58191 100644
index 23f8f5f1042cbc85e630d57e26624963d9cbc71c..544f2bcf906ad40769e5961d97211fbba549d03a 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7800,6 +7800,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -7836,6 +7836,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index 12b9553587d04990afe25c8e1cc96ce295838498..fba8faa8c1a060a9a8874acd87d259e6
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c7b82e032049fb94f6686f5b1b22c73659919c2e..d9e99e818f0115c341c2b297488b26c75b301ffe 100644
index c9b13be94c531a528cdbc8046d80d43fe704ef36..4b53b6060e6d7aae818a3d81faa0a1ae673ea59e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4175,6 +4175,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4212,6 +4212,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@@ -37,7 +37,7 @@ index c7b82e032049fb94f6686f5b1b22c73659919c2e..d9e99e818f0115c341c2b297488b26c7
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -4216,12 +4222,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4253,12 +4259,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -66,10 +66,10 @@ index 033780b477965e6915fc808cb468598f55050f2b..51da4e464c5768d979188bb46c11565c
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 1c459729c7c90f71b40d99ff5a72fc2617361808..d42b55fb8b6a01787e3a167ee9e8ec1c76742c16 100644
index d7a8a6d628b790ad9747335b45d1bb148f536ed7..7ba6f9bf054cf9b4d89cfa129caf91a865e1cf97 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -658,6 +658,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -665,6 +665,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -79,10 +79,10 @@ index 1c459729c7c90f71b40d99ff5a72fc2617361808..d42b55fb8b6a01787e3a167ee9e8ec1c
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 44fbcd7d2dde27793cfc2c465717fee32d89eecc..0b04edcca248d337335bde2d28f25c95b07012b8 100644
index fe0b1b96209c48d298a0de2041e2841083f891a9..044a426f4dab1b60b035e4f383b6c468446afc74 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -167,6 +167,7 @@ class NetworkService;
@@ -169,6 +169,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -90,7 +90,7 @@ index 44fbcd7d2dde27793cfc2c465717fee32d89eecc..0b04edcca248d337335bde2d28f25c95
} // namespace network
namespace sandbox {
@@ -1070,6 +1071,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1078,6 +1079,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -100,7 +100,7 @@ index 44fbcd7d2dde27793cfc2c465717fee32d89eecc..0b04edcca248d337335bde2d28f25c95
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 885899b151520e0173a5ca68c2613b1333cadddf..5b53ee691c0a07ed1655139ca2d90341b5fa55a3 100644
index 0e348f7ca57e3004c1f85435ecd0c66896c5a8fb..8019a5c687a87a4257f9f7c0581781095fc20043 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -28,6 +28,17 @@ namespace content {
@@ -122,7 +122,7 @@ index 885899b151520e0173a5ca68c2613b1333cadddf..5b53ee691c0a07ed1655139ca2d90341
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 5da6f93293bc5ddae88c17ac2dd8d7037ba8e8f3..76d699790fb7d92587293b14332f696dc5460322 100644
index c5bda327264c330345baf7b44b4ba5c478e58952..989778079d5dc91127989e43f3ce6b25a9df56d4 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -148,10 +148,10 @@ index 5da6f93293bc5ddae88c17ac2dd8d7037ba8e8f3..76d699790fb7d92587293b14332f696d
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 59f5d3e730a108c7541925809b7c49345f556257..1a0e197b5fe5b698671ddcb0660b69669939ebc2 100644
index 556f5310719f9a9e56bb3a34d75a529b8b26f839..68cc76c0f63f3f828ab582dab88f893453144b2a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6288,6 +6288,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6316,6 +6316,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
blink::GetNavigationInitiatorActivationAndAdStatus(
request.HasUserGesture(), GetWebFrame()->IsAdScriptInStack());
@@ -163,7 +163,7 @@ index 59f5d3e730a108c7541925809b7c49345f556257..1a0e197b5fe5b698671ddcb0660b6966
// moved on send.
bool is_background_tab =
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
index bdf18ff21a92c7cde33cb299b5c3c0a609ce2ea8..97822402213729a4204cf36c3cd42ee5f568fc21 100644
index e4ee6ba03a5683ce7b1a72ac643b5b2520a2f998..44ac0ad92d22b2db8992c67910e420029f005433 100644
--- a/content/web_test/browser/web_test_content_browser_client.cc
+++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -504,6 +504,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -176,7 +176,7 @@ index bdf18ff21a92c7cde33cb299b5c3c0a609ce2ea8..97822402213729a4204cf36c3cd42ee5
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h
index 6e9041279578d8365a4eae6bd9f221baf79324d7..39ff665cc8b87ed4997a60a18c05cd42bc6ffd24 100644
index d17a2d7f09d1899f2e8888c4747ecffbc5b5ff9a..894795fe392013e66513f1f578970908ec652d5d 100644
--- a/content/web_test/browser/web_test_content_browser_client.h
+++ b/content/web_test/browser/web_test_content_browser_client.h
@@ -83,6 +83,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -210,10 +210,10 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 0fe13a68578656da5bd511ce7ea2339150080044..cd6f197dcfdd797c0cffe1194a949c8c095c20ae 100644
index 6283f14f8b613bc435f8c04fec13d1222795797a..2313fe0a9092dd41db0fecf17080ed12b91b0485 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2202,6 +2202,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2195,6 +2195,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);

Some files were not shown because too many files have changed in this diff Show More