Compare commits

...

137 Commits

Author SHA1 Message Date
trop[bot]
347c02ec76 fix: record helper error messages in electron_main_mac (#37812)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-04-03 15:22:56 -07:00
trop[bot]
2dd225e4d5 build: fix build-tools schema in config (#37778)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-31 17:46:23 +02:00
trop[bot]
c96e3b9e60 fix: draggable regions shouldn't capture clicks on frames windows (#37740)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-31 12:20:19 +02:00
John Kleinschmidt
5c51515982 docs: fixup WebUSB fiddle (#37754)
docs: fixup WebUSB fiddle (#37455)

docs: fixup webusb fiddle
(cherry picked from commit 0d3aee26b9)
2023-03-30 19:34:42 -04:00
trop[bot]
dc7a49b873 docs: add links to IPC event structures (#37771)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-03-30 20:38:02 +02:00
trop[bot]
96ee0b7c36 docs: updated package.json content and electron version in build first app guide (#37742)
* Docs: updated package.json content and electron version in build first app guide

Co-authored-by: Mikołaj <32898551+dufipl@users.noreply.github.com>

* docs: removed caret from electron version

Co-authored-by: Mikołaj Sawicki <32898551+dufipl@users.noreply.github.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mikołaj <32898551+dufipl@users.noreply.github.com>
2023-03-29 12:09:11 +02:00
John Kleinschmidt
9e4d81fb0b fix: allow cancelling of bluetooth requests (#37720)
fix: allow cancelling of bluetooth requests (#37601)

(cherry picked from commit 6a6908c4c8)
2023-03-28 10:51:06 -04:00
trop[bot]
9bcb5dc9f7 chore: generator objects can't be sent over the context bridge (#37729)
chore: generator objects can't be sent over the context bridge (#37593)

* chore: generator objects can't be sent over the context bridge

* Trigger Build

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-28 10:50:26 -04:00
trop[bot]
62540b9120 fix: crash in MessagePortMain with some postMessage params (#37724)
* fix: crash in MessagePortMain postMessage

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

* Update shell/browser/api/message_port.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-03-28 10:38:30 -04:00
trop[bot]
ee9484e05c docs: fixup incorrect value for disabling sandbox (#37721)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Peter Xu <sysu.peter.hsu@gmail.com>
2023-03-27 20:40:48 -04:00
trop[bot]
3adb49a831 ci: fixup gn check to actually run gn check (#37680)
* ci: fixup gn check to actually run gn check

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

* chore: update filenames.libcxx.gni

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-03-27 12:53:05 -04:00
Pedro Pontes
6da4c2f12a chore: cherry-pick 6da1a8953313 from angle (#37708) 2023-03-27 09:53:20 -04:00
David Sanders
75ddfcc0e2 docs: change MSDN links to new Microsoft docs (#37706) 2023-03-27 09:37:43 -04:00
John Kleinschmidt
4e692e2211 ci: update appveyor image to e-110.0.5481.208 (#37685) 2023-03-23 20:05:25 -04:00
electron-roller[bot]
e508ef2b8c chore: bump chromium to 110.0.5481.208 (23-x-y) (#37645)
chore: bump chromium in DEPS to 110.0.5481.208

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2023-03-22 22:53:01 -04:00
trop[bot]
cb5b8a6311 docs: update notifications tutorial (#37641)
* docs: update notifications tutorial

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

* delete unused assets

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2023-03-22 10:18:20 -04:00
trop[bot]
67788dd2ba fix: invoke app.dock.{hide|show} instead of duplicating logic (#37624)
fix: invoke app.dock.{hide|show} instead of duplicating logic

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-20 20:15:30 -04:00
trop[bot]
596cb9d1ed docs: update broken links (#37622)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-03-20 12:27:40 -04:00
trop[bot]
71cce1cdd7 fix: properly bubble up cookie creation failure message (#37596)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-16 17:52:46 +01:00
trop[bot]
9b338b91ec fix: don't set delegate for QLPreviewPanel (#37577)
fix: don't set delegate for QLPreviewPanel

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Spiegel <jeremy.spiegel@frontapp.com>
2023-03-16 13:48:26 +01:00
trop[bot]
cb3a169caa feat: add enableLocalEcho flag to setDisplayMediaRequestHandler() callback (#37529)
* feat: add enableLocalEcho flag to setDisplayMediaRequestHandler() callback

Co-authored-by: Theo Gravity <theo@switchboard.app>

* Fix lint

Co-authored-by: Theo Gravity <theo@switchboard.app>

* Update doc

Co-authored-by: Theo Gravity <theo@switchboard.app>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Theo Gravity <theo@switchboard.app>
2023-03-16 10:13:02 +01:00
trop[bot]
443699a22f fix: BroadcastChannel initialization location (#37444)
* fix: `BroadcastChannel` initialization location

* fix: BroadcastChannel initialization location

* chore: update patches

---------

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

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

* Update .patches

chore: fixup .patches file that trop botched

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[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: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-03-16 09:56:18 +01:00
trop[bot]
269e7ba7e4 docs: clarify open-url not preventable (#37573)
docs: clarify open-url not preventable

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-14 20:20:48 -04:00
trop[bot]
4382f2adc0 fix: don't double-log unhandled rejections (#37501)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-14 11:50:46 +01:00
trop[bot]
c1b8848fd7 docs: remove outdated ipc example (#37539)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2023-03-09 10:01:20 -05:00
electron-roller[bot]
66683e5caf chore: bump chromium to 110.0.5481.192 (23-x-y) (#37533)
* chore: bump chromium in DEPS to 110.0.5481.192

* 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-03-08 17:41:11 -05:00
trop[bot]
093a215296 fix: fallback to X11 capturer if pipewire fails on Wayland (#37526)
* fix: fallback to x11 desktop capturer on Wayland

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>

* fix: sanitize window/screen capturer inputs

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* chore: clean up patch description

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-03-07 18:34:17 -08:00
trop[bot]
c174ed70f5 fix: WebUSB on ARM64 macs (#37521)
* fix: WebUSB on ARM64 macs

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

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-03-07 21:15:08 -05:00
trop[bot]
12673d8caa docs: remove misleading info from will-finish-launching docs (#37517)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-03-07 10:26:43 +01:00
trop[bot]
eeea337757 refactor: leverage Skia helpers for NSColor ANSI logic (#37488)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-06 11:43:00 +01:00
electron-roller[bot]
e84dde4bad chore: bump chromium to 110.0.5481.179 (23-x-y) (#37471)
chore: bump chromium in DEPS to 110.0.5481.179

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2023-03-06 11:05:08 +01:00
trop[bot]
f5385bcdec fix: draggable regions on MAS (#37473)
* fix: draggable regions on MAS

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* lint

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-03-03 09:46:05 +01:00
trop[bot]
c3dfd55224 fix: handle closing webContents in BrowserViews (#37451)
* fix: handle closing webContents in BrowserViews

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

* test: add window.close() test

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-03-02 12:23:18 +01:00
trop[bot]
99f6ff430f fix: min/max width/height enforcement when aspectRatio is set (#37457)
fix: min/max width/height with aspect ratio

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-02 12:22:56 +01:00
trop[bot]
587594eb19 chore: improve contents.takeHeapSnapshot error messages (#37460)
* chore: improve contents.takeHeapSnapshot error messages

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

* fix wstring conversion issue

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-03-01 19:09:48 +01:00
trop[bot]
d6a6ef203a fix: Notification with reply obscuring first action on macOS (#37448)
fix: Notification with reply obscuring first action

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-01 13:56:05 +01:00
trop[bot]
ceb76a5fa0 fix: cookies filter secure invalid (#37248)
fix: cookies filter secure and session invalid

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2023-02-26 23:48:43 -08:00
trop[bot]
38f4017dd7 fix: allow contextmenu event in draggable regions (#37394)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-02-26 21:24:00 -08:00
Samuel Attard
74baea7283 build: set base rev 23-x-y (#37410) 2023-02-26 20:19:34 -08:00
trop[bot]
0c47264c4b docs: document change in draggable region behavior on macOS (#37408)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2023-02-26 16:52:59 -08:00
trop[bot]
43deaa422e ci: rename Electron build step to include type of build being built (#37398)
ci: rename Electron build step to describe what is being built

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-02-26 16:52:17 -08:00
electron-roller[bot]
9fbc726385 chore: bump chromium to 110.0.5481.177 (23-x-y) (#37389)
* chore: bump chromium in DEPS to 110.0.5481.177

* 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-02-23 19:15:06 +01:00
trop[bot]
dc0e55aeda fix: restoring X11 window should not remove previous maximize state (#37359)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2023-02-21 17:55:58 +01:00
trop[bot]
41c1b50e66 fix: guard more private API usage on MAS builds (#37363)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-21 17:54:55 +01:00
trop[bot]
3d2cfea8c1 fix: html fullscreen when window not fullscreenable (#37367)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-21 17:54:29 +01:00
electron-roller[bot]
453e31bd01 chore: bump chromium to 110.0.5481.104 (23-x-y) (#37333)
chore: bump chromium in DEPS to 110.0.5481.104

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2023-02-20 13:02:58 -08:00
trop[bot]
1f038a6464 test: rename & split internal module tests (#37327)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-02-20 19:15:56 +01:00
Keeley Hammond
936a9446a4 chore: cherry-pick e0efbd45ea74 from webrtc (#37297) 2023-02-20 13:06:42 +01:00
trop[bot]
36f80bd587 docs: add win.isFocusable() return type (#37261)
docs: fix `win.isFocusable()` return type

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Andrew Ferreira <andrew.shien2@gmail.com>
2023-02-20 12:52:57 +01:00
trop[bot]
29f8161917 test: fix "crash cases" tests not failing properly (#37326)
* test: fix "crash cases" tests not failing properly

Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>

* fixup! test: fix "crash cases" tests not failing properly

Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>
2023-02-19 01:26:17 -08:00
trop[bot]
a9bc82713d docs: only macOS 10.13+ is supported now (#37290)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-02-16 15:56:54 -08:00
Keeley Hammond
83928bd9ff build: use node 18.12 in AppVeyor (23-x-y) (#37282)
* build: use node18.12 appveyor image

* build: use e-110.0.5481.77-node18
2023-02-15 14:22:31 -08:00
electron-roller[bot]
9885c1cfe6 chore: bump chromium to 110.0.5481.100 (23-x-y) (#37183)
* chore: bump chromium in DEPS to 110.0.5481.78

* chore: bump chromium in DEPS to 110.0.5481.97

* 4240359: [intl] Revert date formatting behavior change from ICU 72

https://chromium-review.googlesource.com/c/v8/v8/+/4240359

* chore: bump chromium in DEPS to 110.0.5481.100

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-15 22:35:57 +01:00
trop[bot]
92d966c215 feat: include all standard paper sizes for webContents.print() (#37264)
feat: include standard paper sizes for webContents.print()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-15 19:59:10 +01:00
trop[bot]
c437aa90e2 fix: BrowserView crash when 'beforeunload' prevented (#37267)
fix: crash when beforeunload prevented

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-14 20:54:55 +01:00
trop[bot]
c7e9011f73 refactor: simplify Node.js event loop with SpinEventLoop (#37259)
refactor: simplify Node.js event loop with SpinEventLoop

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-14 18:42:02 +01:00
trop[bot]
5e0014f08b docs: update stable dates (#37251)
* docs: update stable dates

Co-authored-by: VerteDinde <vertedinde@electronjs.org>

* docs: add node version for 23

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2023-02-13 15:53:55 -08:00
trop[bot]
1998ec2de1 build: set make_latest correctly on published releases (#37243)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-02-13 15:19:12 +01:00
trop[bot]
4c007a96e9 chore: update https://cs.chromium.org/ links to https://source.chromium.org/ (#37236)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-02-13 16:33:14 +09:00
John Kleinschmidt
1cac941047 ci: update appveyor image (23-x-y) (#37226)
ci update appveyor image

(cherry picked from commit 454dc6aa318cadeb45a07cb311eccdd5a3a3670e)
2023-02-11 13:36:07 -05:00
trop[bot]
f99c1752ad fix: crash on WebWorkerObserver script execution (#37081)
fix: crash on WebWorkerObserver script execution

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-09 16:19:13 +01:00
trop[bot]
b03574b715 docs: add missing clipboard-sanitized-write permission value to setPermissionRequestHandler() (#37208)
docs: add missing clipboard-sanitized-write permission value to setPermissionRequestHandler() (#37173)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-02-09 14:31:13 +01:00
trop[bot]
3c8ce8e85d chore: enable microtask queue per window agent (#37189)
* chore: enable microtask queue per window agent

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

* chore: switch policies on context microtask queue

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

* fix: ensure node::Environment is valid

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-02-09 10:31:44 +01:00
David Sanders
599833fce2 docs: remove reference to electron/releases (#37188) 2023-02-08 21:25:48 +01:00
trop[bot]
c781daaa6a fix: expose native bindings by process type (#37176)
* fix: expose native bindings by process type

Co-authored-by: Milan Burda <milan.burda@gmail.com>

* fix test

* fix test

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-02-08 14:35:05 +01:00
trop[bot]
27bb1095fb docs: use relative links within docs (#37161)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-02-07 11:33:21 -05:00
trop[bot]
b1e7078bb5 fix: handle Notification requireInteraction option (#36502)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Spiegel <jeremy.spiegel@frontapp.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-02-07 19:35:41 +09:00
trop[bot]
8e7e0dfca1 docs: remove invalid appcache value from storages in clearStorageData() (#37108)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-02-07 19:32:57 +09:00
Samuel Attard
edeaa9f2be build: do not install package silently during publish 2023-02-06 16:27:11 -08:00
Keeley Hammond
bfb870234d fix: crash on window.print() (#37149)
* fix: crash on `window.print()` (#37052)

fix: crash on window.print()

* chore: fix up patch

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-06 11:29:11 -08:00
trop[bot]
792a7c5913 chore: remove deprecated capturer count APIs (#37148)
chore: remove deprecated incrementCapturerCount() / decrementCapturerCount()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-02-06 11:25:58 -08:00
David Sanders
705ef4bc60 build: fixup release_dependency_versions action (#37110)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-06 07:40:16 -08:00
trop[bot]
14dc9a479f fix: enable basic a11y when voice control is active (#37145)
c.f. https://chromium-review.googlesource.com/c/chromium/src/+/2680102

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-02-06 07:39:57 -08:00
trop[bot]
a290148714 docs: use automatic link syntax for symbol server link (#37118)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-02-02 17:43:38 -08:00
electron-roller[bot]
b71926aba9 chore: bump chromium to 110.0.5481.77 (23-x-y) (#37120)
* chore: bump chromium in DEPS to 110.0.5481.77

* 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-02-02 17:54:10 -05:00
trop[bot]
485bbfecfd feat: enable whole-program optimization native modules by default (#37046)
* feat: enable whole-program optimization

Enable whole-program optimization in electron native modules by default.

Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

* pass --with-ltcg to configure.py instead of setting variable

Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

* enable ltcg only on windows

Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-02-02 20:53:20 +09:00
trop[bot]
401ea74cc8 fix: nodeIntegrationInWorker fails to boot in AudioWorklets (#37104)
fix: nodeIntegrationInWorker in AudioWorklets

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-02-02 19:51:11 +09:00
trop[bot]
419b5b77ae docs: note how to clear an aspect ratio (#37086)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-01-31 17:23:37 -05:00
trop[bot]
53ab44b1f2 ci: fixup ninja for release (#37084)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-01-31 11:31:46 -05:00
trop[bot]
13549bbc7b ci: ensure correct ninja is used (#37072)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-01-30 18:15:57 -05:00
trop[bot]
e69270a600 fix: resizing borders in nondraggable regions (#37037)
* fix: resizing borders in nondraggable regions

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

* chore: remove frame handling from ShouldDescendIntoChildForEventHandling

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-01-30 11:50:01 +01:00
trop[bot]
39203e93c0 docs: updated deep link docs (#37031) 2023-01-30 10:58:26 +01:00
electron-roller[bot]
961cc47948 chore: bump chromium to 110.0.5481.52 (23-x-y) (#37035)
* chore: bump chromium in DEPS to 110.0.5481.52

* 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-01-26 16:40:43 -05:00
trop[bot]
9c614be4f8 fix: fallback to GtkStatusIcon when app indicator is not supported (#37033)
* chore: get ready for multi backend tray

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>

* fix: fallback to GtkStatusIcon when app indicator is not supported

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>

* chore: use smart pointers

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2023-01-26 13:39:23 +01:00
trop[bot]
e5da0b5c59 chore: fix memory leak in v8.serialize() (#37030)
chore: fix memory leak in v8.serialize()

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-01-26 13:03:12 +01:00
trop[bot]
7db9895214 chore: remove crashpad related sandbox policy (#37026)
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-01-26 19:12:00 +09:00
trop[bot]
d706649da8 chore: call ListenerDestroyed() in FileSelectHelper::RunFileChooserEnd() (#37020)
chore: call ListenerDestroyed() in FileSelectHelper::RunFileChooserEnd()

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-01-26 17:27:51 +09:00
trop[bot]
51ac59e1eb chore: update README.md (#37029)
Update README.md

Co-authored-by: Milan Burda <milan.burda@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-01-26 16:19:38 +09:00
trop[bot]
7623604030 fix: do not error on null exports in ESM loader (#37024)
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-01-26 16:19:07 +09:00
trop[bot]
ab2d2dc625 fix: treat maxWidth/Height<=0 as unlimited (#36511)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-01-25 13:06:25 -08:00
David Sanders
0e8b10beba test: support running tests against Electron releases (#36969)
Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-01-24 12:00:21 -05:00
trop[bot]
e1dce7c1f7 test: add a <datalist> spec for time type (#36996)
spec: add a datalist spec for time type

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-01-24 09:07:00 +01:00
trop[bot]
266c471680 chore: cleanup autofill agent shutdown sequence (#36976)
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-01-23 13:13:56 +01:00
trop[bot]
2bc14c9b7e fix: make plugin helper executable unconditional (#36977)
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-01-21 21:41:33 +09:00
trop[bot]
b8c4a71cd7 test: fix nativeTheme test when system in dark mode (#36966)
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-01-20 14:34:52 -08:00
trop[bot]
1403a48add fix: <datalist> dropdown positioning (#36959)
fix: datalist dropdown positioning

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-01-20 10:10:11 +01:00
trop[bot]
7c5430a47f docs: update clipboard fiddles (#36962)
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-01-19 18:05:47 -05:00
trop[bot]
0dd5d57423 docs: Change factuality and word choice in app.runningUnderARM64Translation (#36963)
Change factuality and word choice.

Added "or WOW" to the phrase, "when they are running the x64 version under Rosetta", to reflect the use of a supported platform, Windows, as a possible scenario.
Changed the wording of that same sentence to make it appear clearer. "incorrectly" to "mistakenly" and moved this word to before the verb instead of the end of the sentence.

Co-authored-by: GGIEnrike <52293637+GGIEnrike@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: GGIEnrike <52293637+GGIEnrike@users.noreply.github.com>
2023-01-19 18:03:48 -05:00
electron-roller[bot]
a49593580d chore: bump chromium to 110.0.5481.38 (23-x-y) (#36955)
* chore: bump chromium in DEPS to 110.0.5481.38

* 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-01-19 12:45:11 -05:00
trop[bot]
0a6a3fd812 fix: webview background color on reload (#36938)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-01-19 12:15:27 +01:00
trop[bot]
56d28dce94 feat: add label property to Display objects (#36933)
Co-authored-by: Milan Burda <milan.burda@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-01-19 15:59:12 +09:00
trop[bot]
857ce18e17 test: fix test for USB device.forget() (#36950)
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-01-19 09:53:26 +09:00
electron-roller[bot]
56f042f5e5 chore: bump chromium to 110.0.5481.30 (23-x-y) (#36819)
* chore: bump chromium in DEPS to 110.0.5481.24

* chore: update patches

* 4098946: Migrate Extension::Create() argument to base::Value::Dict (part 4 of 4)

https://chromium-review.googlesource.com/c/chromium/src/+/4098946
(cherry picked from commit 716a0f66f6)

* chore: bump chromium in DEPS to 110.0.5481.30

* chore: update patches

* chore: cleanup password from keychain after test

(cherry picked from commit 6c3b0f84c5)

* 4143761: [110] Disable SwiftShader for WebGL on M1 Macs.

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

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-01-18 12:13:25 +01:00
John Kleinschmidt
ce36849a3d ci: run WOA tests on AppVeyor (23-x-y) (#36926)
ci: run WOA tests on AppVeyor
2023-01-18 12:12:42 +01:00
trop[bot]
3483a341de fix: Cmd+Tab not working when exiting kiosk mode (#36917)
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-01-17 12:15:23 +01:00
trop[bot]
e8cc2f613e chore: fix typo in promise rejection (#36896)
Co-Authored-By: Eugene Nesvetaev <github@nesvet.ru>
Co-Authored-By: David Sanders <dsanders11@ucsbalum.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Eugene Nesvetaev <github@nesvet.ru>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-01-13 15:16:14 +09:00
Robo
6749f8f065 fix: missing libcxx headers (#36864)
* chore: add libcxx script to precommit hook

* chore: run gen-libc++-filename.js
2023-01-12 11:58:39 +01:00
trop[bot]
10fba52f73 build: migrate patch-up to use app creds (#36866)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2023-01-11 17:59:32 -05:00
trop[bot]
f2daab093c fix: RTL WindowButtonsProxy buttons (#36850)
* fix: RTL WindowButtonsProxy buttons

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

* chore: address review feedback

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-01-11 20:29:41 +01:00
trop[bot]
89763c9042 fix: getUserMedia duplicate permissions call (#36874)
* fix: getUserMedia duplicate permissions call

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

* test: add regression test

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-01-11 20:21:52 +01:00
trop[bot]
c506624807 fix: handle null/undefined options for fs.readdir (#36848)
fix: handle null/undefined options for fs.readdir (#34764)

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-01-11 11:56:52 +01:00
trop[bot]
3f344e91bb build: update release deps workflow (#36853)
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-01-10 21:55:48 -08:00
trop[bot]
d9533135d0 docs: add missing window-management permission value to setPermissionRequestHandler() (#36845) 2023-01-10 14:26:34 +01:00
trop[bot]
b8df68d7f4 docs: fix link in breaking-changes.md (#36838)
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-01-10 09:37:07 +09:00
trop[bot]
79b07b9c70 docs: update links (#36771)
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-01-10 09:34:07 +09:00
trop[bot]
bb88737b9c docs: update code highlights in tutorial (#36767)
docs: fix code highlighting in preload tutorial

The highlighted lines in the code snippets were unaligned,
which could cause a newcomer unneeded confusion on what
lines need to be changed.

Co-authored-by: Roger Zurawicki <zurawiki@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Roger Zurawicki <zurawiki@users.noreply.github.com>
2023-01-10 09:33:37 +09:00
trop[bot]
6494e41306 fix: focus rings with multiple buttons in showMessageBox (#36803)
fix: focus rings with multiple buttons in messageBox

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-01-09 16:40:58 +09:00
electron-roller[bot]
5a5ea4845e chore: bump chromium to 110.0.5478.5 (23-x-y) (#36574)
* chore: bump chromium in DEPS to 110.0.5461.0

* chore: bump chromium in DEPS to 110.0.5463.0

* chore: bump chromium in DEPS to 110.0.5465.0

* chore: bump chromium in DEPS to 110.0.5467.0

* chore: bump chromium in DEPS to 110.0.5469.0

* chore: bump chromium in DEPS to 110.0.5471.0

* chore: bump chromium in DEPS to 110.0.5473.0

* chore: bump chromium in DEPS to 110.0.5475.0

* chore: bump chromium in DEPS to 110.0.5477.0

* chore: bump chromium in DEPS to 110.0.5479.0

* chore: bump chromium in DEPS to 110.0.5481.0

* chore: bump chromium in DEPS to 110.0.5481.4

* chore: bump chromium in DEPS to 110.0.5478.5

* chore: update patches

* 4074449: Add gl::FrameData to software path

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

* fixup! 4074449: Add gl::FrameData to software path

(cherry picked from commit 2316ec931ec9cb1d4ade43df2f3663ef155c5a61)

* 4074449: Add gl::FrameData to software path

This commit also reformatted the two files in this patch. The only
change here is the addition of the |data| arg to |OnSwapBuffers|.

https://chromium-review.googlesource.com/c/chromium/src/+/4074449
(cherry picked from commit aa2504ee6b4e3a2eaf3348eb535ef8121dd6cc3b)

* 4081108: task posting v3: remove task_runner_util{.h,_unittest.cc}

https://chromium-review.googlesource.com/c/chromium/src/+/4081108
(cherry picked from commit fce317513ee15138351f8b1bdf062250d97f57b9)

* 4081108: task posting v3: remove task_runner_util{.h,_unittest.cc}

https://chromium-review.googlesource.com/c/chromium/src/+/4081108
(cherry picked from commit cb14d9f5df300020a3b8d11078656763b428789e)

* chore: add missing RefCountedMemory include

(cherry picked from commit 893a1da1ed5a461e0e46abecab2a2de545ab543b)

* 4025927: [Code Health] Migrate e/c/manifest.cc to base::Value::Dict interface

https://chromium-review.googlesource.com/c/chromium/src/+/4025927
(cherry picked from commit f9e1ce44bdbe1c199881daef2799164737e2d39d)

* 4072471: Rename Mixed Download Blocking to Insecure Download Blocking

https://chromium-review.googlesource.com/c/chromium/src/+/4072471
(cherry picked from commit e191d7526d3821ace54717ce7c8a5e95df542135)

* 4060548: Remove base::Value::GetListDeprecated().

https://chromium-review.googlesource.com/c/chromium/src/+/4060548
(cherry picked from commit f76cb2bcb4d1772c596c7e8dc5be27024e2b9cfe)

* 4032656: hid: Abstract HidSystemTrayIcon class for profiles' HID connections

https://chromium-review.googlesource.com/c/chromium/src/+/4032656
(cherry picked from commit 9737692d016d726f277c7a6ac6ec919b18820cba)

* 3903024: hid: Add connection count tracking methods for HidDelegate

https://chromium-review.googlesource.com/c/chromium/src/+/3903024
(cherry picked from commit a0299046cd3cedb1c84b4ecf867089fce9304861)

* 4076211: Turn FrameTreeNode::frame_tree into raw_ref.

https://chromium-review.googlesource.com/c/chromium/src/+/4076211
(cherry picked from commit 6cca422b421013ce166779cc9687d50301ac3280)

* 4112537: Remove DictionaryPrefUpdate.
https://chromium-review.googlesource.com/c/chromium/src/+/4112537

(cherry picked from commit ec8e8f75deed5da760c75267c5575509923ae7e4)

* 3835037: Add new slides media session actions to Picture-in-Picture window

https://chromium-review.googlesource.com/c/chromium/src/+/3835037
(cherry picked from commit 7dc35729bce450b365b8d211536a275e8e3f0a08)

* 4065264: [Extensions] Add a new side panel view type

https://chromium-review.googlesource.com/c/chromium/src/+/4065264
(cherry picked from commit c6c3c3ff8289c87a6ca831ff23100b3dde74eddf)

* 4085814: [Test Automation] Move NativeWindowTracker to ui/views

https://chromium-review.googlesource.com/c/chromium/src/+/4085814
(cherry picked from commit ffbe5437139752f507bef4c66cc958e6dcef3bce)

* chore: disable Microtask queues per WindowAgent.

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

(cherry picked from commit 0ffa9df410a27236ed73b07d5b36c84783b0f9d1)

* fixup: disable Microtask queues per WindowAgent.

(cherry picked from commit 438be771dd)

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Calvin Watford <cwatford@slack-corp.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-01-05 21:35:45 -05:00
trop[bot]
4076f06036 docs: Add note about argv getting modified (#36805)
Add note about argv getting modified

See https://github.com/electron/electron/issues/20322

Co-authored-by: Mikael Finstad <finstaden@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-01-05 12:10:25 -05:00
trop[bot]
169136c69c fix: rename WebSwapCGLLayer to WebSwapCGLLayerChromium (#36799) 2023-01-05 10:37:06 +01:00
trop[bot]
63e59a196a docs: fix broken links (#36561)
* docs: fix broken links

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

* docs: change link to navigator.getUserMedia

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

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

* docs: fix link in examples.md

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-01-02 11:26:23 +01:00
trop[bot]
4d8d8f56cc docs: Fix incorrect highlight in an example snippet (#36713)
Fix incorrect highlight in an example snippet

At the moment, the "Communicating between processes" `main.js` snippet highlights the line containing `})` when the relevant line is `ipcMain.handle('ping', () => 'pong')`.

Co-authored-by: MAPGarrett <19568204+MAPGarrett@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: MAPGarrett <19568204+MAPGarrett@users.noreply.github.com>
2023-01-02 10:33:43 +01:00
trop[bot]
7b7b4941fe docs: update visual studio min version (#36732)
Co-authored-by: George Xu <george.xu99@hotmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: George Xu <george.xu99@hotmail.com>
2022-12-30 22:16:43 -08:00
trop[bot]
9537370cf6 ci: pin action shas (#36565)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>

Co-authored-by: StepSecurity Bot <bot@stepsecurity.io>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: StepSecurity Bot <bot@stepsecurity.io>
2022-12-20 10:17:45 -08:00
trop[bot]
8edbb1d4ae fix: blend node and blink code generation policy when both are loaded (#36667)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-12-19 11:20:53 -08:00
trop[bot]
f8c0682b6e test: replace (webContents as any).destroy() with webContents.destroy() (#36669) 2022-12-19 11:17:47 -08:00
Samuel Attard
8a10a90ebf chore: cherry-pick 09ae62b from node (#36623)
* chore: cherry-pick 09ae62b from node

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-12-14 16:07:02 -05:00
trop[bot]
2255705c70 fix: use the process cache to reduce the memory for asar file (#36665)
* fix: use the process cache to reduce the memory for asar file

Co-authored-by: webster.xu <webster.xu@ringcentral.com>

* Update shell/common/api/electron_api_asar.cc

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: webster.xu <webster.xu@ringcentral.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-12-14 16:05:10 -05:00
trop[bot]
74d5ddcd28 fix: strip branded binaries (#36656)
When creating branded release builds and using scripts/strip-binaries.py
on Linux, the final artifacts end up unstripped due to the static set of
binaries considered for stripping.
With this patch the name of the electron binary is taken from the
BRANDING.json `project_name` key.

Signed-off-by: Robert Günzler <r@gnzler.io>

Co-authored-by: Robert Günzler <r@gnzler.io>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Robert Günzler <r@gnzler.io>
2022-12-14 11:50:53 -05:00
trop[bot]
bb9badc41a chore: update AppVeyor image to include latest Windows updates (#36652)
clenaup

Co-authored-by: VerteDinde <vertedinde@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-12-13 16:58:37 -05:00
trop[bot]
10632e3f54 docs: link net.request options to ClientRequestConstructorOptions (#36570)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-12-13 10:53:49 -08:00
trop[bot]
6010ac6c76 docs: add mdn link to web-request-filter.md (#36616)
* Add MDN link to web-request-filter.md

When I was using the Electron docs I wanted to know how to use [webRequest.onBeforeSendHeaders](https://www.electronjs.org/docs/latest/api/web-request#webrequestonbeforesendheadersfilter-listener) but I was unable to correctly guess the correct format for the `WebRequestFilter` URL strings, and there was no explanation in the Electron docs. Eventually I googled it and found the MDN article which helped me.

Co-authored-by: Hugh Davey <9026053+hughjdavey@users.noreply.github.com>

* Update docs/api/structures/web-request-filter.md

Co-authored-by: Black-Hole <158blackhole@gmail.com>

Co-authored-by: Hugh Davey <9026053+hughjdavey@users.noreply.github.com>

* Update docs/api/structures/web-request-filter.md

Co-authored-by: Black-Hole <158blackhole@gmail.com>

Co-authored-by: Hugh Davey <9026053+hughjdavey@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Hugh Davey <9026053+hughjdavey@users.noreply.github.com>
2022-12-08 14:55:35 -08:00
trop[bot]
1c1a0cdead chore: bump chromium to 110.0.5451.0 (23-x-y) (#36568)
chore: bump chromium to 110.0.5451.0 (main) (#36394)

* chore: bump chromium in DEPS to 110.0.5425.0

* chore: bump chromium in DEPS to 110.0.5427.0

* chore: bump chromium in DEPS to 110.0.5429.0

* chore: bump chromium in DEPS to 110.0.5431.0

* chore: update patches/chromium/picture-in-picture.patch to fix upstream code shear

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

* chore: sync patch w/upstream shear: remove_usage_of_incognito_apis_in_the_spellchecker.patch

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

* chore: sync patch w/upstream shear: feat_expose_raw_response_headers_from_urlloader.patch

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

* chore: sync patch w/upstream shear: chromium/custom_protocols_plzserviceworker.patch

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

* build: update references to core_api_provider; its location was moved upstream

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

* build: remove back_to_tab_image_button from our enable_picture_in_picture deps

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

back_to_tab_image_button has been removed upstream

* chore: update patches

* chore: bump chromium in DEPS to 110.0.5433.0

* chore: sync patch w/upstream shear: chromium/printing.patch

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

* chore: sync patch w/trivial upstream shear: chromium/process_singleton.patch

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

* refactor: remove kAutofillCenterAlignedSuggestions feature flag check.

This behavior had been an experiment behind a feature flag. The
experiment was a success so the feature was kept & the flag was removed.

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3870616
moves from disabled-by-default to enabled-by-default

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4030556
removed the feature flag

* chore: update patches

* chore: bump chromium in DEPS to 110.0.5435.0

* chore: update patches

* chore: sync code with upstream change: AXLMode method name

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

* 3841761: Adapting code to support kSystemProfileSelectionDefaultNone experiment

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

* chore: bump chromium in DEPS to 110.0.5437.0

* 4040140: Pip 2.0: Merge VideoOverlayWindowViews and OverlayWindowViews

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

* 4045567: Fix a crash opening a popup from tab capture fullscreen

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

* chore: fixup patch indices

* 4048263: Remove deprecated Value calls in frame_tracker_unittest.cc.

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

* 4004606: [intl] Migrate to ICU 72

https://chromium-review.googlesource.com/c/v8/v8/+/4004606

* chore: bump chromium in DEPS to 110.0.5439.0

* 3890670: Prerender: Add first implementation of prerender-in-new-tab mode

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

* chore: fixup patch indices

* chore: bump chromium in DEPS to 110.0.5441.0

* chore: update patches

* chore: bump chromium in DEPS to 110.0.5443.0

* 4035451: Remove remaining uses of ScopedNestableTaskAllower.

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

* chore: bump chromium in DEPS to 110.0.5445.0

* chore: update patches

* fixup! 3890670: Prerender: Add first implementation of prerender-in-new-tab mode

* test: disable parallel/test-worker-init-failure

Refs https://chromium-review.googlesource.com/c/v8/v8/+/4017512
Refs https://github.com/nodejs/node-v8/issues/246

* chore: disable parallel/test-fetch

Test is flaky on Linux CI, but runs fine locally.

* chore: bump chromium in DEPS to 110.0.5451.0

* chore: update patches

* chore: cleanup patch

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: electron-roller[bot] <84116207+electron-roller[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>
2022-12-05 22:20:25 -05:00
trop[bot]
af0a995bb2 docs: document outlivesOpener option in window open handler (#36509)
* docs: document outlivesOpener option in window open handler

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* outlivesOpener is optional

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-12-05 12:07:16 -05:00
trop[bot]
a0efada13b refactor: make StatusIconType an enum class (#36554)
Co-authored-by: Milan Burda <miburda@microsoft.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-12-05 10:39:37 -05:00
trop[bot]
8635029f47 build: fixup mksnapshot args on linux (#36534)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-12-01 19:27:00 -05:00
trop[bot]
ac0ba48736 chore: drop support for Windows 7 / 8 / 8.1 (#36513)
* chore: drop support for Windows 7 & 8

Co-authored-by: Milan Burda <miburda@microsoft.com>

* chore: remove disable-redraw-lock.patch

Co-authored-by: Milan Burda <miburda@microsoft.com>

* chore: update patches

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

* Update docs/breaking-changes.md

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

Co-authored-by: Milan Burda <milan.burda@gmail.com>

* Update docs/breaking-changes.md

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

Co-authored-by: Milan Burda <milan.burda@gmail.com>

* fix breaking-changes.md

Co-authored-by: Milan Burda <miburda@microsoft.com>

* chore: note last supported version

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* chore: add link to deprecation policy

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* Update docs/breaking-changes.md

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Milan Burda <milan.burda@gmail.com>

* update README.md

Co-authored-by: Milan Burda <miburda@microsoft.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-11-30 20:53:40 -08:00
368 changed files with 5100 additions and 4870 deletions

View File

@@ -51,7 +51,7 @@ jobs:
steps:
- checkout
- path-filtering/set-parameters:
base-revision: main
base-revision: origin/23-x-y
mapping: |
^((?!docs/).)*$ run-build-mac true
^((?!docs/).)*$ run-build-linux true

View File

@@ -218,6 +218,7 @@ step-maybe-cleanup-arm64-mac: &step-maybe-cleanup-arm64-mac
security delete-generic-password -l "Chromium Safe Storage" || echo "✓ Keychain does not contain password from tests"
security delete-generic-password -l "Electron Test Main Safe Storage" || echo "✓ Keychain does not contain password from tests"
security delete-generic-password -a "electron-test-safe-storage" || echo "✓ Keychain does not contain password from tests"
security delete-generic-password -l "electron-test-safe-storage Safe Storage" || echo "✓ Keychain does not contain password from tests"
elif [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
XVFB=/usr/bin/Xvfb
/sbin/start-stop-daemon --stop --exec $XVFB || echo "Xvfb not running"
@@ -485,7 +486,9 @@ step-fix-sync: &step-fix-sync
run:
name: Fix Sync
command: |
SEDOPTION="-i"
if [ "`uname`" == "Darwin" ]; then
SEDOPTION="-i ''"
# Fix Clang Install (wrong binary)
rm -rf src/third_party/llvm-build
python3 src/tools/clang/scripts/update.py
@@ -495,13 +498,16 @@ step-fix-sync: &step-fix-sync
# Remove extra output from calling gclient getdep which always calls update_depot_tools
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
# Fix ninja (wrong binary)
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
sed -i '' "s/Updating depot_tools... //g" ninja_ensure_file
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
fi
# Make sure we are using the right ninja
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
sed $SEDOPTION "s/Updating depot_tools... //g" ninja_ensure_file
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
# Explicitly add ninja to the path
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/ninja"' >> $BASH_ENV
cd src/third_party/angle
rm .git/objects/info/alternates
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
@@ -707,7 +713,7 @@ step-mksnapshot-build: &step-mksnapshot-build
ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
# Remove unused args from mksnapshot_args
SEDOPTION=
SEDOPTION="-i"
if [ "`uname`" == "Darwin" ]; then
SEDOPTION="-i ''"
fi
@@ -956,26 +962,13 @@ step-ts-compile: &step-ts-compile
# List of all steps.
steps-electron-gn-check: &steps-electron-gn-check
steps:
- *step-checkout-electron
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- install-python2-mac
- *step-setup-env-for-build
- *step-setup-goma-for-build
- *step-generate-deps-hash
- *step-touch-sync-done
- maybe-restore-portaled-src-cache
- run:
name: Ensure src checkout worked
command: |
if [ ! -d "src/third_party/blink" ]; then
echo src cache was not restored for an unknown reason
exit 1
fi
- run:
name: Wipe Electron
command: rm -rf src/electron
- *step-checkout-electron
- checkout-from-cache
- *step-setup-env-for-build
- *step-wait-for-goma
- *step-gn-gen-default
- *step-gn-check
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
steps:
@@ -1048,6 +1041,8 @@ commands:
parameters:
artifact-key:
type: string
build-type:
type: string
build-nonproprietary-ffmpeg:
type: boolean
default: true
@@ -1055,6 +1050,7 @@ commands:
- *step-gn-gen-default
- ninja_build_electron:
clean-prebuilt-snapshot: false
build-type: << parameters.build-type >>
- *step-maybe-electron-dist-strip
- step-electron-dist-build:
additional-targets: shell_browser_ui_unittests third_party/electron_node:headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip
@@ -1216,9 +1212,12 @@ commands:
clean-prebuilt-snapshot:
type: boolean
default: true
build-type:
type: string
steps:
- run:
name: Electron build
name: Electron << parameters.build-type >> build
no_output_timeout: 60m
command: |
cd src
@@ -1229,7 +1228,7 @@ commands:
ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
# Remove unused args from mksnapshot_args
SEDOPTION=
SEDOPTION="-i"
if [ "`uname`" == "Darwin" ]; then
SEDOPTION="-i ''"
fi
@@ -1286,6 +1285,8 @@ commands:
default: true
artifact-key:
type: string
build-type:
type: string
after-build-and-save:
type: steps
default: []
@@ -1412,6 +1413,7 @@ commands:
steps:
- build_and_save_artifacts:
artifact-key: << parameters.artifact-key >>
build-type: << parameters.build-type >>
build-nonproprietary-ffmpeg: << parameters.build-nonproprietary-ffmpeg >>
- steps: << parameters.after-build-and-save >>
@@ -1557,6 +1559,8 @@ commands:
checkout:
type: boolean
default: true
build-type:
type: string
steps:
- when:
condition: << parameters.attach >>
@@ -1588,7 +1592,8 @@ commands:
- *step-gn-gen-default
# Electron app
- ninja_build_electron
- ninja_build_electron:
build-type: << parameters.build-type >>
- *step-show-goma-stats
- *step-maybe-generate-breakpad-symbols
- *step-maybe-electron-dist-strip
@@ -1651,6 +1656,7 @@ jobs:
save-git-cache: true
checkout-to-create-src-cache: true
artifact-key: 'nil'
build-type: 'nil'
mac-checkout:
executor:
@@ -1669,6 +1675,7 @@ jobs:
persist-checkout: true
restore-src-cache: false
artifact-key: 'nil'
build-type: 'nil'
mac-make-src-cache:
executor:
@@ -1687,6 +1694,7 @@ jobs:
save-git-cache: true
checkout-to-create-src-cache: true
artifact-key: 'nil'
build-type: 'nil'
# Layer 2: Builds.
linux-x64-testing:
@@ -1704,6 +1712,7 @@ jobs:
checkout: false
checkout-and-assume-cache: true
artifact-key: 'linux-x64'
build-type: 'Linux'
linux-x64-testing-asan:
executor:
@@ -1722,6 +1731,7 @@ jobs:
checkout: true
build-nonproprietary-ffmpeg: false
artifact-key: 'linux-x64-asan'
build-type: 'Linux'
linux-x64-testing-no-run-as-node:
executor:
@@ -1738,6 +1748,7 @@ jobs:
persist: false
checkout: true
artifact-key: 'linux-x64-no-run-as-node'
build-type: 'Linux'
linux-x64-testing-gn-check:
executor:
@@ -1769,6 +1780,7 @@ jobs:
- electron-publish:
attach: false
checkout: true
build-type: 'Linux'
linux-arm-testing:
@@ -1789,6 +1801,7 @@ jobs:
checkout: false
checkout-and-assume-cache: true
artifact-key: 'linux-arm'
build-type: 'Linux ARM'
linux-arm-publish:
executor:
@@ -1813,6 +1826,7 @@ jobs:
- electron-publish:
attach: false
checkout: true
build-type: 'Linux ARM'
linux-arm64-testing:
executor:
@@ -1832,6 +1846,7 @@ jobs:
checkout: false
checkout-and-assume-cache: true
artifact-key: 'linux-arm64'
build-type: 'Linux ARM64'
linux-arm64-testing-gn-check:
executor:
@@ -1866,6 +1881,7 @@ jobs:
- electron-publish:
attach: false
checkout: true
build-type: 'Linux ARM64'
osx-testing-x64:
executor:
@@ -1884,6 +1900,7 @@ jobs:
checkout-and-assume-cache: true
attach: true
artifact-key: 'darwin-x64'
build-type: 'Darwin'
after-build-and-save:
- run:
name: Configuring MAS build
@@ -1894,6 +1911,7 @@ jobs:
rm -rf src/out/Default/Electron*.app
- build_and_save_artifacts:
artifact-key: 'mas-x64'
build-type: 'MAS'
after-persist:
- persist_to_workspace:
root: .
@@ -1930,6 +1948,7 @@ jobs:
- electron-publish:
attach: true
checkout: false
build-type: 'Darwin'
osx-publish-arm64:
executor:
@@ -1952,6 +1971,7 @@ jobs:
- electron-publish:
attach: true
checkout: false
build-type: 'Darwin ARM64'
osx-testing-arm64:
executor:
@@ -1972,6 +1992,7 @@ jobs:
checkout-and-assume-cache: true
attach: true
artifact-key: 'darwin-arm64'
build-type: 'Darwin ARM64'
after-build-and-save:
- run:
name: Configuring MAS build
@@ -1982,6 +2003,7 @@ jobs:
rm -rf src/out/Default/Electron*.app
- build_and_save_artifacts:
artifact-key: 'mas-arm64'
build-type: 'MAS ARM64'
after-persist:
- persist_to_workspace:
root: .
@@ -2008,6 +2030,7 @@ jobs:
- electron-publish:
attach: true
checkout: false
build-type: 'MAS'
mas-publish-arm64:
executor:
@@ -2030,6 +2053,7 @@ jobs:
- electron-publish:
attach: true
checkout: false
build-type: 'MAS ARM64'
# Layer 3: Tests.
linux-x64-testing-tests:

View File

@@ -35,8 +35,13 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
write_config() {
echo "
{
\"root\": \"/workspaces/gclient\",
\"goma\": \"$1\",
\"root\": \"/workspaces/gclient\",
\"remotes\": {
\"electron\": {
\"origin\": \"https://github.com/electron/electron.git\"
}
}
\"gen\": {
\"args\": [
\"import(\\\"//electron/build/args/testing.gn\\\")\",
@@ -48,11 +53,7 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
},
\"remotes\": {
\"electron\": {
\"origin\": \"https://github.com/electron/electron.git\"
}
}
\"$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\"
}
" >$buildtools/configs/evm.testing.json
}

View File

@@ -1,166 +0,0 @@
name: Electron WOA Testing
on:
push:
branches: '**'
workflow_dispatch:
inputs:
appveyor_job_id:
description: 'Job Id of Appveyor WOA job to test'
type: text
required: true
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
electron-woa-init:
if: ${{ github.event_name == 'push' && github.repository == 'electron/electron' }}
runs-on: ubuntu-latest
steps:
- name: Dummy step for push event
run: |
echo "This job is a needed initialization step for Electron WOA testing. Another test result will appear once the electron-woa-testing build is done."
electron-woa-testing:
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'electron/electron' }}
runs-on: [self-hosted, woa]
permissions:
checks: write
pull-requests: write
steps:
- uses: LouisBrunner/checks-action@442ad2296fb110373e3fe01c2a3717b546583631 # tag: v1.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: electron-woa-testing
status: in_progress
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"summary":"Test In Progress","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
- name: Clean Workspace
run: |
Remove-Item * -Recurse -Force
shell: powershell
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag: v3
with:
path: src\electron
fetch-depth: 0
- name: Yarn install
run: |
cd src\electron
node script/yarn.js install --frozen-lockfile
- name: Download and extract dist.zip for test
run: |
$localArtifactPath = "$pwd\dist.zip"
$serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/dist.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\Default -y $localArtifactPath
shell: powershell
- name: Download and extract native test executables for test
run: |
$localArtifactPath = "src\out\Default\shell_browser_ui_unittests.exe"
$serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/shell_browser_ui_unittests.exe"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
shell: powershell
- name: Download and extract ffmpeg.zip for test
run: |
$localArtifactPath = "$pwd\ffmpeg.zip"
$serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/ffmpeg.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\ffmpeg $localArtifactPath
shell: powershell
- name: Download node headers for test
run: |
$localArtifactPath = "src\node_headers.zip"
$serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/node_headers.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
cd src
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip
shell: powershell
- name: Download electron.lib for test
run: |
$localArtifactPath = "src\out\Default\electron.lib"
$serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/electron.lib"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
shell: powershell
# Uncomment the following block if pdb files are needed to debug issues
# - name: Download pdb files for detailed stacktraces
# if: ${{ github.event_name == 'workflow_dispatch' }}
# run: |
# try {
# $localArtifactPath = "src\pdb.zip"
# $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/pdb.zip"
# Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
# cd src
# & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
# } catch {
# Write-Host "There was an exception encountered while downloading pdb files:" $_.Exception.Message
# } finally {
# $global:LASTEXITCODE = 0
# }
# shell: powershell
- name: Setup node headers
run: |
New-Item src\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
shell: powershell
- name: Run Electron Main process tests
run: |
cd src
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
set npm_config_arch=arm64
cd electron
node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion
env:
ELECTRON_ENABLE_STACK_DUMPING: true
ELECTRON_OUT_DIR: Default
IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
- name: Verify ffmpeg
run: |
cd src
echo "Verifying non proprietary ffmpeg"
python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
shell: cmd
- name: Kill processes left running from last test run
if: ${{ always() }}
run: |
Get-Process | Where Name -Like "electron*" | Stop-Process
Get-Process | Where Name -Like "msedge*" | Stop-Process
shell: powershell
- name: Delete user app data directories
if: ${{ always() }}
run: |
Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
shell: powershell
- uses: LouisBrunner/checks-action@442ad2296fb110373e3fe01c2a3717b546583631 # tag: v1.1.1
if: ${{ success() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: electron-woa-testing
conclusion: "${{ job.status }}"
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"summary":"${{ job.status }}","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
- uses: LouisBrunner/checks-action@442ad2296fb110373e3fe01c2a3717b546583631 # tag: v1.1.1
if: ${{ success() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: electron-woa-testing
conclusion: "${{ job.status }}"
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"summary":"Job Succeeded","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
- uses: LouisBrunner/checks-action@442ad2296fb110373e3fe01c2a3717b546583631 # tag: v1.1.1
if: ${{ ! success() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: electron-woa-testing
conclusion: "${{ job.status }}"
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"summary":"Job Failed","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}

View File

@@ -7,28 +7,27 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
check_tag:
trigger_chromedriver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag: v3
- name: Check Tag
- name: Trigger New chromedriver Release
run: |
if [[ ${{ github.event.release.tag_name }} =~ ^v[0-9]+\.0\.0$ ]]; then
echo ::set-output name=should_release::true
if [[ ${{ github.event.release.tag_name }} =~ ^v\d+\.\d+\.\d+$ ]]; then
gh api /repos/:owner/chromedriver/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
else
echo "Not releasing for version ${{ github.event.release.tag_name }}"
fi
trigger:
trigger_mksnapshot:
runs-on: ubuntu-latest
needs: check_tag
if: needs.check_tag.outputs.should_release == 'true'
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag: v3
- name: Trigger New chromedriver Release
run: |
gh api /repos/:owner/chromedriver/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
- name: Trigger New mksnapshot Release
run: |
gh api /repos/:owner/mksnapshot/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
if [[ ${{ github.event.release.tag_name }} =~ ^v\d+\.\d+\.\d+$ ]]; then
gh api /repos/:owner/mksnapshot/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
else
echo "Not releasing for version ${{ github.event.release.tag_name }}"
fi

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
- name: Yarn install
@@ -37,7 +37,7 @@ jobs:
fi
- name: (Optionally) Update Appveyor Image
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
uses: mikefarah/yq@v4.27.2
uses: mikefarah/yq@1c7dc0e88aad311c89889bc5ce5d8f96931a1bd0 # v4.27.2
with:
cmd: yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
- name: (Optionally) Generate Commit Diff
@@ -48,7 +48,7 @@ jobs:
rm appveyor2.yml appveyor.diff
- name: (Optionally) Commit and Pull Request
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
commit-message: 'build: update appveyor image to latest version'

View File

@@ -632,8 +632,6 @@ source_set("electron_lib") {
sources += [
"shell/browser/certificate_manager_model.cc",
"shell/browser/certificate_manager_model.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
@@ -746,7 +744,7 @@ source_set("electron_lib") {
"//components/update_client:update_client",
"//components/zoom",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/browser/api:api_provider",
"//extensions/browser/updater",
"//extensions/common",
"//extensions/common:core_api_provider",

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'110.0.5415.0',
'110.0.5481.208',
'node_version':
'v18.12.1',
'nan_version':

View File

@@ -39,7 +39,7 @@ For more installation options and troubleshooting tips, see
Each Electron release provides binaries for macOS, Windows, and Linux.
* macOS (High Sierra and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* Windows (Windows 7 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8.
* Windows (Windows 10 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. Support for Windows 7, 8 and 8.1 was [removed in Electron 23, in line with Chromium's Windows deprecation policy](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice).
* Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on:
* Ubuntu 14.04 and newer
* Fedora 24 and newer

View File

@@ -6,7 +6,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: Windows_Default_Appveyor
image: e-110.0.5481.208
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -16,17 +16,60 @@ environment:
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
PYTHONIOENCODING: UTF-8
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# init:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - appveyor version
# - ps: $ErrorActionPreference = 'Stop'
# - ps: 'Write-Host "OS Build: $((Get-CimInstance Win32_OperatingSystem).BuildNumber)"'
# clone_folder: '%USERPROFILE%\image-bake-scripts'
# clone_script:
# - ps: Invoke-WebRequest "https://github.com/appveyor/build-images/archive/1f90d94e74c8243c909a09b994e527584dfcb838.zip" -OutFile "$env:temp\scripts.zip"
# - ps: Expand-Archive -Path "$env:temp\scripts.zip" -DestinationPath "$env:temp\scripts" -Force
# - ps: Copy-Item -Path "$env:temp\scripts\build-images-1f90d94e74c8243c909a09b994e527584dfcb838\scripts\Windows\*" -Destination $env:APPVEYOR_BUILD_FOLDER -Recurse
build_script:
- ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size
- ps: Get-Partition -DriveLetter C
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# - ps: .\init_server.ps1
# - ps: .\extend_system_volume.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# - appveyor version
# - ps: .\install_path_utils.ps1
# - ps: .\install_powershell_core.ps1
# - ps: .\install_powershell_get.ps1
# - ps: .\install_7zip.ps1
# - ps: .\install_chocolatey.ps1
# - ps: .\install_webpi.ps1
# - ps: .\install_nuget.ps1
# - ps: .\install_pstools.ps1
# - ps: .\install_git.ps1
# - ps: .\install_git_lfs.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# END LINES FOR COMPLETELY NEW IMAGE
- git config --global core.longpaths true
- cd ..
- mkdir src
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (-not (Test-Path -Path C:\projects\src)) {
New-Item -Path C:\projects\src -ItemType Directory
}
- cd C:\projects\
- git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/electron/electron.git C:\projects\src\electron
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- update_depot_tools.bat
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- src\electron\script\setup-win-for-dev.bat
# Uncomment the following line if windows deps change
# - src\electron\script\setup-win-for-dev.bat
- >-
gclient config
--name "src\electron"
@@ -40,13 +83,25 @@ build_script:
- ps: cd ..\..
- gclient sync --with_branch_heads --with_tags --nohooks
- ps: regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\amd64\msdia140.dll"
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# - cd %USERPROFILE%\image-bake-scripts
# - appveyor version
# - ps: .\optimize_dotnet_runtime.ps1
# - ps: .\disable_windows_background_services.ps1
# - ps: .\enforce_windows_firewall.ps1
# - ps: .\cleanup_windows.ps1
# END LINES FOR COMPLETELY NEW IMAGE
on_image_bake:
- ps: >-
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
- ps: Remove-Item -Recurse -Force $pwd\depot_tools
- ps: Remove-Item -Recurse -Force $pwd\src\electron
# Uncomment these lines to enable RDP
#on_finish:
# - ps: >-
# $env:APPVEYOR_RDP_PASSWORD = "electron"
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- ps: Remove-Item -Recurse -Force C:\projects\depot_tools
- ps: Remove-Item -Recurse -Force C:\projects\src\electron
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP after bake is done
# # on_finish:
# - ps: >-
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

279
appveyor-woa.yml Normal file
View File

@@ -0,0 +1,279 @@
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor.yml
# IF APPLICABLE!!!!
#
#
# The config expects the following environment variables to be set:
# - "GN_CONFIG" Build type. One of {'testing', 'release'}.
# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
# e.g. 'target_cpu="x86"' to build for a 32bit platform.
# https://gn.googlesource.com/gn/+/master/docs/reference.md#target_cpu
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordingly
# if you pass a custom value for 'target_cpu'.
# - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
# - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "TARGET_ARCH" value.
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
# Is used in some publishing scripts, but does NOT affect the Electron binary.
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
# Otherwise the release will be uploaded to the GitHub Releases.
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
#
# The publishing scripts expect access tokens to be defined as env vars,
# but those are not covered here.
#
# AppVeyor docs on variables:
# https://www.appveyor.com/docs/environment-variables/
# https://www.appveyor.com/docs/build-configuration/#secure-variables
# https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-110.0.5481.208
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
ELECTRON_ENABLE_STACK_DUMPING: 1
ELECTRON_ALSO_LOG_TO_STDERR: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
PYTHONIOENCODING: UTF-8
matrix:
- job_name: Build Arm on X64 Windows
- job_name: Test On Windows On Arm Hardware
job_depends_on: Build Arm on X64 Windows
APPVEYOR_BUILD_WORKER_IMAGE: base-woa
APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa
clone_folder: C:\projects\src\electron
skip_branch_with_pr: true
# the first failed job cancels other jobs and fails entire build
matrix:
fast_finish: true
for:
- matrix:
only:
- job_name: Build Arm on X64 Windows
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
$global:LASTEXITCODE = 0
- cd ..
- ps: Write-Host "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
- ps: >-
if (Test-Path -Path "$pwd\depot_tools") {
Remove-Item -Recurse -Force $pwd\depot_tools
}
- ps: >-
if (Test-Path -Path "$pwd\build-tools") {
Remove-Item -Recurse -Force $pwd\build-tools
}
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {
Remove-Item -Recurse -Force $pwd\src\electron
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..\..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
}
- gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron"
# Patches are applied in the image bake. Check depshash to see if patches have changed.
- ps: $env:RUN_GCLIENT_SYNC="false"
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw
- ps: cd src\electron
- ps: node script\generate-deps-hash.js
- ps: $depshash = Get-Content .\.depshash -Raw
- ps: cd ..\..
- ps: >-
if ($depshash_baked -ne $depshash) {
$env:RUN_GCLIENT_SYNC="true"
}
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
- cd src
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
- ps: >-
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- 7z a node_headers.zip out\Default\gen\node_headers
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python3 electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
} else {
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
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
deploy_script:
- cd electron
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python3 script\release\uploaders\upload.py --verbose
}
}
on_finish:
# Uncomment this lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- cd C:\projects\src
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- 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)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
}
- matrix:
only:
- job_name: Test On Windows On Arm Hardware
environment:
IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
$global:LASTEXITCODE = 0
- cd ..
- mkdir out\Default
- cd ..
- ps: |
# 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')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build Arm on X64 Windows") {
$jobId = $job.jobId
foreach($artifact_name in $artifacts_to_download) {
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
$outfile = "src\out\Default\$artifact_name"
} else {
$outfile = $artifact_name
}
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
}
}
}
- ps: |
$out_default_zips = @('dist.zip','pdb.zip')
foreach($zip_name in $out_default_zips) {
7z x -y -osrc\out\Default $zip_name
}
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
- ps: 7z x -y -osrc node_headers.zip
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
- ps: |
cd src
New-Item .\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
- set npm_config_nodedir=%cd%\out\Default\gen\node_headers
- set npm_config_arch=arm64
- cd electron
# Explicitly set npm_config_arch because the .env doesn't persist
- ps: >-
if ($env:TARGET_ARCH -eq 'ia32') {
$env:npm_config_arch = "ia32"
}
- echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion
- cd ..
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
on_finish:
# Uncomment these lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )

View File

@@ -1,3 +1,7 @@
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor-woa.yml
# IF APPLICABLE!!!!
#
#
# The config expects the following environment variables to be set:
# - "GN_CONFIG" Build type. One of {'testing', 'release'}.
# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
@@ -25,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-110.0.5415.0-fix
image: e-110.0.5481.208
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -45,6 +49,8 @@ environment:
clone_folder: C:\projects\src\electron
skip_branch_with_pr: true
# the first failed job cancels other jobs and fails entire build
matrix:
fast_finish: true
@@ -55,12 +61,6 @@ for:
only:
- job_name: Build
init:
- ps: >-
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
}
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
@@ -80,7 +80,7 @@ for:
if (Test-Path -Path "$pwd\build-tools") {
Remove-Item -Recurse -Force $pwd\build-tools
}
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {
@@ -130,6 +130,7 @@ for:
}
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
- cd src
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
@@ -185,8 +186,6 @@ for:
Write-Output "Uploading Electron release distribution to github releases"
& python3 script\release\uploaders\upload.py --verbose
}
} elseif (Test-Path Env:\TEST_WOA) {
node script/release/ci-release-build.js --job=electron-woa-testing --ci=GHA --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
}
on_finish:
# Uncomment this lines to enable RDP
@@ -214,9 +213,6 @@ for:
if ($env:RUN_TESTS -ne 'true') {
Write-warning "Skipping tests for $env:APPVEYOR_PROJECT_NAME"; Exit-AppveyorBuild
}
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
}
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
@@ -276,8 +272,8 @@ for:
- echo "Done verifying mksnapshot"
- echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
- echo "Done verifying chromedriver"
# Uncomment these lines to enable RDP
# on_finish:
on_finish:
# Uncomment these lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )

View File

@@ -80,7 +80,6 @@ static_library("chrome") {
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
"//chrome/browser/ui/frame/window_frame_util.cc",
"//chrome/browser/ui/frame/window_frame_util.h",
"//chrome/browser/ui/native_window_tracker.h",
"//chrome/browser/ui/ui_features.cc",
"//chrome/browser/ui/ui_features.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
@@ -89,6 +88,7 @@ static_library("chrome") {
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.h",
"//extensions/browser/app_window/size_constraints.cc",
"//extensions/browser/app_window/size_constraints.h",
"//ui/views/native_window_tracker.h",
]
if (is_posix) {
@@ -138,9 +138,9 @@ static_library("chrome") {
if (use_aura) {
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/aura/native_window_tracker_aura.cc",
"//chrome/browser/ui/aura/native_window_tracker_aura.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
"//ui/views/native_window_tracker_aura.cc",
"//ui/views/native_window_tracker_aura.h",
]
}
@@ -275,8 +275,6 @@ static_library("chrome") {
sources += [
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.cc",
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.h",
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.h",
@@ -285,20 +283,18 @@ static_library("chrome") {
"//chrome/browser/ui/views/overlay/hang_up_button.h",
"//chrome/browser/ui/views/overlay/overlay_window_image_button.cc",
"//chrome/browser/ui/views/overlay/overlay_window_image_button.h",
"//chrome/browser/ui/views/overlay/overlay_window_views.cc",
"//chrome/browser/ui/views/overlay/overlay_window_views.h",
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
"//chrome/browser/ui/views/overlay/playback_image_button.h",
"//chrome/browser/ui/views/overlay/resize_handle_button.cc",
"//chrome/browser/ui/views/overlay/resize_handle_button.h",
"//chrome/browser/ui/views/overlay/simple_overlay_window_image_button.cc",
"//chrome/browser/ui/views/overlay/simple_overlay_window_image_button.h",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.cc",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.h",
"//chrome/browser/ui/views/overlay/toggle_camera_button.cc",
"//chrome/browser/ui/views/overlay/toggle_camera_button.h",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.cc",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.h",
"//chrome/browser/ui/views/overlay/track_image_button.cc",
"//chrome/browser/ui/views/overlay/track_image_button.h",
"//chrome/browser/ui/views/overlay/video_overlay_window_views.cc",
"//chrome/browser/ui/views/overlay/video_overlay_window_views.h",
]

View File

@@ -42,7 +42,7 @@ an issue:
* [Web embeds in Electron](tutorial/web-embeds.md)
* [Boilerplates and CLIs](tutorial/boilerplates-and-clis.md)
* [Boilerplate vs CLI](tutorial/boilerplates-and-clis.md#boilerplate-vs-cli)
* [electron-forge](tutorial/boilerplates-and-clis.md#electron-forge)
* [Electron Forge](tutorial/boilerplates-and-clis.md#electron-forge)
* [electron-builder](tutorial/boilerplates-and-clis.md#electron-builder)
* [electron-react-boilerplate](tutorial/boilerplates-and-clis.md#electron-react-boilerplate)
* [Other Tools and Boilerplates](tutorial/boilerplates-and-clis.md#other-tools-and-boilerplates)

View File

@@ -23,8 +23,7 @@ The `app` object emits the following events:
Emitted when the application has finished basic startup. On Windows and Linux,
the `will-finish-launching` event is the same as the `ready` event; on macOS,
this event represents the `applicationWillFinishLaunching` notification of
`NSApplication`. You would usually set up listeners for the `open-file` and
`open-url` events here, and start the crash reporter and auto updater.
`NSApplication`.
In most cases, you should do everything in the `ready` event handler.
@@ -128,8 +127,6 @@ Emitted when the user wants to open a URL with the application. Your application
`Info.plist` file must define the URL scheme within the `CFBundleURLTypes` key, and
set `NSPrincipalClass` to `AtomApplication`.
You should call `event.preventDefault()` if you want to handle this event.
As with the `open-file` event, be sure to register a listener for the `open-url`
event early in your application startup to detect if the the application being
is being opened to handle a URL. If you register the listener in response to a
@@ -498,6 +495,10 @@ and `workingDirectory` is its current working directory. Usually
applications respond to this by making their primary window focused and
non-minimized.
**Note:** `argv` will not be exactly the same list of arguments as those passed
to the second instance. The order might change and additional arguments might be appended.
If you need to maintain the exact same arguments, it's advised to use `additionalData` instead.
**Note:** If the second instance is started by a different user than the first, the `argv` array will not include the arguments.
This event is guaranteed to be emitted after the `ready` event of `app`
@@ -1509,19 +1510,18 @@ dock on macOS.
A `boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
[dock-menu]:https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[tasks]:https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/electron-packager
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme
[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/documentation/coreservices/1441725-lscopydefaulthandlerforurlscheme?language=objc
[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html
[activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType
[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher
[mas-builds]: ../tutorial/mac-app-store-submission-guide.md
[Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
[JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx
[JumpListBeginListMSDN]: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-beginlist
[about-panel-options]: https://developer.apple.com/reference/appkit/nsapplication/1428479-orderfrontstandardaboutpanelwith?language=objc
### `app.name`
@@ -1563,5 +1563,4 @@ an ARM64 translator (like the macOS
or Windows [WOW](https://en.wikipedia.org/wiki/Windows_on_Windows)).
You can use this property to prompt users to download the arm64 version of
your application when they are running the x64 version under Rosetta
incorrectly.
your application when they are mistakenly running the x64 version under Rosetta or WOW.

View File

@@ -32,9 +32,9 @@ This is a requirement of `Squirrel.Mac`.
On Windows, you have to install your app into a user's machine before you can
use the `autoUpdater`, so it is recommended that you use the
[electron-winstaller][installer-lib], [electron-forge][electron-forge-lib] or the [grunt-electron-installer][installer] package to generate a Windows installer.
[electron-winstaller][installer-lib], [Electron Forge][electron-forge-lib] or the [grunt-electron-installer][installer] package to generate a Windows installer.
When using [electron-winstaller][installer-lib] or [electron-forge][electron-forge-lib] make sure you do not try to update your app [the first time it runs](https://github.com/electron/windows-installer#handling-squirrel-events) (Also see [this issue for more info](https://github.com/electron/electron/issues/7155)). It's also recommended to use [electron-squirrel-startup](https://github.com/mongodb-js/electron-squirrel-startup) to get desktop shortcuts for your app.
When using [electron-winstaller][installer-lib] or [Electron Forge][electron-forge-lib] make sure you do not try to update your app [the first time it runs](https://github.com/electron/windows-installer#handling-squirrel-events) (Also see [this issue for more info](https://github.com/electron/electron/issues/7155)). It's also recommended to use [electron-squirrel-startup](https://github.com/mongodb-js/electron-squirrel-startup) to get desktop shortcuts for your app.
The installer generated with Squirrel will create a shortcut icon with an
[Application User Model ID][app-user-model-id] in the format of
@@ -139,6 +139,6 @@ application starts.
[squirrel-windows]: https://github.com/Squirrel/Squirrel.Windows
[installer]: https://github.com/electron/grunt-electron-installer
[installer-lib]: https://github.com/electron/windows-installer
[electron-forge-lib]: https://github.com/electron-userland/electron-forge
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[electron-forge-lib]: https://github.com/electron/forge
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

View File

@@ -269,7 +269,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
zoom to the width of the screen. This will also affect the behavior when
calling `maximize()` directly. Default is `false`.
* `tabbingIdentifier` string (optional) _macOS_ - Tab group name, allows
opening the window as a native tab on macOS 10.12+. Windows with the same
opening the window as a native tab. Windows with the same
tabbing identifier will be grouped together. This also adds a native new
tab button to your window's tab bar and allows your `app` and window to
receive the `new-window-for-tab` event.
@@ -629,7 +629,7 @@ Returns:
* `event` Event
* `command` string
Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx)
Emitted when an [App Command](https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-appcommand)
is invoked. These are typically related to keyboard media keys or browser
commands, as well as the "Back" button built into some mice on Windows.
@@ -1036,6 +1036,8 @@ height areas you have within the overall content view.
The aspect ratio is not respected when window is resized programmatically with
APIs like `win.setSize`.
To reset an aspect ratio, pass 0 as the `aspectRatio` value: `win.setAspectRatio(0)`.
#### `win.setBackgroundColor(backgroundColor)`
* `backgroundColor` string - Color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. The alpha channel is optional for the hex type.
@@ -1655,13 +1657,13 @@ in the taskbar.
#### `win.setAppDetails(options)` _Windows_
* `options` Object
* `appId` string (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx).
* `appId` string (optional) - Window's [App User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids).
It has to be set, otherwise the other options will have no effect.
* `appIconPath` string (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx).
* `appIconPath` string (optional) - Window's [Relaunch Icon](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchiconresource).
* `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`.
Ignored when `appIconPath` is not set. Default is `0`.
* `relaunchCommand` string (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx).
* `relaunchDisplayName` string (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx).
* `relaunchCommand` string (optional) - Window's [Relaunch Command](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchcommand).
* `relaunchDisplayName` string (optional) - Window's [Relaunch Display Name](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchdisplaynameresource).
Sets the properties for the window's taskbar button.
@@ -1767,7 +1769,7 @@ On macOS it does not remove the focus from the window.
#### `win.isFocusable()` _macOS_ _Windows_
Returns whether the window can be focused.
Returns `boolean` - Whether the window can be focused.
#### `win.setParentWindow(parent)`
@@ -1850,7 +1852,7 @@ frameless window.
Sets the touchBar layout for the current window. Specifying `null` or
`undefined` clears the touch bar. This method only has an effect if the
machine has a touch bar and is running on macOS 10.12.1+.
machine has a touch bar.
**Note:** The TouchBar API is currently experimental and may change or be
removed in future Electron releases.
@@ -1901,7 +1903,7 @@ removed in future Electron releases.
On a Window with Window Controls Overlay already enabled, this method updates
the style of the title bar overlay.
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
[page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
[quick-look]: https://en.wikipedia.org/wiki/Quick_Look
[vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc

View File

@@ -2,7 +2,7 @@
> Perform copy and paste operations on the system clipboard.
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) (non-sandboxed only)
On Linux, there is also a `selection` clipboard. To manipulate it
you need to pass `selection` to each method:

View File

@@ -79,3 +79,5 @@ Returns `Menu | null` - The application's [dock menu][dock-menu].
* `image` ([NativeImage](native-image.md) | string)
Sets the `image` associated with this dock icon.
[dock-menu]: https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/

View File

@@ -51,7 +51,7 @@ See [`Menu`](menu.md) for examples.
the placement of their containing group after the containing group of the item
with the specified label.
**Note:** `acceleratorWorksWhenHidden` is specified as being macOS-only because accelerators always work when items are hidden on Windows and Linux. The option is exposed to users to give them the option to turn it off, as this is possible in native macOS development. This property is only usable on macOS High Sierra 10.13 or newer.
**Note:** `acceleratorWorksWhenHidden` is specified as being macOS-only because accelerators always work when items are hidden on Windows and Linux. The option is exposed to users to give them the option to turn it off, as this is possible in native macOS development.
### Roles

View File

@@ -56,3 +56,4 @@ Emitted when the remote end of a MessagePortMain object becomes disconnected.
[`MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
[Channel Messaging API]: https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

View File

@@ -49,7 +49,7 @@ quality, it is recommended to include at least the following sizes in the:
Check the *Size requirements* section in [this article][icons].
[icons]:https://msdn.microsoft.com/en-us/library/windows/desktop/dn742485(v=vs.85).aspx
[icons]: https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-icons
## High Resolution Image

View File

@@ -54,7 +54,7 @@ The `net` module has the following methods:
### `net.request(options)`
* `options` (ClientRequestConstructorOptions | string) - The `ClientRequest` constructor options.
* `options` ([ClientRequestConstructorOptions](client-request.md#new-clientrequestoptions) | string) - The `ClientRequest` constructor options.
Returns [`ClientRequest`](./client-request.md)

View File

@@ -4,9 +4,12 @@
Process: [Main](../glossary.md#main-process)
## Using in the renderer process
:::info Renderer process notifications
If you want to show Notifications from a renderer process you should use the [HTML5 Notification API](../tutorial/notifications.md)
If you want to show notifications from a renderer process you should use the
[web Notifications API](../tutorial/notifications.md)
:::
## Class: Notification
@@ -29,10 +32,10 @@ Returns `boolean` - Whether or not desktop notifications are supported on the cu
### `new Notification([options])`
* `options` Object (optional)
* `title` string (optional) - A title for the notification, which will be shown at the top of the notification window when it is shown.
* `title` string (optional) - A title for the notification, which will be displayed at the top of the notification window when it is shown.
* `subtitle` string (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
* `body` string (optional) - The body text of the notification, which will be displayed below the title or subtitle.
* `silent` boolean (optional) - Whether or not to emit an OS notification noise when showing the notification.
* `silent` boolean (optional) - Whether or not to suppress the OS notification noise when showing the notification.
* `icon` (string | [NativeImage](native-image.md)) (optional) - An icon to use in the notification.
* `hasReply` boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
* `timeoutType` string (optional) _Linux_ _Windows_ - The timeout duration of the notification. Can be 'default' or 'never'.
@@ -47,8 +50,11 @@ Returns `boolean` - Whether or not desktop notifications are supported on the cu
Objects created with `new Notification` emit the following events:
**Note:** Some events are only available on specific operating systems and are
labeled as such.
:::info
Some events are only available on specific operating systems and are labeled as such.
:::
#### Event: 'show'
@@ -56,7 +62,7 @@ Returns:
* `event` Event
Emitted when the notification is shown to the user, note this could be fired
Emitted when the notification is shown to the user. Note that this event can be fired
multiple times as a notification can be shown multiple times through the
`show()` method.
@@ -106,14 +112,13 @@ Emitted when an error is encountered while creating and showing the native notif
### Instance Methods
Objects created with `new Notification` have the following instance methods:
Objects created with the `new Notification()` constructor have the following instance methods:
#### `notification.show()`
Immediately shows the notification to the user, please note this means unlike the
HTML5 Notification implementation, instantiating a `new Notification` does
not immediately show it to the user, you need to call this method before the OS
will display it.
Immediately shows the notification to the user. Unlike the web notification API,
instantiating a `new Notification()` does not immediately show it to the user. Instead, you need to
call this method before the OS will display it.
If the notification has been shown before, this method will dismiss the previously
shown notification and create a new one with identical properties.
@@ -160,7 +165,7 @@ A `boolean` property representing whether the notification has a reply action.
A `string` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
Default is 'low' - see [NotifyUrgency](https://developer.gnome.org/notification-spec/#urgency-levels) for more information.
Default is 'low' - see [NotifyUrgency](https://developer-old.gnome.org/notification-spec/#urgency-levels) for more information.
#### `notification.timeoutType` _Linux_ _Windows_

View File

@@ -44,3 +44,5 @@ event.
* `message` any
Sends a message from the process to its parent.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

View File

@@ -39,7 +39,7 @@ The `pushNotification` module has the following methods:
Returns `Promise<string>`
Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/sremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message.
Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/nsremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message.
See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
### `pushNotifications.unregisterForAPNSNotifications()` _macOS_

View File

@@ -561,7 +561,7 @@ Clears the sessions HTTP cache.
* `origin` string (optional) - Should follow `window.location.origin`s representation
`scheme://host:port`.
* `storages` string[] (optional) - The types of storages to clear, can contain:
`appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`,
`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:
@@ -784,6 +784,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
* `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.
* `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.
@@ -794,6 +795,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `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.
* `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
* `callback` Function
* `permissionGranted` boolean - Allow or deny the permission.
@@ -877,6 +879,10 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
Specifying a loopback device will capture system audio, and is
currently only supported on Windows. If a WebFrameMain is specified,
will capture audio from that frame.
* `enableLocalEcho` Boolean (optional) - If `audio` is a [WebFrameMain](web-frame-main.md)
and this is set to `true`, then local playback of audio will not be muted (e.g. using `MediaRecorder`
to record `WebFrameMain` with this flag set to `true` will allow audio to pass through to the speakers
while recording). Default is `false`.
This handler will be called when web content requests access to display media
via the `navigator.mediaDevices.getDisplayMedia` API. Use the

View File

@@ -2,7 +2,7 @@
* `id` string - The identifier of a window or screen that can be used as a
`chromeMediaSourceId` constraint when calling
[`navigator.webkitGetUserMedia`]. The format of the identifier will be
[`navigator.getUserMedia`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia). The format of the identifier will be
`window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
the current process, and 0 for all others. ZZ is a sequential number
that represents the screen, and it does not equal to the index in the

View File

@@ -1,6 +1,7 @@
# Display Object
* `id` number - Unique identifier associated with the display.
* `label` string - User-friendly label, determined by the platform.
* `rotation` number - Can be 0, 90, 180, 270, represents screen rotation in
clock-wise degrees.
* `scaleFactor` number - Output device's pixel scale factor.

View File

@@ -3,9 +3,9 @@
* `processId` Integer - The internal ID of the renderer process that sent this message
* `frameId` Integer - The ID of the renderer frame that sent this message
* `returnValue` any - Set this to the value to be returned in a synchronous message
* `sender` WebContents - Returns the `webContents` that sent the message
* `senderFrame` WebFrameMain _Readonly_ - The frame that sent this message
* `ports` MessagePortMain[] - A list of MessagePorts that were transferred with this message
* `sender` [WebContents](../web-contents.md) - Returns the `webContents` that sent the message
* `senderFrame` [WebFrameMain](../web-frame-main.md) _Readonly_ - The frame that sent this message
* `ports` [MessagePortMain](../message-port-main.md)[] - A list of MessagePorts that were transferred with this message
* `reply` Function - A function that will send an IPC message to the renderer frame that sent the original message that you are currently handling. You should use this method to "reply" to the sent message in order to guarantee the reply will go to the correct process and frame.
* `channel` string
* `...args` any[]

View File

@@ -2,5 +2,5 @@
* `processId` Integer - The internal ID of the renderer process that sent this message
* `frameId` Integer - The ID of the renderer frame that sent this message
* `sender` WebContents - Returns the `webContents` that sent the message
* `senderFrame` WebFrameMain _Readonly_ - The frame that sent this message
* `sender` [WebContents](../web-contents.md) - Returns the `webContents` that sent the message
* `senderFrame` [WebFrameMain](../web-frame-main.md) _Readonly_ - The frame that sent this message

View File

@@ -1,7 +1,8 @@
# IpcRendererEvent Object extends `Event`
* `sender` IpcRenderer - The `IpcRenderer` instance that emitted the event originally
* `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`.
* `ports` MessagePort[] - A list of MessagePorts that were transferred with this message
* `ports` [MessagePort][][] - A list of MessagePorts that were transferred with this message
[ipc-renderer-sendto]: ../ipc-renderer.md#ipcrenderersendtowebcontentsid-channel-args
[MessagePort]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort

View File

@@ -1,3 +1,3 @@
# WebRequestFilter Object
* `urls` string[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.
* `urls` string[] - Array of [URL patterns](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) that will be used to filter out the requests that do not match the URL patterns.

View File

@@ -235,7 +235,7 @@ if (browserOptions.transparent) {
}
```
[dwm-composition]:https://msdn.microsoft.com/en-us/library/windows/desktop/aa969540.aspx
[dwm-composition]: https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw
### `systemPreferences.getAccentColor()` _Windows_ _macOS_
@@ -336,8 +336,8 @@ See the [Windows docs][windows-colors] and the [macOS docs][macos-colors] for mo
The following colors are only available on macOS 10.14: `find-highlight`, `selected-content-background`, `separator`, `unemphasized-selected-content-background`, `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
[windows-colors]:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724371(v=vs.85).aspx
[macos-colors]:https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#dynamic-system-colors
[windows-colors]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor
[macos-colors]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#dynamic-system-colors
### `systemPreferences.getSystemColor(color)` _macOS_
@@ -394,8 +394,6 @@ system default and override the value of `getEffectiveAppearance`.
Returns `boolean` - whether or not this device has the ability to use Touch ID.
**NOTE:** This API will return `false` on macOS systems older than Sierra 10.12.2.
### `systemPreferences.promptTouchID(reason)` _macOS_
* `reason` string - The reason you are asking for Touch ID authentication
@@ -414,8 +412,6 @@ systemPreferences.promptTouchID('To get consent for a Security-Gated Thing').the
This API itself will not protect your user data; rather, it is a mechanism to allow you to do so. Native apps will need to set [Access Control Constants](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags?language=objc) like [`kSecAccessControlUserPresence`](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags/ksecaccesscontroluserpresence?language=objc) on their keychain entry so that reading it would auto-prompt for Touch ID biometric consent. This could be done with [`node-keytar`](https://github.com/atom/node-keytar), such that one would store an encryption key with `node-keytar` and only fetch it if `promptTouchID()` resolves.
**NOTE:** This API will return a rejected Promise on macOS systems older than Sierra 10.12.2.
### `systemPreferences.isTrustedAccessibilityClient(prompt)` _macOS_
* `prompt` boolean - whether or not the user will be informed via prompt if the current process is untrusted.
@@ -428,7 +424,7 @@ Returns `boolean` - `true` if the current process is a trusted accessibility cli
Returns `string` - Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
This user consent was not required on macOS 10.13 High Sierra or lower so this method will always return `granted`.
This user consent was not required on macOS 10.13 High Sierra so this method will always return `granted`.
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
macOS 10.15 Catalina or higher requires consent for `screen` access.
@@ -441,9 +437,9 @@ It will always return `granted` for `screen` and for all media types on older ve
Returns `Promise<boolean>` - A promise that resolves with `true` if consent was granted and `false` if it was denied. If an invalid `mediaType` is passed, the promise will be rejected. If an access request was denied and later is changed through the System Preferences pane, a restart of the app will be required for the new permissions to take effect. If access has already been requested and denied, it _must_ be changed through the preference pane; an alert will not pop up and the promise will resolve with the existing access status.
**Important:** In order to properly leverage this API, you [must set](https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc) the `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your app's `Info.plist` file. The values for these keys will be used to populate the permission dialogs so that the user will be properly informed as to the purpose of the permission request. See [Electron Application Distribution](../tutorial/application-distribution.md#macos) for more information about how to set these in the context of Electron.
**Important:** In order to properly leverage this API, you [must set](https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc) the `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your app's `Info.plist` file. The values for these keys will be used to populate the permission dialogs so that the user will be properly informed as to the purpose of the permission request. See [Electron Application Distribution](../tutorial/application-distribution.md#rebranding-with-downloaded-binaries) for more information about how to set these in the context of Electron.
This user consent was not required until macOS 10.14 Mojave, so this method will always return `true` if your system is running 10.13 High Sierra or lower.
This user consent was not required until macOS 10.14 Mojave, so this method will always return `true` if your system is running 10.13 High Sierra.
### `systemPreferences.getAnimationSettings()`

View File

@@ -29,8 +29,9 @@ __Platform Considerations__
__Linux__
* Tray icon requires support of [StatusNotifierItem](https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/)
in user's desktop environment.
* Tray icon uses [StatusNotifierItem](https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/)
by default, when it is not available in user's desktop environment the
`GtkStatusIcon` will be used instead.
* The `click` event is emitted when the tray icon receives activation from
user, however the StatusNotifierItem spec does not specify which action would
cause an activation, for some environments it is left mouse click, but for
@@ -234,7 +235,7 @@ Sets the hover text for this tray icon.
* `title` string
* `options` Object (optional)
* `fontType` string (optional) - The font family variant to display, can be `monospaced` or `monospacedDigit`. `monospaced` is available in macOS 10.15+ and `monospacedDigit` is available in macOS 10.11+. When left blank, the title uses the default system font.
* `fontType` string (optional) - The font family variant to display, can be `monospaced` or `monospacedDigit`. `monospaced` is available in macOS 10.15+ When left blank, the title uses the default system font.
Sets the title displayed next to the tray icon in the status bar (Support ANSI colors).

View File

@@ -132,6 +132,7 @@ Returns:
Emitted when the child process sends a message using [`process.parentPort.postMessage()`](process.md#processparentport).
[`child_process.fork`]: https://nodejs.org/dist/latest-v16.x/docs/api/child_process.html#child_processforkmodulepath-args-options
[Services API]: https://chromium.googlesource.com/chromium/src/+/master/docs/mojo_and_services.md
[Services API]: https://chromium.googlesource.com/chromium/src/+/main/docs/mojo_and_services.md
[stdio]: https://nodejs.org/dist/latest/docs/api/child_process.html#optionsstdio
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[`MessagePortMain`]: message-port-main.md

View File

@@ -713,20 +713,24 @@ Returns:
* `callback` Function
* `deviceId` string
Emitted when bluetooth device needs to be selected on call to
`navigator.bluetooth.requestDevice`. To use `navigator.bluetooth` api
`webBluetooth` should be enabled. If `event.preventDefault` is not called,
first available device will be selected. `callback` should be called with
`deviceId` to be selected, passing empty string to `callback` will
cancel the request.
Emitted when a bluetooth device needs to be selected when a call to
`navigator.bluetooth.requestDevice` is made. `callback` should be called with
the `deviceId` of the device to be selected. Passing an empty string to
`callback` will cancel the request.
If no event listener is added for this event, all bluetooth requests will be cancelled.
If an event listener is not added for this event, or if `event.preventDefault`
is not called when handling this event, the first available device will be
automatically selected.
```javascript
Due to the nature of bluetooth, scanning for devices when
`navigator.bluetooth.requestDevice` is called may take time and will cause
`select-bluetooth-device` to fire multiple times until `callback` is called
with either a device id or an empty string to cancel the request.
```javascript title='main.js'
const { app, BrowserWindow } = require('electron')
let win = null
app.commandLine.appendSwitch('enable-experimental-web-platform-features')
app.whenReady().then(() => {
win = new BrowserWindow({ width: 800, height: 600 })
@@ -736,6 +740,9 @@ app.whenReady().then(() => {
return device.deviceName === 'test'
})
if (!result) {
// The device wasn't found so we need to either wait longer (eg until the
// device is turned on) or cancel the request by calling the callback
// with an empty string.
callback('')
} else {
callback(result.deviceId)
@@ -1155,7 +1162,7 @@ Ignore application menu shortcuts while this web contents is focused.
#### `contents.setWindowOpenHandler(handler)`
* `handler` Function<{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}>
* `handler` Function<{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}>
* `details` Object
* `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
* `frameName` string - Name of the window provided in `window.open()`
@@ -1170,8 +1177,11 @@ Ignore application menu shortcuts while this web contents is focused.
be set. If no post data is to be sent, the value will be `null`. Only defined
when the window is being created by a form that set `target=_blank`.
Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
Returns `{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
By default, child windows are closed when their opener is closed. This can be
changed by specifying `outlivesOpener: true`, in which case the opened window
will not be closed when its opener is closed.
Returning an unrecognized value such as a null, undefined, or an object
without a recognized 'action' value will result in a console error and have
the same effect as returning `{action: 'deny'}`.
@@ -1356,31 +1366,6 @@ If you would like the page to stay hidden, you should ensure that `stayHidden` i
Returns `boolean` - Whether this page is being captured. It returns true when the capturer count
is large then 0.
#### `contents.incrementCapturerCount([size, stayHidden, stayAwake])` _Deprecated_
* `size` [Size](structures/size.md) (optional) - The preferred size for the capturer.
* `stayHidden` boolean (optional) - Keep the page hidden instead of visible.
* `stayAwake` boolean (optional) - Keep the system awake instead of allowing it to sleep.
Increase the capturer count by one. The page is considered visible when its browser window is
hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.
This also affects the Page Visibility API.
**Deprecated:** This API's functionality is now handled automatically within `contents.capturePage()`. See [breaking changes](../breaking-changes.md).
#### `contents.decrementCapturerCount([stayHidden, stayAwake])` _Deprecated_
* `stayHidden` boolean (optional) - Keep the page in hidden state instead of visible.
* `stayAwake` boolean (optional) - Keep the system awake instead of allowing it to sleep.
Decrease the capturer count by one. The page will be set to hidden or occluded state when its
browser window is hidden or occluded and the capturer count reaches zero. If you want to
decrease the hidden capturer count instead you should set `stayHidden` to true.
**Deprecated:** This API's functionality is now handled automatically within `contents.capturePage()`.
See [breaking changes](../breaking-changes.md).
#### `contents.getPrinters()` _Deprecated_
Get the system printer list.
@@ -1423,8 +1408,8 @@ Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/
* `vertical` number (optional) - The vertical dpi.
* `header` string (optional) - string to be printed as page header.
* `footer` string (optional) - string to be printed as page footer.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`,
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
* `callback` Function (optional)
* `success` boolean - Indicates success of the print call.
* `failureReason` string - Error description called back if the print fails.
@@ -1589,7 +1574,7 @@ ipcMain.on('open-devtools', (event, targetContentsId, devtoolsContentsId) => {
An example of showing devtools in a `BrowserWindow`:
```js
```js title='main.js'
const { app, BrowserWindow } = require('electron')
let win = null
@@ -1672,40 +1657,14 @@ Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
:::warning
The renderer process can handle the message by listening to `channel` with the
[`ipcRenderer`](ipc-renderer.md) module.
Sending non-standard JavaScript types such as DOM objects or
special Electron objects will throw an exception.
An example of sending messages from the main process to the renderer process:
:::
```javascript
// In the main process.
const { app, BrowserWindow } = require('electron')
let win = null
app.whenReady().then(() => {
win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL(`file://${__dirname}/index.html`)
win.webContents.on('did-finish-load', () => {
win.webContents.send('ping', 'whoooooooh!')
})
})
```
```html
<!-- index.html -->
<html>
<body>
<script>
require('electron').ipcRenderer.on('ping', (event, message) => {
console.log(message) // Prints 'whoooooooh!'
})
</script>
</body>
</html>
```
For additional reading, refer to [Electron's IPC guide](../tutorial/ipc.md).
#### `contents.sendToFrame(frameId, channel, ...args)`
@@ -2080,3 +2039,4 @@ with open(), or by navigating a link with a target attribute.
[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
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
[`MessagePortMain`]: message-port-main.md

View File

@@ -233,3 +233,4 @@ See also how the [Page Visibility API](browser-window.md#page-visibility) is aff
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
[`MessagePortMain`]: message-port-main.md

View File

@@ -993,7 +993,7 @@ Emitted when DevTools is closed.
Emitted when DevTools is focused / opened.
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
[chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/
### Event: 'context-menu'

View File

@@ -14,6 +14,20 @@ This document uses the following convention to categorize breaking changes:
## Planned Breaking API Changes (23.0)
### Behavior Changed: Draggable Regions on macOS
The implementation of draggable regions (using the CSS property `-webkit-app-region: drag`) has changed on macOS to bring it in line with Windows and Linux. Previously, when a region with `-webkit-app-region: no-drag` overlapped a region with `-webkit-app-region: drag`, the `no-drag` region would always take precedence on macOS, regardless of CSS layering. That is, if a `drag` region was above a `no-drag` region, it would be ignored. Beginning in Electron 23, a `drag` region on top of a `no-drag` region will correctly cause the region to be draggable.
Additionally, the `customButtonsOnHover` BrowserWindow property previously created a draggable region which ignored the `-webkit-app-region` CSS property. This has now been fixed (see [#37210](https://github.com/electron/electron/issues/37210#issuecomment-1440509592) for discussion).
As a result, if your app uses a frameless window with draggable regions on macOS, the regions which are draggable in your app may change in Electron 23.
### Removed: Windows 7 / 8 / 8.1 support
[Windows 7, Windows 8, and Windows 8.1 are no longer supported](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice). Electron follows the planned Chromium deprecation policy, which will [deprecate Windows 7 support beginning in Chromium 109](https://support.google.com/chrome/thread/185534985/sunsetting-support-for-windows-7-8-8-1-in-early-2023?hl=en).
Older versions of Electron will continue to run on these operating systems, but Windows 10 or later will be required to run Electron v23.0.0 and higher.
### Removed: BrowserWindow `scroll-touch-*` events
The deprecated `scroll-touch-begin`, `scroll-touch-end` and `scroll-touch-edge`
@@ -230,6 +244,13 @@ webContents.printToPDF({
## Planned Breaking API Changes (20.0)
### Removed: macOS 10.11 / 10.12 support
macOS 10.11 (El Capitan) and macOS 10.12 (Sierra) are no longer supported by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/3646050).
Older versions of Electron will continue to run on these operating systems, but macOS 10.13 (High Sierra)
or later will be required to run Electron v20.0.0 and higher.
### Default Changed: renderers without `nodeIntegration: true` are sandboxed by default
Previously, renderers that specified a preload script defaulted to being
@@ -254,7 +275,7 @@ requires unsafe mode), so Electron is unable to support this feature on Linux.
The handler invoked when `session.setDevicePermissionHandler(handler)` is used
has a change to its arguments. This handler no longer is passed a frame
`[WebFrameMain](api/web-frame-main.md)`, but instead is passed the `origin`, which
[`WebFrameMain`](api/web-frame-main.md), but instead is passed the `origin`, which
is the origin that is checking for device permission.
## Planned Breaking API Changes (19.0)

View File

@@ -7,13 +7,12 @@ Follow the guidelines below for building **Electron itself** on Windows, for the
## Prerequisites
* Windows 10 / Server 2012 R2 or higher
* Visual Studio 2017 15.7.2 or higher - [download VS 2019 Community Edition for
free](https://www.visualstudio.com/vs/)
* Visual Studio 2019 (>=16.0.0) to build, but Visual Studio 2022 (>=17.0.0) is preferred - [download VS 2022 Community Edition for free](https://www.visualstudio.com/vs/)
* See [the Chromium build documentation](https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md#visual-studio) for more details on which Visual Studio
components are required.
* If your Visual Studio is installed in a directory other than the default, you'll need to
set a few environment variables to point the toolchains to your installation path.
* `vs2019_install = DRIVE:\path\to\Microsoft Visual Studio\2019\Community`, replacing `2019` and `Community` with your installed versions and replacing `DRIVE:` with the drive that Visual Studio is on. Often, this will be `C:`.
* `vs2022_install = DRIVE:\path\to\Microsoft Visual Studio\2022\Community`, replacing `2022` and `Community` with your installed versions and replacing `DRIVE:` with the drive that Visual Studio is on. Often, this will be `C:`.
* `WINDOWSSDKDIR = DRIVE:\path\to\Windows Kits\10`, replacing `DRIVE:` with the drive that Windows Kits is on. Often, this will be `C:`.
* [Node.js](https://nodejs.org/download/)
* [Git](https://git-scm.com)

View File

@@ -18,8 +18,8 @@ See also [V8 Development](v8-development.md)
### Code Resources
- [Code Search](https://cs.chromium.org/) - Indexed and searchable source code for Chromium and associated projects.
- [Source Code](https://cs.chromium.org/chromium/src/) - The source code for Chromium itself.
- [Code Search](https://source.chromium.org/chromium) - Indexed and searchable source code for Chromium and associated projects.
- [Source Code](https://source.chromium.org/chromium/chromium/src) - The source code for Chromium itself.
- [Chromium Review](https://chromium-review.googlesource.com) - The searchable code host which facilitates code reviews for Chromium and related projects.
### Informational Resources

View File

@@ -144,7 +144,7 @@ NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_{api_name},Initialize)
In your [`shell/common/node_bindings.cc`](https://github.com/electron/electron/blob/main/shell/common/node_bindings.cc) file, add your node binding name to Electron's built-in modules.
```cpp title='shell/common/node_bindings.cc'
#define ELECTRON_BUILTIN_MODULES(V) \
#define ELECTRON_BROWSER_MODULES(V) \
V(electron_browser_{api_name})
```
@@ -158,7 +158,7 @@ We will need to create a new TypeScript file in the path that follows:
`"lib/browser/api/{electron_browser_{api_name}}.ts"`
An example of the contents of this file can be found [here](https://github.com/electron/electron/blob/main/lib/browser/api/native-image.ts).
An example of the contents of this file can be found [here](https://github.com/electron/electron/blob/main/lib/browser/api/native-theme.ts).
### Expose your module to TypeScript

View File

@@ -89,7 +89,7 @@ For an introduction to ProcMon's basic and advanced debugging features, go check
out [this video tutorial][procmon-instructions] provided by Microsoft.
[sys-internals]: https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx
[procmon-instructions]: https://channel9.msdn.com/shows/defrag-tools/defrag-tools-4-process-monitor
[procmon-instructions]: https://learn.microsoft.com/en-us/shows/defrag-tools/4-process-monitor
## Using WinDbg
<!-- TODO(@codebytere): add images and more information here? -->

View File

@@ -15,7 +15,7 @@ calls, and other compiler optimizations. The only workaround is to build an
unoptimized local build.
The official symbol server URL for Electron is
https://symbols.electronjs.org.
<https://symbols.electronjs.org>.
You cannot visit this URL directly, you must add it to the symbol path of your
debugging tool. In the examples below, a local cache directory is used to avoid
repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an

View File

@@ -60,7 +60,7 @@ garbage collected.
If you encounter this problem, the following articles may prove helpful:
* [Memory Management][memory-management]
* [Variable Scope][variable-scope]
* [Closures][closures]
If you want a quick fix, you can make the variables global by changing your
code from this:
@@ -153,8 +153,7 @@ The effect is visible only on (some?) LCD screens. Even if you don't see a diffe
Notice that just setting the background in the CSS does not have the desired effect.
[memory-management]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
[variable-scope]: https://msdn.microsoft.com/library/bzt2dkta(v=vs.94).aspx
[electron-module]: https://www.npmjs.com/package/electron
[closures]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures
[storage]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
[local-storage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
[session-storage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

View File

@@ -9,6 +9,7 @@
<h1>Web Bluetooth API</h1>
<button id="clickme">Test Bluetooth</button>
<button id="cancel">Cancel Bluetooth Request</button>
<p>Currently selected bluetooth device: <strong id="device-name""></strong></p>

View File

@@ -1,22 +1,37 @@
const {app, BrowserWindow, ipcMain} = require('electron')
const path = require('path')
let bluetoothPinCallback
let selectBluetoothCallback
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
}
})
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault()
if (deviceList && deviceList.length > 0) {
callback(deviceList[0].deviceId)
}
selectBluetoothCallback = callback
const result = deviceList.find((device) => {
return device.deviceName === 'test'
})
if (result) {
callback(result.deviceId)
} else {
// The device wasn't found so we need to either wait longer (eg until the
// device is turned on) or until the user cancels the request
}
})
ipcMain.on('cancel-bluetooth-request', (event) => {
selectBluetoothCallback('')
})
// Listen for a message from the renderer to get the response for the Bluetooth pairing.
ipcMain.on('bluetooth-pairing-response', (event, response) => {
bluetoothPinCallback(response)
@@ -27,14 +42,14 @@ function createWindow () {
bluetoothPinCallback = callback
// Send a message to the renderer to prompt the user to confirm the pairing.
mainWindow.webContents.send('bluetooth-pairing-request', details)
})
})
mainWindow.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})

View File

@@ -1,6 +1,7 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
cancelBluetoothRequest: (callback) => ipcRenderer.send('cancel-bluetooth-request', callback),
bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
})

View File

@@ -7,9 +7,15 @@ async function testIt() {
document.getElementById('clickme').addEventListener('click',testIt)
function cancelRequest() {
window.electronAPI.cancelBluetoothRequest()
}
document.getElementById('cancel').addEventListener('click', cancelRequest)
window.electronAPI.bluetoothPairingRequest((event, details) => {
const response = {}
switch (details.pairingKind) {
case 'confirm': {
response.confirmed = confirm(`Do you want to connect to device ${details.deviceId}?`)
@@ -31,4 +37,4 @@ window.electronAPI.bluetoothPairingRequest((event, details) => {
}
window.electronAPI.bluetoothPairingResponse(response)
})
})

View File

@@ -1,5 +1,4 @@
const {app, BrowserWindow} = require('electron')
const e = require('express')
const path = require('path')
function createWindow () {
@@ -44,7 +43,6 @@ function createWindow () {
}
})
mainWindow.webContents.session.setDevicePermissionHandler((details) => {
if (details.deviceType === 'usb' && details.origin === 'file://') {
if (!grantedDeviceThroughPermHandler) {

View File

@@ -1,5 +1,5 @@
function getDeviceDetails(device) {
return grantedDevice.productName || `Unknown device ${grantedDevice.deviceId}`
return device.productName || `Unknown device ${device.deviceId}`
}
async function testIt() {

View File

@@ -70,7 +70,7 @@
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb226797(v=vs.85).aspx"
href="https://learn.microsoft.com/en-us/previous-versions/windows/desktop/bb226797"
>Windows<span
>(opens in new window)</span
></a

View File

@@ -2,12 +2,13 @@
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<div>
<div>
<h1>Clipboard copy</h1>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Main, Renderer (non-sandboxed only)</i>
<div>
<div>
<button id="copy-to">Copy</button>
@@ -17,8 +18,6 @@
</div>
</div>
</div>
<script src="./renderer.js"></script>
</body>
<script>
require('./renderer.js')
</script>
</html>

View File

@@ -1,4 +1,5 @@
const { app, BrowserWindow } = require('electron')
const { app, BrowserWindow, ipcMain, clipboard } = require('electron')
const path = require('path')
let mainWindow = null
@@ -8,7 +9,7 @@ function createWindow () {
height: 400,
title: 'Clipboard copy',
webPreferences: {
nodeIntegration: true
preload: path.join(__dirname, 'preload.js')
}
}
@@ -20,6 +21,18 @@ function createWindow () {
})
}
ipcMain.handle('clipboard:writeText', (event, text) => {
clipboard.writeText(text)
})
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

View File

@@ -0,0 +1,5 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('clipboard', {
writeText: (text) => ipcRenderer.invoke('clipboard:writeText', text)
})

View File

@@ -1,5 +1,3 @@
const { clipboard } = require('electron')
const copyBtn = document.getElementById('copy-to')
const copyInput = document.getElementById('copy-to-input')

View File

@@ -2,12 +2,13 @@
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<div>
<div>
<h1>Clipboard paste</h1>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Main, Renderer (non-sandboxed only)</i>
<div>
<div>
<button id="paste-to">Paste</button>
@@ -17,8 +18,6 @@
</div>
</div>
</div>
<script src="./renderer.js"></script>
</body>
<script>
require('./renderer.js')
</script>
</html>

View File

@@ -1,4 +1,5 @@
const { app, BrowserWindow } = require('electron')
const { app, BrowserWindow, ipcMain, clipboard } = require('electron')
const path = require('path')
let mainWindow = null
@@ -8,7 +9,7 @@ function createWindow () {
height: 400,
title: 'Clipboard paste',
webPreferences: {
nodeIntegration: true
preload: path.join(__dirname, 'preload.js')
}
}
@@ -20,6 +21,22 @@ function createWindow () {
})
}
ipcMain.handle('clipboard:readText', () => {
return clipboard.readText()
})
ipcMain.handle('clipboard:writeText', (event, text) => {
clipboard.writeText(text)
})
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

View File

@@ -0,0 +1,6 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('clipboard', {
readText: () => ipcRenderer.invoke('clipboard:readText'),
writeText: (text) => ipcRenderer.invoke('clipboard:writeText', text)
})

View File

@@ -1,9 +1,7 @@
const { clipboard } = require('electron')
const pasteBtn = document.getElementById('paste-to')
pasteBtn.addEventListener('click', () => {
clipboard.writeText('What a demo!')
const message = `Clipboard contents: ${clipboard.readText()}`
pasteBtn.addEventListener('click', async () => {
await clipboard.writeText('What a demo!')
const message = `Clipboard contents: ${await clipboard.readText()}`
document.getElementById('paste-from').innerHTML = message
})

View File

@@ -23,6 +23,8 @@ if (!gotTheLock) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus()
}
dialog.showErrorBox('Welcome Back', `You arrived from: ${commandLine.pop().slice(0,-1)}`)
})
// Create mainWindow, load the rest of the app, etc...

View File

@@ -132,7 +132,7 @@ OSR (offscreen rendering) can be used for loading heavy page in
background and then displaying it after (it will be much faster).
It allows you to render page without showing it on screen.
For more information, read the [Offscreen Rendering][osr] tutorial.
For more information, read the [Offscreen Rendering] tutorial.
### preload script
@@ -235,10 +235,10 @@ embedded content.
[mac app store submission guide]: tutorial/mac-app-store-submission-guide.md
[main]: #main-process
[msi]: https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-portal
[Native Node Modules]: tutorial/using-native-node-modules.md
[offscreen rendering]: tutorial/offscreen-rendering.md
[process sandboxing]: tutorial/sandbox.md
[renderer]: #renderer-process
[userland]: #userland
[using native node modules]: tutorial/using-native-node-modules.md
[UtilityProcess]: api/utility-process.md
[v8]: #v8

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -24,7 +24,7 @@ development and release. They are more helpful and supportive but enforce
guidelines on how your code should be structured and built. *Especially for
beginners, using a command line tool is likely to be helpful*.
## electron-forge
## Electron Forge
Electron Forge is a tool for packaging and publishing Electron applications. It unifies Electron's tooling ecosystem
into a single extensible interface so that anyone can jump right into making Electron apps.

View File

@@ -95,7 +95,7 @@ Before signing Windows builds, you must do the following:
You can get a code signing certificate from a lot of resellers. Prices vary, so
it may be worth your time to shop around. Popular resellers include:
- [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm)
- [digicert](https://www.digicert.com/dc/code-signing/microsoft-authenticode.htm)
- [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing)
- Amongst others, please shop around to find one that suits your needs! 😄

View File

@@ -13,7 +13,7 @@ from the OS.
If your app has its own dark mode, you should toggle it on and off in sync with
the system's dark mode setting. You can do this by using the
[prefer-color-scheme] CSS media query.
[prefers-color-scheme] CSS media query.
### Manually update your own interfaces

View File

@@ -15,7 +15,7 @@ NPM package that does just that.
If you don't want to use the tooling approach, you can also do all of the necessary
operations by hand. To load an extension in Electron, you need to download it via Chrome,
locate its filesystem path, and then load it into your [Session][session] by calling the
[`ses.loadExtension`] API.
[`ses.loadExtension`][load-extension] API.
Using the [React Developer Tools][react-devtools] as an example:

View File

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

View File

@@ -52,5 +52,6 @@ You can find the full list of "How to?" in the sidebar. If there is
something that you would like to do that is not documented, please join
our [Discord server][discord] and let us know!
[app]: ../api/app.md
[discord]: https://discord.gg/electronjs
[fiddle]: https://www.electronjs.org/fiddle

View File

@@ -31,6 +31,6 @@ template and submit a new issue.
[(package)]: https://www.electronforge.io/cli#package
[(make)]: https://www.electronforge.io/cli#make
[(publish)]: https://www.electronforge.io/cli#publish
[GitHub issue tracker]: https://github.com/electron-userland/electron-forge/issues
[GitHub issue tracker]: https://github.com/electron/forge/issues
[discord]: https://discord.gg/APGC3k5yaH
[tutorial]: https://www.electronjs.org/docs/latest/tutorial/tutorial-prerequisites
[tutorial]: ./tutorial-1-prerequisites.md

View File

@@ -12,7 +12,7 @@ hide_title: true
<!-- ✍ Update this section if you want to provide more details -->
This guide will take you through the process of setting your Electron app as the default
handler for a specific [protocol](https://www.electronjs.org/docs/api/protocol).
handler for a specific [protocol](../api/protocol.md).
By the end of this tutorial, we will have set our app to intercept and handle
any clicked URLs that start with a specific protocol. In this guide, the protocol
@@ -61,7 +61,7 @@ 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](https://www.electronjs.org/docs/api/app#apprequestsingleinstancelock).
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).
#### Windows code:
@@ -77,17 +77,15 @@ if (!gotTheLock) {
if (mainWindow.isMinimized()) mainWindow.restore()
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)}`)
})
// Create mainWindow, load the rest of the app, etc...
app.whenReady().then(() => {
createWindow()
})
// Handle the protocol. In this case, we choose to show an Error Box.
app.on('open-url', (event, url) => {
dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`)
})
}
```

View File

@@ -1,109 +1,108 @@
# Notifications
## Overview
Each operating system has its own mechanism to display notifications to users. Electron's notification
APIs are cross-platform, but are different for each process type.
All three operating systems provide means for applications to send
notifications to the user. The technique of showing notifications is different
for the Main and Renderer processes.
If you want to use a renderer process API in the main process or vice-versa, consider using
[inter-process communication](./ipc.md).
For the Renderer process, Electron conveniently allows developers to send
notifications with the [HTML5 Notification API](https://notifications.spec.whatwg.org/),
using the currently running operating system's native notification APIs
to display it.
## Usage
To show notifications in the Main process, you need to use the
[Notification](../api/notification.md) module.
Below are two examples showing how to display notifications for each process type.
## Example
### Show notifications in the main process
### Show notifications in the Renderer process
Main process notifications are displayed using Electron's [Notification module](../api/notification.md).
Notification objects created using this module do not appear unless their `show()` instance
method is called.
Starting with a working application from the
[Quick Start Guide](quick-start.md), add the following line to the
`index.html` file before the closing `</body>` tag:
```js title='Main Process'
const { Notification } = require("electron");
```html
<script src="renderer.js"></script>
const NOTIFICATION_TITLE = "Basic Notification";
const NOTIFICATION_BODY = "Notification from the Main process";
new Notification({
title: NOTIFICATION_TITLE,
body: NOTIFICATION_BODY,
}).show();
```
...and add the `renderer.js` file:
```javascript fiddle='docs/fiddles/features/notifications/renderer'
const NOTIFICATION_TITLE = 'Title'
const NOTIFICATION_BODY = 'Notification from the Renderer process. Click to log to console.'
const CLICK_MESSAGE = 'Notification clicked'
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY })
.onclick = () => console.log(CLICK_MESSAGE)
```
After launching the Electron application, you should see the notification:
![Notification in the Renderer process](../images/notification-renderer.png)
Additionally, if you click on the notification, the DOM will update to show "Notification clicked!".
### Show notifications in the Main process
Starting with a working application from the
[Quick Start Guide](quick-start.md), update the `main.js` file with the following lines:
Here's a full example that you can open with Electron Fiddle:
```javascript fiddle='docs/fiddles/features/notifications/main'
const { Notification } = require('electron')
const { Notification } = require("electron");
const NOTIFICATION_TITLE = 'Basic Notification'
const NOTIFICATION_BODY = 'Notification from the Main process'
const NOTIFICATION_TITLE = "Basic Notification";
const NOTIFICATION_BODY = "Notification from the Main process";
const showNotification = () => {
new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
}
app.whenReady().then(createWindow).then(showNotification)
new Notification({
title: NOTIFICATION_TITLE,
body: NOTIFICATION_BODY,
}).show();
```
After launching the Electron application, you should see the system notification:
### Show notifications in the renderer process
![Notification in the Main process](../images/notification-main.png)
Notifications can be displayed directly from the renderer process with the
[web Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API).
## Additional information
```js title='Renderer Process'
const NOTIFICATION_TITLE = "Title";
const NOTIFICATION_BODY =
"Notification from the Renderer process. Click to log to console.";
const CLICK_MESSAGE = "Notification clicked";
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
() => console.log(CLICK_MESSAGE);
```
Here's a full example that you can open with Electron Fiddle:
```javascript fiddle='docs/fiddles/features/notifications/renderer'
const NOTIFICATION_TITLE = "Title";
const NOTIFICATION_BODY =
"Notification from the Renderer process. Click to log to console.";
const CLICK_MESSAGE = "Notification clicked";
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
() => console.log(CLICK_MESSAGE);
```
## Platform considerations
While code and user experience across operating systems are similar, there
are subtle differences.
### Windows
* On Windows 10, a shortcut to your app with an
[Application User Model ID][app-user-model-id] must be installed to the
Start Menu. This can be overkill during development, so adding
`node_modules\electron\dist\electron.exe` to your Start Menu also does the
trick. Navigate to the file in Explorer, right-click and 'Pin to Start Menu'.
You will then need to add the line `app.setAppUserModelId(process.execPath)` to
your main process to see notifications.
* On Windows 8.1 and Windows 8, a shortcut to your app with an [Application User
Model ID][app-user-model-id] must be installed to the Start screen. Note,
however, that it does not need to be pinned to the Start screen.
* On Windows 7, notifications work via a custom implementation which visually
resembles the native one on newer systems.
For notifications on Windows, your Electron app needs to have a Start Menu shortcut with an
[AppUserModelID][app-user-model-id] and a corresponding [ToastActivatorCLSID][toast-activator-clsid].
Electron attempts to automate the work around the Application User Model ID. When
Electron is used together with the installation and update framework Squirrel,
[shortcuts will automatically be set correctly][squirrel-events]. Furthermore,
Electron will detect that Squirrel was used and will automatically call
Electron attempts to automate the work around the AppUserModelID and ToastActivatorCLSID. When
Electron is used together with Squirrel.Windows (e.g. if you're using electron-winstaller),
[shortcuts will automatically be set correctly][squirrel-events].
In production, Electron will also detect that Squirrel was used and will automatically call
`app.setAppUserModelId()` with the correct value. During development, you may have
to call [`app.setAppUserModelId()`][set-app-user-model-id] yourself.
Furthermore, in Windows 8, the maximum length for the notification body is 250
characters, with the Windows team recommending that notifications should be kept
to 200 characters. That said, that limitation has been removed in Windows 10, with
the Windows team asking developers to be reasonable. Attempting to send gigantic
amounts of text to the API (thousands of characters) might result in instability.
:::info Notifications in development
#### Advanced Notifications
To quickly bootstrap notifications during development, adding
`node_modules\electron\dist\electron.exe` to your Start Menu also does the
trick. Navigate to the file in Explorer, right-click and 'Pin to Start Menu'.
Then, call `app.setAppUserModelId(process.execPath)` in the main process to see notifications.
Later versions of Windows allow for advanced notifications, with custom templates,
images, and other flexible elements. To send those notifications (from either the
main process or the renderer process), use the userland module
[electron-windows-notifications](https://github.com/felixrieseberg/electron-windows-notifications),
:::
#### Use advanced notifications
Windows also allow for advanced notifications with custom templates, images, and other flexible
elements.
To send those notifications from the main process, you can use the userland module
[`electron-windows-notifications`](https://github.com/felixrieseberg/electron-windows-notifications),
which uses native Node addons to send `ToastNotification` and `TileNotification` objects.
While notifications including buttons work with `electron-windows-notifications`,
@@ -112,41 +111,41 @@ handling replies requires the use of
which helps with registering the required COM components and calling your
Electron app with the entered user data.
#### Quiet Hours / Presentation Mode
#### Query notification state
To detect whether or not you're allowed to send a notification, use the
userland module [electron-notification-state](https://github.com/felixrieseberg/electron-notification-state).
userland module [`windows-notification-state`][windows-notification-state].
This allows you to determine ahead of time whether or not Windows will
silently throw the notification away.
This module allows you to determine ahead of time whether or not Windows will silently throw the
notification away.
### macOS
Notifications are straight-forward on macOS, but you should be aware of
Notifications are straightforward on macOS, but you should be aware of
[Apple's Human Interface guidelines regarding notifications][apple-notification-guidelines].
Note that notifications are limited to 256 bytes in size and will be truncated
if you exceed that limit.
[apple-notification-guidelines]: https://developer.apple.com/macos/human-interface-guidelines/system-capabilities/notifications/
#### Do not disturb / Session State
#### Query notification state
To detect whether or not you're allowed to send a notification, use the userland module
[electron-notification-state][electron-notification-state].
[`macos-notification-state`][macos-notification-state].
This will allow you to detect ahead of time whether or not the notification will be displayed.
[electron-notification-state]: https://github.com/felixrieseberg/electron-notification-state
This module allows you to detect ahead of time whether or not the notification will be displayed.
### Linux
Notifications are sent using `libnotify` which can show notifications on any
Notifications are sent using `libnotify`, which can show notifications on any
desktop environment that follows [Desktop Notifications
Specification][notification-spec], including Cinnamon, Enlightenment, Unity,
GNOME, KDE.
GNOME, and KDE.
[notification-spec]: https://developer-old.gnome.org/notification-spec/
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[set-app-user-model-id]: ../api/app.md#appsetappusermodelidid-windows
[squirrel-events]: https://github.com/electron/windows-installer/blob/master/README.md#handling-squirrel-events
[squirrel-events]: https://github.com/electron/windows-installer/blob/main/README.md#handling-squirrel-events
[toast-activator-clsid]: https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-toastactivatorclsid
[apple-notification-guidelines]: https://developer.apple.com/macos/human-interface-guidelines/system-capabilities/notifications/
[windows-notification-state]: https://github.com/felixrieseberg/windows-notification-state
[macos-notification-state]: https://github.com/felixrieseberg/macos-notification-state

View File

@@ -438,7 +438,7 @@ Call `Menu.setApplicationMenu(null)` before `app.on("ready")`. This will prevent
[request-idle-callback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
[multithreading]: ./multithreading.md
[caniuse]: https://caniuse.com/
[jquery-need]: http://youmightnotneedjquery.com/
[jquery-need]: https://youmightnotneedjquery.com/
[service-workers]: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
[webpack]: https://webpack.js.org/
[parcel]: https://parceljs.org/

View File

@@ -138,5 +138,5 @@ of `app` module will be emitted for it.
[dock-menu-image]: https://cloud.githubusercontent.com/assets/639601/5069610/2aa80758-6e97-11e4-8cfb-c1a414a10774.png
[addrecentdocument]: ../api/app.md#appaddrecentdocumentpath-macos-windows
[clearrecentdocuments]: ../api/app.md#appclearrecentdocuments-macos-windows
[app-registration]: https://msdn.microsoft.com/en-us/library/cc144104(VS.85).aspx
[app-registration]: https://learn.microsoft.com/en-us/windows/win32/shell/app-registration
[menu-item-image]: https://user-images.githubusercontent.com/3168941/33003655-ea601c3a-cd70-11e7-97fa-7c062149cfb1.png

View File

@@ -84,7 +84,7 @@ the `sandbox: false` preference in the [`BrowserWindow`][browser-window] constru
app.whenReady().then(() => {
const win = new BrowserWindow({
webPreferences: {
sandbox: true
sandbox: false
}
})
win.loadURL('https://google.com')

View File

@@ -13,7 +13,7 @@ system modification.
There are three ways to create a `.snap` file:
1) Using [`electron-forge`][electron-forge] or
1) Using [Electron Forge][electron-forge] or
[`electron-builder`][electron-builder], both tools that come with `snap`
support out of the box. This is the easiest option.
2) Using `electron-installer-snap`, which takes `electron-packager`'s output.
@@ -162,7 +162,7 @@ building blocks.
If you do not already have a `.deb` package, using `electron-installer-snap`
might be an easier path to create snap packages. However, multiple solutions
for creating Debian packages exist, including [`electron-forge`][electron-forge],
for creating Debian packages exist, including [Electron Forge][electron-forge],
[`electron-builder`][electron-builder] or
[`electron-installer-debian`][electron-installer-debian].
@@ -239,7 +239,7 @@ apps:
[snapcraft-syntax]: https://docs.snapcraft.io/build-snaps/syntax
[electron-packager]: https://github.com/electron/electron-packager
[electron-forge]: https://github.com/electron-userland/electron-forge
[electron-forge]: https://github.com/electron/forge
[electron-builder]: https://github.com/electron-userland/electron-builder
[electron-installer-debian]: https://github.com/unindented/electron-installer-debian
[electron-winstaller]: https://github.com/electron/windows-installer

View File

@@ -13,7 +13,7 @@ hide_title: true
<!-- ✍ Update this section if you want to provide more details -->
This guide will take you through the process of creating a
[Tray](https://www.electronjs.org/docs/api/tray) icon with
[Tray](../api/tray.md) icon with
its own context menu to the system's notification area.
On MacOS and Ubuntu, the Tray will be located on the top
@@ -31,11 +31,11 @@ const { app, Tray, Menu, nativeImage } = require('electron')
```
Next we will create our Tray. To do this, we will use a
[`NativeImage`](https://www.electronjs.org/docs/api/native-image) icon,
[`NativeImage`](../api/native-image.md) icon,
which can be created through any one of these
[methods](https://www.electronjs.org/docs/api/native-image#methods).
[methods](../api/native-image.md#methods).
Note that we wrap our Tray creation code within an
[`app.whenReady`](https://www.electronjs.org/docs/api/app#appwhenready)
[`app.whenReady`](../api/app.md#appwhenready)
as we will need to wait for our electron app to finish initializing.
```js title='main.js'
@@ -64,7 +64,7 @@ tray.setContextMenu(contextMenu)
The code above will create 4 separate radio-type items in the context menu.
To read more about constructing native menus, click
[here](https://www.electronjs.org/docs/api/menu#menubuildfromtemplatetemplate).
[here](../api/menu.md#menubuildfromtemplatetemplate).
Finally, let's give our tray a tooltip and a title.

View File

@@ -121,14 +121,13 @@ need to install Node.js themselves as a prerequisite to running your app.
To check which version of Node.js is running in your app, you can access the global
[`process.versions`] variable in the main process or preload script. You can also reference
the list of versions in the [electron/releases] repository.
<https://releases.electronjs.org/releases.json>.
:::
<!-- Links -->
[chromium]: https://www.chromium.org/
[electron/releases]: https://github.com/electron/releases/blob/master/readme.md#releases
[homebrew]: https://brew.sh/
[mdn-guide]: https://developer.mozilla.org/en-US/docs/Learn/
[node]: https://nodejs.org/

View File

@@ -81,10 +81,13 @@ the exact dependency versions to install.
"version": "1.0.0",
"description": "Hello World!",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jane Doe",
"license": "MIT",
"devDependencies": {
"electron": "19.0.0"
"electron": "23.1.3"
}
}
```
@@ -137,13 +140,14 @@ script in the current directory and run it in dev mode.
"version": "1.0.0",
"description": "Hello World!",
"main": "main.js",
"scripts": {
"start": "electron .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jane Doe",
"license": "MIT",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "^19.0.0"
"electron": "23.1.3"
}
}
```

View File

@@ -81,7 +81,7 @@ contextBridge.exposeInMainWorld('versions', {
To attach this script to your renderer process, pass its path to the
`webPreferences.preload` option in the BrowserWindow constructor:
```js {8-10} title="main.js"
```js {2,8-10} title="main.js"
const { app, BrowserWindow } = require('electron')
const path = require('path')
@@ -202,7 +202,7 @@ Then, set up your `handle` listener in the main process. We do this _before_
loading the HTML file so that the handler is guaranteed to be ready before
you send out the `invoke` call from the renderer.
```js {1,11} title="main.js"
```js {1,12} title="main.js"
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')

View File

@@ -63,7 +63,7 @@ into end users' hands.
<!-- Link labels -->
[discord]: https://discord.gg/electronjs
[github]: https://github.com/electron/electronjs.org-new/issues/new
[github]: https://github.com/electron/website/issues/new
[how-to]: ./examples.md
[node-platform]: https://nodejs.org/api/process.html#process_process_platform

View File

@@ -222,16 +222,16 @@ rest of our docs and happy developing! If you have questions, please stop by our
[code-signed]: ./code-signing.md
[discord server]: https://discord.gg/electronjs
[electron fiddle]: https://electronjs.org/fiddle
[fiddle-build]: https://github.com/electron/fiddle/blob/master/.github/workflows/build.yaml
[fiddle-forge-config]: https://github.com/electron/fiddle/blob/master/forge.config.js
[fiddle-build]: https://github.com/electron/fiddle/blob/main/.github/workflows/build.yaml
[fiddle-forge-config]: https://github.com/electron/fiddle/blob/main/forge.config.js
[github actions]: https://github.com/features/actions
[github publisher]: https://www.electronforge.io/config/publishers/github
[github releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
[git tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging
[git-tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging
[new-pat]: https://github.com/settings/tokens/new
[publish command]: https://www.electronforge.io/cli#publish
[publisher]: https://www.electronforge.io/config/publishers
[`publishergithubconfig`]: https://js.electronforge.io/publisher/github/interfaces/publishergithubconfig
[`publishergithubconfig`]: https://js.electronforge.io/interfaces/_electron_forge_publisher_github.PublisherGitHubConfig.html
[`update-electron-app`]: https://github.com/electron/update-electron-app
[update-server]: ./updates.md

View File

@@ -67,7 +67,7 @@ Depending on your needs, you can choose from one of these:
to minify server cost.
Once you've deployed your update server, you can instrument your app code to receive and
apply the updates with Electron's [autoUpdater] module.
apply the updates with Electron's [autoUpdater](../api/auto-updater.md) module.
### Step 2: Receiving updates in your app

View File

@@ -110,7 +110,7 @@ On Windows, by default, `node-gyp` links native modules against `node.dll`.
However, in Electron 4.x and higher, the symbols needed by native modules are
exported by `electron.exe`, and there is no `node.dll`. In order to load native
modules on Windows, `node-gyp` installs a [delay-load
hook](https://msdn.microsoft.com/en-us/library/z9h1h6ty.aspx) that triggers
hook](https://learn.microsoft.com/en-us/cpp/build/reference/error-handling-and-notification?view=msvc-170#notification-hooks) that triggers
when the native module is loaded, and redirects the `node.dll` reference to use
the loading executable instead of looking for `node.dll` in the library search
path (which would turn up nothing). As such, on Electron 4.x and higher,

View File

@@ -35,9 +35,15 @@ filenames = {
"shell/browser/relauncher_linux.cc",
"shell/browser/ui/electron_desktop_window_tree_host_linux.cc",
"shell/browser/ui/file_dialog_gtk.cc",
"shell/browser/ui/gtk/menu_gtk.cc",
"shell/browser/ui/gtk/menu_gtk.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/message_box_gtk.cc",
"shell/browser/ui/tray_icon_gtk.cc",
"shell/browser/ui/tray_icon_gtk.h",
"shell/browser/ui/status_icon_gtk.cc",
"shell/browser/ui/status_icon_gtk.h",
"shell/browser/ui/tray_icon_linux.cc",
"shell/browser/ui/tray_icon_linux.h",
"shell/browser/ui/views/client_frame_view_linux.cc",
"shell/browser/ui/views/client_frame_view_linux.h",
"shell/common/application_info_linux.cc",
@@ -67,17 +73,6 @@ filenames = {
"shell/browser/native_window_views_win.cc",
"shell/browser/notifications/win/notification_presenter_win.cc",
"shell/browser/notifications/win/notification_presenter_win.h",
"shell/browser/notifications/win/notification_presenter_win7.cc",
"shell/browser/notifications/win/notification_presenter_win7.h",
"shell/browser/notifications/win/win32_desktop_notifications/common.h",
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc",
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h",
"shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc",
"shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h",
"shell/browser/notifications/win/win32_desktop_notifications/toast.cc",
"shell/browser/notifications/win/win32_desktop_notifications/toast.h",
"shell/browser/notifications/win/win32_notification.cc",
"shell/browser/notifications/win/win32_notification.h",
"shell/browser/notifications/win/windows_toast_notification.cc",
"shell/browser/notifications/win/windows_toast_notification.h",
"shell/browser/relauncher_win.cc",
@@ -158,7 +153,7 @@ filenames = {
"shell/browser/notifications/mac/notification_presenter_mac.mm",
"shell/browser/relauncher_mac.cc",
"shell/browser/ui/certificate_trust_mac.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.cc",
"shell/browser/ui/cocoa/delayed_native_view_host.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.h",
"shell/browser/ui/cocoa/electron_bundle_mover.h",
"shell/browser/ui/cocoa/electron_bundle_mover.mm",
@@ -180,8 +175,6 @@ filenames = {
"shell/browser/ui/cocoa/electron_touch_bar.mm",
"shell/browser/ui/cocoa/event_dispatching_window.h",
"shell/browser/ui/cocoa/event_dispatching_window.mm",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/root_view_mac.h",

View File

@@ -271,6 +271,10 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__debug",
"//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h",
"//buildtools/third_party/libc++/trunk/include/__errc",
"//buildtools/third_party/libc++/trunk/include/__expected/bad_expected_access.h",
"//buildtools/third_party/libc++/trunk/include/__expected/expected.h",
"//buildtools/third_party/libc++/trunk/include/__expected/unexpect.h",
"//buildtools/third_party/libc++/trunk/include/__expected/unexpected.h",
"//buildtools/third_party/libc++/trunk/include/__filesystem/copy_options.h",
"//buildtools/third_party/libc++/trunk/include/__filesystem/directory_entry.h",
"//buildtools/third_party/libc++/trunk/include/__filesystem/directory_iterator.h",
@@ -290,6 +294,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__format/buffer.h",
"//buildtools/third_party/libc++/trunk/include/__format/concepts.h",
"//buildtools/third_party/libc++/trunk/include/__format/enable_insertable.h",
"//buildtools/third_party/libc++/trunk/include/__format/escaped_output_table.h",
"//buildtools/third_party/libc++/trunk/include/__format/extended_grapheme_cluster_table.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_arg.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_arg_store.h",
@@ -311,6 +316,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__format/formatter_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__format/formatter_string.h",
"//buildtools/third_party/libc++/trunk/include/__format/parser_std_format_spec.h",
"//buildtools/third_party/libc++/trunk/include/__format/range_default_formatter.h",
"//buildtools/third_party/libc++/trunk/include/__format/unicode.h",
"//buildtools/third_party/libc++/trunk/include/__functional/binary_function.h",
"//buildtools/third_party/libc++/trunk/include/__functional/binary_negate.h",
@@ -343,8 +349,10 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__fwd/array.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/get.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/hash.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/memory_resource.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/pair.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/span.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/string.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/string_view.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/tuple.h",
"//buildtools/third_party/libc++/trunk/include/__hash_table",
@@ -395,6 +403,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__memory/allocation_guard.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_arg_t.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_destructor.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_traits.h",
"//buildtools/third_party/libc++/trunk/include/__memory/assume_aligned.h",
"//buildtools/third_party/libc++/trunk/include/__memory/auto_ptr.h",
@@ -414,7 +423,14 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__memory/uninitialized_algorithms.h",
"//buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h",
"//buildtools/third_party/libc++/trunk/include/__memory/uses_allocator.h",
"//buildtools/third_party/libc++/trunk/include/__memory/uses_allocator_construction.h",
"//buildtools/third_party/libc++/trunk/include/__memory/voidify.h",
"//buildtools/third_party/libc++/trunk/include/__memory_resource/memory_resource.h",
"//buildtools/third_party/libc++/trunk/include/__memory_resource/monotonic_buffer_resource.h",
"//buildtools/third_party/libc++/trunk/include/__memory_resource/polymorphic_allocator.h",
"//buildtools/third_party/libc++/trunk/include/__memory_resource/pool_options.h",
"//buildtools/third_party/libc++/trunk/include/__memory_resource/synchronized_pool_resource.h",
"//buildtools/third_party/libc++/trunk/include/__memory_resource/unsynchronized_pool_resource.h",
"//buildtools/third_party/libc++/trunk/include/__mutex_base",
"//buildtools/third_party/libc++/trunk/include/__node_handle",
"//buildtools/third_party/libc++/trunk/include/__numeric/accumulate.h",
@@ -476,12 +492,14 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__ranges/dangling.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/data.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/drop_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/drop_while_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/empty.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/empty_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/enable_borrowed_range.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/enable_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/filter_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/iota_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/istream_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/join_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/lazy_split_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/non_propagating_cache.h",
@@ -495,6 +513,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__ranges/size.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/subrange.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/take_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/take_while_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/transform_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/view_interface.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/views.h",
@@ -614,6 +633,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_scoped_enum.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed_integer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_specialization.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_standard_layout.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_swappable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivial.h",
@@ -654,6 +674,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_reference.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_volatile.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/result_of.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/strip_signature.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/type_identity.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/type_list.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/underlying_type.h",
@@ -726,6 +747,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/errno.h",
"//buildtools/third_party/libc++/trunk/include/exception",
"//buildtools/third_party/libc++/trunk/include/execution",
"//buildtools/third_party/libc++/trunk/include/expected",
"//buildtools/third_party/libc++/trunk/include/experimental/__config",
"//buildtools/third_party/libc++/trunk/include/experimental/__memory",
"//buildtools/third_party/libc++/trunk/include/experimental/algorithm",
@@ -767,6 +789,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/istream",
"//buildtools/third_party/libc++/trunk/include/iterator",
"//buildtools/third_party/libc++/trunk/include/latch",
"//buildtools/third_party/libc++/trunk/include/libcxx.imp",
"//buildtools/third_party/libc++/trunk/include/limits",
"//buildtools/third_party/libc++/trunk/include/limits.h",
"//buildtools/third_party/libc++/trunk/include/list",
@@ -775,6 +798,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/map",
"//buildtools/third_party/libc++/trunk/include/math.h",
"//buildtools/third_party/libc++/trunk/include/memory",
"//buildtools/third_party/libc++/trunk/include/memory_resource",
"//buildtools/third_party/libc++/trunk/include/module.modulemap.in",
"//buildtools/third_party/libc++/trunk/include/mutex",
"//buildtools/third_party/libc++/trunk/include/new",

View File

@@ -623,11 +623,11 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
};
const { readdir } = fs;
fs.readdir = function (pathArgument: string, options: { encoding?: string | null; withFileTypes?: boolean } = {}, callback?: Function) {
fs.readdir = function (pathArgument: string, options?: { encoding?: string | null; withFileTypes?: boolean } | null, callback?: Function) {
const pathInfo = splitPath(pathArgument);
if (typeof options === 'function') {
callback = options;
options = {};
options = undefined;
}
if (!pathInfo.isAsar) return readdir.apply(this, arguments);
const { asarPath, filePath } = pathInfo;
@@ -646,7 +646,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
return;
}
if (options.withFileTypes) {
if (options?.withFileTypes) {
const dirents = [];
for (const file of files) {
const childPath = path.join(filePath, file);

View File

@@ -28,11 +28,47 @@ type PostData = LoadURLOptions['postData']
// Stock page sizes
const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
A5: {
custom_display_name: 'A5',
height_microns: 210000,
name: 'ISO_A5',
width_microns: 148000
Letter: {
custom_display_name: 'Letter',
height_microns: 279400,
name: 'NA_LETTER',
width_microns: 215900
},
Legal: {
custom_display_name: 'Legal',
height_microns: 355600,
name: 'NA_LEGAL',
width_microns: 215900
},
Tabloid: {
height_microns: 431800,
name: 'NA_LEDGER',
width_microns: 279400,
custom_display_name: 'Tabloid'
},
A0: {
custom_display_name: 'A0',
height_microns: 1189000,
name: 'ISO_A0',
width_microns: 841000
},
A1: {
custom_display_name: 'A1',
height_microns: 841000,
name: 'ISO_A1',
width_microns: 594000
},
A2: {
custom_display_name: 'A2',
height_microns: 594000,
name: 'ISO_A2',
width_microns: 420000
},
A3: {
custom_display_name: 'A3',
height_microns: 420000,
name: 'ISO_A3',
width_microns: 297000
},
A4: {
custom_display_name: 'A4',
@@ -41,29 +77,17 @@ const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
is_default: 'true',
width_microns: 210000
},
A3: {
custom_display_name: 'A3',
height_microns: 420000,
name: 'ISO_A3',
width_microns: 297000
A5: {
custom_display_name: 'A5',
height_microns: 210000,
name: 'ISO_A5',
width_microns: 148000
},
Legal: {
custom_display_name: 'Legal',
height_microns: 355600,
name: 'NA_LEGAL',
width_microns: 215900
},
Letter: {
custom_display_name: 'Letter',
height_microns: 279400,
name: 'NA_LETTER',
width_microns: 215900
},
Tabloid: {
height_microns: 431800,
name: 'NA_LEDGER',
width_microns: 279400,
custom_display_name: 'Tabloid'
A6: {
custom_display_name: 'A6',
height_microns: 148000,
name: 'ISO_A6',
width_microns: 105000
}
} as const;
@@ -272,7 +296,7 @@ WebContents.prototype.printToPDF = async function (options) {
if (options.pageRanges !== undefined) {
if (typeof options.pageRanges !== 'string') {
return Promise.reject(new Error('printBackground must be a String'));
return Promise.reject(new Error('pageRanges must be a String'));
}
printSettings.pageRanges = options.pageRanges;
}

View File

@@ -21,8 +21,9 @@ global.module = new Module('electron/js2c/worker_init');
global.require = makeRequireFunction(global.module);
// Set the __filename to the path of html file if it is file: protocol.
if (self.location.protocol === 'file:') {
const pathname = process.platform === 'win32' && self.location.pathname[0] === '/' ? self.location.pathname.substr(1) : self.location.pathname;
// NB. 'self' isn't defined in an AudioWorklet.
if (typeof self !== 'undefined' && self.location.protocol === 'file:') {
const pathname = process.platform === 'win32' && self?.location.pathname[0] === '/' ? self?.location.pathname.substr(1) : self?.location.pathname;
global.__filename = path.normalize(decodeURIComponent(pathname));
global.__dirname = path.dirname(global.__filename);

View File

@@ -7,9 +7,10 @@
"@azure/storage-blob": "^12.9.0",
"@electron/asar": "^3.2.1",
"@electron/docs-parser": "^1.0.0",
"@electron/fiddle-core": "^1.0.4",
"@electron/github-app-auth": "^1.5.0",
"@electron/typescript-definitions": "^8.10.0",
"@octokit/auth-app": "^2.10.0",
"@octokit/rest": "^18.0.3",
"@octokit/rest": "^19.0.7",
"@primer/octicons": "^10.0.0",
"@types/basic-auth": "^1.1.3",
"@types/busboy": "^0.2.3",
@@ -143,10 +144,11 @@
"ts-node script/check-patch-diff.ts"
],
"DEPS": [
"node script/gen-hunspell-filenames.js"
"node script/gen-hunspell-filenames.js",
"node script/gen-libc++-filenames.js"
]
},
"resolutions": {
"nan": "nodejs/nan#16fa32231e2ccd89d2804b3f765319128b20c4ac"
}
}
}

2
patches/angle/.patches Normal file
View File

@@ -0,0 +1,2 @@
fix_rename_webswapcgllayer_to_webswapcgllayerchromium.patch
cherry-pick-6da1a8953313.patch

View File

@@ -0,0 +1,134 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Thu, 16 Feb 2023 23:16:46 -0500
Subject: M110: Vulkan: Don't close render pass if rebind to same fbo
In the Vulkan backend, the render pass can occasionally (and
transiently) be in a state of "open but inactive". This is when the
render pass is closed, but has the potential for future modifications
(for example to add a resolve attachment). Under many circumstances, it
is expected that an open render pass cannot be in such a state.
This assumption can be broken in this scenario:
- Open render pass, draw, etc
- Change framebuffer binding
- Change framebuffer binding back to original
- Masked Clear
When ContextVk is synced before clear, it sees that the framebuffer
binding is changed (though it hasn't really), and it closes the render
passes and sets the render pass dirty bit. If a draw were to follow, a
new render pass would have started (unnecessarily). However, in the
case of a masked clear, UtilsVk notices that the render pass is started,
assumes it must be active, and continues recording to it. While the
operation itself succeeds, the assumption that the render pass is active
is false (and fails assertion).
This change makes sure that framebuffer binding change is no-oped if the
framebuffer is the same one that has opened the current render pass. If
any application does unnecessary binding changes and back, it will be
optimized by this change as well.
Bug: chromium:1411210
Change-Id: I37a3a9f2eaa1a81a1b3393840b9458ec71a87377
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4261215
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
(cherry picked from commit 05e62f39412e8c6bfc98582f5e7a49041991c97b)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4296296
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Prudhvikumar Bommana <pbommana@google.com>
Commit-Queue: Prudhvikumar Bommana <pbommana@google.com>
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp
index ad5f83854f29c7245553fe3e98b7f6545d7ea91c..9f05c2a32ae2e0f6a4b1466d9f4423b3022b4975 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -5224,6 +5224,15 @@ angle::Result ContextVk::syncState(const gl::Context *context,
// as some optimizations in non-draw commands require the render pass to remain
// open, such as invalidate or blit. Note that we always start a new command buffer
// because we currently can only support one open RenderPass at a time.
+ //
+ // The render pass is not closed if binding is changed to the same framebuffer as
+ // before.
+ if (hasStartedRenderPass() && hasStartedRenderPassWithQueueSerial(
+ drawFramebufferVk->getLastRenderPassQueueSerial()))
+ {
+ break;
+ }
+
onRenderPassFinished(RenderPassClosureReason::FramebufferBindingChange);
if (getFeatures().preferSubmitAtFBOBoundary.enabled &&
mRenderPassCommands->started())
diff --git a/src/tests/gl_tests/ClearTest.cpp b/src/tests/gl_tests/ClearTest.cpp
index bbe243281fce2b7503767b2553d2900b598b7e81..51a953019c53e8ed1f09184965164002f4cc4c79 100644
--- a/src/tests/gl_tests/ClearTest.cpp
+++ b/src/tests/gl_tests/ClearTest.cpp
@@ -2863,6 +2863,26 @@ TEST_P(ClearTest, DISABLED_ClearReachesWindow)
angle::Sleep(2000);
}
+// Tests that masked clear after a no-op framebuffer binding change with an open render pass works.
+TEST_P(ClearTest, DrawThenChangeFBOBindingAndBackThenMaskedClear)
+{
+ ANGLE_GL_PROGRAM(blueProgram, essl1_shaders::vs::Simple(), essl1_shaders::fs::Blue());
+
+ // Draw blue.
+ drawQuad(blueProgram, essl1_shaders::PositionAttrib(), 0.5f);
+
+ // Change framebuffer and back
+ glBindFramebuffer(GL_FRAMEBUFFER, mFBOs[0]);
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ // Masked clear
+ glColorMask(1, 0, 0, 1);
+ glClearColor(1.0f, 0.5f, 0.5f, 1.0f);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::magenta);
+}
+
// Test that clearing slices of a 3D texture and reading them back works.
TEST_P(ClearTestES3, ClearAndReadPixels3DTexture)
{
diff --git a/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp b/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
index b62f434d5db1eac4bf5039db49d50ffd092b3621..bacac33673b9d2c2b8d62b9ff12a61773273eff1 100644
--- a/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
+++ b/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
@@ -5,7 +5,7 @@
//
// VulkanPerformanceCounterTest:
// Validates specific GL call patterns with ANGLE performance counters.
-// For example we can verify a certain call set doesn't break the RenderPass.
+// For example we can verify a certain call set doesn't break the render pass.
#include "test_utils/ANGLETest.h"
#include "test_utils/angle_test_instantiate.h"
@@ -7090,6 +7090,26 @@ TEST_P(VulkanPerformanceCounterTest, AsyncMonolithicPipelineCreation)
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
}
+// Verify that changing framebuffer and back doesn't break the render pass.
+TEST_P(VulkanPerformanceCounterTest, FBOChangeAndBackDoesNotBreakRenderPass)
+{
+ uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
+
+ ANGLE_GL_PROGRAM(drawRed, essl3_shaders::vs::Simple(), essl3_shaders::fs::Red());
+ drawQuad(drawRed, essl1_shaders::PositionAttrib(), 0);
+
+ GLFramebuffer fbo;
+ glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ drawQuad(drawRed, essl1_shaders::PositionAttrib(), 0);
+
+ // Verify render pass count.
+ EXPECT_EQ(getPerfCounters().renderPasses, expectedRenderPassCount);
+
+ EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VulkanPerformanceCounterTest);
ANGLE_INSTANTIATE_TEST(
VulkanPerformanceCounterTest,

View File

@@ -0,0 +1,66 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Milan Burda <milan.burda@gmail.com>
Date: Mon, 10 Oct 2022 15:11:08 +0400
Subject: fix: rename WebSwapCGLLayer to WebSwapCGLLayerChromium
Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x23c589b50)
and src/out/testing/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x1123f8488).
One of the two will be used. Which one is undefined.
diff --git a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
index 7101cd271c07e604c6f5241d1a22f59f446c0033..98a89976f87e32a66bd504951698204fad938d57 100644
--- a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
+++ b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
@@ -18,7 +18,7 @@ struct __IOSurface;
typedef __IOSurface *IOSurfaceRef;
// WebKit's build process requires that every Objective-C class name has the prefix "Web".
-@class WebSwapCGLLayer;
+@class WebSwapCGLLayerChromium;
namespace rx
{
@@ -89,7 +89,7 @@ class WindowSurfaceCGL : public SurfaceGL
gl::Framebuffer *framebuffer) override;
private:
- WebSwapCGLLayer *mSwapLayer;
+ WebSwapCGLLayerChromium *mSwapLayer;
SharedSwapState mSwapState;
uint64_t mCurrentSwapId;
diff --git a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
index 27990e9c2facbbe0e30f4b275e0778a6474fb9ce..84f9fa9b6d31fb0e85a4c4270dff4d935f855c26 100644
--- a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
+++ b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
@@ -24,7 +24,7 @@
# include "libANGLE/renderer/gl/StateManagerGL.h"
# include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
-@interface WebSwapCGLLayer : CAOpenGLLayer {
+@interface WebSwapCGLLayerChromium : CAOpenGLLayer {
CGLContextObj mDisplayContext;
bool initialized;
@@ -38,7 +38,7 @@ - (id)initWithSharedState:(rx::SharedSwapState *)swapState
withFunctions:(const rx::FunctionsGL *)functions;
@end
-@implementation WebSwapCGLLayer
+@implementation WebSwapCGLLayerChromium
- (id)initWithSharedState:(rx::SharedSwapState *)swapState
withContext:(CGLContextObj)displayContext
withFunctions:(const rx::FunctionsGL *)functions
@@ -220,9 +220,9 @@ - (void)drawInCGLContext:(CGLContextObj)glContext
mSwapState.lastRendered = &mSwapState.textures[1];
mSwapState.beingPresented = &mSwapState.textures[2];
- mSwapLayer = [[WebSwapCGLLayer alloc] initWithSharedState:&mSwapState
- withContext:mContext
- withFunctions:mFunctions];
+ mSwapLayer = [[WebSwapCGLLayerChromium alloc] initWithSharedState:&mSwapState
+ withContext:mContext
+ withFunctions:mFunctions];
[mLayer addSublayer:mSwapLayer];
[mSwapLayer setContentsScale:[mLayer contentsScale]];

View File

@@ -58,10 +58,10 @@ index 852b76bea69988e0b3ac76a17b603128f239dde0..d443f4dc2daea0b7aa86ae75d31d995f
callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg);
callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg);
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
index ba4b6983f5e898b5300ee7a5d683e0cba94682e8..1117a007da931e005b41e9d97672bdfd4eb61449 100644
index b1876e0dcdab3bc69107093919e0c20fb92fc670..dffb4bcb519a3e8c2d0e2fc63603964a03cc1f4e 100644
--- a/include/openssl/cipher.h
+++ b/include/openssl/cipher.h
@@ -460,6 +460,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
@@ -464,6 +464,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
// EVP_aes_128_cfb128 is only available in decrepit.
OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void);

View File

@@ -20,10 +20,10 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
case ssl_open_record_error:
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
index a6ca0ab96266475384429e73970de18d4ba09912..c7e7bd02f2484f91bf55df1400e94804e61ea914 100644
index cfd1862d4bd031dffb4e7d0cfd0aadcb61200c47..d14c8cd02171daf26ed9460b890b82475d3537c0 100644
--- a/ssl/ssl_lib.cc
+++ b/ssl/ssl_lib.cc
@@ -1319,7 +1319,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
@@ -1320,7 +1320,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
}
if (ret_code == 0) {
@@ -32,7 +32,7 @@ index a6ca0ab96266475384429e73970de18d4ba09912..c7e7bd02f2484f91bf55df1400e94804
return SSL_ERROR_ZERO_RETURN;
}
// An EOF was observed which violates the protocol, and the underlying
@@ -2592,13 +2592,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
@@ -2598,13 +2598,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
}
@@ -48,10 +48,10 @@ index a6ca0ab96266475384429e73970de18d4ba09912..c7e7bd02f2484f91bf55df1400e94804
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
RSA *(*cb)(SSL *ssl, int is_export,
diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
index 3709a4694f3c9be67fd918f125f023b5aa660971..3507f4ef5bd4444c2499b06a5e312ab54f08bc3b 100644
index 89273853c368ebd2c3c0098cc2a23af0490b7b87..5003607d4aded4ed885b6e362d224497932f1626 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -8358,11 +8358,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8435,11 +8435,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(ret, 0);
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_ZERO_RETURN);
@@ -63,7 +63,7 @@ index 3709a4694f3c9be67fd918f125f023b5aa660971..3507f4ef5bd4444c2499b06a5e312ab5
// Although the client has seen close_notify, it should continue to report
// |SSL_ERROR_SYSCALL| when its writes fail.
ret = SSL_write(client.get(), data, sizeof(data));
@@ -8370,22 +8365,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8447,22 +8442,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_SYSCALL);
EXPECT_TRUE(write_failed);
write_failed = false;

View File

@@ -10,7 +10,6 @@ render_widget_host_view_base.patch
render_widget_host_view_mac.patch
webview_cross_drag.patch
gin_enable_disable_v8_platform.patch
disable-redraw-lock.patch
enable_reset_aspect_ratio.patch
boringssl_build_gn.patch
pepper_plugin_support.patch
@@ -124,3 +123,7 @@ build_only_use_the_mas_build_config_in_the_required_components.patch
fix_tray_icon_gone_on_lock_screen.patch
chore_introduce_blocking_api_for_electron.patch
chore_patch_out_partition_attribute_dcheck_for_webviews.patch
expose_v8initializer_codegenerationcheckcallbackinmainthread.patch
chore_patch_out_profile_methods_in_profile_selections_cc.patch
fix_x11_window_restore_minimized_maximized_window.patch
chore_defer_usb_service_getdevices_request_until_usb_service_is.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 0aac97f658748761317fe8d6fda48737f7dc8ec6..8ab71d7a6de908ae204490d254be88e62dd38567 100644
index a044de5f13ef0f07f3aca582d706a4ffa9bc35a8..9543b18f3e7c524a8a56ffcfc02bb9b19f863035 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -240,6 +240,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -242,6 +242,10 @@ int GpuMain(MainFunctionParams parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,7 +24,7 @@ index 0aac97f658748761317fe8d6fda48737f7dc8ec6..8ab71d7a6de908ae204490d254be88e6
// 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
@@ -324,7 +328,6 @@ int GpuMain(MainFunctionParams parameters) {
@@ -326,7 +330,6 @@ int GpuMain(MainFunctionParams parameters) {
const_cast<base::CommandLine*>(&command_line), gpu_preferences);
const bool dead_on_arrival = !init_success;

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