Compare commits

...

533 Commits

Author SHA1 Message Date
Electron Bot
979e59e871 Bump v9.3.4 2020-11-09 12:28:27 -08:00
Shelley Vohr
1384b76570 fix: draggable region edge calculation on resize (#26322)
* fix: draggable region edge calculation on resize

* Feedback from review
2020-11-04 11:17:24 +09:00
Shelley Vohr
1ba30ace9b build: only check patch diffs in testing builds (#26285)
* build: only check patch diffs in testing builds

* Fixup patch indices
2020-11-02 18:57:11 +09:00
Shelley Vohr
8326cea7e7 fix: draggable regions exclusively on BrowserViews (#26261) 2020-11-02 16:08:20 +09:00
David Sanders
e6b24a21e4 chore: change some for loops to range-based (#26264) 2020-10-29 20:51:59 -07:00
Jeremy Rose
a9b1f2fd0e chore: cherry-pick f440137cd96a from chromium (#26210) 2020-10-29 10:43:22 -07:00
trop[bot]
0563bcad49 fix: hover text only working when VO enabled (#26244)
* fix: hover text only working when VO enabled

* chore: simplify conditional

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-29 08:51:20 -07:00
David Sanders
a64a3e8aa9 chore: use auto to avoid repeating type (#26256) 2020-10-29 08:50:32 -07:00
Cheng Zhao
f1ffcb56d9 fix: set app locale after user's script is loaded (#26242) 2020-10-28 20:23:03 -07:00
Jeremy Rose
f3af287d4a chore: cherry-pick 30261f9de11e from chromium (#26204) 2020-10-28 15:42:29 -07:00
Jeremy Rose
305d623570 chore: cherry-pick 6a4cd97d6691 from v8 (#26207) 2020-10-28 14:38:46 -07:00
Jeremy Rose
c8d7be4a09 chore: cherry-pick 88f263f401b4 from chromium (#26197) 2020-10-28 14:38:12 -07:00
Jeremy Rose
e3d1a3163f chore: cherry-pick 6aa1e71fbd09 from v8 (#26200) 2020-10-28 14:03:49 -07:00
Jeremy Rose
8261e580ae chore: cherry-pick 229fdaf8fc05 from chromium (#26194) 2020-10-28 14:02:49 -07:00
Jeremy Rose
d007efa5e8 chore: cherry-pick 1ed869ad4bb3 from chromium (#26191)
* chore: cherry-pick 1ed869ad4bb3 from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-28 16:07:38 -04:00
Charles Kerr
a1e9b973b1 perf: improve heap snapshot performance (#26228)
Fixes #24509.

cherry-pick 2e2dc98 from v8
2020-10-28 15:58:50 -04:00
Jeremy Rose
eca3138e10 chore: cherry-pick 9591642a0896 from pdfium (#26213)
* chore: cherry-pick 9591642a0896 from pdfium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-28 15:21:42 -04:00
trop[bot]
8443cf143b docs: fix app 'ready' event arguments (#26175)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-26 20:37:59 -07:00
trop[bot]
b7584fa0e8 chore: prefer empty() check for readability (#26169)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-10-26 20:36:59 -07:00
Electron Bot
0b5f24002b Bump v9.3.3 2020-10-26 09:39:50 -07:00
Shelley Vohr
dcb5b8244e ci: cleanup up test app directories (#26121)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2020-10-24 18:49:06 -05:00
trop[bot]
6785021927 fix: setSimpleFullScreen shows traffic light in frameless window (#26128)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-23 09:43:08 -07:00
trop[bot]
d073ab64fb fix: return early on promise rejection (#26112)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-10-22 14:45:33 -05:00
trop[bot]
205f9432ee chore: tweak branch detection in release notes. (#26108)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-10-22 14:43:15 -05:00
trop[bot]
b2fb8cd60e fix: release NSAlert properly (#26098)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-10-22 08:22:02 -07:00
Samuel Attard
ab504006e2 revert: reply notifs sometimes destroyed too early (#26083)
This reverts commit cbd91b1fba.
2020-10-21 15:58:43 -07:00
Andrey Belenko
e2ab29fb29 chore: cherry-pick b977dff8 from freetype (#26069)
Co-authored-by: Andrey Belenko <anbelen@microsoft.com>
2020-10-21 13:35:24 -07:00
Shelley Vohr
8837679de6 fix: Save As PDF from PDF Preview (#26067) 2020-10-20 18:59:43 -07:00
Shelley Vohr
ba167e6c86 fix: crash in printing on Windows (#26066) 2020-10-20 16:38:43 -04:00
trop[bot]
1bc5b7f350 perf: remove GC timer that fired once per minute. (#26053)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-10-19 20:19:28 -07:00
trop[bot]
9d72cda6c4 build: fix invocation of cpplint on Windows (#26042)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-10-19 14:19:38 -07:00
Shelley Vohr
6763cca16f fix: pass module resolution paths to wrapped function (#26035)
Co-authored-by: Matt Kane <m@mk.gg>
2020-10-19 12:07:16 -07:00
trop[bot]
599da9c728 fix: correct null pointer checks in autoresizing browser views (#26034)
* Correction null pointer checks

* fix: correct null pointer checks in autoresizing browser views

Co-authored-by: mlaurencin <mlaurencin@microsoft.com>
2020-10-19 12:05:35 -07:00
Shelley Vohr
16db2d7856 fix: disable PDF annotation button (#26004) 2020-10-16 16:02:40 -07:00
trop[bot]
04548770fb fix: maximized frameless window bleeding to other monitors (#25980)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-10-15 20:02:07 -07:00
trop[bot]
ca8cda068d docs: move breaking-changes-ns.md contents to breaking-changes.md (#25948)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-15 10:50:59 +09:00
Pedro Pontes
b4f7463215 chore: cherry-pick 8629cd7f8af3 from chromium (#25857)
* chore: cherry-pick 8629cd7f8af3 from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-15 10:07:16 +09:00
Pedro Pontes
1efe79b874 chore: backport ffed0925f2 from webrtc. (#25854) 2020-10-15 10:06:30 +09:00
Shelley Vohr
e58853af3d docs: rename launch-failure -> launch-failed to match C++ code (#25930) 2020-10-14 10:56:12 -05:00
Pedro Pontes
437701d0ef chore: cherry-pick 3b5f65c0aeca from chromium (#25859)
* chore: cherry-pick 3b5f65c0aeca from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-14 10:20:54 +09:00
Shelley Vohr
13f319eddf fix: uv loop polling when render process reuse enabled (#25924) 2020-10-14 10:18:03 +09:00
Pedro Pontes
88baf5507f chore: cherry-pick f06a6cb3a38e from chromium (#25911)
* chore: cherry-pick f06a6cb3a38e from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-13 10:20:43 -07:00
trop[bot]
2472f81647 fix: NativeImage.getScaleFactors returns correct scales (#25904)
* fix: NativeImage.getScaleFactors returns correct scales

* fix tests

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-10-13 09:21:24 -07:00
Pedro Pontes
40f0c01e15 chore: cherry-pick b7ccc3f6cc from chromium (#25896)
* chore: cherry-pick b7ccc3f6cc from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-12 19:38:21 -07:00
Michaela Laurencin
5e6c03c5c5 fix: notifications successfully never timeout with included flag (#25862)
* Backport changes for notification timeout never to version 9

* fix: notifications successfully never timeout with included flag

Co-authored-by: mlaurencin <mlaurencin@microsoft.com>
2020-10-12 10:55:13 -07:00
Milan Burda
9d3aa08c75 chore: cherry-pick abc6ab85e704 from chromium (#25638)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-10-10 22:12:16 +09:00
Milan Burda
a5a34868d5 chore: cherry-pick adc731d678c4 from chromium (#25641)
Co-authored-by: Milan Burda <miburda@microsoft.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-10-10 10:13:50 +09:00
Milan Burda
c481324725 test: improve app 'session-created' event spec (#25815) 2020-10-09 20:54:05 +09:00
Milan Burda
ea7d9182a1 chore: cherry-pick 7e5c7b5964 from v8 (#25645)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-10-09 20:05:44 +09:00
trop[bot]
143c6b3d39 ci: fixup doc only check on Windows (#25840)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-10-08 21:35:25 -04:00
Robert Borg
86372e642c fix: gdi printing in silent printing mode (#25724)
for windows print_text_with_gdi is set to the value of is_modifiable
but this code path is not taken for silent printing
2020-10-08 09:41:20 -07:00
Electron Bot
09677ab592 Bump v9.3.2 2020-10-05 09:18:53 -07:00
Milan Burda
2cd8848b97 chore: cherry-pick 52dceba66599 from chromium (#25656)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-10-05 09:58:07 +09:00
trop[bot]
82151b4f0d fix: crash when application launched from UNUserNotificationCenter notification (#25739)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-02 13:57:41 -07:00
trop[bot]
37ece8b71a build: move to ACR for docker image storage (#25733)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-10-02 13:28:52 -07:00
Shelley Vohr
e4c2be03b2 fix: close window when leave fs crash (#25605) 2020-09-30 10:49:24 -04:00
Milan Burda
d1735ee2f3 chore: cherry-pick 814a27f8522b from chromium (#25643)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-09-29 16:06:22 -07:00
trop[bot]
4c8eb34bab fix: submenu should be autoreleased (#25689)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-29 15:48:23 -04:00
Milan Burda
14ded68b75 chore: cherry-pick 0e61c69ebd47 from chromium (#25658)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-09-28 10:04:13 -07:00
trop[bot]
220b356233 refactor: add a wrapper for wrangling uv handles. (#25663) 2020-09-27 18:52:01 -07:00
Michaela Laurencin
858d74bc36 fix: prevent destroyed view references from causing crashes (#25609) 2020-09-25 09:42:58 -07:00
trop[bot]
c32cb09a68 chore: improve renderer crash logging (#25620)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-09-24 12:55:54 -07:00
Shelley Vohr
194edd0270 fix: check printer list when no default printers (#25607) 2020-09-23 15:44:23 -07:00
trop[bot]
6c3c9b5a51 fix: unsubscribe from observers when window is closing (#25586)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-23 10:02:19 -04:00
Samuel Maddock
a43d4cacde fix(extensions): devtools now open for background pages (#25567) 2020-09-22 07:12:32 -07:00
trop[bot]
a7372e8f53 fix: app.importCertificate crash on Linux (#25538)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-19 15:24:14 -06:00
Milan Burda
3aa207c2dc build: fix build with enable_pdf_viewer=false (#25494) (#25521) 2020-09-17 20:23:53 -06:00
trop[bot]
f96153a4d1 fix: disable CORS when webSecurity is disabled (#25505)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-17 14:55:56 -06:00
Shelley Vohr
1aeba811cc chore: add V8 crash information to crashReporter (#24864) 2020-09-17 12:08:24 -06:00
trop[bot]
f6dced63b5 fix: ensure ready-to-show event is fired (#25490)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-17 09:42:24 +09:00
Jeremy Rose
489aafc1f9 fix: call node::Stop on exit (#25502) 2020-09-17 09:39:35 +09:00
trop[bot]
a6ed6480d8 fix: update node certdata to NSS 3.56 (#25364)
* fix: update node certdata to NSS 3.56

* Update .patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-09-15 21:52:36 -06:00
trop[bot]
81c1a6ed29 chore: log hint on renderer crash (#25473)
* chore: log hint on renderer crash

* Address feedback from review

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-15 14:01:31 -06:00
Electron Bot
fe3378db92 Bump v9.3.1 2020-09-14 13:10:19 -07:00
Samuel Attard
fe85a94035 fix: handle electron script errors better (#25331) (#25453)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2020-09-14 11:21:23 -07:00
trop[bot]
48779feb91 fix: Ensure electron delay loads the same modules as chromium (#25437)
* Ensure electron delay loads the appropriate modules as chromium on windows

This change adds the same module delay load list that chromium uses for electron.  Some modules were already getting delay loaded from other build files in chromium but not the main list via //build/config/win:delayloads.  We do not include the list of delay loads in delayloads_not_for_child_dll as those have issues being loaded in sandboxes processes.  This will reduce the overall reference set impact of the electron processes.

* fix: Ensure win modules are properly delayloaded

* chore: fix linting

Co-authored-by: Chris Davis <chrisdavis@outlook.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-09-14 09:05:27 -06:00
Cheng Zhao
5e289cee04 chore: cherry-pick 1283160e334f 0dc563cbbca5 from chromium (#25391) 2020-09-14 15:28:53 +09:00
Cheng Zhao
5f4ccec09a chore: cherry-pick c1a7439efcc7 from chromium (#25390) 2020-09-14 11:03:20 +09:00
Cheng Zhao
20f58fddf1 chore: cherry-pick 5e61913985df from chromium (#25389) 2020-09-14 09:50:03 +09:00
Jeremy Rose
75f193a089 fix: memory leak in net.request (#25382) 2020-09-10 11:40:53 +09:00
trop[bot]
7de2539399 fix: bind fake mojo service for badging (#25371)
* fix: bind fake mojo service for badging

* Add a test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-10 09:14:34 +09:00
Charles Kerr
a90397f348 chore: sync 9-x-y release notes script to master (#25305)
* adds the '(Also in N-x-y)' annotations
* handle sublists in release notes (#25279)
* has prepare-release.js catch thrown exceptions (#24923)
* syncs related tests
2020-09-08 20:18:51 +09:00
Eryk Rakowski
6e734570ac feat(extensions): add support for some chrome.management APIs (#25344)
* feat(extensions): add support for some chrome.management APIs (#25098)

* fix: initialize management policy

* fix(extensions): crash when using chrome.management

* test: add tests

* docs: add a note about chrome.management

* fix: lint errors

* fix: lint errors

* fix: remove favicon_service include

* fix: add missing management permission

* docs: more supported apis

* fix: extensions.md line endings

* feat(extensions): add support for some chrome.management APIs (#25098)

* fix: initialize management policy

* fix(extensions): crash when using chrome.management

* test: add tests

* docs: add a note about chrome.management

* fix: lint errors

* fix: lint errors

* fix: remove favicon_service include

* fix: add missing management permission

* docs: more supported apis

* fix: extensions.md line endings

* Update electron_extensions_api_client.cc
2020-09-08 20:12:57 +09:00
Robo
79c1c8d21f fix: avoid creating client_id file for empty DIR_CRASH_DUMPS (#25316) 2020-09-03 18:46:29 -07:00
Cheng Zhao
35b348a7d7 fix: multiple dock icons when calling dock.show/hide (#25301) 2020-09-03 13:06:39 -07:00
Jeremy Rose
213f2fc838 chore: cherry-pick f6cb89728f04 from chromium (#25289) 2020-09-03 11:02:01 -07:00
Electron Bot
fb03807cd2 Bump v9.3.0 2020-09-02 18:08:24 -07:00
Electron Bot
89523b2504 Revert "Bump v9.3.0"
This reverts commit 243dbda31c.
2020-09-02 16:06:01 -07:00
Electron Bot
243dbda31c Bump v9.3.0 2020-09-02 15:02:59 -07:00
Electron Bot
587157e933 Revert "Bump v9.3.0"
This reverts commit 15f9300a64.
2020-09-02 14:51:38 -07:00
Electron Bot
15f9300a64 Bump v9.3.0 2020-09-02 14:23:38 -07:00
Jeremy Rose
88898acfef chore: cherry-pick 72ee7c437c88 from chromium (#25242) 2020-09-02 14:00:58 -07:00
Jeremy Rose
8a69889048 chore: cherry-pick 9ad8c9610d0a from chromium (#25240) 2020-09-02 12:02:49 -07:00
Jeremy Rose
b032c415c1 chore: cherry-pick 0dc563cbbca5 from chromium (#25238) 2020-09-02 11:56:47 -07:00
Jeremy Rose
e8643c1144 chore: cherry-pick 138b748dd0a4 from chromium (#25231) 2020-09-02 11:52:56 -07:00
Jeremy Rose
f8af08c279 chore: cherry-pick 9d100199c92b from chromium (#25229) 2020-09-02 10:31:34 -07:00
Jeremy Rose
713ff4c471 chore: cherry-pick c4f3b713800f from swiftshader (#25265) 2020-09-02 09:48:19 -07:00
Jeremy Rose
99abcba062 chore: cherry-pick af5b008a9546 from angle (#25263) 2020-09-02 09:48:03 -07:00
Jeremy Rose
086086b4e5 chore: cherry-pick bee371eeaf66 from chromium (#25226)
* chore: cherry-pick bee371eeaf66 from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-09-02 10:00:49 +09:00
Jeremy Rose
6e7425164f chore: cherry-pick e50772b2a25e from skia (#25245) 2020-09-01 14:21:06 -07:00
Jeremy Rose
4a03aa5bd2 chore: cherry-pick 44bb4d7abee6 from angle (#25233) 2020-09-01 14:19:58 -07:00
Jeremy Rose
99b4fd1ce0 chore: cherry-pick 9746a4cde14a from chromium (#25225)
* chore: cherry-pick 9746a4cde14a from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-09-01 14:17:47 -07:00
Jeremy Rose
a60211333c chore: cherry-pick 6b9a07d9eb9b from chromium (#25223) 2020-09-01 14:17:13 -07:00
trop[bot]
732ce44e61 chore: force source code and markdown files to use LF line ending (#25177)
* chore: force source code and markdown files to use LF line ending

* chore: replace CRLF with LF

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-01 12:48:07 +09:00
Robo
0f70d096fc fix: crash when using v8 cpu_profiler with wasm in the renderer (#25220)
* fix: crash when using v8 cpu_profiler with wasm in the renderer

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-08-31 13:15:11 -07:00
Robo
56cde790e1 fix: Avoid loading DRI via GBM when GpuMemoryBuffers are disabled (#25221) 2020-08-31 13:04:31 -07:00
Robo
7dc7b3627f fix: client area inset calculation when maximized for framless windows (#25052) (#25218)
* adopt per monitor scale factor

* fix: client area inset calculation when maximized

* address review feedback

* pass correct glass insets to GetDwmFrameInsetsInPixels

* remove unused code

* Windows 8 and 10 use the same DWM frame calculation

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

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-31 11:22:25 -07:00
trop[bot]
123f4087ca docs: fix supported platforms of powerMonitor (#25215)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-31 10:15:14 -07:00
Shelley Vohr
b5720bb2b8 feat: reinvigorate visibleOnFullscreen option (#25126) 2020-08-28 11:41:43 -07:00
trop[bot]
84f05ee0a4 fix: do not reset process_id in URLLoaderFactoryParams (#25179)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-28 11:37:27 -07:00
trop[bot]
694e8d8e66 fix: save dialog extensions should be deterministic (#25194)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-28 10:34:33 -07:00
Milan Burda
1529bf7ce5 fix: register for connected standby changes (#25076) (#25165)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-28 10:17:00 +09:00
Markus Olsson
d688b77187 fix: make shell.moveItemToTrash return false on Windows when move is unsuccessful (#25169)
* test: add tests for shell.moveItemToTrash (#25113)

* fix: make shell.moveItemToTrash return false on Windows when move unsuccessful (#25124)

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-08-27 13:07:19 -07:00
trop[bot]
7651036bce feat: expose currencyCode on Product struct in IAP module (#25085)
Co-authored-by: Shur Singh <ssingh@evernote.com>
2020-08-27 11:46:49 -07:00
Shelley Vohr
294825837c fix: save normal window bounds when maximizing (#25133)
* fix: save normal window bounds when maximizing

* fix: prevent maximize being emitted twice

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-25 22:08:26 -07:00
Samuel Attard
945defd47e refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25109)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)

* refactor: wire will-navigate up to a navigation throttle instead of OpenURL

* spec: add test for x-site _top navigation

* chore: old code be old
2020-08-25 19:22:13 +09:00
trop[bot]
cbd91b1fba fix: reply notifs sometimes destroyed too early (#25101)
* fix: reply notifs sometimes destroyed too early

* Fix windows build

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-24 08:47:30 -07:00
Eryk Rakowski
1aebbe9538 fix(extensions): enable WebSQL in background pages (#25070)
* fix(extensions): enable WebSQL in background pages

* fix: remove trailing spaces
2020-08-21 10:40:05 -07:00
trop[bot]
508d2cb1f5 fix: calculate frame when setting window placement (#25045)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-20 08:46:12 -07:00
trop[bot]
f769da64ad fix: enable TLS renegotiation in node (#25041)
* fix: enable TLS renegotiation in node

* Update .patches

* update patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-08-19 19:35:47 -07:00
Jeremy Rose
e16decd6a1 chore: cherry-pick 70579363ce7b from chromium (#25024)
* chore: cherry-pick 70579363ce7b from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-08-19 12:38:54 -07:00
Electron Bot
03c7a54dc5 Bump v9.2.1 2020-08-18 10:36:50 -07:00
Robo
eefcbda641 fix: [a11y] Allow focus to move into an editable combobox's listbox (#25004) 2020-08-18 10:33:08 -07:00
Eryk Rakowski
ea118c3984 fix(extensions): bypass cors in requests made from background pages (#24915) 2020-08-18 16:42:21 +09:00
trop[bot]
b204da6603 build: upload windows breakpad symbols (#25007)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-08-17 22:27:28 -07:00
Daniel White
cf321a9b55 chore: cherry-pick fix from chromium issue 1113227 (#24997) 2020-08-17 21:58:19 -07:00
trop[bot]
358d6e1116 fix: pdf download not working (#24996)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-17 19:49:37 -07:00
Jeremy Rose
12934c911f fix: browser contexts live forever (#25002) 2020-08-17 19:49:17 -07:00
trop[bot]
e2c4e341cc fix: loading dedicated/shared worker scripts over custom protocol (#24750)
* fix: add patch to avoid crash in worker with nodeintegration enabled

[worker_global_scope.cc(111)] Check failed: url_.IsValid().

* update patches

* ProtocolRegistry does not exist yet

* use custom partition for sw tests

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-17 14:41:57 -04:00
trop[bot]
79f6ba4b18 fix: use non-symbols in isURLInstance check (#24862) 2020-08-17 08:55:34 -07:00
Pedro Pontes
3e835c1247 chore: cherry-pick c7c412a36c from webrtc (#24887) 2020-08-10 21:07:09 -07:00
Pedro Pontes
91849fccbe chore: cherry-pick 26df3fdc25 from v8 (#24885) 2020-08-10 20:24:16 -07:00
trop[bot]
8dc38cb973 fix: send guid with linux crashes (#24898) 2020-08-10 13:45:24 -07:00
trop[bot]
f799b6eb37 build: ensure symbol files are named lowercase on disk so that boto can find them (#24858)
* build: ensure symbol files are named lowercase on disk so that boto can find them

* build: only do the lower case symbol copy on case sensitive file systems (#24876)

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-08-07 13:51:49 -07:00
trop[bot]
7063ba73df fix: do not render inactive titlebar as active on Windows (#24873)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-06 20:46:59 -07:00
Jeremy Rose
f01bb5f43b fix: increase max crash key value length (#24854) 2020-08-06 08:02:46 -07:00
Electron Bot
0c2cb59b62 Bump v9.2.0 2020-08-05 11:36:24 -07:00
Electron Bot
310495212a Revert "Bump v9.2.0"
This reverts commit c7e00b933f.
2020-08-05 11:35:26 -07:00
Electron Bot
c7e00b933f Bump v9.2.0 2020-08-05 10:28:20 -07:00
trop[bot]
81d26ac1b7 fix: duplicate suspend/resume events (#24845)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-05 10:25:47 -07:00
trop[bot]
a5795824ef feat: add worldSafe flag for executeJS results (#24712)
* feat: add worldSafe flag for executeJS results

* chore: do not log warning for webContents.executeJS

* Apply suggestions from code review

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

* chore: apply PR feedback

* chore: split logic a bit

* chore: allow primitives through the world safe checl

* chore: clean up per PR feedback

* chore: flip boolean logic

* chore: update per PR feedback

* chore: fix typo

* chore: fix spec

* Update web-frame.ts

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-08-05 12:08:03 -04:00
Robo
0107cab3d1 fix: save crash reports locally when uploadToServer: false on linux (#24778) (#24788)
* fix: generate dumps under crashDumps folder in linux

* Update spec-main/api-crash-reporter-spec.ts

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

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-07-30 23:20:52 -07:00
trop[bot]
f65756bd4f build: upload sentry src bundles on windows as well (#24784)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-07-29 13:59:18 -07:00
Samuel Attard
05343a8972 fix: ensure that errors thrown in the context bridge are created in the correct context (#24747) 2020-07-28 22:26:46 -07:00
Jeremy Rose
72d921e453 fix: wrap OnWindowMessage w/ handlescope (#24769)
* fix: wrap OnWindowMessage w/ handlescope (#24716)

* Update electron_api_top_level_window.cc
2020-07-28 20:34:26 -07:00
Robo
7564453101 chore: cherry-pick 2469d759e3fe from chromium (#24765)
* chore: cherry-pick 2469d759e3fe from chromium

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-07-28 17:53:36 -07:00
trop[bot]
720e49d73d fix: crash when navigating from a page with webview that has inherited zoom level (#24764)
* fix: cleanup webview zoom level observers on navigation

* add spec

* webview should be on same partition

* wait for webview to finish loading

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-07-28 15:52:36 -07:00
Electron Bot
faf9434e32 Bump v9.1.2 2020-07-28 13:09:54 -07:00
Samuel Attard
3b682d6a98 perf: pass primitives directly through the context bridge, avoids copying (#24531) (#24746) 2020-07-28 13:03:54 -07:00
trop[bot]
8280b2bfbb fix: disable rosetta as Electron does not run under rosetta (#24745)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-07-28 10:56:56 -07:00
trop[bot]
9350e93520 fix: remove corner mask override to increase window resize performance (#24702)
* fix: remove corner mask override to increase window resize performance

* uses corner mask only for vibrant view

Co-authored-by: gellert <gellert.hegyi@around.co>
2020-07-23 19:46:34 +09:00
trop[bot]
72b4d197be fix: Allow VoiceOver to navigate "back into" web contents (#24699)
* fix: Use ElectronAdaptedContentView

* fix: Actually, nevermind, it's "BrowserAccessebilityCocoa"

* chore: Remove things instead of manually keeping them

Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2020-07-22 17:42:21 -07:00
trop[bot]
00be927ad6 fix: Close protocol response streams when aborted (#24657)
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2020-07-20 19:08:55 -07:00
Electron Bot
88d54af01e Bump v9.1.1 2020-07-20 12:47:24 -07:00
Shelley Vohr
d7b6d3ffa3 fix: broken --trace-sync-io flag in Node.js (#24648) 2020-07-20 12:45:31 -07:00
Cheng Zhao
9307bf2414 chore: cherry-pick fix from chromium issue 1042986 (#24624) 2020-07-20 13:56:14 +09:00
Cheng Zhao
539b5c5418 chore: cherry-pick fix from chromium issue 1016278 (#24620) 2020-07-20 11:53:53 +09:00
Cheng Zhao
06b8c9b36d chore: cherry-pick fix from chromium issue 1074340 (#24621) 2020-07-20 09:57:12 +09:00
Cheng Zhao
f6402150fa chore: cherry-pick fix from chromium issue 1073409 (#24625) 2020-07-18 09:47:00 +09:00
Cheng Zhao
44341c2c50 chore: cherry-pick fix from chromium issue 978779 (#24617) 2020-07-18 09:45:58 +09:00
Cheng Zhao
3fad4f2afa chore: cherry-pick fix from chromium issue 986051 (#24614) 2020-07-18 09:45:16 +09:00
Cheng Zhao
61ae10ab4d chore: cherry-pick fix from chromium issue 1065731 (#24594) 2020-07-17 12:52:23 +09:00
Cheng Zhao
9ddc69b496 chore: cherry-pick fix from chromium issue 1080481 (#24586) 2020-07-17 08:47:44 +09:00
Cheng Zhao
3e257c7a2d chore: cherry-pick fix from chromium issue 1081722 (#24582) 2020-07-16 12:40:11 -07:00
Cheng Zhao
f79b489baa chore: cherry-pick fix from chromium issue 1076703 (#24563) 2020-07-16 18:36:57 +09:00
Cheng Zhao
df1e7a0816 chore: cherry-pick fix from chromium issue 1090543 (#24569) 2020-07-16 15:09:05 +09:00
Cheng Zhao
a9c419a8cc chore: cherry-pick fix from chromium issue 1074317 (#24560) 2020-07-16 12:48:20 +09:00
Cheng Zhao
a20dae7e3f chore: cherry-pick fix from chromium issue 1065122 (#24557) 2020-07-16 09:56:23 +09:00
Cheng Zhao
fbf024dba4 chore: cherry-pick fix from chromium issue 1084820 (#24566) 2020-07-16 08:31:30 +09:00
Cheng Zhao
2c08cc711f chore: cherry-pick fix from chromium issue 1091404 (#24572) 2020-07-15 16:10:41 -07:00
Cheng Zhao
98b44f86cb chore: cherry-pick fix from chromium issue 1087629 (#24554) 2020-07-16 08:08:23 +09:00
Shelley Vohr
8ad7e2213d fix: default to simplex for printing DuplexMode (#24547) 2020-07-15 06:18:14 -04:00
Shelley Vohr
4e202b8bd0 fix: Node.js cpu and heap profiling (#24541)
* fix: Node.js cpu and heap profiling

* chore: emable more now-working Node.js specs
2020-07-14 12:58:19 -07:00
trop[bot]
99bbec4487 fix: use default NSVisualEffectState (#24533)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-13 22:06:53 -07:00
Shelley Vohr
f59d898f5c fix: always callback error with invalid print settings (#24508)
* fix: always callback error with invalid print settings

* fixup printing patch

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-07-13 17:19:51 -04:00
trop[bot]
6d34d0759d docs: fix incorrect formatting in browser docs. (#24516)
Address incorrect typing for isEnabled. The root cause of this was due
to missing backticks which caused the docs parser to think that the
return type of the `isEnabled` function was null, where it was supposed
to be a boolean type.

The side effect of this was that the generated typescript typings were
incorrect for this function.

Fixes #24409

Co-authored-by: Sam Saccone <samccone@gmail.com>
2020-07-13 08:56:54 -07:00
trop[bot]
4737ea8a6d fix: clipboard.readBuffer returning empty value (#24469)
Co-authored-by: Deepak Mohan <hop2deep@gmail.com>
2020-07-08 17:26:22 -07:00
trop[bot]
579bfa9403 fix: uv_walk crash on web worker close (#24464)
* fix: uv_walk crash on web worker close

* Use DCHECK_EQ

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-08 13:19:13 -07:00
Electron Bot
a822d2639a Bump v9.1.0 2020-07-06 12:39:46 -07:00
trop[bot]
9d6ac058c9 feat: expose sessionId in debugger module (#24398)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-07-06 15:37:52 -04:00
trop[bot]
cbe66f27e7 fix: intermittent 100% CPU usage on macOS (#24415)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-06 09:37:17 -07:00
Milan Burda
4f10bde056 feat: implement systemPreferences.getMediaAccessStatus() on Windows (#24275) (#24312) 2020-07-06 09:32:45 -07:00
trop[bot]
473c7dbe73 chore: use node_bindings loop for clarity (#24418)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-03 18:47:04 -07:00
trop[bot]
4515c4db00 feat: add app render-process-gone event (#24315)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-07-03 16:35:16 -07:00
trop[bot]
6dd394a155 fix: remove same-tag notifications before showing new ones (#24406)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-03 07:13:22 -07:00
Milan Burda
4ace4995c8 feat: MessagePorts in the main process (#24323)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-07-02 08:37:09 -07:00
trop[bot]
71e329663e feat: add new render-process-gone event (#24309)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-07-01 16:49:53 -07:00
trop[bot]
67002fdf11 fix: macOS modal focus (#24354)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-29 15:49:26 -07:00
Electron Bot
348b2fb9de chore: bump chromium in DEPS to 83.0.4103.122 (#24339) 2020-06-29 09:21:08 -07:00
trop[bot]
f6ce6cafed feat: support suspend/resume on macOS (#24294)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-29 09:05:35 -07:00
trop[bot]
76072270b5 feat: support suspend/resume on Windows (#24283)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-29 09:04:28 -07:00
Electron Bot
c1842ab6ed chore: bump chromium in DEPS to 83.0.4103.121 (#24332) 2020-06-27 07:55:47 -07:00
trop[bot]
1e38fb1a8d build: minify internal JS code (#24273)
* chore: minify internal JS code

* chore: upgrade webpack

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-25 21:19:56 -07:00
Electron Bot
42efa2ad04 Bump v9.0.6 2020-06-24 14:01:03 -07:00
trop[bot]
8b61d26a70 fix: frameless vibrant modals shouldn't bezel (#24285)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-24 10:15:22 -07:00
Jeremy Rose
783590276e fix: backport nodejs/node#33682 (#24267) 2020-06-24 00:58:11 -07:00
trop[bot]
f7b6249d00 fix: only notify mouse-up on mouse-up (#24259)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-23 09:20:00 -07:00
Electron Bot
28350b4e00 Bump v9.0.5 2020-06-22 10:50:19 -07:00
Samuel Attard
31e8b9f4ba build: remove dead symlink from MAS build (#24158) (#24238)
* build: remove dead symlink from MAS build

* chore: new out cache

* build: fixup gn check

* Update node_main.cc

* chore: fix lint
2020-06-22 10:41:01 -07:00
trop[bot]
06902de06b fix: emit click events with tray context menu (#24236)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-22 09:15:05 -07:00
Electron Bot
f92b42eda5 chore: bump chromium in DEPS to 83.0.4103.119 (#24234) 2020-06-22 08:58:16 -07:00
trop[bot]
3704dc9284 fix: isTrustedSender() in test-app (#24232)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-06-22 08:23:52 -07:00
Electron Bot
d321e2940e chore: bump chromium to 83.0.4103.118 (9-x-y) (#24219)
* chore: bump chromium in DEPS to 83.0.4103.117

* chore: bump chromium in DEPS to 83.0.4103.118
2020-06-21 12:41:04 -07:00
Electron Bot
305d75516b chore: bump chromium in DEPS to 83.0.4103.115 (#24210) 2020-06-19 16:44:27 -07:00
Electron Bot
5d18005338 chore: bump chromium in DEPS to 83.0.4103.114 (#24198) 2020-06-18 09:39:25 -07:00
trop[bot]
ee27523363 fix: do not use CONTEXT_MENU flag for tray menu (reland) (#24193) 2020-06-18 08:35:13 -07:00
trop[bot]
368f583399 fix: volume key globalShortcut deregistration (#24155)
Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-06-17 21:45:48 -07:00
trop[bot]
f6d3c565fe Make pasteandmatchstyle accelerator OS specific (#24185)
Co-authored-by: Elena Topaka <el1topa@gmail.com>
2020-06-17 21:43:56 -07:00
Robo
f11aad0784 fix: let Node.js perform microtask checkpoint in the main process (#24131) (#24178)
* fix: let Node.js perform microtask checkpoint in the main process

* fix: don't specify v8::MicrotasksScope for explicit policy

* fix: remove checkpoint from some call-sites

We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.

* fix: remove checkpoint from some call-sites

We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.

* fix incorrect specs

* default constructor arguments are considered for explicit mark

* add regression spec
2020-06-17 16:00:56 -07:00
Robo
b0cbf49ee0 chore: cherry-pick c20afc96e36f57 from chromium (#24059) 2020-06-17 12:15:06 -07:00
trop[bot]
f7c4199853 docs: fix MenuItem click handler type (#24177)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-17 11:30:18 -07:00
Electron Bot
4a092ccdf2 chore: bump chromium in DEPS to 83.0.4103.113 (#24172) 2020-06-17 10:32:37 -07:00
Electron Bot
71a104ae48 chore: bump chromium in DEPS to 83.0.4103.112 (#24150) 2020-06-16 09:52:17 -07:00
trop[bot]
284017b22c fix: emit 'shutdown' outside -[NSApplication terminate:] (#24141)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-15 21:02:50 -07:00
trop[bot]
e8e05f7e99 fix: handle non-client area pointer events from pen on Win10 (#24103)
* fix: handle non client pointer events from pen on Win10

* fix trop oops

* update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-06-15 18:57:59 -07:00
Electron Bot
2734773305 chore: bump chromium to 83.0.4103.109 (9-x-y) (#24127)
* chore: bump chromium in DEPS to 83.0.4103.108

* chore: bump chromium in DEPS to 83.0.4103.109
2020-06-15 18:05:34 -07:00
trop[bot]
db7ac3587e fix: correctly handle nexttick scheduling in stream reads (#24082)
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2020-06-15 19:00:47 +09:00
Electron Bot
87d6f6f599 chore: bump chromium to 83.0.4103.107 (9-x-y) (#24098)
* chore: bump chromium in DEPS to 83.0.4103.105

* chore: bump chromium in DEPS to 83.0.4103.107
2020-06-13 08:27:22 -07:00
trop[bot]
496b0f811f fix: showing certificate dialog with no window (#24121)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-13 08:19:44 -07:00
trop[bot]
0d80baf528 fix: fs.readdir should support withFileTypes (#24108)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-12 13:41:48 -07:00
Electron Bot
bcf77df3d9 Bump v9.0.4 2020-06-12 12:34:10 -07:00
Robo
dfc9be60c9 chore: cherry-pick 867fcd45891e from chromium (#24060)
https://chromium-review.googlesource.com/c/chromium/src/+/2134037
2020-06-11 17:22:42 -07:00
Samuel Attard
3d6125894b Revert "fix: do not use CONTEXT_MENU flag for tray menu (#23880)" (#24078)
This reverts commit 26c6c81540.
2020-06-11 14:26:48 -04:00
Robo
d5fe2812ff chore: cherry-pick bc4df9dd11e609e from chromium (#24061) 2020-06-11 10:28:35 -07:00
Electron Bot
13499392e9 chore: bump chromium in DEPS to 83.0.4103.104 (#24068) 2020-06-11 09:54:27 -07:00
trop[bot]
03e7293384 fix: Add .paks for media-internals and webrtc-internals pages (#24058)
* fix: adds paks for media-internals and webrtc-internals pages

* adds tests

Co-authored-by: gellert <gellert.hegyi@around.co>
2020-06-11 09:25:50 -07:00
Cheng Zhao
9a7c2fa2af fix: assign session to remote webContents (#24065)
Co-authored-by: Eryk Rakowski <sentialx@gmail.com>
2020-06-11 10:07:20 -04:00
trop[bot]
974be18991 fix: backport libuv patch for failure to load advapi32 (#24039)
* chore: backport advapi32 libuv fix

* Update .patches

* Update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-11 12:55:42 +09:00
trop[bot]
acd8829190 fix: Allow windows behind macOS elements if frame = false (#24033)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2020-06-11 10:56:10 +09:00
Electron Bot
cc5acfa0ed chore: bump chromium to 83.0.4103.103 (9-x-y) (#24050)
* chore: bump chromium in DEPS to 83.0.4103.103

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-10 13:53:07 -04:00
Electron Bot
604cd3d09b chore: bump chromium in DEPS to 83.0.4103.102 (#24028) 2020-06-09 14:07:14 -04:00
Shelley Vohr
413e41f7db fix: compensate for lazy-loaded circular deps (#23956) 2020-06-08 12:03:18 -04:00
Jeremy Rose
4c485e53a4 fix: throw instead of crash when using ipcRenderer after context released (#23917) (#23978)
* fix: throw instead of crash when using ipcRenderer after context released (#23917)

* meh

* test: reduce flakiness of post-context-release ipc test
2020-06-08 10:57:12 -05:00
trop[bot]
e9427e7b92 fix: add missing isComposing KeyboardEvent property (#23996)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-08 10:55:39 -05:00
Electron Bot
36673bf5e6 chore: bump chromium in DEPS to 83.0.4103.101 (#24013) 2020-06-08 10:48:09 -04:00
Robo
fc9fb0b179 fix: default to NTLM v2 in the network service for POSIX platforms (#23934)
* build: fix for "enable_desktop_capturer = false" (#23864)

* build: fix filenames autogen with new BUILDFLAG syntax (#23952)

* fix: default to NTLM v2 in the network service for POSIX platforms (#23846)

* chore: update patch

Co-authored-by: Alexey Kuzmin <alkuzmin@microsoft.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-07 13:56:08 -07:00
Electron Bot
4ad03dc60a Bump v9.0.3 2020-06-05 11:55:50 -07:00
Electron Bot
72dbe13f76 chore: bump chromium in DEPS to 83.0.4103.100 (#23986) 2020-06-05 11:09:24 -07:00
trop[bot]
e6616d62e0 fix: use acceptLanguages argument in session.setUserAgent() (#23962)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-06-05 10:11:33 -07:00
Electron Bot
aa301f76d9 chore: bump chromium in DEPS to 83.0.4103.99 (#23967) 2020-06-04 16:21:58 -04:00
trop[bot]
058e2e73bb feat: add V8CacheOptions webpreference (#23868)
* feat: add V8CacheOptions webpreference

* address review comments

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-06-04 12:08:40 -04:00
trop[bot]
59538c9b36 fix: Make the --disable-color-correct-rendering switch work again (#23900)
* fix: Make the `--disable-color-correct-rendering` switch work again

This regressed once again in Electron 8 due to Chromium changes.

Test Plan:

- Confirm that test case from https://github.com/electron/electron/pull/15898#issuecomment-443191770 now works

Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`

* update patches

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-03 11:23:53 -07:00
trop[bot]
455228bed5 fix: restore original GTK/appindicator implementation of tray icons (#23926)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-03 11:07:37 -07:00
Electron Bot
f9d18015e0 chore: bump chromium in DEPS to 83.0.4103.98 (#23943) 2020-06-03 10:53:27 -07:00
trop[bot]
8fd0c11513 fix: correctly support the --inspect-brk-node flag (#23920)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-03 17:01:45 +09:00
Electron Bot
d40162e4bd chore: bump chromium to 83.0.4103.97 (9-x-y) (#23907)
* chore: bump chromium in DEPS to 83.0.4103.97

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-02 15:37:31 -04:00
trop[bot]
a57e7eb2e5 docs: default of allowRendererProcessReuse is true (#23913)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-02 12:02:51 -07:00
Electron Bot
12afb18487 Bump v9.0.2 2020-06-02 11:14:21 -07:00
trop[bot]
89340008ee fix: add patch to prevent crash during frame swap with ctx isolation enabled (#23895)
* fix: add patch to prevent crash during frame swap with ctx isolation enabled

* Update .patches

* chore: update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-02 10:52:39 -07:00
trop[bot]
dd7c9fb55b build: make electron renderer init scripts profilable (#23892)
The devtools profiler is not attached at the point we run out init scripts (or our apps preload scripts), we do not really want to change when we run these init scripts but for when a dev is doing performance work it makes sense to give them an option to make the devtools profiler actually work on both our init scripts and their preload script.  This PR adds that logic behind an environment variable ELECTRON_PROFILE_INIT_SCRIPTS.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-01 17:37:54 -07:00
trop[bot]
26c6c81540 fix: do not use CONTEXT_MENU flag for tray menu (#23880)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-01 12:24:29 -05:00
Electron Bot
7f769ec325 Bump v9.0.1 2020-06-01 09:32:10 -07:00
Electron Bot
32ecaae8a8 chore: bump chromium in DEPS to 83.0.4103.94 (#23875) 2020-06-01 11:13:02 -04:00
Electron Bot
7d0cc5edd8 chore: bump chromium to 83.0.4103.93 (9-x-y) (#23858)
* chore: bump chromium in DEPS to 83.0.4103.92

* chore: bump chromium in DEPS to 83.0.4103.93
2020-05-31 14:37:58 -07:00
Electron Bot
c09083b1d8 chore: bump chromium to 83.0.4103.91 (9-x-y) (#23848)
* chore: bump chromium in DEPS to 83.0.4103.91

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-29 15:24:23 -04:00
Shelley Vohr
718bbf137c fix: nativeImage remote serialization (#23796) 2020-05-28 13:21:28 -07:00
trop[bot]
568d38c61a fix: weakly reference MenuModel from MenuController (#23808)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:47:56 -07:00
Electron Bot
68a01398d9 chore: bump chromium in DEPS to 83.0.4103.89 (#23825) 2020-05-28 09:46:55 -07:00
trop[bot]
d0495f5fd4 fix: handle asynchronous URL loading in bw proxy (#23805)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:41:49 -07:00
Alexey Kuzmin
314cfa7aec test: refactor how spec files are collected (#23814)
(cherry picked from commit 3a7775fa73)
2020-05-28 09:41:25 -07:00
trop[bot]
ff4cc4dc16 fix: volume key globalShortcut registration (#23824)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:40:38 -07:00
trop[bot]
af1253392b fix: only bezel frameless windows (#23810)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 08:54:02 -04:00
Cheng Zhao
4f2699f4d9 Revert "fix: trigger activate event when app is activated via app switcher (#23773)" (#23821)
This reverts commit b5baafdab6.
2020-05-28 08:37:00 -04:00
trop[bot]
ca76da9f14 fix: pass correct buffer length (#23801)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-27 13:31:48 -07:00
Electron Bot
0814e72012 chore: bump chromium in DEPS to 83.0.4103.87 (#23790) 2020-05-27 08:41:01 -07:00
trop[bot]
b5baafdab6 fix: trigger activate event when app is activated via app switcher (#23773)
When application is activated thru macOS app switcher (cmd+tab) the
App's activate event is note emitted. The reason is that
`applicationShouldHandleReopen:hasVisibleWindows:` is sent only when app
is activated via Dock. Using `applicationDidBecomeActive:` is handling
all cases properly.

Co-authored-by: Lukas Weber <luweber@microsoft.com>
2020-05-27 09:52:30 +09:00
trop[bot]
0f96402c78 ci: deflake WOA tests (#23770)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-26 08:46:54 -07:00
Electron Bot
5d357e87b4 chore: bump chromium in DEPS to 83.0.4103.86 (#23765) 2020-05-26 08:46:19 -07:00
Electron Bot
448a645128 chore: bump chromium in DEPS to 83.0.4103.85 (#23750) 2020-05-25 12:03:40 -07:00
Electron Bot
7f1e492a68 chore: bump chromium to 83.0.4103.84 (9-x-y) (#23733)
* chore: bump chromium in DEPS to 83.0.4103.82

* chore: bump chromium in DEPS to 83.0.4103.84
2020-05-24 15:34:54 -07:00
Alexey Kuzmin
8803c12715 test: do not run spellchecker tests if the feature is disabled (9-x-y) (#23724)
* test: do not run SpellChecker tests if the features is disabled at build time

* fixup! test: do not run SpellChecker tests if the features is disabled at build time

* fixup! test: do not run SpellChecker tests if the features is disabled at build time
2020-05-23 11:05:37 -07:00
Electron Bot
98033f8520 chore: bump chromium in DEPS to 83.0.4103.81 (#23725) 2020-05-22 21:09:02 -07:00
trop[bot]
be6c102fa1 fix: trigger about panel for about role on on win (#23715)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-21 21:09:05 -04:00
trop[bot]
85aa3e9c3e fix: read GTK dark theme setting on Linux (#23712)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 20:39:29 -04:00
trop[bot]
2a5c92f534 test: multiple processes may crash in crashReporter test (#23705)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 15:41:06 -07:00
trop[bot]
525179dbfc docs: errors in isolated world are not dispatched (#23706)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 15:40:46 -07:00
Electron Bot
55c4de8723 chore: bump chromium in DEPS to 83.0.4103.77 (#23700) 2020-05-21 12:42:08 -07:00
Alexey Kuzmin
2241b146a0 test: call "expect()" on a correct call stack (#23696)
(cherry picked from commit 33d6a99d40)
2020-05-21 11:42:41 -04:00
Charles Kerr
14945be56c fix: don't run environment bootstrapper (#23689)
* chore: remove node "split CreateEnvironment" patch

* chore: remove `environment.js` from electron-node

* chore: don't call the electron-node API we removed

* fix: don't prepareMainExecution twice

* test: re-enable some node tests

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-21 11:27:34 -04:00
trop[bot]
0aa104ed9c fix: make sure hunspell file is not destroyed in UI thread (#23660)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 10:27:25 -04:00
LuoJinghua
c21c9b64e2 net: Don't ignore the referer header in net.request (#23685) 2020-05-20 20:27:27 -04:00
Electron Bot
935f5ca081 chore: bump chromium in DEPS to 83.0.4103.76 (#23679) 2020-05-20 09:41:09 -07:00
trop[bot]
a02d3c80a0 feat: add enableWebSQL webpreference (#23580)
* feat: add enableWebSQL webpreference

* chore: update indexedDB test

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-19 15:44:14 -04:00
Electron Bot
0b12642826 chore: bump chromium in DEPS to 83.0.4103.75 (#23657) 2020-05-19 11:18:41 -07:00
trop[bot]
011b2733d6 build: save mksnapshot args on Windows (#23641)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-19 09:28:40 -04:00
Milan Burda
90833d372f build: allow use of BUILDFLAG directives from within JS code (#23496) 2020-05-19 09:26:59 -04:00
trop[bot]
69a343e276 refactor: improve MoveItemToTrash error description (#23628)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-18 18:35:32 -07:00
Electron Bot
4da01641ce Bump v9.0.0 2020-05-18 14:17:08 -07:00
Charles Kerr
9d46395940 refactor: revert release notes changes (#23649)
* refactor: undo the "look harder for commit PRs" notes changes

* chore: chmod +x the notes script
2020-05-18 16:12:09 -05:00
Electron Bot
67a905c090 Revert "Bump v9.0.0"
This reverts commit dcdca6a014.
2020-05-18 13:37:51 -07:00
Electron Bot
dcdca6a014 Bump v9.0.0 2020-05-18 13:36:41 -07:00
Charles Kerr
7db9c35fa8 fix: eat octokit 422 errs when scraping commit PRs (#23643) 2020-05-18 16:33:23 -04:00
Electron Bot
5c03d05b8e Revert "Bump v9.0.0"
This reverts commit 0ac262dc2d.
2020-05-18 13:16:26 -07:00
Electron Bot
0ac262dc2d Bump v9.0.0 2020-05-18 13:04:48 -07:00
trop[bot]
4de54b412f ci: use longer mocha timeout on WOA testing (#23636)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-18 14:07:30 -04:00
Electron Bot
29af2312ca Revert "Bump v9.0.0-beta.25"
This reverts commit 1a4c34bb13.
2020-05-18 08:42:10 -07:00
Electron Bot
1a4c34bb13 Bump v9.0.0-beta.25 2020-05-18 08:32:13 -07:00
Electron Bot
8556eaab9b chore: bump chromium to 83.0.4103.64 (9-x-y) (#23623)
* chore: bump chromium in DEPS to 83.0.4103.61

* chore: bump chromium in DEPS to 83.0.4103.62

* chore: bump chromium in DEPS to 83.0.4103.64
2020-05-18 11:03:53 -04:00
trop[bot]
b22c44fef7 test: skip remote module related tests when enable_remote_module = false (#23568)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-18 10:45:38 +09:00
trop[bot]
c084b128dc fix: exclude crashpad_handler binary on linux (#23575)
* fix: exclude crashpad_handler binary on linux

* Update build/zip.py

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-05-18 10:30:30 +09:00
trop[bot]
fcf50849f3 test: remove usage of the remote module from tests (#23577)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-18 10:29:52 +09:00
trop[bot]
9988beabb5 feat: look harder for a commit's pull request. (#23596)
PR numbers are almost always listed parenthetically in the commit message;
but when something is committed manually, it could be missing. This change
uses octokit's listPullRequestsAssociatedWithCommit() as a second approach
to finding a commit's PR.

Last night's Releases WG meeting noted that "re-enable pdf viewer" was
missing from the notes. This PR fixes that omission.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-05-18 10:12:09 +09:00
trop[bot]
32bc081ba5 build: remove unused header from a patch (#23590)
It can cause build failures because the header is generated
and there's no explicit dependency on a target that creates it.

Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-05-17 08:53:52 -07:00
Samuel Attard
320487080f refactor: remove the RenderFrameFunctionStore and use privates to memory manage (#23592) (#23617) 2020-05-15 16:33:44 -07:00
Electron Bot
a143339d35 chore: bump chromium in DEPS to 83.0.4103.59 (#23606) 2020-05-15 12:44:33 -07:00
Electron Bot
9011d5e7fc chore: bump chromium in DEPS to 83.0.4103.57 (#23588) 2020-05-14 19:37:57 -04:00
Electron Bot
73e1fceb39 Revert "Bump v9.0.0-beta.25"
This reverts commit 3dbebcb285.
2020-05-14 09:06:05 -07:00
Electron Bot
3dbebcb285 Bump v9.0.0-beta.25 2020-05-14 08:33:20 -07:00
trop[bot]
3a51ee5ce5 fix: generate symbols for the correct crashpad handler binary (#23573)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-05-14 10:42:59 -04:00
trop[bot]
a3256facea fix: leave behind the unmodified XDG_CURRENT_DESKTOP variable (#23554)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-05-13 12:37:50 -04:00
Electron Bot
3698f000c2 chore: bump chromium in DEPS to 83.0.4103.56 (#23559) 2020-05-13 09:12:41 -07:00
Milan Burda
810b54854a fix: expose v8util.createIDWeakMap() regardless of enable_remote_module (#23546) (#23556) 2020-05-13 09:12:15 -07:00
trop[bot]
56e84acab9 build: use correct v8_context_snapshot_generator in mksnapshot zip (#23540)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-13 09:40:44 -04:00
trop[bot]
8252565979 fix: run Node.js at-exit callbacks in renderer proc (#23544)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-12 18:32:29 -07:00
trop[bot]
169c87bfc1 fix: do not destroy thread in UI thread (#23535)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-13 09:18:52 +09:00
trop[bot]
cded93ae8e build: fix building with enable_remote_module = false (#23533)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-13 09:18:41 +09:00
Electron Bot
ab34627723 chore: bump chromium in DEPS to 83.0.4103.53 (#23524) 2020-05-12 14:18:07 -07:00
trop[bot]
d313998cdb test: skip "handles Promise timeouts correctly" when ELECTRON_RUN_AS_NODE is disabled (#23500)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-12 09:53:04 -05:00
Electron Bot
b8460f11fa chore: bump chromium to 83.0.4103.50 (9-x-y) (#23469)
* chore: bump chromium in DEPS to 83.0.4103.46

* chore: bump chromium in DEPS to 83.0.4103.48

* chore: bump chromium in DEPS to 83.0.4103.49

* chore: bump chromium in DEPS to 83.0.4103.50

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-11 14:17:18 -04:00
Alexey Kuzmin
6d75e7aac6 spec: fix conditions for some tests (#23489) (#23494)
(cherry picked from commit dc3de49a08)
2020-05-11 12:08:25 -04:00
Electron Bot
8cf55a674e Bump v9.0.0-beta.24 2020-05-11 08:31:56 -07:00
Erick Zhao
4542e2eef9 docs: document supported extensions apis (#22021) (#23434)
* docs: document supported extensions apis

* Update extensions.md

* Update README.md

* Apply suggestions from code review

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-05-11 10:49:32 +09:00
trop[bot]
5009538045 fix: do not initialize extension system in in-memory sessions (#23472)
* fix: do not initialize any extension related logic in OffTheRecord contexts

* chore: fix linting

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-05-08 12:43:07 -07:00
Jeremy Apthorp
2f8150891b fix: crashReporter incompatible with sandbox on Linux (#23265) (#23461) 2020-05-08 11:41:42 -07:00
Charles Kerr
4b9df8c248 feat: add force option to app.focus() (#22612) (#23447)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-07 12:16:24 -07:00
trop[bot]
0920d01c9c fix: multiple extension filters on macOS (#23450)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-07 11:57:45 -07:00
Electron Bot
520e0bcc43 chore: bump chromium in DEPS to 83.0.4103.45 (#23446) 2020-05-07 08:56:40 -07:00
Electron Bot
6be41c2f8e Bump v9.0.0-beta.23 2020-05-07 08:32:03 -07:00
Electron Bot
b997c562f7 chore: bump chromium in DEPS to 83.0.4103.44 (#23424) 2020-05-06 11:00:45 -07:00
Electron Bot
2c9fe0b951 chore: bump chromium to 83.0.4103.42 (9-x-y) (#23416)
* chore: bump chromium in DEPS to 83.0.4103.42

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-05 10:35:19 -07:00
Charles Kerr
4445182739 chore: remove redundant release note items. (#23408)
Backport of #23335. See that PR for details.
2020-05-05 08:38:16 -07:00
Charles Kerr
e549aec5fc fix: respect system language preferences on Win/macOS (#23247) (#23405)
This commit fixes https://github.com/electron/electron/issues/18829

Previously the full preferences set to OS was not given to Chromium.

Also, this commit improves fallback font selection for CJK text.
Chromium uses browser languages to determine fallback fonts on Windows,
especially kanji/han characters in CJK.

For instance, when user sets 'en-US, ja-JP' to Accept-Language,
while Chromium chooses Japanese font for kanji text, but Electron
chooses Chinese font.  This is because only the first language was given
to Accept-Language on Electron.

This patch is based on https://github.com/electron/electron/pull/15532

Co-authored-by: Nitish Sakhawalkar <nitsakh@icloud.com>
Co-authored-by: Kasumi Hanazuki <kasumi@rollingapple.net>

Co-authored-by: Nitish Sakhawalkar <nitsakh@icloud.com>
Co-authored-by: Kasumi Hanazuki <kasumi@rollingapple.net>

Co-authored-by: Sorah Fukumori <her@sorah.jp>
Co-authored-by: Nitish Sakhawalkar <nitsakh@icloud.com>
Co-authored-by: Kasumi Hanazuki <kasumi@rollingapple.net>
2020-05-04 19:41:17 -07:00
trop[bot]
c1311480c0 fix: guard pdf behind correct buildflags (#23406)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-04 19:38:24 -07:00
Shelley Vohr
6c78c9274a refactor: return null when passing empty menu templates (#23401) 2020-05-04 14:39:58 -05:00
Electron Bot
d50fb2938b chore: bump chromium to 83.0.4103.41 (9-x-y) (#23378)
* chore: bump chromium in DEPS to 83.0.4103.38

* chore: bump chromium in DEPS to 83.0.4103.39

* chore: bump chromium in DEPS to 83.0.4103.40

* chore: bump chromium in DEPS to 83.0.4103.41
2020-05-04 08:13:12 -07:00
trop[bot]
5414c8dd7e fix: hold browser_context instead of render_frame_host to fix lifetime issues (#23375)
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2020-05-03 16:19:52 -07:00
trop[bot]
ee68e1a787 fix: ensure guest-embedder map is updated when webview is removed (#23374)
There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: https://github.com/microsoft/vscode/issues/92420

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-01 12:32:35 -07:00
Charles Kerr
e3d4f999ca fix: undo and redo broken in webviews (#23370)
* fix: undo and redo broken in webviews

Backport upstream fix https://chromium-review.googlesource.com/c/chromium/src/+/2135187 to 9-x-y.

* chore: re-run git-export-patches to refresh patch
2020-04-30 17:18:27 -05:00
trop[bot]
b62df312f2 docs: event.newGuest for new-window in WebContents and webContents in BrowsweWindow's constructor (#23356)
* docs: `newGuest` in `WebContents` and `webContents` in `BrowsweWindow`

According to the example codes in the documentation of `new-window`
event in `WebContents`, `webContents` in `BrowsweWindow` constructor
options and `newGuest` in `event` argument of `new-window` handler are
both existing but documented. This patch is for adding the related
documentations. Also, it provides typescript-definitations for these
two properties.

* Remove the documnent of `webContents` in BrowserWindow constructor option.

Co-authored-by: Sean Lee <sean.l@canva.com>
2020-04-30 15:42:14 -05:00
trop[bot]
9ba491116c ci: make sure msedge isn't running at end of woa test (#23361)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-04-30 14:14:20 -04:00
Electron Bot
c74dd6eee7 chore: bump chromium in DEPS to 83.0.4103.36 (#23348) 2020-04-30 11:02:09 -07:00
Electron Bot
2d888dc7b5 Bump v9.0.0-beta.22 2020-04-30 08:33:00 -07:00
trop[bot]
1024544573 fix: do not leak IPC or context bridge promises (#23338)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-04-29 17:23:25 -07:00
trop[bot]
ebbd3081b9 fix: build when some buildflags are disabled (#23337)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-04-29 16:09:42 -07:00
trop[bot]
dc3dc81beb feat: support fullScreen BrowserWindow property (#23330)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-29 12:16:11 -07:00
Electron Bot
6babb8a9fe chore: bump chromium in DEPS to 83.0.4103.34 (#23326) 2020-04-29 14:06:23 -04:00
trop[bot]
088e23d604 menu-item.md remove duplicate options (#23296)
Co-authored-by: szTheory <szTheory@users.noreply.github.com>
2020-04-28 23:17:11 -07:00
Electron Bot
d0a764bd16 chore: bump chromium to 83.0.4103.31 (9-x-y) (#23270)
* chore: bump chromium in DEPS to 83.0.4103.27

* chore: bump chromium in DEPS to 83.0.4103.28

* chore: bump chromium in DEPS to 83.0.4103.29

* chore: bump chromium in DEPS to 83.0.4103.30

* chore: bump chromium in DEPS to 83.0.4103.31

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-04-28 17:20:24 -07:00
Electron Bot
d47b788e03 Bump v9.0.0-beta.21 2020-04-27 18:23:30 -07:00
Samuel Attard
a985865f65 refactor: port window-setup to use ctx bridge instead of being run in the main world (#23299)
* refactor: port parts of window-setup to use ctx bridge instead of being run in the main world (#23194)

* refactor: port parts of window-setup to use ctx bridge instead of being run in the main world

* chore: update ctx bridge specs for new base numbers

* refactor: port window.open and window.opener to use ctx bridge instead of hole punching (#23235)

* refactor: port window.open and window.opener to use ctx bridge instead of hole punching

* refactor: only run the isolated init bundle when webview is enabled
2020-04-27 14:42:14 -07:00
trop[bot]
729019b974 style: use build/include_directory for NOLINT (#23300)
build/include linter was splitted to build/include_directory at
depot_tools upstream.

https://crrev.com/c/2159690
https://crbug.com/1073191

Co-authored-by: Sorah Fukumori <her@sorah.jp>
2020-04-27 13:28:41 -07:00
Electron Bot
e83d6be20c Bump v9.0.0-beta.20 2020-04-27 08:58:50 -07:00
trop[bot]
69eddfb2f9 fix: set default menu in will-finish-launching event (#23263)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-04-24 20:43:46 +09:00
Electron Bot
71c3c2b65e chore: bump chromium in DEPS to 83.0.4103.26 (#23256) 2020-04-23 14:03:37 -04:00
trop[bot]
cf230bc709 ci: robustify doc only change check (#23259)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-04-23 10:54:46 -07:00
Charles Kerr
6d3a6ce307 docs: minor grammar & spelling fixes (#22851) (#23262) 2020-04-23 10:52:51 -07:00
Charles Kerr
3d8b2af151 refactor: precache the IsWindowStateEvent() XAtom (#22706) (#23260)
* refactor: precache the IsWindowStateEvent() atom

XAtoms never change after creation so we can perload the atoms we need.
This is useful in WindowStateWatcher's XEvent handler, which is called
on every XEvent, e.g. mouse movement...

* empty commit for ci
2020-04-23 10:50:09 -07:00
shelley vohr
45174dfc19 feat: add property support for remainder of BrowserWindow (#23208)
Adds property-based support for the remainder of primitive getter/setter pairs on `BrowserWindow`.

Namely:
- `win.simpleFullScreen`
- `win.title`
- `win.visibleOnAllWorkspaces`
- `win.documentEdited`
- `win.representedFilename`
- `win.shadow`
- `win.kiosk`
- `win.menuBarVisible`
2020-04-23 10:34:20 -07:00
Electron Bot
5bdb5b821b Bump v9.0.0-beta.19 2020-04-23 08:32:16 -07:00
Samuel Attard
0cce079c8f fix: do not mutate ipc instances across contexts (#23238) 2020-04-22 17:11:37 -07:00
Samuel Attard
0c67a1de8c fix: do not allow child windows to specify their own preload script (#23227) 2020-04-22 17:07:22 -07:00
trop[bot]
963ef4dbe7 fix: block custom window.open when nativeWindowOpen is true (#23222)
* fix: block custom window.open when nativeWindowOpen is true

* Update guest-window-manager.js

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-04-22 17:07:10 -07:00
trop[bot]
e559af3616 fix: cherry-pick 04dab5a91b61 from chromium (#23190)
* Make HitTestResult::LocalPoint() for inline element as same as legacy layout

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

* update patches

* update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-04-22 13:30:49 -04:00
trop[bot]
ed2bc5a4aa fix: ensure that functions are not retained beyond their context being released (#23209)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-04-22 09:09:18 -07:00
Electron Bot
edb22be8d4 chore: bump chromium in DEPS to 83.0.4103.24 (#23218) 2020-04-22 10:37:18 -04:00
Charles Kerr
74d391baae fix: use Node's microtasks policy in node_main.cc (#23154)
Fixes #21515.
2020-04-21 13:42:59 -07:00
Electron Bot
b35a98ce2a chore: bump chromium in DEPS to 83.0.4103.21 (#23198) 2020-04-21 13:48:07 -04:00
trop[bot]
9bc01adbd5 spec: fix type errors in devToolsWebContents (#23189)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-20 20:22:35 -07:00
Electron Bot
af43d065d2 chore: bump chromium to 83.0.4103.20 (9-x-y) (#23155)
* chore: bump chromium in DEPS to 83.0.4103.17

* chore: bump chromium in DEPS to 83.0.4103.18

* chore: bump chromium in DEPS to 83.0.4103.19

* chore: bump chromium in DEPS to 83.0.4103.20
2020-04-20 12:02:42 -07:00
Shelley Vohr
6f4412a317 fix: wasm codegen in script.runInNewContext (#23146) 2020-04-20 15:01:30 -04:00
trop[bot]
f0a34a2f91 docs: fix devToolsWebContents union type (#23170)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-20 11:35:57 -07:00
Shelley Vohr
30e68263ed fix: print from PDF viewer not working (#23173) 2020-04-20 11:32:28 -07:00
Electron Bot
73a6d507a7 Bump v9.0.0-beta.18 2020-04-20 08:32:24 -07:00
trop[bot]
ff6e411973 fix: don't assign NSAlert to window which is not visible (#23090) 2020-04-16 20:25:47 -07:00
Electron Bot
fe5af34acc chore: bump chromium to 83.0.4103.16 (9-x-y) (#23121) 2020-04-16 14:17:12 -07:00
Electron Bot
cd359127c9 Bump v9.0.0-beta.17 2020-04-16 14:15:56 -07:00
Samuel Attard
248beeb7a5 Merge pull request from GHSA-h9jc-284h-533g 2020-04-16 14:10:18 -07:00
Samuel Attard
bb2773bf66 Revert "Bump v9.0.0-beta.17"
This reverts commit 27367fb553.
2020-04-16 14:06:24 -07:00
trop[bot]
914a8d02b4 docs: explain the swipe event on macOS (#23135)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-16 10:55:25 -07:00
Electron Bot
27367fb553 Bump v9.0.0-beta.17 2020-04-16 08:31:59 -07:00
Electron Bot
f193d9a34f chore: bump chromium to 83.0.4103.14 (9-x-y) (#23095)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-04-14 17:14:59 -07:00
trop[bot]
bcb7fbd9c5 build: improve patch filename remembering (#23092)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-04-13 14:59:31 -07:00
Electron Bot
9762f6e7fd Bump v9.0.0-beta.16 2020-04-13 08:32:34 -07:00
trop[bot]
aef7986c64 fix: persist maximizable state when toggling fullscreen (#23021)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-10 09:40:26 -07:00
trop[bot]
82b65dcca7 fix: reset node env earlier during shutdown (#23068)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-04-10 09:37:04 -07:00
Eryk Rakowski
afeda19d15 fix(extensions): add more properties to port.sender.tab (#23008) 2020-04-09 12:21:03 -07:00
Electron Bot
1c791f9056 Bump v9.0.0-beta.15 2020-04-09 08:33:07 -07:00
Jeremy Apthorp
359110a651 ci: auto-3way patches and detect changes (#23031)
* ci: auto-3way patches and detect changes (#22976)

* bust cache

* update-index || true

* update patches

* lint

* idk what is up with lint

* idek

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-04-09 11:06:57 -04:00
Jeremy Apthorp
7894ae9c01 chore: bump chromium to 83.0.4102.3 (#22941)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-04-08 14:37:31 -07:00
trop[bot]
ab41460616 fix: nullptr check when closing windows (#23023) 2020-04-07 22:10:28 -07:00
trop[bot]
8a4d41cd46 build: set merge=union for .patches (#22991)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-04-07 09:55:17 -07:00
trop[bot]
41f33edd9e fix: webframe crashes for removed render frame (#22949)
* fix: webframe crashes for removed render frame

* Make errors more descriptive

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-06 11:38:44 -07:00
Electron Bot
21f78af43f Bump v9.0.0-beta.14 2020-04-06 08:32:24 -07:00
Electron Bot
c09bfb5a79 chore: bump chromium in DEPS to 82.0.4085.27 (#22932) 2020-04-02 17:53:33 -07:00
Electron Bot
fb5871ccf0 Bump v9.0.0-beta.13 2020-04-02 08:31:38 -07:00
Cheng Zhao
f255d47073 fix: webRequest module should work with file:// protocol (9-x-y) (#22919)
* fix: webRequest module should work with file:// protocol

* test: do not trigger unhandled promise rejections
2020-04-01 13:36:24 -07:00
trop[bot]
050844dc38 fix: screen module should still be creatable if the first create is before the ready event (#22912)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-04-01 11:37:12 -07:00
trop[bot]
317f1a3d3a fix: ensure standard schemes are registered in nw service process (#22917)
* fix: ensure standard schemes are registered in nw service process

Refs https://github.com/electron/electron/pull/20546

* chore: add test

* chore: apply suggestions from code review

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-03-31 21:25:45 -07:00
trop[bot]
b4675ce0ae fix: dialog fails to show after modal close (#22890)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-31 14:50:11 -07:00
trop[bot]
3f6227c61a fix: propagate preferred color scheme to the renderer (#22900)
* fix: do not crash if the window is closed syncronously with a nativeTheme change

* fix: propogate preferred color scheme to the renderer and keep it up to date

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-31 14:46:15 -07:00
Electron Bot
bfc069e5c0 Bump v9.0.0-beta.12 2020-03-30 08:32:46 -07:00
trop[bot]
6cb495034e fix: don't try to hide host which has set flag disable_hidden_ (#22852)
Lack of this change will lead to freeze after call to hide/show
on window which has set flag disable_hidden_. To reproduce the
problem it's necessary to create some number of windows (how many
it depends on number of windows being cached by Chromium's
FrameEvictionManager).

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
2020-03-27 11:42:20 -07:00
trop[bot]
6d2cf47797 fix: heap-use-after-free in tray.popUpContextMenu (#22855)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-27 15:34:18 +09:00
Electron Bot
e06880a90e Bump v9.0.0-beta.11 2020-03-26 08:32:00 -07:00
trop[bot]
0600420bac fix: don't allow window to go behind menu bar on mac (#22828)
Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
2020-03-25 10:45:32 -05:00
trop[bot]
a6ff42c190 fix: workaround for hang when preventDefault-ing nativeWindowOpen (#22750)
* fix: enable workaround for nativeWindowOpen hang

* add test

* test: ensure window doesn't leak into other test

* update to use new webcontents delegate methods

Co-authored-by: Andy Locascio <andy@slack-corp.com>
2020-03-25 10:40:12 +09:00
trop[bot]
969579070f refactor: migrate base::ThreadPool() as trait to base::ThreadPool:: API (#22607) 2020-03-24 15:09:28 -07:00
trop[bot]
9ee656f856 build: fix missing pdf dep in chromium_src (#22814)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-24 09:00:51 -04:00
Samuel Attard
7e4475cf51 Revert "fix: better window hierarchy checks"
This reverts commit 792fe833d1.
2020-03-23 19:35:21 -07:00
Samuel Attard
79d9bd3a29 Revert "Bump v9.0.0-beta.11"
This reverts commit 50debf8595.
2020-03-23 19:35:12 -07:00
Electron Bot
50debf8595 Bump v9.0.0-beta.11 2020-03-23 15:30:19 -07:00
Electron Bot
2d68a4d2ee Revert "Bump v9.0.0-beta.11"
This reverts commit 6ce0062c0e.
2020-03-23 15:25:54 -07:00
Electron Bot
6ce0062c0e Bump v9.0.0-beta.11 2020-03-23 14:27:00 -07:00
Samuel Attard
86aa0dfc45 build: fix beta version bumper logic for betas beyond 10 2020-03-23 14:25:54 -07:00
Samuel Attard
792fe833d1 fix: better window hierarchy checks 2020-03-23 14:13:00 -07:00
Samuel Attard
9b14ae770d feat: add support for net requests to use the session cookie store (#22806)
* chore: refactor all the net specs to be async with better error handling (#22731)

* chore: fix net specs when rerunning locally (#22745)

* feat: add support for net requests to use the session cookie store (#22704)

* fix: allow net requests to use Same-Site cookies (#22788)
2020-03-23 10:53:40 -07:00
Samuel Attard
5a34ad4e21 build: enable JS semicolons (#22785) 2020-03-23 09:18:28 -07:00
Eryk Rakowski
edd7e97dd9 feat(extensions): add more properties to extension object (#22595) 2020-03-21 10:28:05 +09:00
Electron Bot
b92734d912 chore: bump chromium to 82.0.4085.14 (9-x-y) (#22743) 2020-03-20 15:58:36 -07:00
Shelley Vohr
dc25ad2ef0 chore: update app module property support (#22747) 2020-03-20 16:09:47 +09:00
Charles Kerr
54a8258c1c refactor: omit duplicates from app's x11 icon list (#22736) 2020-03-19 14:12:07 -07:00
trop[bot]
02eff88e1b chore: revert deprecated WebContents properties (#22682) 2020-03-19 14:11:41 -07:00
trop[bot]
09ca564bf4 fix: prevent crash in ListValue v8 converter when conversion fails (#22759) 2020-03-19 14:02:31 -07:00
trop[bot]
54e31956f8 chore: more modules to dual prop/fn support (#22734) 2020-03-19 09:27:39 -07:00
Electron Bot
c6539f0d01 Bump v9.0.0-beta.10 2020-03-19 08:31:11 -07:00
trop[bot]
bef8448393 build: auto-generate the codesigning cert used for macOS CI testing runs (#22762)
* build: auto-generate the codesigning cert used for macOS CI testing runs

* build: give the cert ALL the trust values

* chore: also import public key

* idek

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-19 16:34:57 +09:00
trop[bot]
27619e8ab0 test: no need to loadURL in menu test (#22765)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-03-19 16:33:57 +09:00
trop[bot]
89c23f313f fix: crash when destroying WebContentsView during GC (#22764)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-19 16:33:22 +09:00
Cheng Zhao
a9b9016b99 fix: avoid double-free in TrackableObject (#22768) 2020-03-19 16:32:46 +09:00
trop[bot]
f1c1542958 chore: support props/fns for BrowserWindow (#22733) 2020-03-18 19:53:11 -07:00
Сковорода Никита Андреевич
cb90ef47bb feat: add disableDialogs option to WebPreferences (#22664)
Allows to disable dialogs completely in a similar way of how safeDialogs option can be used. Overrides safeDialogs option.
2020-03-18 20:02:29 -04:00
trop[bot]
a345fe2b4f fix: persist maximizable state through theme change (#22724)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-18 09:39:00 +09:00
trop[bot]
0cf02dd78b fix: remove bad usages of for-in and guard against it (#22727)
* fix: remove bad usages of for-in and guard against it

* Apply suggestions from code review

Co-Authored-By: Samuel Maddock <samuel.maddock@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* Update remote.js

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-03-18 09:38:26 +09:00
Electron Bot
3d941fc464 chore: bump chromium to 82.0.4085.10 (9-x-y) (#22506)
* chore: bump chromium in DEPS to 82.0.4076.1

* update patches

* chore: bump chromium in DEPS to 82.0.4077.1

* update v8 patches

* Remove deprecated wasm module type check

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

* chore: bump chromium in DEPS to 82.0.4078.0

* chore: bump chromium in DEPS to 82.0.4079.0

* chore: bump chromium in DEPS to 82.0.4080.0

* chore: bump chromium in DEPS to 82.0.4080.1

* chore: bump chromium in DEPS to 82.0.4081.2

* Update patches

* chore: bump chromium in DEPS to 82.0.4082.1

* Remove cursor_types.h in favor of cursor_type.mojom

https://chromium-review.googlesource.com/c/chromium/src/+/2052103
(cherry picked from commit 3b6e4d4a1a)

* Refactor extensions report in management disclosure page

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

* Rename an old referrer policy value

https://chromium-review.googlesource.com/c/chromium/src/+/2082856
(cherry picked from commit 3cb8af2515)

* Fixup compiler errors

* Move GLHelper to gpu::

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

* [api] Remove deprecated wasm module type check

https://chromium-review.googlesource.com/c/v8/v8/+/2033170
(cherry picked from commit 937988e6ce)

* Replace blink::WebCursorInfo with ui::Cursor

https://chromium-review.googlesource.com/c/chromium/src/+/1997138
(cherry picked from commit 3e348c4d59)

* DownloadURLParameters: Remove NetworkIsolationKey parameter.

https://chromium-review.googlesource.com/c/chromium/src/+/2050987
(cherry picked from commit 9b4aae745e)

* Convert FrameHostMsg_UpdateFaviconURL to mojo

https://chromium-review.googlesource.com/c/chromium/src/+/2043181
(cherry picked from commit 11b9c27eee)

* Merge ui::ContextFactoryPrivate with ui::ContextFactory

https://chromium-review.googlesource.com/c/chromium/src/+/2047728
(cherry picked from commit 176876f243)

* fix pdf viewer tests by binding more mojo things

(cherry picked from commit 74def418df)

* chore: bump chromium in DEPS to 82.0.4083.1

* Update electron_swiftshader_binaries deps

https://chromium-review.googlesource.com/c/chromium/src/+/2056931
(cherry picked from commit 312f11129f)

* Update patches

* Use Promise with RequestPointerLock calls

https://chromium-review.googlesource.com/c/chromium/src/+/2069199
(cherry picked from commit 34350db4bd)

* chore: bump chromium in DEPS to 82.0.4084.1

* Replace content::CursorInfo with ui::Cursor

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

* Convert MaterialDesignController to a true singleton.

https://chromium-review.googlesource.com/c/chromium/src/+/2090877
(cherry picked from commit 21ced9206d)

* Drop WebContentsView::RenderViewCreated hook

https://chromium-review.googlesource.com/c/chromium/src/+/2093535
(cherry picked from commit 9ff4e65053)

* Update patches

* Splitting context_menu_params.h into separate browser VS common parts.

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

* Fix DCHECK on OnThemeChanged()

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

* chore: bump chromium in DEPS to 82.0.4085.1

* chore: bump chromium in DEPS to 82.0.4085.5

* chore: bump chromium in DEPS to 82.0.4085.7

* chore: bump chromium in DEPS to 82.0.4085.9

* Add debugging for TAB tests

* update patches

* fix: add patch to fix linux arm build (#22523)


(cherry picked from commit 479354e721)

* chore: bump chromium in DEPS to 82.0.4085.10

* Check PointerLock requests for new options and update accordingly

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

* Update for changes from master roller review

* FIXME: skip Menu.setApplicationMenu(null) test

(cherry picked from commit 305f167889)

* Revert "Add debugging for TAB tests"

This reverts commit af393c1b0b.

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-03-17 16:56:25 -04:00
Erick Zhao
d32e1f8d97 fix: prevent in-memory sessions from writing to custom spellchecker dictionary (#22157) (#22683)
* fix: prevent in-memory sessions from writing to custom dictionary

* docs

* spec
2020-03-17 10:50:00 -05:00
Shelley Vohr
b798e1ff54 fix: crash on invalid zoomFactor (#22708) 2020-03-17 10:43:06 -05:00
Electron Bot
bcb1d529ff Bump v9.0.0-beta.9 2020-03-16 08:31:53 -07:00
trop[bot]
e217a9416a fix: when building with enable_pepper_flash = false (#22692)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-03-15 11:59:34 -07:00
Erick Zhao
4be52b8f78 test: add specs for custom dictionary API (#22681) 2020-03-13 14:53:37 -04:00
Electron Bot
2bc7aaf2ef Bump v9.0.0-beta.8 2020-03-12 08:32:27 -07:00
Erick Zhao
1114954cbf fix: guard against duplicate TouchBarItem IDs (#22644) 2020-03-12 10:48:17 +09:00
trop[bot]
a76ea622b9 build: fix broken Views build (#22642)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-11 16:00:55 +09:00
trop[bot]
7ee7890fd8 test: test setPath for errors thrown (#22639)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-10 10:03:36 -07:00
trop[bot]
851ed7a6e7 fix: when building with enable_pdf_viewer = false (#22631)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-03-10 10:54:07 -04:00
loc
16c4d6e487 fix: port CL that fixes ARIA tree impl for macOS (#22421) 2020-03-10 19:53:39 +09:00
trop[bot]
56c0ba138b chore: don't delete nightly tag after draft (#22624)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-10 17:04:34 +09:00
Alexey Kuzmin
1883edd869 build: fix build without built-in spellchecker (#22610)
(cherry picked from commit 385d778a8b4e97c1cffa8f31efcf9748e82e3d94)
2020-03-10 16:59:39 +09:00
trop[bot]
9b5f2159a2 build: upload sentry src bundles to symbol S3 bucket (#22617)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-03-09 16:24:44 -07:00
Samuel Maddock
60f16eaf95 fix: disallow loading extensions in temp sessions (#22090) (#22571)
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-03-09 11:33:23 -07:00
Electron Bot
0f08c6c874 Bump v9.0.0-beta.7 2020-03-09 08:31:47 -07:00
trop[bot]
e227578ae0 optional typically sync callback for WebFrame#executeJavaScript* (#22501)
Co-authored-by: bughit <bughit@users.noreply.github.com>
2020-03-06 19:07:46 +09:00
trop[bot]
f413cda758 feat(extensions): add chrome.tabs.connect API (#22549)
* feat(extensions): add chrome.tabs.connect API

* test(extensions): verify that chrome.tabs.connect port communication works

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2020-03-06 19:06:40 +09:00
trop[bot]
c41b543842 feat: add events for spellcheck dictionary downloads (#22556)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-03-06 19:04:52 +09:00
trop[bot]
7bb430dc44 docs: clean up dark mode related docs (#22562)
* docs: clean up systemPreferences.effectiveAppearance text

* Grammar fixes
* Add links for Electron Packager & Electron Forge
* Update Packager API links, given https://github.com/electron/electron-packager/pull/1131

* docs: clean up Dark Mode guide

* Grammar fixes
* Add links for Electron Packager & Electron Forge

* docs: adjust based on Electron 8 using 10.14 SDK

Co-authored-by: Mark Lee <electronjs@lazymalevolence.com>
2020-03-06 19:04:31 +09:00
Samuel Maddock
231f5af1a1 feat(extensions): add chrome.i18n API (#22570)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-06 19:03:38 +09:00
Samuel Attard
539ca773de feat: programmatically modify traffic light positioning (#22533) (#22566)
* setter

* getter

* specs and docs

* fixup

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-05 16:59:00 -08:00
Samuel Attard
1fc197bedb fix: allow persistent media salts (#22386) (#22567)
* fix: allow persistent media salts

* chore: add regression test for persistent media device ids across reloads

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-05 16:58:39 -08:00
Samuel Attard
926bea232d fix: reposition traffic lights on theme change (#22560)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-05 14:02:23 -08:00
Electron Bot
db664f3433 Bump v9.0.0-beta.6 2020-03-05 07:31:44 -08:00
Cheng Zhao
9ec73a3dcf fix: destroy node platform after destroying wrappers (#22535)
Co-authored-by: Cheng Zhao <zcbenz@electronjs.org>
2020-03-05 13:07:48 +09:00
Samuel Attard
c1c1ac2b2e fix: disable contextBridge object identity caching (#22525)
* fix: disable contextBridge object identity caching

* cleanup

* chore: make non-const references raw pointers

* fix: zero-param constructors are not explicit

* refactor: use base::LinkedList

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-04 16:54:05 -08:00
trop[bot]
9c931136d0 fix: do not reposition traffic lights when fullscreened (#22509)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-04 20:08:43 +09:00
trop[bot]
f01ee72ea5 fix: properly forward properties to webview (#22511)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-04 20:08:19 +09:00
trop[bot]
f6b4c39195 fix: bail early if no printers on the network (#22519)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-04 16:19:37 +09:00
Cheng Zhao
578f59532d chore: remove unneeded header (#22520) 2020-03-04 12:31:46 +09:00
trop[bot]
dcf9e4b2dd docs: add documentation on case insensitive dictionary hosting (#22487)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-03 14:30:30 -08:00
Shelley Vohr
2021f25453 chore: ensure correct scopes are in place (#22479) 2020-03-03 11:30:52 +09:00
John Kleinschmidt
faee8a092d fix: revive offscreen rendering support (#22160) (#22425)
(cherry picked from commit 36f982aee2)

Co-authored-by: Andy Dill <andy@discordapp.com>
2020-03-02 20:17:48 -05:00
Erick Zhao
3d65d84193 feat: add session.removeWordFromSpellCheckerDictionary API (#22368)
* feat: add session.removeWordFromSpellCheckerDictionary API

* rebase fixup
2020-03-02 14:46:19 -08:00
Jeremy Apthorp
5e05df9f71 chore: update chromium to 82.0.4058.2 (#22198)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: loc <andy@slack-corp.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2020-03-02 11:21:22 -08:00
Electron Bot
df2d03fe9b Bump v9.0.0-beta.5 2020-03-02 07:31:48 -08:00
trop[bot]
80967287ad fix: make webRequest work for CORS preflight requests (#22468)
* fix: support CORS preflight

* test: webRequest should work for CORS requests

Co-authored-by: Cheng Zhao <zcbenz@electronjs.org>
2020-03-02 20:25:28 +09:00
trop[bot]
2855f1d237 fix: do not call close on sheets themselves (#22445)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-02 16:50:22 +09:00
trop[bot]
5e25649e77 fix: Add ContentsView to AXChildren (#22469)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2020-03-02 16:28:38 +09:00
trop[bot]
3e90e523eb fix: add patch to set the base download URL rather than override it completely (#22385)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-28 17:00:44 -08:00
trop[bot]
c702aec1f8 fix: dictionaries download path should be in userdata (#22447)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-28 17:00:15 -08:00
Electron Bot
ede40f260e Bump v9.0.0-beta.4 2020-02-27 16:37:59 -08:00
Samuel Attard
ca53cc8380 fix: backport v8 patch for type inference issue (#22426) 2020-02-27 12:48:23 -08:00
Samuel Attard
7ec9b4e252 feat: set app.enableRendererProcessReuse to true by default (#22336) (#22401)
* feat: set app.enableRendererProcessReuse to true by default

* chore: add context aware info to breaking changes doc

* spec: fix nodeIntegration in child windows test for rendererprocessreuse

* spec: fix remote listeners in destroyed renderers spec as the error is now async

* Update api-browser-window-spec.ts

* chore: deprecate affinity

* chore: fix docs

* spec: handle tests crashing without an exist code

* spec: update tests for new rendererprocessreuse default

* spec: with renderer process re-use we get to destroy less views
2020-02-27 12:19:31 -08:00
trop[bot]
0d7e13d2a6 feat: add API for receiving logs from service workers (#22313)
* feat: add API for receiving logs from service workers

* feat: add new serviceWorkerContext APIs

* chore: add missing #include's

* refactor: rename serviceWorkerContext to serviceWorkers

* chore: clean up based on review

* chore: remove native_mate

* chore: add tests for the service worker module

* Update spec-main/api-service-workers-spec.ts

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* chore: fix linting

* chore: handle renames

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-27 11:02:31 -08:00
Electron Bot
a5c56684b9 Revert "Bump v9.0.0-beta.4"
This reverts commit 68d96459c3.
2020-02-27 10:01:45 -08:00
Electron Bot
68d96459c3 Bump v9.0.0-beta.4 2020-02-27 09:14:14 -08:00
trop[bot]
6cf4757019 docs: improve documentation on spellchecker download URL (#22402)
* docs: improve documentation on spellchecker download URL

* Update session.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-26 23:09:43 -08:00
trop[bot]
6e80d6fba5 fix: pass safeDialogs preference properly (#22378)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-26 13:34:42 -08:00
trop[bot]
ec07954d5d test: disable clipboard tests for WOA (#22387)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-26 18:04:32 +09:00
Electron Bot
7fd2d39f72 Bump v9.0.0-beta.3 2020-02-25 14:03:20 -08:00
trop[bot]
64880c75a3 fix: emit will-navigate for sandboxed contents (#22327)
* fix: emit will-navigate for sandboxed contents

* uncomment test

* more tests

* use ShouldFork instead of browser_handles_all_top_level_requests

* forward post data in OpenURLFromTab

* align OpenURLFromTab with chrome's version (browser_navigator.cc/LoadURLInContents)

* add tests for navigating from file: and about:blank to http:

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-25 11:11:33 +09:00
trop[bot]
cc94689db1 chore: allow custom node-spec-runner options (#22331)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-25 11:10:02 +09:00
trop[bot]
806e483049 fix(extensions): set lowest isolated world id (#22355)
* fix(extensions): set lowest isolated world id

* refactor: move world IDs into separate header file

Several files are including electron_render_frame_observer.h just for the world IDs.

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2020-02-25 11:01:30 +09:00
Jeremy Apthorp
8129e92d2b refactor: saner blink_initialization_order.patch (#22054) (#22366) 2020-02-24 13:19:33 -08:00
trop[bot]
660706ba2c fix: disable remote layer APIs in MAS build (#22354)
* fix: add patch to disable remote layer APIs

* fix: use --disable-gpu-memory-buffer-compositor-resources for MAS build

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-24 19:29:15 +09:00
trop[bot]
2feca9d35a fix: revert {Atom => Electron}Application rename (#22325)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-24 12:29:10 +09:00
trop[bot]
3a4118703a docs: clean up protocol docs (#22308)
* docs: clean up protocol docs

* Fix capitalization

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-02-24 12:28:29 +09:00
Jeremy Apthorp
bd669f72ee feat: [extensions] support extension.getBackgroundPage (#21951) (#22177) 2020-02-21 14:33:28 -08:00
trop[bot]
1f3c3eee83 fix: typo in crash reporter constructor (#22322) 2020-02-21 17:50:32 +00:00
trop[bot]
6e84ebee8e chore: remove libcc from release not generator (#22294)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-20 10:17:41 -05:00
trop[bot]
f22376ef32 fix: add patch to route mouse event navigations through the WebContentsDelegate (#22204)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-19 13:46:15 +09:00
trop[bot]
324b49a5eb doc: remove accidental deprecation (#22264)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-19 13:44:45 +09:00
John Kleinschmidt
0e9727e8d5 ci: enable goma for all testing builds (#21992) (#22203)
(cherry picked from commit e7982623ec)
2020-02-18 12:03:33 -05:00
trop[bot]
44ee90e5cf fix: don't include breakpad_symbols dir in dsym.zip (#22221)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-18 11:57:33 -05:00
Electron Bot
2b9ef75d82 Bump v9.0.0-beta.2 2020-02-15 16:07:17 -08:00
John Kleinschmidt
4dc2b4d55f Revert "Bump v9.0.0-beta.2"
This reverts commit 69f77d309d.
2020-02-14 16:50:33 -05:00
Electron Bot
69f77d309d Bump v9.0.0-beta.2 2020-02-14 12:39:21 -08:00
John Kleinschmidt
9cd1744a2b Revert "Bump v9.0.0-beta.2"
This reverts commit 8b11adc6f2.
2020-02-14 15:37:16 -05:00
trop[bot]
c6e411173e build: fix release script to work with sudowoodo (#22200)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-14 15:35:10 -05:00
Electron Bot
8b11adc6f2 Bump v9.0.0-beta.2 2020-02-14 12:29:44 -08:00
trop[bot]
57ec30e459 feat: add session.listWordsFromSpellCheckerDictionary API (#22128)
* doesn't work yet but compiles.

* works

* fixup

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2020-02-14 15:26:17 -05:00
trop[bot]
c4a836f95a fix: crash on custom printing margins (#22185)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-02-14 15:40:01 +09:00
trop[bot]
9b2de2583e fix: no-arg console.log is undefined (#22171)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-02-14 15:31:49 +09:00
Samuel Attard
7b2bfb4a0f chore: update NMV for Electron 9 (#22189) 2020-02-13 13:18:22 -08:00
Jeremy Apthorp
0e31826043 feat: enable pdf viewer 2020-02-13 10:09:29 -08:00
trop[bot]
7b3c073b3e fix RTL bug when used with traffic light repositioning (#22163)
Co-authored-by: tonyfwoo <55114329+tonyfwoo@users.noreply.github.com>
2020-02-12 11:29:03 -06:00
trop[bot]
2dc900b95d ci: Speed up release (#22159) 2020-02-12 07:27:21 +00:00
trop[bot]
f41423501a fix: make webRequest work with WebSocket (#22133)
* fix: web request support proxying websocket

* fix: make tests work

* chore: do not use api:: code outside api/ folder

* chore: do not create proxy when no listener

* test: use separate session to avoid conflicts

* chore: address review

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-11 15:56:00 -05:00
trop[bot]
07d9728b63 build: fix spellchecker deps (#22155)
Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>
2020-02-11 15:45:46 -05:00
trop[bot]
d4c90e80a5 refactor: use NSVisualEffectMaterial* constants directly (#22148) 2020-02-11 17:48:44 +00:00
trop[bot]
91141028e6 chore: print more logging for failed tests (#22116)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-11 15:07:54 +09:00
Electron Bot
9d69d4b9ef Bump v9.0.0-beta.1 2020-02-10 06:50:08 -08:00
Electron Bot
d57d5c544e Revert "Bump v9.0.0-beta.2"
This reverts commit 74d4dab157.
2020-02-10 06:38:44 -08:00
Electron Bot
74d4dab157 Bump v9.0.0-beta.2 2020-02-10 04:32:41 -08:00
trop[bot]
94246dabe3 ci: fix build failure on doc only changes (#22089)
* ci: fix build failure on doc only changes

* ci: fix doc-only check when CI fires on branch before PR is created

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-10 17:09:35 +09:00
trop[bot]
4fe91e56ac chore: remove debugging log (#22095)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-10 17:05:34 +09:00
trop[bot]
0d7440d676 build: preserve timestamps when stripping files (#22098)
* build: preserve timestamps when stripping files

Resolves an issue where the binaries in mksnapshot.zip were not getting stripped.

* Add missing comma

* Update script/strip-binaries.py

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* Don't try to run strip on macOS

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-10 17:05:04 +09:00
trop[bot]
60edd2d3b1 build: try using newer version of xcode/macOS sdk (#22106)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-10 16:48:51 +09:00
trop[bot]
d4d06660f3 fix: flash plugin (#22111)
* fix: flash plugin

Fixes https://github.com/electron/electron/issues/20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
2020-02-10 10:50:56 +09:00
trop[bot]
8d8f15121b fix: use a WeakPtr so we do not UAF the store in FunctionLifetimeMonitor (#22113)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-10 10:47:23 +09:00
trop[bot]
1f8cb5144d build: copy chromedriver to correct location (#22092)
* build: copy chromedriver to correct location

* build: try to free up disk space for macos releases

* get verbose mode working on strip-binaries

* Only use separate chromedriver build arm/arm64

* fixup circleci config

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-07 16:49:04 -05:00
trop[bot]
667ee359a1 test: get native unit tests running (#22086)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-07 10:53:09 -05:00
trop[bot]
4b009159ba docs: clarify requirements for GOOGLE_API_KEY (#22071)
* docs: clarify requirements for GOOGLE_API_KEY

* Update docs/api/environment-variables.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/api/environment-variables.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/api/environment-variables.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* update

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-02-06 15:25:28 -05:00
John Kleinschmidt
89f66bd00c Revert "Bump v9.0.0-beta.1"
This reverts commit 68346fec55.
2020-02-06 15:19:27 -05:00
trop[bot]
2d542c6028 build: copy chromedriver to proper directory for release (#22073)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-06 15:07:46 -05:00
Electron Bot
68346fec55 Bump v9.0.0-beta.1 2020-02-05 13:46:21 -08:00
Samuel Attard
23f32ca9f3 chore: prepare for 9.0.0-beta.1 2020-02-05 13:44:23 -08:00
1091 changed files with 63695 additions and 30623 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,11 @@
"browser": true
},
"rules": {
"semi": ["error", "always"],
"no-var": "error",
"no-unused-vars": 0,
"no-global-assign": 0,
"guard-for-in": 2,
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
@@ -25,7 +27,13 @@
"sourceType": "module"
},
"globals": {
"standardScheme": "readonly"
"standardScheme": "readonly",
"BUILDFLAG": "readonly",
"ENABLE_DESKTOP_CAPTURER": "readonly",
"ENABLE_ELECTRON_EXTENSIONS": "readonly",
"ENABLE_REMOTE_MODULE": "readonly",
"ENABLE_VIEW_API": "readonly",
"BigInt": "readonly"
},
"overrides": [
{

11
.gitattributes vendored
View File

@@ -1,3 +1,14 @@
# `git apply` and friends don't understand CRLF, even on windows. Force those
# files to be checked out with LF endings even if core.autocrlf is true.
*.patch text eol=lf
patches/**/.patches merge=union
# Source code and markdown files should always use LF as line ending.
*.cc text eol=lf
*.mm text eol=lf
*.h text eol=lf
*.js text eol=lf
*.ts text eol=lf
*.py text eol=lf
*.ps1 text eol=lf
*.md text eol=lf

154
BUILD.gn
View File

@@ -3,6 +3,7 @@ import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//content/public/app/mac_helpers.gni")
import("//extensions/buildflags/buildflags.gni")
import("//pdf/features.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
@@ -58,6 +59,17 @@ if (is_mas_build) {
"It doesn't make sense to build a MAS build on a non-mac platform")
}
if (enable_pdf_viewer) {
assert(enable_pdf, "PDF viewer support requires enable_pdf=true")
assert(enable_electron_extensions,
"PDF viewer support requires enable_electron_extensions=true")
}
if (enable_electron_extensions) {
assert(enable_extensions,
"Chrome extension support requires enable_extensions=true")
}
config("branding") {
defines = [
"ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
@@ -224,7 +236,6 @@ grit("resources") {
]
# Mojo manifest overlays are generated.
source_is_generated = true
grit_flags = [
"-E",
"target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
@@ -322,6 +333,7 @@ source_set("electron_lib") {
"shell/common/api:mojo",
"//base:base_static",
"//base/allocator:buildflags",
"//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
@@ -331,7 +343,10 @@ source_set("electron_lib") {
"//components/network_hints/common:mojo_bindings",
"//components/network_hints/renderer",
"//components/network_session_configurator/common",
"//components/pref_registry",
"//components/prefs",
"//components/upload_list",
"//components/user_prefs",
"//components/viz/host",
"//components/viz/service",
"//content/public/browser",
@@ -427,6 +442,9 @@ source_set("electron_lib") {
"*\bviews/*",
]
}
if (!is_mas_build) {
deps += [ "//components/crash/core/app" ]
}
set_sources_assignment_filter(
sources_assignment_filter + extra_source_filters)
@@ -444,6 +462,10 @@ source_set("electron_lib") {
]
}
if (is_linux) {
deps += [ "//components/crash/content/browser" ]
}
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
@@ -451,6 +473,10 @@ source_set("electron_lib") {
"//ui/accelerated_widget_mac",
]
if (!is_mas_build) {
deps += [ "//third_party/crashpad/crashpad/client" ]
}
libs = [
"AVFoundation.framework",
"Carbon.framework",
@@ -469,12 +495,14 @@ source_set("electron_lib") {
]
if (is_mas_build) {
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
sources -= [
"shell/browser/auto_updater_mac.mm",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
]
sources -= [ "shell/browser/auto_updater_mac.mm" ]
defines += [ "MAS_BUILD" ]
sources -= [
"shell/app/electron_crash_reporter_client.cc",
"shell/app/electron_crash_reporter_client.h",
"shell/common/crash_keys.cc",
"shell/common/crash_keys.h",
]
} else {
libs += [
"Squirrel.framework",
@@ -494,17 +522,21 @@ source_set("electron_lib") {
deps += [
":libnotify_loader",
"//build/config/linux/gtk",
"//chrome/browser/ui/gtk",
"//dbus",
"//device/bluetooth",
"//third_party/breakpad:client",
"//ui/events/devices/x11",
"//ui/events/platform/x11",
"//ui/gtk",
"//ui/views/controls/webview",
"//ui/wm",
]
if (use_x11) {
deps += [
"//ui/gfx/x",
"//ui/gtk:x",
]
}
configs += [ ":gio_unix" ]
include_dirs += [ "//third_party/breakpad" ]
configs += [ "//build/config/linux:x11" ]
defines += [
# Disable warnings for g_settings_list_schemas.
@@ -513,6 +545,16 @@ source_set("electron_lib") {
sources += filenames.lib_sources_nss
sources += [
"shell/browser/ui/gtk/app_indicator_icon.cc",
"shell/browser/ui/gtk/app_indicator_icon.h",
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
"shell/browser/ui/gtk/app_indicator_icon_menu.h",
"shell/browser/ui/gtk/gtk_status_icon.cc",
"shell/browser/ui/gtk/gtk_status_icon.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/gtk/status_icon.cc",
"shell/browser/ui/gtk/status_icon.h",
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
@@ -520,6 +562,7 @@ source_set("electron_lib") {
if (is_win) {
libs += [ "dwmapi.lib" ]
deps += [
"//components/crash/core/app:crash_export_thunks",
"//ui/native_theme:native_theme_browser",
"//ui/views/controls/webview",
"//ui/wm",
@@ -531,14 +574,6 @@ source_set("electron_lib") {
]
}
if ((is_mac && !is_mas_build) || is_win) {
sources += [
"shell/common/crash_reporter/crash_reporter_crashpad.cc",
"shell/common/crash_reporter/crash_reporter_crashpad.h",
]
deps += [ "//third_party/crashpad/crashpad/client" ]
}
if (enable_plugins) {
deps += [ "chromium_src:plugins" ]
sources += [
@@ -578,8 +613,6 @@ source_set("electron_lib") {
if (enable_remote_module) {
sources += [
"shell/common/api/remote/object_life_monitor.cc",
"shell/common/api/remote/object_life_monitor.h",
"shell/common/api/remote/remote_callback_freer.cc",
"shell/common/api/remote/remote_callback_freer.h",
"shell/common/api/remote/remote_object_freer.cc",
@@ -629,25 +662,29 @@ source_set("electron_lib") {
deps += [ "//components/printing/common:mojo_interfaces" ]
}
deps += [ "shell/common/extensions/api:extensions_features" ]
deps += [ "shell/common/extensions/api" ]
deps += [
"//components/pref_registry",
"//components/user_prefs",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/common",
"//extensions/common:core_api_provider",
"//extensions/renderer",
]
if (enable_electron_extensions) {
sources += filenames.lib_sources_extensions
deps += [
"shell/browser/extensions/api:api_registration",
"shell/common/extensions/api",
"shell/common/extensions/api:extensions_features",
"//chrome/browser/resources:component_extension_resources",
"//components/zoom",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/common",
"//extensions/common:core_api_provider",
"//extensions/renderer",
]
}
if (enable_pdf) {
# Printing depends on some //pdf code, so it needs to be built even if the
# pdf viewer isn't enabled.
deps += [ "//pdf" ]
deps += [
"//pdf",
"//pdf:features",
]
}
if (enable_pdf_viewer) {
deps += [
@@ -728,9 +765,14 @@ if (is_mac) {
sources = [
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [ "//ui/gl:swiftshader_library_copy" ]
public_deps = [
"//ui/gl:swiftshader_egl_library_copy",
"//ui/gl:swiftshader_vk_library_copy",
]
}
}
group("electron_angle_library") {
@@ -746,11 +788,17 @@ if (is_mac) {
}
bundle_data("electron_crashpad_helper") {
sources = [ "$root_out_dir/crashpad_handler" ]
sources = [ "$root_out_dir/chrome_crashpad_handler" ]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
public_deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
public_deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
if (is_asan) {
# crashpad_handler requires the ASan runtime at its @executable_path.
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ]
}
}
mac_framework_bundle("electron_framework") {
@@ -760,6 +808,9 @@ if (is_mac) {
"Resources",
"Libraries",
]
if (!is_mas_build) {
framework_contents += [ "Helpers" ]
}
public_deps = [
":electron_framework_libraries",
":electron_lib",
@@ -783,6 +834,7 @@ if (is_mac) {
include_dirs = [ "." ]
sources = filenames.framework_sources
libs = []
if (enable_osr) {
libs += [ "IOSurface.framework" ]
@@ -981,21 +1033,24 @@ if (is_mac) {
}
extract_symbols("crashpad_handler_syms") {
binary = "$root_out_dir/crashpad_handler"
binary = "$root_out_dir/chrome_crashpad_handler"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/crashpad_handler.dSYM/Contents/Resources/DWARF/crashpad_handler"
deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
dsym_file = "$root_out_dir/chrome_crashpad_handler.dSYM/Contents/Resources/DWARF/chrome_crashpad_handler"
deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
}
group("electron_symbols") {
deps = [
":crashpad_handler_syms",
":electron_app_syms",
":electron_framework_syms",
":swiftshader_egl_syms",
":swiftshader_gles_syms",
]
if (!is_mas_build) {
deps += [ ":crashpad_handler_syms" ]
}
foreach(helper_params, content_mac_helpers) {
_helper_target = helper_params[0]
deps += [ ":electron_helper_syms_${_helper_target}" ]
@@ -1025,6 +1080,7 @@ if (is_mac) {
":electron_app_manifest",
":electron_lib",
":packed_resources",
"//components/crash/core/app",
"//content:sandbox_helper_win",
"//electron/buildflags",
"//ui/strings",
@@ -1054,20 +1110,22 @@ if (is_mac) {
"shell/browser/resources/win/resource.h",
]
deps += [
"//components/browser_watcher:browser_watcher_client",
"//components/crash/core/app:run_as_crashpad_handler",
]
ldflags = []
libs = [
"comctl32.lib",
"uiautomationcore.lib",
"wtsapi32.lib",
]
configs += [ "//build/config/win:windowed" ]
ldflags = [
# Windows 7 doesn't have these DLLs.
# TODO: are there other DLLs we need to list here to be win7
# compatible?
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
configs += [
"//build/config/win:windowed",
"//build/config/win:delayloads",
]
# This is to support renaming of electron.exe. node-gyp has hard-coded
@@ -1257,7 +1315,7 @@ dist_zip("electron_chromedriver_zip") {
mksnapshot_deps = [
":licenses",
"//tools/v8_context_snapshot:v8_context_snapshot_generator",
"//tools/v8_context_snapshot:v8_context_snapshot_generator($v8_snapshot_toolchain)",
"//v8:mksnapshot($v8_snapshot_toolchain)",
]

4
DEPS
View File

@@ -12,7 +12,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'2102ff0fb03469ca5ff317a168e6ad99ca0f23f1',
'83.0.4103.122',
'node_version':
'v12.14.1',
'nan_version':
@@ -155,3 +155,5 @@ hooks = [
recursedeps = [
'src',
]
# Touch DEPS again to bust cache

View File

@@ -1 +1 @@
9.0.0-nightly.20200205
9.3.4

View File

@@ -53,7 +53,9 @@ build_script:
} else {
node script/yarn.js install --frozen-lockfile
if ($(node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH;$LASTEXITCODE -eq 0)) {
$result = node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
Write-Output $result
if ($result.ExitCode -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
}
@@ -118,29 +120,43 @@ build_script:
}
}
- 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
.\src\electron\script\start-goma.ps1 -gomaDir "$pwd\src\electron\external_binaries\goma"
if ($env:GN_CONFIG -ne 'release') {
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
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
cd ..
.\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
}
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- if DEFINED RAW_GOMA_AUTH (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"//electron/build/args/goma.gn\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
- if DEFINED GN_GOMA_FILE (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron:manifests
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED RAW_GOMA_AUTH (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- 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/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
- if DEFINED RAW_GOMA_AUTH (python electron\external_binaries\goma\goma_ctl.py stat)
- if "%GN_CONFIG%"=="testing" ( python %LOCAL_GOMA_DIR%\goma_ctl.py stat )
- python electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/dist.zip
@@ -187,8 +203,7 @@ test_script:
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --enable-logging)
- cd ..
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( gn desc out\Default v8:run_mksnapshot_default args > out\Default\mksnapshot_args )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )

View File

@@ -88,5 +88,6 @@ steps:
- powershell: |
Get-Process | Where Name Like "electron*" | Stop-Process
Get-Process | Where Name Like "MicrosoftEdge*" | Stop-Process
Get-Process | Where Name Like "msedge*" | Stop-Process
displayName: 'Kill processes left running from last test run'
condition: always()

View File

@@ -2,7 +2,7 @@ is_electron_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
node_module_version = 76
node_module_version = 80
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
@@ -20,8 +20,3 @@ angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
is_cfi = false
# TODO: disabled due to crashes. re-enable.
enable_osr = false
enable_electron_extensions = true

View File

@@ -1,3 +1,4 @@
const fs = require('fs');
const path = require('path')
const webpack = require('webpack')
@@ -9,7 +10,9 @@ config.output = {
filename: path.basename(outPath)
}
webpack(config, (err, stats) => {
const { wrapInitWithProfilingTimeout, wrapInitWithTryCatch, ...webpackConfig } = config;
webpack(webpackConfig, (err, stats) => {
if (err) {
console.error(err)
process.exit(1)
@@ -17,6 +20,26 @@ webpack(config, (err, stats) => {
console.error(stats.toString('normal'))
process.exit(1)
} else {
let contents = fs.readFileSync(outPath, 'utf8');
if (wrapInitWithTryCatch) {
contents = `try {
${contents}
} catch (err) {
console.error('Electron ${webpackConfig.output.filename} script failed to run');
console.error(err);
}`;
}
if (wrapInitWithProfilingTimeout) {
contents = `function ___electron_webpack_init__() {
${contents}
};
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
setTimeout(___electron_webpack_init__, 0);
} else {
___electron_webpack_init__();
}`;
}
fs.writeFileSync(outPath, contents)
process.exit(0)
}
})

View File

@@ -1,6 +1,7 @@
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin');
const electronRoot = path.resolve(__dirname, '../..')
@@ -20,11 +21,73 @@ class AccessDependenciesPlugin {
}
}
const defines = {
BUILDFLAG: onlyPrintingGraph ? '(a => a)' : ''
}
const buildFlagsPrefix = '--buildflags='
const buildFlagArg = process.argv.find(arg => arg.startsWith(buildFlagsPrefix))
if (buildFlagArg) {
const buildFlagPath = buildFlagArg.substr(buildFlagsPrefix.length)
const flagFile = fs.readFileSync(buildFlagPath, 'utf8')
for (const line of flagFile.split(/(\r\n|\r|\n)/g)) {
const flagMatch = line.match(/#define BUILDFLAG_INTERNAL_(.+?)\(\) \(([01])\)/)
if (flagMatch) {
const [, flagName, flagValue] = flagMatch;
defines[flagName] = JSON.stringify(Boolean(parseInt(flagValue, 10)));
}
}
}
const ignoredModules = []
if (defines['ENABLE_DESKTOP_CAPTURER'] === 'false') {
ignoredModules.push(
'@electron/internal/browser/desktop-capturer',
'@electron/internal/renderer/api/desktop-capturer'
)
}
if (defines['ENABLE_REMOTE_MODULE'] === 'false') {
ignoredModules.push(
'@electron/internal/browser/remote/server',
'@electron/internal/renderer/api/remote'
)
}
if (defines['ENABLE_VIEW_API'] === 'false') {
ignoredModules.push(
'@electron/internal/browser/api/views/box-layout',
'@electron/internal/browser/api/views/button',
'@electron/internal/browser/api/views/label-button',
'@electron/internal/browser/api/views/layout-manager',
'@electron/internal/browser/api/views/md-text-button',
'@electron/internal/browser/api/views/resize-area',
'@electron/internal/browser/api/views/text-field'
)
}
if (defines['ENABLE_ELECTRON_EXTENSIONS'] === 'false') {
ignoredModules.push(
'@electron/internal/@browser/chrome-extension-shim'
)
} else {
ignoredModules.push(
'@electron/internal/browser/chrome-extension',
'@electron/internal/renderer/chrome-api',
'@electron/internal/renderer/content-scripts-injector'
)
}
module.exports = ({
alwaysHasNode,
loadElectronFromAlternateTarget,
targetDeletesNodeGlobals,
target
target,
wrapInitWithProfilingTimeout,
wrapInitWithTryCatch
}) => {
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
if (!fs.existsSync(entry)) {
@@ -33,29 +96,37 @@ module.exports = ({
return ({
mode: 'development',
devtool: 'inline-source-map',
devtool: false,
entry,
target: alwaysHasNode ? 'node' : 'web',
output: {
filename: `${target}.bundle.js`
},
wrapInitWithProfilingTimeout,
wrapInitWithTryCatch,
resolve: {
alias: {
'@electron/internal': path.resolve(electronRoot, 'lib'),
'electron': path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts'),
// Force timers to resolve to our dependency that doens't use window.postMessage
// Force timers to resolve to our dependency that doesn't use window.postMessage
'timers': path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
},
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: (moduleName) => !onlyPrintingGraph && ignoredModules.includes(moduleName),
loader: 'null-loader',
}, {
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
transpileOnly: onlyPrintingGraph,
ignoreDiagnostics: [6059]
ignoreDiagnostics: [
// File '{0}' is not under 'rootDir' '{1}'.
6059,
]
}
}]
},
@@ -66,6 +137,17 @@ module.exports = ({
// one of our renderer bundles should import it from the 'timers' package
setImmediate: false,
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true,
},
}),
],
},
plugins: [
new AccessDependenciesPlugin(),
...(targetDeletesNodeGlobals ? [
@@ -78,6 +160,7 @@ module.exports = ({
new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise'],
}),
new webpack.DefinePlugin(defines),
]
})
}

View File

@@ -1,4 +1,5 @@
module.exports = require('./webpack.config.base')({
target: 'isolated_renderer',
alwaysHasNode: false
alwaysHasNode: false,
wrapInitWithTryCatch: true
})

View File

@@ -1,5 +1,7 @@
module.exports = require('./webpack.config.base')({
target: 'renderer',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
targetDeletesNodeGlobals: true,
wrapInitWithProfilingTimeout: true,
wrapInitWithTryCatch: true
})

View File

@@ -1,4 +1,6 @@
module.exports = require('./webpack.config.base')({
target: 'sandboxed_renderer',
alwaysHasNode: false
alwaysHasNode: false,
wrapInitWithProfilingTimeout: true,
wrapInitWithTryCatch: true
})

View File

@@ -2,5 +2,6 @@ module.exports = require('./webpack.config.base')({
target: 'worker',
loadElectronFromAlternateTarget: 'renderer',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
targetDeletesNodeGlobals: true,
wrapInitWithTryCatch: true
})

View File

@@ -16,6 +16,7 @@ template("webpack_build") {
inputs = [
invoker.config_file,
"//electron/build/webpack/webpack.config.base.js",
"//electron/build/webpack/run-compiler.js",
"//electron/tsconfig.json",
"//electron/yarn.lock",
"//electron/typings/internal-ambient.d.ts",
@@ -25,7 +26,9 @@ template("webpack_build") {
args = [
rebase_path(invoker.config_file),
rebase_path(invoker.out_file),
"--buildflags=" + rebase_path("$target_gen_dir/buildflags/buildflags.h"),
]
deps += [ "buildflags" ]
outputs = [ invoker.out_file ]
}

View File

@@ -25,6 +25,13 @@ PATHS_TO_SKIP = [
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
# ship it.
'pyproto',
# On Windows, this binary doesn't exist (the crashpad handler is built-in).
# On MacOS, the binary is called 'chrome_crashpad_handler' and is inside the
# app bundle.
# On Linux, we don't use crashpad, but this binary is still built for some
# reason. Exclude it from the zip.
'./crashpad_handler',
]
def skip_path(dep, dist_zip, target_cpu):

View File

@@ -14,7 +14,7 @@ declare_args() {
enable_view_api = false
enable_pdf_viewer = false
enable_pdf_viewer = true
enable_tts = true
@@ -32,7 +32,7 @@ declare_args() {
enable_pepper_flash = true
# Enable Chrome extensions support.
enable_electron_extensions = false
enable_electron_extensions = true
# Enable Spellchecker support
enable_builtin_spellchecker = true

View File

@@ -14,6 +14,8 @@ static_library("chrome") {
sources = [
"//chrome/browser/browser_process.cc",
"//chrome/browser/browser_process.h",
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc",
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.h",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
@@ -51,10 +53,12 @@ static_library("chrome") {
"//chrome/browser/ssl/security_state_tab_helper.cc",
"//chrome/browser/ssl/security_state_tab_helper.h",
"//chrome/browser/ssl/tls_deprecation_config.cc",
"//chrome/browser/ui/autofill/popup_view_common.cc",
"//chrome/browser/ui/autofill/popup_view_common.h",
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
"//chrome/browser/win/chrome_process_finder.cc",
"//chrome/browser/win/chrome_process_finder.h",
"//chrome/child/v8_crashpad_support_win.cc",
"//chrome/child/v8_crashpad_support_win.h",
"//extensions/browser/app_window/size_constraints.cc",
"//extensions/browser/app_window/size_constraints.h",
]
@@ -68,8 +72,8 @@ static_library("chrome") {
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/browser/ssl:proto",
"//components/feature_engagement:buildflags",
"//components/optimization_guide/proto:optimization_guide_proto",
]
if (is_linux) {
@@ -110,11 +114,15 @@ static_library("chrome") {
]
if (use_aura) {
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/views/color_chooser_aura.cc",
"//chrome/browser/ui/views/color_chooser_aura.h",
]
sources += [ "//chrome/browser/platform_util_aura.cc" ]
if (!is_win) {
sources += [
"//chrome/browser/ui/views/color_chooser_aura.cc",
"//chrome/browser/ui/views/color_chooser_aura.h",
]
}
deps += [ "//components/feature_engagement" ]
}
@@ -233,11 +241,24 @@ static_library("chrome") {
if (enable_electron_extensions) {
sources += [
"//chrome/browser/extensions/chrome_url_request_util.cc",
"//chrome/browser/extensions/chrome_url_request_util.h",
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc",
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h",
"//chrome/renderer/extensions/extension_hooks_delegate.cc",
"//chrome/renderer/extensions/extension_hooks_delegate.h",
"//chrome/renderer/extensions/tabs_hooks_delegate.cc",
"//chrome/renderer/extensions/tabs_hooks_delegate.h",
]
if (enable_pdf_viewer) {
sources += [
"//chrome/browser/pdf/pdf_extension_util.cc",
"//chrome/browser/pdf/pdf_extension_util.h",
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
]
}
}
}
@@ -261,6 +282,9 @@ source_set("plugins") {
"//ppapi/proxy:ipc",
"//services/device/public/mojom",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/browser" ]
}
if (enable_pepper_flash) {
sources += [
"//chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc",
@@ -293,8 +317,6 @@ source_set("plugins") {
sources += [
"//chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc",
"//chrome/renderer/pepper/pepper_flash_drm_renderer_host.h",
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
"//chrome/renderer/pepper/pepper_flash_fullscreen_host.cc",
"//chrome/renderer/pepper/pepper_flash_fullscreen_host.h",
"//chrome/renderer/pepper/pepper_flash_menu_host.cc",
@@ -303,6 +325,15 @@ source_set("plugins") {
"//chrome/renderer/pepper/pepper_flash_renderer_host.h",
]
}
if (enable_pepper_flash || enable_pdf_viewer) {
sources += [
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/renderer" ]
}
}
deps += [
"//components/strings",
"//media:media_buildflags",

View File

@@ -36,6 +36,7 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
// Linux has only a single persistent slot compared to ChromeOS's separate
// public and private slot.
// Redirect any slot usage to this persistent slot on Linux.
crypto::EnsureNSSInit();
g_nss_cert_database = new net::NSSCertDatabase(
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* public slot */,
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* private slot */);

View File

@@ -827,10 +827,9 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
to_send.append(current_dir.value());
const std::vector<std::string>& argv = electron::ElectronCommandLine::argv();
for (std::vector<std::string>::const_iterator it = argv.begin();
it != argv.end(); ++it) {
for (const auto& arg : argv) {
to_send.push_back(kTokenDelimiter);
to_send.append(*it);
to_send.append(arg);
}
// Send the message

View File

@@ -122,8 +122,7 @@ void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */,
GParamSpec* /* ignored */) {
// If the name owner changed, we need to reregister all the live xids with
// the system.
for (std::set<unsigned long>::const_iterator it = live_xids_.begin();
it != live_xids_.end(); ++it) {
RegisterXID(*it);
for (auto xid : live_xids_) {
RegisterXID(xid);
}
}

View File

@@ -1,48 +1,48 @@
import { app, dialog, BrowserWindow, shell, ipcMain } from 'electron'
import * as path from 'path'
import { app, dialog, BrowserWindow, shell, ipcMain } from 'electron';
import * as path from 'path';
import * as url from 'url';
let mainWindow: BrowserWindow | null = null
let mainWindow: BrowserWindow | null = null;
// Quit when all windows are closed.
app.on('window-all-closed', () => {
app.quit()
})
app.quit();
});
function decorateURL (url: string) {
// safely add `?utm_source=default_app
const parsedUrl = new URL(url)
parsedUrl.searchParams.append('utm_source', 'default_app')
return parsedUrl.toString()
const parsedUrl = new URL(url);
parsedUrl.searchParams.append('utm_source', 'default_app');
return parsedUrl.toString();
}
// Find the shortest path to the electron binary
const absoluteElectronPath = process.execPath
const relativeElectronPath = path.relative(process.cwd(), absoluteElectronPath)
const absoluteElectronPath = process.execPath;
const relativeElectronPath = path.relative(process.cwd(), absoluteElectronPath);
const electronPath = absoluteElectronPath.length < relativeElectronPath.length
? absoluteElectronPath
: relativeElectronPath
: relativeElectronPath;
const indexPath = path.resolve(app.getAppPath(), 'index.html')
const indexPath = path.resolve(app.getAppPath(), 'index.html');
function isTrustedSender (webContents: Electron.WebContents) {
if (webContents !== (mainWindow && mainWindow.webContents)) {
return false
return false;
}
const parsedUrl = new URL(webContents.getURL())
const urlPath = process.platform === 'win32'
// Strip the prefixed "/" that occurs on windows
? path.resolve(parsedUrl.pathname.substr(1))
: parsedUrl.pathname
return parsedUrl.protocol === 'file:' && urlPath === indexPath
try {
return url.fileURLToPath(webContents.getURL()) === indexPath;
} catch {
return false;
}
}
ipcMain.handle('bootstrap', (event) => {
return isTrustedSender(event.sender) ? electronPath : null
})
return isTrustedSender(event.sender) ? electronPath : null;
});
async function createWindow () {
await app.whenReady()
await app.whenReady();
const options: Electron.BrowserWindowConstructorOptions = {
width: 900,
@@ -57,46 +57,46 @@ async function createWindow () {
},
useContentSize: true,
show: false
}
};
if (process.platform === 'linux') {
options.icon = path.join(__dirname, 'icon.png')
options.icon = path.join(__dirname, 'icon.png');
}
mainWindow = new BrowserWindow(options)
mainWindow.on('ready-to-show', () => mainWindow!.show())
mainWindow = new BrowserWindow(options);
mainWindow.on('ready-to-show', () => mainWindow!.show());
mainWindow.webContents.on('new-window', (event, url) => {
event.preventDefault()
shell.openExternal(decorateURL(url))
})
event.preventDefault();
shell.openExternal(decorateURL(url));
});
mainWindow.webContents.session.setPermissionRequestHandler((webContents, permission, done) => {
const parsedUrl = new URL(webContents.getURL())
const parsedUrl = new URL(webContents.getURL());
const options: Electron.MessageBoxOptions = {
title: 'Permission Request',
message: `Allow '${parsedUrl.origin}' to access '${permission}'?`,
buttons: ['OK', 'Cancel'],
cancelId: 1
}
};
dialog.showMessageBox(mainWindow!, options).then(({ response }) => {
done(response === 0)
})
})
done(response === 0);
});
});
return mainWindow
return mainWindow;
}
export const loadURL = async (appUrl: string) => {
mainWindow = await createWindow()
mainWindow.loadURL(appUrl)
mainWindow.focus()
}
mainWindow = await createWindow();
mainWindow.loadURL(appUrl);
mainWindow.focus();
};
export const loadFile = async (appPath: string) => {
mainWindow = await createWindow()
mainWindow.loadFile(appPath)
mainWindow.focus()
}
mainWindow = await createWindow();
mainWindow.loadFile(appPath);
mainWindow.focus();
};

View File

@@ -1,8 +1,8 @@
import { app, dialog } from 'electron'
import { app, dialog } from 'electron';
import * as fs from 'fs'
import * as path from 'path'
import * as url from 'url'
import * as fs from 'fs';
import * as path from 'path';
import * as url from 'url';
type DefaultAppOptions = {
file: null | string;
@@ -14,10 +14,10 @@ type DefaultAppOptions = {
modules: string[];
}
const Module = require('module')
const Module = require('module');
// Parse command line options.
const argv = process.argv.slice(1)
const argv = process.argv.slice(1);
const option: DefaultAppOptions = {
file: null,
@@ -27,50 +27,50 @@ const option: DefaultAppOptions = {
interactive: false,
abi: false,
modules: []
}
};
let nextArgIsRequire = false
let nextArgIsRequire = false;
for (const arg of argv) {
if (nextArgIsRequire) {
option.modules.push(arg)
nextArgIsRequire = false
continue
option.modules.push(arg);
nextArgIsRequire = false;
continue;
} else if (arg === '--version' || arg === '-v') {
option.version = true
break
option.version = true;
break;
} else if (arg.match(/^--app=/)) {
option.file = arg.split('=')[1]
break
option.file = arg.split('=')[1];
break;
} else if (arg === '--interactive' || arg === '-i' || arg === '-repl') {
option.interactive = true
option.interactive = true;
} else if (arg === '--test-type=webdriver') {
option.webdriver = true
option.webdriver = true;
} else if (arg === '--require' || arg === '-r') {
nextArgIsRequire = true
continue
nextArgIsRequire = true;
continue;
} else if (arg === '--abi' || arg === '-a') {
option.abi = true
continue
option.abi = true;
continue;
} else if (arg === '--no-help') {
option.noHelp = true
continue
option.noHelp = true;
continue;
} else if (arg[0] === '-') {
continue
continue;
} else {
option.file = arg
break
option.file = arg;
break;
}
}
if (nextArgIsRequire) {
console.error('Invalid Usage: --require [file]\n\n"file" is required')
process.exit(1)
console.error('Invalid Usage: --require [file]\n\n"file" is required');
process.exit(1);
}
// Set up preload modules
if (option.modules.length > 0) {
Module._preloadModules(option.modules)
Module._preloadModules(option.modules);
}
function loadApplicationPackage (packagePath: string) {
@@ -79,102 +79,102 @@ function loadApplicationPackage (packagePath: string) {
configurable: false,
enumerable: true,
value: true
})
});
try {
// Override app name and version.
packagePath = path.resolve(packagePath)
const packageJsonPath = path.join(packagePath, 'package.json')
let appPath
packagePath = path.resolve(packagePath);
const packageJsonPath = path.join(packagePath, 'package.json');
let appPath;
if (fs.existsSync(packageJsonPath)) {
let packageJson
let packageJson;
try {
packageJson = require(packageJsonPath)
packageJson = require(packageJsonPath);
} catch (e) {
showErrorMessage(`Unable to parse ${packageJsonPath}\n\n${e.message}`)
return
showErrorMessage(`Unable to parse ${packageJsonPath}\n\n${e.message}`);
return;
}
if (packageJson.version) {
app.setVersion(packageJson.version)
app.setVersion(packageJson.version);
}
if (packageJson.productName) {
app.name = packageJson.productName
app.name = packageJson.productName;
} else if (packageJson.name) {
app.name = packageJson.name
app.name = packageJson.name;
}
appPath = packagePath
appPath = packagePath;
}
try {
const filePath = Module._resolveFilename(packagePath, module, true)
app._setDefaultAppPaths(appPath || path.dirname(filePath))
const filePath = Module._resolveFilename(packagePath, module, true);
app._setDefaultAppPaths(appPath || path.dirname(filePath));
} catch (e) {
showErrorMessage(`Unable to find Electron app at ${packagePath}\n\n${e.message}`)
return
showErrorMessage(`Unable to find Electron app at ${packagePath}\n\n${e.message}`);
return;
}
// Run the app.
Module._load(packagePath, module, true)
Module._load(packagePath, module, true);
} catch (e) {
console.error('App threw an error during load')
console.error(e.stack || e)
throw e
console.error('App threw an error during load');
console.error(e.stack || e);
throw e;
}
}
function showErrorMessage (message: string) {
app.focus()
dialog.showErrorBox('Error launching app', message)
process.exit(1)
app.focus();
dialog.showErrorBox('Error launching app', message);
process.exit(1);
}
async function loadApplicationByURL (appUrl: string) {
const { loadURL } = await import('./default_app')
loadURL(appUrl)
const { loadURL } = await import('./default_app');
loadURL(appUrl);
}
async function loadApplicationByFile (appPath: string) {
const { loadFile } = await import('./default_app')
loadFile(appPath)
const { loadFile } = await import('./default_app');
loadFile(appPath);
}
function startRepl () {
if (process.platform === 'win32') {
console.error('Electron REPL not currently supported on Windows')
process.exit(1)
console.error('Electron REPL not currently supported on Windows');
process.exit(1);
}
// prevent quitting
app.on('window-all-closed', () => {})
app.on('window-all-closed', () => {});
const repl = require('repl')
const repl = require('repl');
repl.start('> ').on('exit', () => {
process.exit(0)
})
process.exit(0);
});
}
// Start the specified app if there is one specified in command line, otherwise
// start the default app.
if (option.file && !option.webdriver) {
const file = option.file
const protocol = url.parse(file).protocol
const extension = path.extname(file)
const file = option.file;
const protocol = url.parse(file).protocol;
const extension = path.extname(file);
if (protocol === 'http:' || protocol === 'https:' || protocol === 'file:' || protocol === 'chrome:') {
loadApplicationByURL(file)
loadApplicationByURL(file);
} else if (extension === '.html' || extension === '.htm') {
loadApplicationByFile(path.resolve(file))
loadApplicationByFile(path.resolve(file));
} else {
loadApplicationPackage(file)
loadApplicationPackage(file);
}
} else if (option.version) {
console.log('v' + process.versions.electron)
process.exit(0)
console.log('v' + process.versions.electron);
process.exit(0);
} else if (option.abi) {
console.log(process.versions.modules)
process.exit(0)
console.log(process.versions.modules);
process.exit(0);
} else if (option.interactive) {
startRepl()
startRepl();
} else {
if (!option.noHelp) {
const welcomeMessage = `
@@ -192,10 +192,10 @@ Options:
-i, --interactive Open a REPL to the main process.
-r, --require Module to preload (option can be repeated).
-v, --version Print the version.
-a, --abi Print the Node ABI version.`
-a, --abi Print the Node ABI version.`;
console.log(welcomeMessage)
console.log(welcomeMessage);
}
loadApplicationByFile('index.html')
loadApplicationByFile('index.html');
}

View File

@@ -1,53 +1,53 @@
import { ipcRenderer, contextBridge } from 'electron'
import { ipcRenderer, contextBridge } from 'electron';
async function getOcticonSvg (name: string) {
try {
const response = await fetch(`octicon/${name}.svg`)
const div = document.createElement('div')
div.innerHTML = await response.text()
return div
const response = await fetch(`octicon/${name}.svg`);
const div = document.createElement('div');
div.innerHTML = await response.text();
return div;
} catch {
return null
return null;
}
}
async function loadSVG (element: HTMLSpanElement) {
for (const cssClass of element.classList) {
if (cssClass.startsWith('octicon-')) {
const icon = await getOcticonSvg(cssClass.substr(8))
const icon = await getOcticonSvg(cssClass.substr(8));
if (icon) {
for (const elemClass of element.classList) {
icon.classList.add(elemClass)
icon.classList.add(elemClass);
}
element.before(icon)
element.remove()
break
element.before(icon);
element.remove();
break;
}
}
}
}
async function initialize () {
const electronPath = await ipcRenderer.invoke('bootstrap')
const electronPath = await ipcRenderer.invoke('bootstrap');
function replaceText (selector: string, text: string) {
const element = document.querySelector<HTMLElement>(selector)
const element = document.querySelector<HTMLElement>(selector);
if (element) {
element.innerText = text
element.innerText = text;
}
}
replaceText('.electron-version', `Electron v${process.versions.electron}`)
replaceText('.chrome-version', `Chromium v${process.versions.chrome}`)
replaceText('.node-version', `Node v${process.versions.node}`)
replaceText('.v8-version', `v8 v${process.versions.v8}`)
replaceText('.command-example', `${electronPath} path-to-app`)
replaceText('.electron-version', `Electron v${process.versions.electron}`);
replaceText('.chrome-version', `Chromium v${process.versions.chrome}`);
replaceText('.node-version', `Node v${process.versions.node}`);
replaceText('.v8-version', `v8 v${process.versions.v8}`);
replaceText('.command-example', `${electronPath} path-to-app`);
for (const element of document.querySelectorAll<HTMLSpanElement>('.octicon')) {
loadSVG(element)
loadSVG(element);
}
}
contextBridge.exposeInMainWorld('electronDefaultApp', {
initialize
})
});

View File

@@ -112,6 +112,7 @@ These individual tutorials expand on topics discussed in the guide above.
* [Process Object](api/process.md)
* [Supported Command Line Switches](api/command-line-switches.md)
* [Environment Variables](api/environment-variables.md)
* [Chrome Extensions Support](api/extensions.md)
* [Breaking API Changes](breaking-changes.md)
### Custom DOM Elements:

View File

@@ -54,7 +54,7 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and
* `0` to `9`
* `A` to `Z`
* `F1` to `F24`
* Punctuations like `~`, `!`, `@`, `#`, `$`, etc.
* Punctuation like `~`, `!`, `@`, `#`, `$`, etc.
* `Plus`
* `Space`
* `Tab`

View File

@@ -32,7 +32,8 @@ In most cases, you should do everything in the `ready` event handler.
Returns:
* `launchInfo` unknown _macOS_
* `event` Event
* `launchInfo` Record<string, any> _macOS_
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
holds the `userInfo` of the `NSUserNotification` that was used to open the
@@ -75,7 +76,7 @@ Returns:
* `event` Event
Emitted when all windows have been closed and the application will quit.
Calling `event.preventDefault()` will prevent the default behaviour, which is
Calling `event.preventDefault()` will prevent the default behavior, which is
terminating the application.
See the description of the `window-all-closed` event for the differences between
@@ -204,7 +205,7 @@ Returns:
[`NSUserActivity.activityType`][activity-type].
* `userInfo` unknown - Contains app-specific state stored by the activity.
Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.
Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.
### Event: 'new-window-for-tab' _macOS_
@@ -369,6 +370,25 @@ Returns:
Emitted when the renderer process of `webContents` crashes or is killed.
#### Event: 'render-process-gone'
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `details` Object
* `reason` String - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
Emitted when the renderer process unexpectedly dissapears. This is normally
because it was crashed or killed.
### Event: 'accessibility-support-changed' _macOS_ _Windows_
Returns:
@@ -554,11 +574,17 @@ Returns `Promise<void>` - fulfilled when Electron is initialized.
May be used as a convenient alternative to checking `app.isReady()`
and subscribing to the `ready` event if the app is not ready yet.
### `app.focus()`
### `app.focus([options])`
* `options` Object (optional)
* `steal` Boolean _macOS_ - Make the receiver the active app even if another app is
currently active.
On Linux, focuses on the first visible window. On macOS, makes the application
the active app. On Windows, focuses on the application's first window.
You should seek to use the `steal` option as sparingly as possible.
### `app.hide()` _macOS_
Hides all application windows without minimizing them.
@@ -602,6 +628,7 @@ Returns `String` - The current application directory.
* `videos` Directory for a user's videos.
* `logs` Directory for your app's log folder.
* `pepperFlashSystemPlugin` Full path to the system version of the Pepper Flash plugin.
* `crashDumps` Directory where crash dumps are stored.
Returns `String` - A path to a special directory or file associated with `name`. On
failure, an `Error` is thrown.
@@ -659,8 +686,6 @@ to the npm modules spec. You should usually also specify a `productName`
field, which is your application's full capitalized name, and which will be
preferred over `name` by Electron.
**[Deprecated](modernization/property-updates.md)**
### `app.setName(name)`
* `name` String
@@ -669,8 +694,6 @@ Overrides the current application's name.
**Note:** This function overrides the name used internally by Electron; it does not affect the name that the OS uses.
**[Deprecated](modernization/property-updates.md)**
### `app.getLocale()`
Returns `String` - The current application locale. Possible return values are documented [here](locales.md).
@@ -703,34 +726,34 @@ Clears the recent documents list.
### `app.setAsDefaultProtocolClient(protocol[, path, args])`
* `protocol` String - The name of your protocol, without `://`. If you want your
app to handle `electron://` links, call this method with `electron` as the
parameter.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Defaults to an empty array
* `protocol` String - The name of your protocol, without `://`. For example,
if you want your app to handle `electron://` links, call this method with
`electron` as the parameter.
* `path` String (optional) _Windows_ - The path to the Electron executable.
Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Arguments passed to the executable.
Defaults to an empty array
Returns `Boolean` - Whether the call succeeded.
This method sets the current executable as the default handler for a protocol
(aka URI scheme). It allows you to integrate your app deeper into the operating
system. Once registered, all links with `your-protocol://` will be opened with
the current executable. The whole link, including protocol, will be passed to
your application as a parameter.
On Windows, you can provide optional parameters path, the path to your executable,
and args, an array of arguments to be passed to your executable when it launches.
Sets the current executable as the default handler for a protocol (aka URI
scheme). It allows you to integrate your app deeper into the operating system.
Once registered, all links with `your-protocol://` will be opened with the
current executable. The whole link, including protocol, will be passed to your
application as a parameter.
**Note:** On macOS, you can only register protocols that have been added to
your app's `info.plist`, which can not be modified at runtime. You can however
change the file with a simple text editor or script during build time.
Please refer to [Apple's documentation][CFBundleURLTypes] for details.
your app's `info.plist`, which cannot be modified at runtime. However, you can
change the file during build time via [Electron Forge][electron-forge],
[Electron Packager][electron-packager], or by editing `info.plist` with a text
editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
**Note:** In a Windows Store environment (when packaged as an `appx`) this API
will return `true` for all calls but the registry key it sets won't be accessible
by other applications. In order to register your Windows Store application
as a default protocol handler you must [declare the protocol in your manifest](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
@@ -749,10 +772,8 @@ protocol (aka URI scheme). If so, it will remove the app as the default handler.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Defaults to an empty array
Returns `Boolean`
This method checks if the current executable is the default handler for a protocol
(aka URI scheme). If so, it will return true. Otherwise, it will return false.
Returns `Boolean` - Whether the current executable is the default handler for a
protocol (aka URI scheme).
**Note:** On macOS, you can use this method to check if the app has been
registered as the default protocol handler for a protocol. You can also verify
@@ -760,7 +781,7 @@ this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
macOS machine. Please refer to
[Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.
### `app.getApplicationNameForProtocol(url)`
@@ -1027,7 +1048,7 @@ This method can only be called before app is ready.
By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per
domain basis if the GPU processes crashes too frequently. This function
disables that behaviour.
disables that behavior.
This method can only be called before app is ready.
@@ -1091,14 +1112,10 @@ On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
**Note:** Unity launcher requires the existence of a `.desktop` file to work,
for more information please read [Desktop Environment Integration][unity-requirement].
**[Deprecated](modernization/property-updates.md)**
### `app.getBadgeCount()` _Linux_ _macOS_
Returns `Integer` - The current value displayed in the counter badge.
**[Deprecated](modernization/property-updates.md)**
### `app.isUnityRunning()` _Linux_
Returns `Boolean` - Whether the current desktop environment is Unity launcher.
@@ -1173,8 +1190,6 @@ technologies, such as screen readers, has been detected. See
https://www.chromium.org/developers/design-documents/accessibility for more
details.
**[Deprecated](modernization/property-updates.md)**
### `app.setAccessibilitySupportEnabled(enabled)` _macOS_ _Windows_
* `enabled` Boolean - Enable or disable [accessibility tree](https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/the-accessibility-tree) rendering
@@ -1186,8 +1201,6 @@ This API must be called after the `ready` event is emitted.
**Note:** Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
**[Deprecated](modernization/property-updates.md)**
### `app.showAboutPanel()`
Show the app's about panel options. These options can be overridden with `app.setAboutPanelOptions(options)`.
@@ -1204,7 +1217,7 @@ Show the app's about panel options. These options can be overridden with `app.se
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
Set the about panel options. This will override the values defined in the app's `.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
If you do not set `credits` but still wish to surface them in your app, AppKit will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in that order, in the bundle returned by the NSBundle class method main. The first file found is used, and if none is found, the info area is left blank. See Apple [documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc) for more information.
@@ -1327,6 +1340,8 @@ A `Boolean` property that returns `true` if the app is packaged, `false` otherw
[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
[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
[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html
@@ -1359,7 +1374,7 @@ in your app's initialization to ensure that your overridden value is used.
A `Boolean` which when `true` disables the overrides that Electron has in place
to ensure renderer processes are restarted on every navigation. The current
default value for this property is `false`.
default value for this property is `true`.
The intention is for these overrides to become disabled by default and then at
some point in the future this property will be removed. This property impacts

View File

@@ -177,7 +177,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `simpleFullscreen` Boolean (optional) - Use pre-Lion fullscreen on macOS. Default is `false`.
* `skipTaskbar` Boolean (optional) - Whether to show the window in taskbar. Default is
`false`.
* `kiosk` Boolean (optional) - The kiosk mode. Default is `false`.
* `kiosk` Boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
* `title` String (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
* `icon` ([NativeImage](native-image.md) | String) (optional) - The window icon. On Windows it is
recommended to use `ICO` icons to get best visual effects, you can also
@@ -207,7 +207,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `opacity` Number (optional) - Set the initial opacity of the window, between 0.0 (fully
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
some GTK desktop environments. Default is `false`.
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
Default is `false`. On Windows, does not work unless the window is frameless.
* `type` String (optional) - The type of window, default is normal window. See more about
@@ -289,7 +289,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
between the web pages even when you specified different values for them,
including but not limited to `preload`, `sandbox` and `nodeIntegration`.
So it is suggested to use exact same `webPreferences` for web pages with
the same `affinity`. _This property is experimental_
the same `affinity`. _Deprecated_
* `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents
`300%`. Default is `1.0`.
* `javascript` Boolean (optional) - Enables JavaScript support. Default is `true`.
@@ -348,6 +348,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
You can access this context in the dev tools by selecting the
'Electron Isolated Context' entry in the combo box at the top of the
Console tab.
* `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values
can't unsafely cross between worlds when using `contextIsolation`. The default
is `false`. In Electron 12, the default will be changed to `true`. _Deprecated_
* `nativeWindowOpen` Boolean (optional) - Whether to use native
`window.open()`. Defaults to `false`. Child windows will always have node
integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently
@@ -369,6 +372,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
consecutive dialog protection is triggered. If not defined the default
message would be used, note that currently the default message is in
English and not localized.
* `disableDialogs` Boolean (optional) - Whether to disable dialogs
completely. Overrides `safeDialogs`. Default is `false`.
* `navigateOnDragDrop` Boolean (optional) - Whether dragging and dropping a
file or link onto the page causes a navigation. Default is `false`.
* `autoplayPolicy` String (optional) - Autoplay policy to apply to
@@ -383,6 +388,15 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
visible to users.
* `spellcheck` Boolean (optional) - Whether to enable the builtin spellchecker.
Default is `true`.
* `enableWebSQL` Boolean (optional) - Whether to enable the [WebSQL api](https://www.w3.org/TR/webdatabase/).
Default is `true`.
* `v8CacheOptions` String (optional) - Enforces the v8 code caching policy
used by blink. Accepted values are
* `none` - Disables code caching
* `code` - Heuristic based code caching
* `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation
* `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager.
Default policy is `code`.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
@@ -621,6 +635,12 @@ Returns:
Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`, `left`.
The method underlying this event is built to handle older macOS-style trackpad swiping,
where the content on the screen doesn't move with the swipe. Most macOS trackpads are not
configured to allow this kind of swiping anymore, so in order for it to emit properly the
'Swipe between pages' preference in `System Preferences > Trackpad > More Gestures` must be
set to 'Swipe with two or three fingers'.
#### Event: 'rotate-gesture' _macOS_
Returns:
@@ -795,6 +815,51 @@ A `Boolean` property that determines whether the window menu bar should hide its
If the menu bar is already visible, setting this property to `true` won't
hide it immediately.
#### `win.simpleFullScreen`
A `Boolean` property that determines whether the window is in simple (pre-Lion) fullscreen mode.
#### `win.fullScreen`
A `Boolean` property that determines whether the window is in fullscreen mode.
#### `win.visibleOnAllWorkspaces`
A `Boolean` property that determines whether the window is visible on all workspaces.
**Note:** Always returns false on Windows.
#### `win.shadow`
A `Boolean` property that determines whether the window has a shadow.
#### `win.menuBarVisible` _Windows_ _Linux_
A `Boolean` property that determines whether the menu bar should be visible.
**Note:** If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
#### `win.kiosk`
A `Boolean` property that determines whether the window is in kiosk mode.
#### `win.documentEdited` _macOS_
A `Boolean` property that specifies whether the windows document has been edited.
The icon in title bar will become gray when set to `true`.
#### `win.representedFilename` _macOS_
A `String` property that determines the pathname of the file the window represents,
and the icon of the file will show in window's title bar.
#### `win.title`
A `String` property that determines the title of the native window.
**Note:** The title of the web page can be different from the title of the native window.
#### `win.minimizable`
A `Boolean` property that determines whether the window can be manually minimized by user.
@@ -950,7 +1015,7 @@ Returns `Boolean` - Whether the window is in fullscreen mode.
Enters or leaves simple fullscreen mode.
Simple fullscreen mode emulates the native fullscreen behavior found in versions of Mac OS X prior to Lion (10.7).
Simple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).
#### `win.isSimpleFullScreen()` _macOS_
@@ -1061,7 +1126,7 @@ Disable or enable the window.
#### `win.isEnabled()`
Returns Boolean - whether the window is enabled.
Returns `Boolean` - whether the window is enabled.
#### `win.setSize(width, height[, animate])`
@@ -1113,15 +1178,11 @@ Returns `Integer[]` - Contains the window's maximum width and height.
* `resizable` Boolean
Sets whether the window can be manually resized by user.
**[Deprecated](modernization/property-updates.md)**
Sets whether the window can be manually resized by the user.
#### `win.isResizable()`
Returns `Boolean` - Whether the window can be manually resized by user.
**[Deprecated](modernization/property-updates.md)**
Returns `Boolean` - Whether the window can be manually resized by the user.
#### `win.setMovable(movable)` _macOS_ _Windows_
@@ -1129,41 +1190,29 @@ Returns `Boolean` - Whether the window can be manually resized by user.
Sets whether the window can be moved by user. On Linux does nothing.
**[Deprecated](modernization/property-updates.md)**
#### `win.isMovable()` _macOS_ _Windows_
Returns `Boolean` - Whether the window can be moved by user.
On Linux always returns `true`.
**[Deprecated](modernization/property-updates.md)**
#### `win.setMinimizable(minimizable)` _macOS_ _Windows_
* `minimizable` Boolean
Sets whether the window can be manually minimized by user. On Linux does
nothing.
**[Deprecated](modernization/property-updates.md)**
Sets whether the window can be manually minimized by user. On Linux does nothing.
#### `win.isMinimizable()` _macOS_ _Windows_
Returns `Boolean` - Whether the window can be manually minimized by user
Returns `Boolean` - Whether the window can be manually minimized by the user.
On Linux always returns `true`.
**[Deprecated](modernization/property-updates.md)**
#### `win.setMaximizable(maximizable)` _macOS_ _Windows_
* `maximizable` Boolean
Sets whether the window can be manually maximized by user. On Linux does
nothing.
**[Deprecated](modernization/property-updates.md)**
Sets whether the window can be manually maximized by user. On Linux does nothing.
#### `win.isMaximizable()` _macOS_ _Windows_
@@ -1171,23 +1220,15 @@ Returns `Boolean` - Whether the window can be manually maximized by user.
On Linux always returns `true`.
**[Deprecated](modernization/property-updates.md)**
#### `win.setFullScreenable(fullscreenable)`
* `fullscreenable` Boolean
Sets whether the maximize/zoom window button toggles fullscreen mode or
maximizes the window.
**[Deprecated](modernization/property-updates.md)**
Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.
#### `win.isFullScreenable()`
Returns `Boolean` - Whether the maximize/zoom window button toggles fullscreen mode or
maximizes the window.
**[Deprecated](modernization/property-updates.md)**
Returns `Boolean` - Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.
#### `win.setClosable(closable)` _macOS_ _Windows_
@@ -1195,16 +1236,12 @@ maximizes the window.
Sets whether the window can be manually closed by user. On Linux does nothing.
**[Deprecated](modernization/property-updates.md)**
#### `win.isClosable()` _macOS_ _Windows_
Returns `Boolean` - Whether the window can be manually closed by user.
On Linux always returns `true`.
**[Deprecated](modernization/property-updates.md)**
#### `win.setAlwaysOnTop(flag[, level][, relativeLevel])`
* `flag` Boolean
@@ -1302,7 +1339,7 @@ Makes the window not show in the taskbar.
* `flag` Boolean
Enters or leaves the kiosk mode.
Enters or leaves kiosk mode.
#### `win.isKiosk()`
@@ -1616,31 +1653,28 @@ This cannot be called when `titleBarStyle` is set to `customButtonsOnHover`.
Sets whether the window menu bar should hide itself automatically. Once set the
menu bar will only show when users press the single `Alt` key.
If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
hide it immediately.
**[Deprecated](modernization/property-updates.md)**
If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately.
#### `win.isMenuBarAutoHide()`
Returns `Boolean` - Whether menu bar automatically hides itself.
**[Deprecated](modernization/property-updates.md)**
#### `win.setMenuBarVisibility(visible)` _Windows_ _Linux_
* `visible` Boolean
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
can still bring up the menu bar by pressing the single `Alt` key.
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
#### `win.isMenuBarVisible()`
Returns `Boolean` - Whether the menu bar is visible.
#### `win.setVisibleOnAllWorkspaces(visible)`
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
* `visible` Boolean
* `options` Object (optional)
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
the window should be visible above fullscreen windows
Sets whether the window should be visible on all workspaces.
@@ -1748,6 +1782,17 @@ will remove the vibrancy effect on the window.
Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
deprecated and will be removed in an upcoming version of macOS.
#### `win.setTrafficLightPosition(position)` _macOS_
* `position` [Point](structures/point.md)
Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`.
#### `win.getTrafficLightPosition()` _macOS_
Returns `Point` - The current position for the traffic light buttons. Can only be used with `titleBarStyle`
set to `hidden`.
#### `win.setTouchBar(touchBar)` _macOS_ _Experimental_
* `touchBar` TouchBar | null

View File

@@ -22,6 +22,9 @@ which the request is associated.
with which the request is associated. Defaults to the empty string. The
`session` option prevails on `partition`. Thus if a `session` is explicitly
specified, `partition` is ignored.
* `useSessionCookies` Boolean (optional) - Whether to send cookies with this
request from the provided session. This will make the `net` request's
cookie behavior match a `fetch` request. Default is `false`.
* `protocol` String (optional) - The protocol scheme in the form 'scheme:'.
Currently supported values are 'http:' or 'https:'. Defaults to 'http:'.
* `host` String (optional) - The server host provided as a concatenation of

View File

@@ -28,6 +28,10 @@ Disables the disk cache for HTTP requests.
Disable HTTP/2 and SPDY/3.1 protocols.
### --disable-ntlm-v2
Disables NTLM v2 for posix platforms, no effect elsewhere.
## --lang
Set a custom locale.

View File

@@ -4,18 +4,13 @@
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
The following is an example of automatically submitting a crash report to a
remote server:
The following is an example of setting up Electron to automatically submit
crash reports to a remote server:
```javascript
const { crashReporter } = require('electron')
crashReporter.start({
productName: 'YourName',
companyName: 'YourCompany',
submitURL: 'https://your-domain.com/url-to-submit',
uploadToServer: true
})
crashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })
```
For setting up a server to accept and process crash reports, you can use
@@ -30,11 +25,19 @@ Or use a 3rd party hosted solution:
* [Sentry](https://docs.sentry.io/clients/electron)
* [BugSplat](https://www.bugsplat.com/docs/platforms/electron)
Crash reports are saved locally in an application-specific temp directory folder.
For a `productName` of `YourName`, crash reports will be stored in a folder
named `YourName Crashes` inside the temp directory. You can customize this temp
directory location for your app by calling the `app.setPath('temp', '/my/custom/temp')`
API before starting the crash reporter.
Crash reports are stored temporarily before being uploaded in a directory
underneath the app's user data directory (called 'Crashpad' on Windows and Mac,
or 'Crash Reports' on Linux). You can override this directory by calling
`app.setPath('crashDumps', '/path/to/crashes')` before starting the crash
reporter.
On Windows and macOS, Electron uses
[crashpad](https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md)
to monitor and report crashes. On Linux, Electron uses
[breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/). This
is an implementation detail driven by Chromium, and it may change in future. In
particular, crashpad is newer and will likely eventually replace breakpad on
all platforms.
## Methods
@@ -43,40 +46,68 @@ The `crashReporter` module has the following methods:
### `crashReporter.start(options)`
* `options` Object
* `companyName` String
* `submitURL` String - URL that crash reports will be sent to as POST.
* `productName` String (optional) - Defaults to `app.name`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent to the server. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
* `extra` Record<String, String> (optional) - An object you can define that will be sent along with the
report. Only string properties are sent correctly. Nested objects are not
supported. When using Windows, the property names and values must be fewer than 64 characters.
* `crashesDirectory` String (optional) - Directory to store the crash reports temporarily (only used when the crash reporter is started via `process.crashReporter.start`).
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
`{ globalExtra: { _companyName: ... } }`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent
to the server. If false, crash reports will be collected and stored in the
crashes directory, but not uploaded. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - If true, crashes generated
in the main process will not be forwarded to the system crash handler.
Default is `false`.
* `rateLimit` Boolean (optional) _macOS_ _Windows_ - If true, limit the
number of crashes uploaded to 1/hour. Default is `false`.
* `compress` Boolean (optional) _macOS_ _Windows_ - If true, crash reports
will be compressed and uploaded with `Content-Encoding: gzip`. Not all
collection servers support compressed payloads. Default is `false`.
* `extra` Record<String, String> (optional) - Extra string key/value
annotations that will be sent along with crash reports that are generated
in the main process. Only string values are supported. Crashes generated in
child processes will not contain these extra
parameters to crash reports generated from child processes, call
[`addExtraParameter`](#crashreporteraddextraparameterkey-value) from the
child process.
* `globalExtra` Record<String, String> (optional) - Extra string key/value
annotations that will be sent along with any crash reports generated in any
process. These annotations cannot be changed once the crash reporter has
been started. If a key is present in both the global extra parameters and
the process-specific extra parameters, then the global one will take
precedence. By default, `productName` and the app version are included, as
well as the Electron version.
You are required to call this method before using any other `crashReporter` APIs
and in each process (main/renderer) from which you want to collect crash reports.
You can pass different options to `crashReporter.start` when calling from different processes.
This method must be called before using any other `crashReporter` APIs. Once
initialized this way, the crashpad handler collects crashes from all
subsequently created processes. The crash reporter cannot be disabled once
started.
**Note** Child processes created via the `child_process` module will not have access to the Electron modules.
Therefore, to collect crash reports from them, use `process.crashReporter.start` instead. Pass the same options as above
along with an additional one called `crashesDirectory` that should point to a directory to store the crash
reports temporarily. You can test this out by calling `process.crash()` to crash the child process.
This method should be called as early as possible in app startup, preferably
before `app.on('ready')`. If the crash reporter is not initialized at the time
a renderer process is created, then that renderer process will not be monitored
by the crash reporter.
**Note:** If you need send additional/updated `extra` parameters after your
first call `start` you can call `addExtraParameter` on macOS or call `start`
again with the new/updated `extra` parameters on Linux and Windows.
**Note:** You can test out the crash reporter by generating a crash using
`process.crash()`.
**Note:** On macOS and windows, Electron uses a new `crashpad` client for crash collection and reporting.
If you want to enable crash reporting, initializing `crashpad` from the main process using `crashReporter.start` is required
regardless of which process you want to collect crashes from. Once initialized this way, the crashpad handler collects
crashes from all processes. You still have to call `crashReporter.start` from the renderer or child process, otherwise crashes from
them will get reported without `companyName`, `productName` or any of the `extra` information.
**Note:** If you need to send additional/updated `extra` parameters after your
first call `start` you can call `addExtraParameter`.
**Note:** Parameters passed in `extra`, `globalExtra` or set with
`addExtraParameter` have limits on the length of the keys and values. Key names
must be at most 39 bytes long, and values must be no longer than 127 bytes.
Keys with names longer than the maximum will be silently ignored. Key values
longer than the maximum length will be truncated.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getLastCrashReport()`
Returns [`CrashReport`](structures/crash-report.md):
Returns [`CrashReport`](structures/crash-report.md) - The date and ID of the
last crash report. Only crash reports that have been uploaded will be returned;
even if a crash report is present on disk it will not be returned until it is
uploaded. In the case that there are no uploaded reports, `null` is returned.
Returns the date and ID of the last crash report. Only crash reports that have been uploaded will be returned; even if a crash report is present on disk it will not be returned until it is uploaded. In the case that there are no uploaded reports, `null` is returned.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getUploadedReports()`
@@ -85,43 +116,67 @@ Returns [`CrashReport[]`](structures/crash-report.md):
Returns all uploaded crash reports. Each report contains the date and uploaded
ID.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getUploadToServer()`
Returns `Boolean` - Whether reports should be submitted to the server. Set through
the `start` method or `setUploadToServer`.
**Note:** This API can only be called from the main process.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.setUploadToServer(uploadToServer)`
* `uploadToServer` Boolean _macOS_ - Whether reports should be submitted to the server.
* `uploadToServer` Boolean - Whether reports should be submitted to the server.
This would normally be controlled by user preferences. This has no effect if
called before `start` is called.
**Note:** This API can only be called from the main process.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.addExtraParameter(key, value)` _macOS_ _Windows_
### `crashReporter.getCrashesDirectory()` _Deprecated_
* `key` String - Parameter key, must be less than 64 characters long.
* `value` String - Parameter value, must be less than 64 characters long.
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
Set an extra parameter to be sent with the crash report. The values
specified here will be sent in addition to any values set via the `extra` option when `start` was called. This API is only available on macOS and windows, if you need to add/update extra parameters on Linux after your first call to `start` you can call `start` again with the updated `extra` options.
**Note:** This method is deprecated, use `app.getPath('crashDumps')` instead.
### `crashReporter.removeExtraParameter(key)` _macOS_ _Windows_
### `crashReporter.addExtraParameter(key, value)`
* `key` String - Parameter key, must be less than 64 characters long.
* `key` String - Parameter key, must be no longer than 39 bytes.
* `value` String - Parameter value, must be no longer than 127 bytes.
Remove a extra parameter from the current set of parameters so that it will not be sent with the crash report.
Set an extra parameter to be sent with the crash report. The values specified
here will be sent in addition to any values set via the `extra` option when
`start` was called.
Parameters added in this fashion (or via the `extra` parameter to
`crashReporter.start`) are specific to the calling process. Adding extra
parameters in the main process will not cause those parameters to be sent along
with crashes from renderer or other child processes. Similarly, adding extra
parameters in a renderer process will not result in those parameters being sent
with crashes that occur in other renderer processes or in the main process.
**Note:** Parameters have limits on the length of the keys and values. Key
names must be no longer than 39 bytes, and values must be no longer than 20320
bytes. Keys with names longer than the maximum will be silently ignored. Key
values longer than the maximum length will be truncated.
**Note:** On linux values that are longer than 127 bytes will be chunked into
multiple keys, each 127 bytes in length. E.g. `addExtraParameter('foo', 'a'.repeat(130))`
will result in two chunked keys `foo__1` and `foo__2`, the first will contain
the first 127 bytes and the second will contain the remaining 3 bytes. On
your crash reporting backend you should stitch together keys in this format.
### `crashReporter.removeExtraParameter(key)`
* `key` String - Parameter key, must be no longer than 39 bytes.
Remove a extra parameter from the current set of parameters. Future crashes
will not include this parameter.
### `crashReporter.getParameters()`
See all of the current parameters being passed to the crash reporter.
### `crashReporter.getCrashesDirectory()`
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
Returns `Record<String, String>` - The current 'extra' parameters of the crash reporter.
## Crash Report Payload

View File

@@ -52,6 +52,8 @@ Returns:
* `method` String - Method name.
* `params` any - Event parameters defined by the 'parameters'
attribute in the remote debugging protocol.
* `sessionId` String - Unique identifier of attached debugging session,
will match the value sent from `debugger.sendCommand`.
Emitted whenever the debugging target issues an instrumentation event.
@@ -74,11 +76,16 @@ Returns `Boolean` - Whether a debugger is attached to the `webContents`.
Detaches the debugger from the `webContents`.
#### `debugger.sendCommand(method[, commandParams])`
#### `debugger.sendCommand(method[, commandParams, sessionId])`
* `method` String - Method name, should be one of the methods defined by the
[remote debugging protocol][rdp].
* `commandParams` any (optional) - JSON object with request parameters.
* `sessionId` String (optional) - send command to the target with associated
debugging session id. The initial value can be obtained by sending
[Target.attachToTarget][attachToTarget] message.
[attachToTarget]: https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-attachToTarget
Returns `Promise<any>` - A promise that resolves with the response defined by
the 'returns' attribute of the command description in the remote debugging protocol

View File

@@ -269,6 +269,7 @@ Shows a message box, it will block the process until the message box is closed.
It returns the index of the clicked button.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
If `browserWindow` is not shown dialog will not be attached to it. In such case It will be displayed as independed window.
### `dialog.showMessageBox([browserWindow, ]options)`

View File

@@ -82,16 +82,12 @@ The API is only available in session's `will-download` callback function.
If user doesn't set the save path via the API, Electron will use the original
routine to determine the save path; this usually prompts a save dialog.
**[Deprecated](modernization/property-updates.md): use the `savePath` property instead.**
#### `downloadItem.getSavePath()`
Returns `String` - The save path of the download item. This will be either the path
set via `downloadItem.setSavePath(path)` or the path selected from the shown
save dialog.
**[Deprecated](modernization/property-updates.md): use the `savePath` property instead.**
#### `downloadItem.setSaveDialogOptions(options)`
* `options` SaveDialogOptions - Set the save file dialog options. This object has the same

View File

@@ -53,16 +53,23 @@ Unsupported options are:
### `GOOGLE_API_KEY`
You can provide an API key for making requests to Google's geocoding webservice. To do this, place the following code in your main process
file, before opening any browser windows that will make geocoding requests:
Geolocation support in Electron requires the use of Google Cloud Platform's
geolocation webservice. To enable this feature, acquire a
[Google API key](https://developers.google.com/maps/documentation/geolocation/get-api-key)
and place the following code in your main process file, before opening any
browser windows that will make geolocation requests:
```javascript
process.env.GOOGLE_API_KEY = 'YOUR_KEY_HERE'
```
For instructions on how to acquire a Google API key, visit [this page](https://developers.google.com/maps/documentation/javascript/get-api-key).
By default, a newly generated Google API key may not be allowed to make
geocoding requests. To enable geocoding requests, visit [this page](https://developers.google.com/maps/documentation/geocoding/get-api-key).
By default, a newly generated Google API key may not be allowed to make geolocation requests.
To enable the geolocation webservice for your project, enable it through the
[API library](https://console.cloud.google.com/apis/library).
N.B. You will need to add a
[Billing Account](https://cloud.google.com/billing/docs/how-to/payment-methods#add_a_payment_method)
to the project associated to the API key for the geolocation webservice to work.
### `ELECTRON_NO_ASAR`
@@ -128,3 +135,14 @@ the one downloaded by `npm install`. Usage:
```sh
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
```
## Set By Electron
Electron sets some variables in your environment at runtime.
### `ORIGINAL_XDG_CURRENT_DESKTOP`
This variable is set to the value of `XDG_CURRENT_DESKTOP` that your application
originally launched with. Electron sometimes modifies the value of `XDG_CURRENT_DESKTOP`
to affect other logic within Chromium so if you want access to the _original_ value
you should look up this environment variable instead.

116
docs/api/extensions.md Normal file
View File

@@ -0,0 +1,116 @@
# Chrome Extension Support
Electron supports a subset of the [Chrome Extensions
API][chrome-extensions-api-index], primarily to support DevTools extensions and
Chromium-internal extensions, but it also happens to support some other
extension capabilities.
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
> **Note:** Electron does not support arbitrary Chrome extensions from the
> store, and it is a **non-goal** of the Electron project to be perfectly
> compatible with Chrome's implementation of Extensions.
## Loading extensions
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
work). Extensions are installed per-`session`. To load an extension, call
[`ses.loadExtension`](session.md#sesloadextensionpath):
```js
const { session } = require('electron')
session.loadExtension('path/to/unpacked/extension').then(({ id }) => {
// ...
})
```
Loaded extensions will not be automatically remembered across exits; if you do
not call `loadExtension` when the app runs, the extension will not be loaded.
Note that loading extensions is only supported in persistent sessions.
Attempting to load an extension into an in-memory session will throw an error.
See the [`session`](session.md) documentation for more information about
loading, unloading, and querying active extensions.
## Supported Extensions APIs
We support the following extensions APIs, with some caveats. Other APIs may
additionally be supported, but support for any APIs not listed here is
provisional and may be removed.
### `chrome.devtools.inspectedWindow`
All features of this API are supported.
### `chrome.devtools.network`
All features of this API are supported.
### `chrome.devtools.panels`
All features of this API are supported.
### `chrome.extension`
The following properties of `chrome.extension` are supported:
- `chrome.extension.lastError`
The following methods of `chrome.extension` are supported:
- `chrome.extension.getURL`
- `chrome.extension.getBackgroundPage`
### `chrome.runtime`
The following properties of `chrome.runtime` are supported:
- `chrome.runtime.lastError`
- `chrome.runtime.id`
The following methods of `chrome.runtime` are supported:
- `chrome.runtime.getBackgroundPage`
- `chrome.runtime.getManifest`
- `chrome.runtime.getURL`
- `chrome.runtime.connect`
- `chrome.runtime.sendMessage`
The following events of `chrome.runtime` are supported:
- `chrome.runtime.onStartup`
- `chrome.runtime.onInstalled`
- `chrome.runtime.onSuspend`
- `chrome.runtime.onSuspendCanceled`
- `chrome.runtime.onConnect`
- `chrome.runtime.onMessage`
### `chrome.storage`
Only `chrome.storage.local` is supported; `chrome.storage.sync` and
`chrome.storage.managed` are not.
### `chrome.tabs`
The following methods of `chrome.tabs` are supported:
- `chrome.tabs.sendMessage`
- `chrome.tabs.executeScript`
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
> supported and will raise an error.
### `chrome.management`
The following methods of `chrome.management` are supported:
- `chrome.management.getAll`
- `chrome.management.get`
- `chrome.management.getSelf`
- `chrome.management.getPermissionWarningsById`
- `chrome.management.getPermissionWarningsByManifest`
- `chrome.management.onEnabled`
- `chrome.management.onDisabled`

View File

@@ -52,7 +52,7 @@ win.show()
Uses custom drawn close, and miniaturize buttons that display
when hovering in the top left of the window. The fullscreen button
is not available due to restrictions of frameless windows as they
interface with Apple's MacOS window masks. These custom buttons prevent
interface with Apple's macOS window masks. These custom buttons prevent
issues with mouse events that occur with the standard window toolbar buttons.
This option is only applicable for frameless windows.
@@ -158,7 +158,7 @@ buttons in titlebar non-draggable.
## Text selection
In a frameless window the dragging behaviour may conflict with selecting text.
In a frameless window the dragging behavior may conflict with selecting text.
For example, when you drag the titlebar you may accidentally select the text on
the titlebar. To prevent this, you need to disable text selection within a
draggable area like this:

View File

@@ -57,7 +57,7 @@ Removes all listeners, or those of the specified `channel`.
Send an asynchronous message to the main process via `channel`, along with
arguments. Arguments will be serialized with the [Structured Clone
Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
@@ -68,6 +68,10 @@ throw an exception.
The main process handles it by listening for `channel` with the
[`ipcMain`](ipc-main.md) module.
If you need to transfer a [`MessagePort`][] to the main process, use [`ipcRenderer.postMessage`](#ipcrendererpostmessagechannel-message-transfer).
If you want to receive a single response from the main process, like the result of a method call, consider using [`ipcRenderer.invoke`](#ipcrendererinvokechannel-args).
### `ipcRenderer.invoke(channel, ...args)`
* `channel` String
@@ -77,7 +81,7 @@ Returns `Promise<any>` - Resolves with the response from the main process.
Send a message to the main process via `channel` and expect a result
asynchronously. Arguments will be serialized with the [Structured Clone
Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
@@ -102,6 +106,10 @@ ipcMain.handle('some-name', async (event, someArgument) => {
})
```
If you need to transfer a [`MessagePort`][] to the main process, use [`ipcRenderer.postMessage`](#ipcrendererpostmessagechannel-message-transfer).
If you do not need a respons to the message, consider using [`ipcRenderer.send`](#ipcrenderersendchannel-args).
### `ipcRenderer.sendSync(channel, ...args)`
* `channel` String
@@ -111,7 +119,7 @@ Returns `any` - The value sent back by the [`ipcMain`](ipc-main.md) handler.
Send a message to the main process via `channel` and expect a result
synchronously. Arguments will be serialized with the [Structured Clone
Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
@@ -127,6 +135,35 @@ and replies by setting `event.returnValue`.
> last resort. It's much better to use the asynchronous version,
> [`invoke()`](ipc-renderer.md#ipcrendererinvokechannel-args).
### `ipcRenderer.postMessage(channel, message, [transfer])`
* `channel` String
* `message` any
* `transfer` MessagePort[] (optional)
Send a message to the main process, optionally transferring ownership of zero
or more [`MessagePort`][] objects.
The transferred `MessagePort` objects will be available in the main process as
[`MessagePortMain`](message-port-main.md) objects by accessing the `ports`
property of the emitted event.
For example:
```js
// Renderer process
const { port1, port2 } = new MessageChannel()
ipcRenderer.postMessage('port', { message: 'hello' }, [port1])
// Main process
ipcMain.on('port', (e, msg) => {
const [port] = e.ports
// ...
})
```
For more information on using `MessagePort` and `MessageChannel`, see the [MDN
documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).
### `ipcRenderer.sendTo(webContentsId, channel, ...args)`
* `webContentsId` Number
@@ -150,4 +187,5 @@ in the [`ipc-renderer-event`](structures/ipc-renderer-event.md) structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
[`window.postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
[`MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort

View File

@@ -12,9 +12,9 @@ See [`Menu`](menu.md) for examples.
* `click` Function (optional) - Will be called with
`click(menuItem, browserWindow, event)` when the menu item is clicked.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md)
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.
@@ -69,6 +69,7 @@ a `type`.
The `role` property can have following values:
* `undo`
* `about` - Trigger a native about panel (custom message box on Window, which does not provide its own).
* `redo`
* `cut`
* `copy`
@@ -94,7 +95,6 @@ The `role` property can have following values:
The following additional roles are available on _macOS_:
* `appMenu` - Whole default "App" menu (About, Services, etc.)
* `about` - Map to the `orderFrontStandardAboutPanel` action.
* `hide` - Map to the `hide` action.
* `hideOthers` - Map to the `hideOtherApplications` action.
* `unhide` - Map to the `unhideAllApplications` action.
@@ -117,7 +117,7 @@ When specifying a `role` on macOS, `label` and `accelerator` are the only
options that will affect the menu item. All other options will be ignored.
Lowercase `role`, e.g. `toggledevtools`, is still supported.
**Nota Bene:** The `enabled` and `visibility` properties are not available for top-level menu items in the tray on MacOS.
**Nota Bene:** The `enabled` and `visibility` properties are not available for top-level menu items in the tray on macOS.
### Instance Properties
@@ -151,7 +151,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme
#### `menuItem.role`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
#### `menuItem.accelerator`

View File

@@ -0,0 +1,30 @@
# MessageChannelMain
`MessageChannelMain` is the main-process-side equivalent of the DOM
[`MessageChannel`][] object. Its singular function is to create a pair of
connected [`MessagePortMain`](message-port-main.md) objects.
See the [Channel Messaging API][] documentation for more information on using
channel messaging.
## Class: MessageChannelMain
Example:
```js
const { port1, port2 } = new MessageChannelMain()
w.webContents.postMessage('port', null, [port2])
port1.postMessage({ some: 'message' })
```
### Instance Properties
#### `channel.port1`
A [`MessagePortMain`](message-port-main.md) property.
#### `channel.port2`
A [`MessagePortMain`](message-port-main.md) property.
[`MessageChannel`]: https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel
[Channel Messaging API]: https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API

View File

@@ -0,0 +1,49 @@
# MessagePortMain
`MessagePortMain` is the main-process-side equivalent of the DOM
[`MessagePort`][] object. It behaves similarly to the DOM version, with the
exception that it uses the Node.js `EventEmitter` event system, instead of the
DOM `EventTarget` system. This means you should use `port.on('message', ...)`
to listen for events, instead of `port.onmessage = ...` or
`port.addEventListener('message', ...)`
See the [Channel Messaging API][] documentation for more information on using
channel messaging.
`MessagePortMain` is an [EventEmitter][event-emitter].
## Class: MessagePortMain
### Instance Methods
#### `port.postMessage(message, [transfer])`
* `message` any
* `transfer` MessagePortMain[] (optional)
Sends a message from the port, and optionally, transfers ownership of objects
to other browsing contexts.
#### `port.start()`
Starts the sending of messages queued on the port. Messages will be queued
until this method is called.
#### `port.close()`
Disconnects the port, so it is no longer active.
### Instance Events
#### Event: 'message'
Returns:
* `messageEvent` Object
* `data` any
* `ports` MessagePortMain[]
Emitted when a MessagePortMain object receives a message.
[`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

View File

@@ -5,14 +5,7 @@ The Electron team is currently undergoing an initiative to convert separate gett
## Candidates
* `BrowserWindow`
* `fullscreen`
* `simpleFullscreen`
* `alwaysOnTop`
* `title`
* `documentEdited`
* `hasShadow`
* `menubarVisible`
* `visibleOnAllWorkspaces`
* `crashReporter` module
* `uploadToServer`
* `webFrame` modules
@@ -45,9 +38,3 @@ The Electron team is currently undergoing an initiative to convert separate gett
* `isMacTemplateImage`
* `SystemPreferences` module
* `appLevelAppearance`
* `webContents` module
* `audioMuted`
* `frameRate`
* `userAgent`
* `zoomFactor`
* `zoomLevel`

View File

@@ -276,14 +276,10 @@ Returns [`Size`](structures/size.md)
Marks the image as a template image.
**[Deprecated](modernization/property-updates.md)**
#### `image.isTemplateImage()`
Returns `Boolean` - Whether the image is a template image.
**[Deprecated](modernization/property-updates.md)**
#### `image.crop(rect)`
* `rect` [Rectangle](structures/rectangle.md) - The area of the image to crop.

View File

@@ -24,19 +24,19 @@ app.whenReady().then(() => {
The `powerMonitor` module emits the following events:
### Event: 'suspend'
### Event: 'suspend' _macOS_ _Windows_
Emitted when the system is suspending.
### Event: 'resume'
### Event: 'resume' _macOS_ _Windows_
Emitted when system is resuming.
### Event: 'on-ac' _Windows_
### Event: 'on-ac' _macOS_ _Windows_
Emitted when the system changes to AC power.
### Event: 'on-battery' _Windows_
### Event: 'on-battery' _macOS_ _Windows_
Emitted when system changes to battery power.

View File

@@ -51,7 +51,7 @@ app.whenReady().then(() => {
In the above code the [`BrowserWindow`](browser-window.md) that was created has Node.js disabled and can communicate
only via IPC. The use of this option stops Electron from creating a Node.js runtime in the renderer. Also,
within this new window `window.open` follows the native behaviour (by default Electron creates a [`BrowserWindow`](browser-window.md)
within this new window `window.open` follows the native behavior (by default Electron creates a [`BrowserWindow`](browser-window.md)
and returns a proxy to this via `window.open`).
[`app.enableSandbox`](app.md#appenablesandbox-experimental) can be used to force `sandbox: true` for all `BrowserWindow` instances.

View File

@@ -0,0 +1,62 @@
## Class: ServiceWorkers
> Query and receive events from a sessions active service workers.
Process: [Main](../glossary.md#main-process)
Instances of the `ServiceWorkers` class are accessed by using `serviceWorkers` property of
a `Session`.
For example:
```javascript
const { session } = require('electron')
// Get all service workers.
console.log(session.defaultSession.serviceWorkers.getAllRunning())
// Handle logs and get service worker info
session.defaultSession.serviceWorkers.on('console-message', (event, messageDetails) => {
console.log(
'Got service worker message',
messageDetails,
'from',
session.defaultSession.serviceWorkers.getFromVersionID(messageDetails.versionId)
)
})
```
### Instance Events
The following events are available on instances of `ServiceWorkers`:
#### Event: 'console-message'
Returns:
* `event` Event
* `messageDetails` Object - Information about the console message
* `message` String - The actual console message
* `versionId` Number - The version ID of the service worker that sent the log message
* `source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `sourceUrl` String - The URL the message came from
* `lineNumber` Number - The line number of the source that triggered this console message
Emitted when a service worker logs something to the console.
### Instance Methods
The following methods are available on instances of `ServiceWorkers`:
#### `serviceWorkers.getAllRunning()`
Returns `Record<Number, ServiceWorkerInfo>` - A [ServiceWorkerInfo](structures/service-worker-info.md) object where the keys are the service worker version ID and the values are the information about that service worker.
#### `serviceWorkers.getFromVersionID(versionId)`
* `versionId` Number
Returns [`ServiceWorkerInfo`](structures/service-worker-info.md) - Information about this service worker
If the service worker does not exist or is not running this method will throw an exception.

View File

@@ -105,6 +105,45 @@ Returns:
Emitted when a render process requests preconnection to a URL, generally due to
a [resource hint](https://w3c.github.io/resource-hints/).
#### Event: 'spellcheck-dictionary-initialized'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file has been successfully initialized. This
occurs after the file has been downloaded.
#### Event: 'spellcheck-dictionary-download-begin'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file starts downloading
#### Event: 'spellcheck-dictionary-download-success'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file has been successfully downloaded
#### Event: 'spellcheck-dictionary-download-failure'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file download fails. For details
on the failure you should collect a netlog and inspect the download
request.
### Instance Methods
The following methods are available on instances of `Session`:
@@ -483,18 +522,38 @@ setting with the current OS locale. This setting is persisted across restarts.
By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this
behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell
dictionaries. We publish a `hunspell_dictionaries.zip` file with each release which contains the files you need
to host here.
to host here, the file server must be **case insensitive** you must upload each file twice, once with the case it
has in the ZIP file and once with the filename as all lower case.
If the files present in `hunspell_dictionaries.zip` are available at `https://example.com/dictionaries/language-code.bdic`
then you should call this api with `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`. Please
note the trailing slash. The URL to the dictionaries is formed as `${url}${filename}`.
**Note:** On macOS the OS spellchecker is used and therefore we do not download any dictionary files. This API is a no-op on macOS.
#### `ses.listWordsInSpellCheckerDictionary()`
Returns `Promise<String[]>` - An array of all words in app's custom dictionary.
Resolves when the full dictionary is loaded from disk.
#### `ses.addWordToSpellCheckerDictionary(word)`
* `word` String - The word you want to add to the dictionary
Returns `Boolean` - Whether the word was successfully written to the custom dictionary.
Returns `Boolean` - Whether the word was successfully written to the custom dictionary. This API
will not work on non-persistent (in-memory) sessions.
**Note:** On macOS and Windows 10 this word will be written to the OS custom dictionary as well
#### `ses.removeWordFromSpellCheckerDictionary(word)`
* `word` String - The word you want to remove from the dictionary
Returns `Boolean` - Whether the word was successfully removed from the custom dictionary. This API
will not work on non-persistent (in-memory) sessions.
**Note:** On macOS and Windows 10 this word will be removed from the OS custom dictionary as well
#### `ses.loadExtension(path)`
* `path` String - Path to a directory containing an unpacked Chrome extension
@@ -567,6 +626,10 @@ code to the `setSpellCheckerLanaguages` API that isn't in this array will result
A [`Cookies`](cookies.md) object for this session.
#### `ses.serviceWorkers` _Readonly_
A [`ServiceWorkers`](service-workers.md) object for this session.
#### `ses.webRequest` _Readonly_
A [`WebRequest`](web-request.md) object for this session.

View File

@@ -1,5 +1,8 @@
# Extension Object
* `id` String
* `manifest` any - Copy of the [extension's manifest data](https://developer.chrome.com/extensions/manifest).
* `name` String
* `path` String - The extension's file path.
* `version` String
* `url` String - The extension's `chrome-extension://` URL.

View File

@@ -3,6 +3,7 @@
* `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
* `ports` MessagePortMain[] - 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,6 @@
* `sender` IpcRenderer - 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
[ipc-renderer-sendto]: #ipcrenderersendtowindowid-channel--arg1-arg2-

View File

@@ -0,0 +1,4 @@
# NewWindowEvent Object extends `Event`
* `newGuest` BrowserWindow (optional)

View File

@@ -7,4 +7,5 @@
* `contentLengths` Number[] - The total size of the content, in bytes.
* `price` Number - The cost of the product in the local currency.
* `formattedPrice` String - The locale formatted price of the product.
* `currencyCode` String - 3 character code presenting a product's currency based on the ISO 4217 standard.
* `isDownloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.

View File

@@ -0,0 +1,5 @@
# ServiceWorkerInfo Object
* `scriptUrl` String - The full URL to the script that this service worker runs
* `scope` String - The base URL that this service worker is active for.
* `renderProcessId` Number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`.

View File

@@ -326,7 +326,7 @@ This API is only available on macOS 10.14 Mojave or newer.
* `window-frame-text` - The text in the window's titlebar area.
Returns `String` - The system color setting in RGB hexadecimal form (`#ABCDEF`).
See the [Windows docs][windows-colors] and the [MacOS docs][macos-colors] for more details.
See the [Windows docs][windows-colors] and the [macOS docs][macos-colors] for more details.
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`.
@@ -360,7 +360,7 @@ Returns `Boolean` - `true` if an inverted color scheme (a high contrast color sc
Returns `Boolean` - `true` if a high contrast theme is active, `false` otherwise.
**Depreacted:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API.
**Deprecated:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API.
### `systemPreferences.getEffectiveAppearance()` _macOS_
@@ -369,16 +369,6 @@ Returns `String` - Can be `dark`, `light` or `unknown`.
Gets the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
Please note that until Electron is built targeting the 10.14 SDK, your application's
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
the interim in order for your application to inherit the OS preference you must set the
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
for more details.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.getAppLevelAppearance()` _macOS_ _Deprecated_
Returns `String` | `null` - Can be `dark`, `light` or `unknown`.
@@ -387,8 +377,6 @@ Gets the macOS appearance setting that you have declared you want for
your application, maps to [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc).
You can use the `setAppLevelAppearance` API to set this value.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.setAppLevelAppearance(appearance)` _macOS_ _Deprecated_
* `appearance` String | null - Can be `dark` or `light`
@@ -396,16 +384,12 @@ You can use the `setAppLevelAppearance` API to set this value.
Sets the appearance setting for your application, this should override the
system default and override the value of `getEffectiveAppearance`.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.canPromptTouchID()` _macOS_
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.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.promptTouchID(reason)` _macOS_
* `reason` String - The reason you are asking for Touch ID authentication
@@ -432,7 +416,7 @@ This API itself will not protect your user data; rather, it is a mechanism to al
Returns `Boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_
### `systemPreferences.getMediaAccessStatus(mediaType)` _Windows_ _macOS_
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
@@ -442,6 +426,9 @@ This user consent was not required on macOS 10.13 High Sierra or lower so this m
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
macOS 10.15 Catalina or higher requires consent for `screen` access.
Windows 10 has a global setting controlling `microphone` and `camera` access for all win32 applications.
It will always return `granted` for `screen` and for all media types on older versions of Windows.
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_
* `mediaType` String - the type of media being requested; can be `microphone`, `camera`.
@@ -480,11 +467,3 @@ A `String` property that can be `dark`, `light` or `unknown`.
Returns the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
Please note that until Electron is built targeting the 10.14 SDK, your application's
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
the interim in order for your application to inherit the OS preference you must set the
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
for more details.

View File

@@ -138,7 +138,7 @@ Emitted when page receives favicon urls.
Returns:
* `event` Event
* `event` NewWindowEvent
* `url` String
* `frameName` String
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
@@ -325,7 +325,7 @@ win.webContents.on('will-prevent-unload', (event) => {
})
```
#### Event: 'crashed'
#### Event: 'crashed' _Deprecated_
Returns:
@@ -334,6 +334,29 @@ Returns:
Emitted when the renderer process crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process dissapeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
#### Event: 'render-process-gone'
Returns:
* `event` Event
* `details` Object
* `reason` String - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
Emitted when the renderer process unexpectedly dissapears. This is normally
because it was crashed or killed.
#### Event: 'unresponsive'
Emitted when the web page becomes unresponsive.
@@ -366,6 +389,7 @@ Returns:
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
* `isComposing` Boolean - Equivalent to [KeyboardEvent.isComposing][keyboardevent].
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
@@ -871,10 +895,10 @@ Returns `String` - The URL of the current web page.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
let currentURL = win.webContents.getURL()
console.log(currentURL)
win.loadURL('http://github.com').then(() => {
const currentURL = win.webContents.getURL()
console.log(currentURL)
})
```
#### `contents.getTitle()`
@@ -967,14 +991,10 @@ Returns `Boolean` - Whether the renderer process has crashed.
Overrides the user agent for this web page.
**[Deprecated](modernization/property-updates.md)**
#### `contents.getUserAgent()`
Returns `String` - The user agent for this web page.
**[Deprecated](modernization/property-updates.md)**
#### `contents.insertCSS(css[, options])`
* `css` String
@@ -1054,33 +1074,27 @@ Ignore application menu shortcuts while this web contents is focused.
Mute the audio on the current web page.
**[Deprecated](modernization/property-updates.md)**
#### `contents.isAudioMuted()`
Returns `Boolean` - Whether this page has been muted.
**[Deprecated](modernization/property-updates.md)**
#### `contents.isCurrentlyAudible()`
Returns `Boolean` - Whether audio is currently playing.
#### `contents.setZoomFactor(factor)`
* `factor` Number - Zoom factor.
* `factor` Double - Zoom factor; default is 1.0.
Changes the zoom factor to the specified factor. Zoom factor is
zoom percent divided by 100, so 300% = 3.0.
**[Deprecated](modernization/property-updates.md)**
The factor must be greater than 0.0.
#### `contents.getZoomFactor()`
Returns `Number` - the current zoom factor.
**[Deprecated](modernization/property-updates.md)**
#### `contents.setZoomLevel(level)`
* `level` Number - Zoom level.
@@ -1090,14 +1104,10 @@ increment above or below represents zooming 20% larger or smaller to default
limits of 300% and 50% of original size, respectively. The formula for this is
`scale := 1.2 ^ level`.
**[Deprecated](modernization/property-updates.md)**
#### `contents.getZoomLevel()`
Returns `Number` - the current zoom level.
**[Deprecated](modernization/property-updates.md)**
#### `contents.setVisualZoomLevelLimits(minimumLevel, maximumLevel)`
* `minimumLevel` Number
@@ -1286,7 +1296,9 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`.
* `callback` Function (optional)
* `success` Boolean - Indicates success of the print call.
* `failureReason` String - Called back if the print fails; can be `cancelled` or `failed`.
* `failureReason` String - Error description called back if the print fails.
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minumum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings for printing.
@@ -1311,13 +1323,12 @@ win.webContents.print(options, (success, errorType) => {
* `landscape` Boolean (optional) - `true` for landscape, `false` for portrait.
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin.
and `width` in microns.
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
* `pageRanges` Record<string, number> (optional) - The page range to print.
* `from` Number - the first page to print.
* `to` Number - the last page to print (inclusive).
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean (optional) - Whether to print selection only.
@@ -1593,6 +1604,32 @@ ipcMain.on('ping', (event) => {
})
```
#### `contents.postMessage(channel, message, [transfer])`
* `channel` String
* `message` any
* `transfer` MessagePortMain[] (optional)
Send a message to the renderer process, optionally transferring ownership of
zero or more [`MessagePortMain`][] objects.
The transferred `MessagePortMain` objects will be available in the renderer
process by accessing the `ports` property of the emitted event. When they
arrive in the renderer, they will be native DOM `MessagePort` objects.
For example:
```js
// Main process
const { port1, port2 } = new MessageChannelMain()
webContents.postMessage('port', { message: 'hello' }, [port1])
// Renderer process
ipcRenderer.on('port', (e, msg) => {
const [port] = e.ports
// ...
})
```
#### `contents.enableDeviceEmulation(parameters)`
* `parameters` Object
@@ -1709,14 +1746,10 @@ Returns `Boolean` - If *offscreen rendering* is enabled returns whether it is cu
If *offscreen rendering* is enabled sets the frame rate to the specified number.
Only values between 1 and 60 are accepted.
**[Deprecated](modernization/property-updates.md)**
#### `contents.getFrameRate()`
Returns `Integer` - If *offscreen rendering* is enabled returns the current frame rate.
**[Deprecated](modernization/property-updates.md)**
#### `contents.invalidate()`
Schedules a full repaint of the window this web contents is in.
@@ -1822,7 +1855,7 @@ A [`WebContents`](web-contents.md) instance that might own this `WebContents`.
#### `contents.devToolsWebContents` _Readonly_
A `WebContents` of DevTools for this `WebContents`.
A `WebContents | null` property that represents the of DevTools `WebContents` associated with a given `WebContents`.
**Note:** Users should never store this object because it may become `null`
when the DevTools has been closed.

View File

@@ -22,11 +22,13 @@ The `WebFrame` class has the following instance methods:
### `webFrame.setZoomFactor(factor)`
* `factor` Number - Zoom factor.
* `factor` Double - Zoom factor; default is 1.0.
Changes the zoom factor to the specified factor. Zoom factor is
zoom percent divided by 100, so 300% = 3.0.
The factor must be greater than 0.0.
### `webFrame.getZoomFactor()`
Returns `Number` - The current zoom factor.
@@ -122,13 +124,20 @@ by its key, which is returned from `webFrame.insertCSS(css)`.
Inserts `text` to the focused element.
### `webFrame.executeJavaScript(code[, userGesture])`
### `webFrame.executeJavaScript(code[, userGesture, callback])`
* `code` String
* `userGesture` Boolean (optional) - Default is `false`.
* `callback` Function (optional) - Called after script has been executed. Unless
the frame is suspended (e.g. showing a modal alert), execution will be
synchronous and the callback will be invoked before the method returns. For
compatibility with an older version of this method, the error parameter is
second.
* `result` Any
* `error` Error
Returns `Promise<any>` - A promise that resolves with the result of the executed code
or is rejected if the result of the code is a rejected promise.
Returns `Promise<any>` - A promise that resolves with the result of the executed
code or is rejected if execution throws or results in a rejected promise.
Evaluates `code` in page.
@@ -136,17 +145,31 @@ In the browser window some HTML APIs like `requestFullScreen` can only be
invoked by a gesture from the user. Setting `userGesture` to `true` will remove
this limitation.
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])`
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture, callback])`
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. You can provide any integer here.
* `worldId` Integer - The ID of the world to run the javascript
in, `0` is the default main world (where content runs), `999` is the
world used by Electron's `contextIsolation` feature. Accepts values
in the range 1..536870911.
* `scripts` [WebSource[]](structures/web-source.md)
* `userGesture` Boolean (optional) - Default is `false`.
* `callback` Function (optional) - Called after script has been executed. Unless
the frame is suspended (e.g. showing a modal alert), execution will be
synchronous and the callback will be invoked before the method returns. For
compatibility with an older version of this method, the error parameter is
second.
* `result` Any
* `error` Error
Returns `Promise<any>` - A promise that resolves with the result of the executed code
or is rejected if the result of the code is a rejected promise.
Returns `Promise<any>` - A promise that resolves with the result of the executed
code or is rejected if execution could not start.
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
Note that when the execution of script fails, the returned promise will not
reject and the `result` would be `undefined`. This is because Chromium does not
dispatch errors of isolated worlds to foreign worlds.
### `webFrame.setIsolatedWorldInfo(worldId, info)`
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
* `info` Object

View File

@@ -146,6 +146,7 @@ response are visible by the time this listener is fired.
* `timestamp` Double
* `statusLine` String
* `statusCode` Integer
* `requestHeaders` Record<string, string>
* `responseHeaders` Record<string, string[]> (optional)
* `callback` Function
* `headersReceivedResponse` Object
@@ -228,6 +229,7 @@ redirect is about to occur.
* `fromCache` Boolean
* `statusCode` Integer
* `statusLine` String
* `error` String
The `listener` will be called with `listener(details)` when a request is
completed.

View File

@@ -1,61 +0,0 @@
# Breaking changes (NetworkService) (Draft)
This document describes changes to Electron APIs after migrating network code
to NetworkService API.
We don't currently have an estimate of when we will enable `NetworkService` by
default in Electron, but as Chromium is already removing non-`NetworkService`
code, we might switch before Electron 10.
The content of this document should be moved to `breaking-changes.md` once we have
determined when to enable `NetworkService` in Electron.
## Planned Breaking API Changes
### `protocol.unregisterProtocol`
### `protocol.uninterceptProtocol`
The APIs are now synchronous and the optional callback is no longer needed.
```javascript
// Deprecated
protocol.unregisterProtocol(scheme, () => { /* ... */ })
// Replace with
protocol.unregisterProtocol(scheme)
```
### `protocol.registerFileProtocol`
### `protocol.registerBufferProtocol`
### `protocol.registerStringProtocol`
### `protocol.registerHttpProtocol`
### `protocol.registerStreamProtocol`
### `protocol.interceptFileProtocol`
### `protocol.interceptStringProtocol`
### `protocol.interceptBufferProtocol`
### `protocol.interceptHttpProtocol`
### `protocol.interceptStreamProtocol`
The APIs are now synchronous and the optional callback is no longer needed.
```javascript
// Deprecated
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
// Replace with
protocol.registerFileProtocol(scheme, handler)
```
The registered or intercepted protocol does not have effect on current page
until navigation happens.
### `protocol.isProtocolHandled`
This API is deprecated and users should use `protocol.isProtocolRegistered`
and `protocol.isProtocolIntercepted` instead.
```javascript
// Deprecated
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
// Replace with
const isRegistered = protocol.isProtocolRegistered(scheme)
const isIntercepted = protocol.isProtocolIntercepted(scheme)
```

View File

@@ -2,13 +2,172 @@
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](tutorial/electron-versioning.md#semver) before the change is made.
## `FIXME` comments
### Types of Breaking Changes
The `FIXME` string is used in code comments to denote things that should be fixed for future releases. See https://github.com/electron/electron/search?q=fixme
This document uses the following convention to categorize breaking changes:
- **API Changed:** An API was changed in such a way that code that has not been updated is guaranteed to throw an exception.
- **Behavior Changed:** The behavior of Electron has changed, but not in such a way that an exception will necessarily be thrown.
- **Default Changed:** Code depending on the old default may break, not necessarily throwing an exception. The old behavior can be restored by explicitly specifying the value.
- **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
- **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (12.0)
### Removed: `crashReporter` methods in the renderer process
The following `crashReporter` methods are no longer available in the renderer
process:
- `crashReporter.start`
- `crashReporter.getLastCrashReport`
- `crashReporter.getUploadedReports`
- `crashReporter.getUploadToServer`
- `crashReporter.setUploadToServer`
- `crashReporter.getCrashesDirectory`
They should be called only from the main process.
See [#23265](https://github.com/electron/electron/pull/23265) for more details.
## Planned Breaking API Changes (11.0)
## Planned Breaking API Changes (10.0)
### Deprecated: `companyName` argument to `crashReporter.start()`
The `companyName` argument to `crashReporter.start()`, which was previously
required, is now optional, and further, is deprecated. To get the same
behavior in a non-deprecated way, you can pass a `companyName` value in
`globalExtra`.
```js
// Deprecated in Electron 10
crashReporter.start({ companyName: 'Umbrella Corporation' })
// Replace with
crashReporter.start({ globalExtra: { _companyName: 'Umbrella Corporation' } })
```
### Deprecated: `crashReporter.getCrashesDirectory()`
The `crashReporter.getCrashesDirectory` method has been deprecated. Usage
should be replaced by `app.getPath('crashDumps')`.
```js
// Deprecated in Electron 10
crashReporter.getCrashesDirectory()
// Replace with
app.getPath('crashDumps')
```
### Deprecated: `crashReporter` methods in the renderer process
Calling the following `crashReporter` methods from the renderer process is
deprecated:
- `crashReporter.start`
- `crashReporter.getLastCrashReport`
- `crashReporter.getUploadedReports`
- `crashReporter.getUploadToServer`
- `crashReporter.setUploadToServer`
- `crashReporter.getCrashesDirectory`
The only non-deprecated methods remaining in the `crashReporter` module in the
renderer are `addExtraParameter`, `removeExtraParameter` and `getParameters`.
All above methods remain non-deprecated when called from the main process.
See [#23265](https://github.com/electron/electron/pull/23265) for more details.
### Removed: Browser Window Affinity
The `affinity` option when constructing a new `BrowserWindow` will be removed
as part of our plan to more closely align with Chromium's process model for security,
performance and maintainability.
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
### Default Changed: `enableRemoteModule` defaults to `false`
In Electron 9, using the remote module without explicitly enabling it via the
`enableRemoteModule` WebPreferences option began emitting a warning. In
Electron 10, the remote module is now disabled by default. To use the remote
module, `enableRemoteModule: true` must be specified in WebPreferences:
```js
const w = new BrowserWindow({
webPreferences: {
enableRemoteModule: true
}
})
```
We [recommend moving away from the remote
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
### `protocol.unregisterProtocol`
### `protocol.uninterceptProtocol`
The APIs are now synchronous and the optional callback is no longer needed.
```javascript
// Deprecated
protocol.unregisterProtocol(scheme, () => { /* ... */ })
// Replace with
protocol.unregisterProtocol(scheme)
```
### `protocol.registerFileProtocol`
### `protocol.registerBufferProtocol`
### `protocol.registerStringProtocol`
### `protocol.registerHttpProtocol`
### `protocol.registerStreamProtocol`
### `protocol.interceptFileProtocol`
### `protocol.interceptStringProtocol`
### `protocol.interceptBufferProtocol`
### `protocol.interceptHttpProtocol`
### `protocol.interceptStreamProtocol`
The APIs are now synchronous and the optional callback is no longer needed.
```javascript
// Deprecated
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
// Replace with
protocol.registerFileProtocol(scheme, handler)
```
The registered or intercepted protocol does not have effect on current page
until navigation happens.
### `protocol.isProtocolHandled`
This API is deprecated and users should use `protocol.isProtocolRegistered`
and `protocol.isProtocolIntercepted` instead.
```javascript
// Deprecated
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
// Replace with
const isRegistered = protocol.isProtocolRegistered(scheme)
const isIntercepted = protocol.isProtocolIntercepted(scheme)
```
## Planned Breaking API Changes (9.0)
### `<webview>.getWebContents()`
### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
As of Electron 9 we do not allow loading of non-context-aware native modules in
the renderer process. This is to improve security, performance and maintainability
of Electron as a project.
If this impacts you, you can temporarily set `app.allowRendererProcessReuse` to `false`
to revert to the old behavior. This flag will only be an option until Electron 11 so
you should plan to update your native modules to be context aware.
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
### Removed: `<webview>.getWebContents()`
This API, which was deprecated in Electron 8.0, is now removed.
@@ -20,7 +179,7 @@ const { remote } = require('electron')
remote.webContents.fromId(webview.getWebContentsId())
```
### `webFrame.setLayoutZoomLevelLimits()`
### Removed: `webFrame.setLayoutZoomLevelLimits()`
Chromium has removed support for changing the layout zoom level limits, and it
is beyond Electron's capacity to maintain it. The function was deprecated in
@@ -28,7 +187,7 @@ Electron 8.x, and has been removed in Electron 9.x. The layout zoom level limits
are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
[here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11).
### Sending non-JS objects over IPC now throws an exception
### Behavior Changed: Sending non-JS objects over IPC now throws an exception
In Electron 8.0, IPC was changed to use the Structured Clone Algorithm,
bringing significant performance improvements. To help ease the transition, the
@@ -44,9 +203,14 @@ In Electron 9.0, the old serialization algorithm has been removed, and sending
such non-serializable objects will now throw an "object could not be cloned"
error.
### API Changed: `shell.openItem` is now `shell.openPath`
The `shell.openItem` API has been replaced with an asynchronous `shell.openPath` API.
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/master/wg-api/spec-documents/shell-openitem.md).
## Planned Breaking API Changes (8.0)
### Values sent over IPC are now serialized with Structured Clone Algorithm
### Behavior Changed: Values sent over IPC are now serialized with Structured Clone Algorithm
The algorithm used to serialize objects sent over IPC (through
`ipcRenderer.send`, `ipcRenderer.sendSync`, `WebContents.send` and related
@@ -97,7 +261,7 @@ these kinds of objects will throw a 'could not be cloned' error.
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
### `<webview>.getWebContents()`
### Deprecated: `<webview>.getWebContents()`
This API is implemented using the `remote` module, which has both performance
and security implications. Therefore its usage should be explicit.
@@ -138,7 +302,7 @@ const { ipcRenderer } = require('electron')
ipcRenderer.invoke('openDevTools', webview.getWebContentsId())
```
### `webFrame.setLayoutZoomLevelLimits()`
### Deprecated: `webFrame.setLayoutZoomLevelLimits()`
Chromium has removed support for changing the layout zoom level limits, and it
is beyond Electron's capacity to maintain it. The function will emit a warning
@@ -148,7 +312,7 @@ limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
## Planned Breaking API Changes (7.0)
### Node Headers URL
### Deprecated: Atom.io Node Headers URL
This is the URL specified as `disturl` in a `.npmrc` file or as the `--dist-url`
command line flag when building native Node modules. Both will be supported for
@@ -158,7 +322,7 @@ Deprecated: https://atom.io/download/electron
Replace with: https://electronjs.org/headers
### `session.clearAuthCache(options)`
### API Changed: `session.clearAuthCache()` no longer accepts options
The `session.clearAuthCache` API no longer accepts options for what to clear, and instead unconditionally clears the whole cache.
@@ -169,25 +333,25 @@ session.clearAuthCache({ type: 'password' })
session.clearAuthCache()
```
### `powerMonitor.querySystemIdleState`
### API Changed: `powerMonitor.querySystemIdleState` is now `powerMonitor.getSystemIdleState`
```js
// Removed in Electron 7.0
powerMonitor.querySystemIdleState(threshold, callback)
// Replace with synchronous API
const idleState = getSystemIdleState(threshold)
const idleState = powerMonitor.getSystemIdleState(threshold)
```
### `powerMonitor.querySystemIdleTime`
### API Changed: `powerMonitor.querySystemIdleTime` is now `powerMonitor.getSystemIdleState`
```js
// Removed in Electron 7.0
powerMonitor.querySystemIdleTime(callback)
// Replace with synchronous API
const idleTime = getSystemIdleTime()
const idleTime = powerMonitor.getSystemIdleTime()
```
### webFrame Isolated World APIs
### API Changed: `webFrame.setIsolatedWorldInfo` replaces separate methods
```js
// Removed in Electron 7.0
@@ -204,11 +368,11 @@ webFrame.setIsolatedWorldInfo(
})
```
### Removal of deprecated `marked` property on getBlinkMemoryInfo
### Removed: `marked` property on `getBlinkMemoryInfo`
This property was removed in Chromium 77, and as such is no longer available.
### `webkitdirectory` attribute for `<input type="file"/>`
### Behavior Changed: `webkitdirectory` attribute for `<input type="file"/>` now lists directory contents
The `webkitdirectory` property on HTML file inputs allows them to select folders.
Previous versions of Electron had an incorrect implementation where the `event.target.files`
@@ -241,9 +405,10 @@ In Electron 7, this now returns a `FileList` with a `File` object for:
Note that `webkitdirectory` no longer exposes the path to the selected folder.
If you require the path to the selected folder rather than the folder contents,
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
## Planned Breaking API Changes (6.0)
### `win.setMenu(null)`
### API Changed: `win.setMenu(null)` is now `win.removeMenu()`
```js
// Deprecated
@@ -252,7 +417,7 @@ win.setMenu(null)
win.removeMenu()
```
### `contentTracing.getTraceBufferUsage()`
### API Changed: `contentTracing.getTraceBufferUsage()` is now a promise
```js
// Deprecated
@@ -265,7 +430,7 @@ contentTracing.getTraceBufferUsage().then(infoObject => {
})
```
### `electron.screen` in renderer process
### API Changed: `electron.screen` in the renderer process should be accessed via `remote`
```js
// Deprecated
@@ -274,7 +439,7 @@ require('electron').screen
require('electron').remote.screen
```
### `require` in sandboxed renderers
### API Changed: `require()`ing node builtins in sandboxed renderers no longer implicitly loads the `remote` version
```js
// Deprecated
@@ -298,25 +463,25 @@ require('path')
require('electron').remote.require('path')
```
### `powerMonitor.querySystemIdleState`
### Deprecated: `powerMonitor.querySystemIdleState` replaced with `powerMonitor.getSystemIdleState`
```js
// Deprecated
powerMonitor.querySystemIdleState(threshold, callback)
// Replace with synchronous API
const idleState = getSystemIdleState(threshold)
const idleState = powerMonitor.getSystemIdleState(threshold)
```
### `powerMonitor.querySystemIdleTime`
### Deprecated: `powerMonitor.querySystemIdleTime` replaced with `powerMonitor.getSystemIdleTime`
```js
// Deprecated
powerMonitor.querySystemIdleTime(callback)
// Replace with synchronous API
const idleTime = getSystemIdleTime()
const idleTime = powerMonitor.getSystemIdleTime()
```
### `app.enableMixedSandbox`
### Deprecated: `app.enableMixedSandbox()` is no longer needed
```js
// Deprecated
@@ -325,7 +490,7 @@ app.enableMixedSandbox()
Mixed-sandbox mode is now enabled by default.
### `Tray`
### Deprecated: `Tray.setHighlightMode`
Under macOS Catalina our former Tray implementation breaks.
Apple's native substitute doesn't support changing the highlighting behavior.
@@ -338,7 +503,7 @@ tray.setHighlightMode(mode)
## Planned Breaking API Changes (5.0)
### `new BrowserWindow({ webPreferences })`
### Default Changed: `nodeIntegration` and `webviewTag` default to false, `contextIsolation` defaults to true
The following `webPreferences` option default values are deprecated in favor of the new defaults listed below.
@@ -358,16 +523,16 @@ const w = new BrowserWindow({
})
```
### `nativeWindowOpen`
### Behavior Changed: `nodeIntegration` in child windows opened via `nativeWindowOpen`
Child windows opened with the `nativeWindowOpen` option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames` is `true.
Child windows opened with the `nativeWindowOpen` option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames` is `true`.
### Privileged Schemes Registration
### API Changed: Registering privileged schemes must now be done before app ready
Renderer process APIs `webFrame.setRegisterURLSchemeAsPrivileged` and `webFrame.registerURLSchemeAsBypassingCSP` as well as browser process API `protocol.registerStandardSchemes` have been removed.
Renderer process APIs `webFrame.registerURLSchemeAsPrivileged` and `webFrame.registerURLSchemeAsBypassingCSP` as well as browser process API `protocol.registerStandardSchemes` have been removed.
A new API, `protocol.registerSchemesAsPrivileged` has been added and should be used for registering custom schemes with the required privileges. Custom schemes are required to be registered before app ready.
### webFrame Isolated World APIs
### Deprecated: `webFrame.setIsolatedWorld*` replaced with `webFrame.setIsolatedWorldInfo`
```js
// Deprecated
@@ -384,7 +549,7 @@ webFrame.setIsolatedWorldInfo(
})
```
## `webFrame.setSpellCheckProvider`
### API Changed: `webFrame.setSpellCheckProvider` now takes an asynchronous callback
The `spellCheck` callback is now asynchronous, and `autoCorrectWord` parameter has been removed.
```js
// Deprecated

View File

@@ -25,7 +25,7 @@ Follow the guidelines below for building Electron on Linux.
Doing so permits installing Node on your own home directory as a standard user.
Or try repositories such as [NodeSource](https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories).
* [clang](https://clang.llvm.org/get_started.html) 3.4 or later.
* Development headers of GTK+ and libnotify.
* Development headers of GTK 3 and libnotify.
On Ubuntu, install the following libraries:

View File

@@ -42,7 +42,7 @@ $ pip install pyobjc
If you're developing Electron and don't plan to redistribute your
custom Electron build, you may skip this section.
Official Electron builds are built with [Xcode 9.4.1](http://adcdownload.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip), and the MacOS 10.13 SDK. Building with a newer SDK works too, but the releases currently use the 10.13 SDK.
Official Electron builds are built with [Xcode 9.4.1](http://adcdownload.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip), and the macOS 10.13 SDK. Building with a newer SDK works too, but the releases currently use the 10.13 SDK.
## Building Electron

View File

@@ -20,7 +20,7 @@ you prefer a graphical interface.
tail calls, and other compiler optimizations.
* **Xcode**: In addition to Xcode, also install the Xcode command line tools.
They include LLDB, the default debugger in Xcode on Mac OS X. It supports
They include LLDB, the default debugger in Xcode on macOS. It supports
debugging C, Objective-C and C++ on the desktop and iOS devices and simulator.
* **.lldbinit**: Create or edit `~/.lldbinit` to allow Chromium code to be properly source-mapped.

View File

@@ -35,7 +35,7 @@ $ git fetch upstream
Build steps and dependencies differ slightly depending on your operating system.
See these detailed guides on building Electron locally:
* [Building on MacOS](https://electronjs.org/docs/development/build-instructions-macos)
* [Building on macOS](https://electronjs.org/docs/development/build-instructions-macos)
* [Building on Linux](https://electronjs.org/docs/development/build-instructions-linux)
* [Building on Windows](https://electronjs.org/docs/development/build-instructions-windows)

View File

@@ -324,7 +324,7 @@ app.whenReady().then(() => {
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
const reopenMenuItem = findReopenMenuItem()
if (reopenMenuItem) reopenMenuItem.enabled = true
@@ -335,7 +335,7 @@ app.on('window-all-closed', function () {
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()

View File

@@ -46,7 +46,7 @@ app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
@@ -54,7 +54,7 @@ app.on('window-all-closed', function () {
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()

View File

@@ -1,95 +1,95 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('open-error-dialog', event => {
dialog.showErrorBox('An Error Message', 'Demonstrating an error message.')
})
ipcMain.on('open-information-dialog', event => {
const options = {
type: 'info',
title: 'Information',
message: "This is an information dialog. Isn't it nice?",
buttons: ['Yes', 'No']
}
dialog.showMessageBox(options, index => {
event.sender.send('information-dialog-selection', index)
})
})
ipcMain.on('open-file-dialog', event => {
dialog.showOpenDialog(
{
properties: ['openFile', 'openDirectory']
},
files => {
if (files) {
event.sender.send('selected-directory', files)
}
}
)
})
ipcMain.on('save-dialog', event => {
const options = {
title: 'Save an Image',
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
}
dialog.showSaveDialog(options, filename => {
event.sender.send('saved-file', filename)
})
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('open-error-dialog', event => {
dialog.showErrorBox('An Error Message', 'Demonstrating an error message.')
})
ipcMain.on('open-information-dialog', event => {
const options = {
type: 'info',
title: 'Information',
message: "This is an information dialog. Isn't it nice?",
buttons: ['Yes', 'No']
}
dialog.showMessageBox(options, index => {
event.sender.send('information-dialog-selection', index)
})
})
ipcMain.on('open-file-dialog', event => {
dialog.showOpenDialog(
{
properties: ['openFile', 'openDirectory']
},
files => {
if (files) {
event.sender.send('selected-directory', files)
}
}
)
})
ipcMain.on('save-dialog', event => {
const options = {
title: 'Save an Image',
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
}
dialog.showSaveDialog(options, filename => {
event.sender.send('saved-file', filename)
})
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,18 +1,18 @@
const { ipcRenderer, shell } = require('electron')
const links = document.querySelectorAll('a[href]')
const errorBtn = document.getElementById('error-dialog')
errorBtn.addEventListener('click', event => {
ipcRenderer.send('open-error-dialog')
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
const { ipcRenderer, shell } = require('electron')
const links = document.querySelectorAll('a[href]')
const errorBtn = document.getElementById('error-dialog')
errorBtn.addEventListener('click', event => {
ipcRenderer.send('open-error-dialog')
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -1,70 +1,70 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('open-information-dialog', event => {
const options = {
type: 'info',
title: 'Information',
message: "This is an information dialog. Isn't it nice?",
buttons: ['Yes', 'No']
}
dialog.showMessageBox(options, index => {
event.sender.send('information-dialog-selection', index)
})
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('open-information-dialog', event => {
const options = {
type: 'info',
title: 'Information',
message: "This is an information dialog. Isn't it nice?",
buttons: ['Yes', 'No']
}
dialog.showMessageBox(options, index => {
event.sender.send('information-dialog-selection', index)
})
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,25 +1,25 @@
const { ipcRenderer, shell } = require('electron')
const informationBtn = document.getElementById('information-dialog')
const links = document.querySelectorAll('a[href]')
informationBtn.addEventListener('click', event => {
ipcRenderer.send('open-information-dialog')
})
ipcRenderer.on('information-dialog-selection', (event, index) => {
let message = 'You selected '
if (index === 0) message += 'yes.'
else message += 'no.'
document.getElementById('info-selection').innerHTML = message
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
const { ipcRenderer, shell } = require('electron')
const informationBtn = document.getElementById('information-dialog')
const links = document.querySelectorAll('a[href]')
informationBtn.addEventListener('click', event => {
ipcRenderer.send('open-information-dialog')
})
ipcRenderer.on('information-dialog-selection', (event, index) => {
let message = 'You selected '
if (index === 0) message += 'yes.'
else message += 'no.'
document.getElementById('info-selection').innerHTML = message
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -1,70 +1,70 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('open-file-dialog', event => {
dialog.showOpenDialog(
{
properties: ['openFile', 'openDirectory']
},
files => {
if (files) {
event.sender.send('selected-directory', files)
}
}
)
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('open-file-dialog', event => {
dialog.showOpenDialog(
{
properties: ['openFile', 'openDirectory']
},
files => {
if (files) {
event.sender.send('selected-directory', files)
}
}
)
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,22 +1,22 @@
const { ipcRenderer, shell } = require('electron')
const selectDirBtn = document.getElementById('select-directory')
const links = document.querySelectorAll('a[href]')
selectDirBtn.addEventListener('click', event => {
ipcRenderer.send('open-file-dialog')
})
ipcRenderer.on('selected-directory', (event, path) => {
document.getElementById('selected-file').innerHTML = `You selected: ${path}`
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})
const { ipcRenderer, shell } = require('electron')
const selectDirBtn = document.getElementById('select-directory')
const links = document.querySelectorAll('a[href]')
selectDirBtn.addEventListener('click', event => {
ipcRenderer.send('open-file-dialog')
})
ipcRenderer.on('selected-directory', (event, path) => {
document.getElementById('selected-file').innerHTML = `You selected: ${path}`
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -1,66 +1,66 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('save-dialog', event => {
const options = {
title: 'Save an Image',
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
}
dialog.showSaveDialog(options, filename => {
event.sender.send('saved-file', filename)
})
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
ipcMain.on('save-dialog', event => {
const options = {
title: 'Save an Image',
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
}
dialog.showSaveDialog(options, filename => {
event.sender.send('saved-file', filename)
})
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,23 +1,23 @@
const { ipcRenderer, shell } = require('electron')
const saveBtn = document.getElementById('save-dialog')
const links = document.querySelectorAll('a[href]')
saveBtn.addEventListener('click', event => {
ipcRenderer.send('save-dialog')
})
ipcRenderer.on('saved-file', (event, path) => {
if (!path) path = 'No path'
document.getElementById('file-saved').innerHTML = `Path selected: ${path}`
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
const { ipcRenderer, shell } = require('electron')
const saveBtn = document.getElementById('save-dialog')
const links = document.querySelectorAll('a[href]')
saveBtn.addEventListener('click', event => {
ipcRenderer.send('save-dialog')
})
ipcRenderer.on('saved-file', (event, path) => {
if (!path) path = 'No path'
document.getElementById('file-saved').innerHTML = `Path selected: ${path}`
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -36,7 +36,7 @@ app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
@@ -44,7 +44,7 @@ app.on('window-all-closed', function () {
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()

View File

@@ -1,56 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,13 +1,13 @@
const { shell } = require('electron')
const os = require('os')
const exLinksBtn = document.getElementById('open-ex-links')
const fileManagerBtn = document.getElementById('open-file-manager')
fileManagerBtn.addEventListener('click', (event) => {
shell.showItemInFolder(os.homedir())
})
exLinksBtn.addEventListener('click', (event) => {
shell.openExternal('http://electron.atom.io')
const { shell } = require('electron')
const os = require('os')
const exLinksBtn = document.getElementById('open-ex-links')
const fileManagerBtn = document.getElementById('open-file-manager')
fileManagerBtn.addEventListener('click', (event) => {
shell.showItemInFolder(os.homedir())
})
exLinksBtn.addEventListener('click', (event) => {
shell.openExternal('http://electron.atom.io')
})

View File

@@ -1,56 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,29 +1,29 @@
const basicNotification = {
title: 'Basic Notification',
body: 'Short message part'
}
const notification = {
title: 'Notification with image',
body: 'Short message plus a custom image',
icon: 'https://via.placeholder.com/150'
}
const basicNotificationButton = document.getElementById('basic-noti')
const notificationButton = document.getElementById('advanced-noti')
notificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(notification.title, notification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})
basicNotificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(basicNotification.title, basicNotification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})
const basicNotification = {
title: 'Basic Notification',
body: 'Short message part'
}
const notification = {
title: 'Notification with image',
body: 'Short message plus a custom image',
icon: 'https://via.placeholder.com/150'
}
const basicNotificationButton = document.getElementById('basic-noti')
const notificationButton = document.getElementById('advanced-noti')
notificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(notification.title, notification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})
basicNotificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(basicNotification.title, basicNotification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})

File diff suppressed because one or more lines are too long

View File

@@ -1,35 +1,35 @@
const { ipcRenderer, shell } = require('electron')
const trayBtn = document.getElementById('put-in-tray')
const links = document.querySelectorAll('a[href]')
let trayOn = false
trayBtn.addEventListener('click', function (event) {
if (trayOn) {
trayOn = false
document.getElementById('tray-countdown').innerHTML = ''
ipcRenderer.send('remove-tray')
} else {
trayOn = true
const message = 'Click demo again to remove.'
document.getElementById('tray-countdown').innerHTML = message
ipcRenderer.send('put-in-tray')
}
})
// Tray removed from context menu on icon
ipcRenderer.on('tray-removed', function () {
ipcRenderer.send('remove-tray')
trayOn = false
document.getElementById('tray-countdown').innerHTML = ''
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
const { ipcRenderer, shell } = require('electron')
const trayBtn = document.getElementById('put-in-tray')
const links = document.querySelectorAll('a[href]')
let trayOn = false
trayBtn.addEventListener('click', function (event) {
if (trayOn) {
trayOn = false
document.getElementById('tray-countdown').innerHTML = ''
ipcRenderer.send('remove-tray')
} else {
trayOn = true
const message = 'Click demo again to remove.'
document.getElementById('tray-countdown').innerHTML = message
ipcRenderer.send('put-in-tray')
}
})
// Tray removed from context menu on icon
ipcRenderer.on('tray-removed', function () {
ipcRenderer.send('remove-tray')
trayOn = false
document.getElementById('tray-countdown').innerHTML = ''
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -38,7 +38,7 @@ app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
@@ -46,7 +46,7 @@ app.on('window-all-closed', function () {
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()

View File

@@ -1,56 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,25 +1,25 @@
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const framelessWindowBtn = document.getElementById('frameless-window')
const links = document.querySelectorAll('a[href]')
framelessWindowBtn.addEventListener('click', (event) => {
const modalPath = 'https://electronjs.org'
let win = new BrowserWindow({ frame: false })
win.on('close', () => { win = null })
win.loadURL(modalPath)
win.show()
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const framelessWindowBtn = document.getElementById('frameless-window')
const links = document.querySelectorAll('a[href]')
framelessWindowBtn.addEventListener('click', (event) => {
const modalPath = 'https://electronjs.org'
let win = new BrowserWindow({ frame: false })
win.on('close', () => { win = null })
win.loadURL(modalPath)
win.show()
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -1,56 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,35 +1,35 @@
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const manageWindowBtn = document.getElementById('manage-window')
const links = document.querySelectorAll('a[href]')
let win
manageWindowBtn.addEventListener('click', (event) => {
const modalPath = 'https://electronjs.org'
win = new BrowserWindow({ width: 400, height: 275 })
win.on('resize', updateReply)
win.on('move', updateReply)
win.on('close', () => { win = null })
win.loadURL(modalPath)
win.show()
function updateReply () {
const manageWindowReply = document.getElementById('manage-window-reply')
const message = `Size: ${win.getSize()} Position: ${win.getPosition()}`
manageWindowReply.innerText = message
}
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const manageWindowBtn = document.getElementById('manage-window')
const links = document.querySelectorAll('a[href]')
let win
manageWindowBtn.addEventListener('click', (event) => {
const modalPath = 'https://electronjs.org'
win = new BrowserWindow({ width: 400, height: 275 })
win.on('resize', updateReply)
win.on('move', updateReply)
win.on('close', () => { win = null })
win.loadURL(modalPath)
win.show()
function updateReply () {
const manageWindowReply = document.getElementById('manage-window-reply')
const message = `Size: ${win.getSize()} Position: ${win.getPosition()}`
manageWindowReply.innerText = message
}
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -5,7 +5,7 @@
</head>
<body>
<h2>Create a new window</h2>
<h3>Supports: Win, MacOS, Linux <span>|</span> Process: Main</h3>
<h3>Supports: Win, macOS, Linux <span>|</span> Process: Main</h3>
<button id="new-window">View Demo</button>
<p>The <code>BrowserWindow</code> module gives you the ability to create new windows in your app. This main process module can be used from the renderer process with the <code>remote</code> module, as is shown in this demo.</p>
<p>There are a lot of options when creating a new window. A few are in this demo, but visit the <a id="browser-window-link" href="">documentation<span>(opens in new window)</span></a>

View File

@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()

View File

@@ -1,56 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,48 +1,48 @@
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const listenToWindowBtn = document.getElementById('listen-to-window')
const focusModalBtn = document.getElementById('focus-on-modal-window')
const links = document.querySelectorAll('a[href]')
let win
listenToWindowBtn.addEventListener('click', () => {
const modalPath = 'https://electronjs.org'
win = new BrowserWindow({ width: 600, height: 400 })
const hideFocusBtn = () => {
focusModalBtn.classList.add('disappear')
focusModalBtn.classList.remove('smooth-appear')
focusModalBtn.removeEventListener('click', clickHandler)
}
const showFocusBtn = (btn) => {
if (!win) return
focusModalBtn.classList.add('smooth-appear')
focusModalBtn.classList.remove('disappear')
focusModalBtn.addEventListener('click', clickHandler)
}
win.on('focus', hideFocusBtn)
win.on('blur', showFocusBtn)
win.on('close', () => {
hideFocusBtn()
win = null
})
win.loadURL(modalPath)
win.show()
const clickHandler = () => { win.focus() }
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const listenToWindowBtn = document.getElementById('listen-to-window')
const focusModalBtn = document.getElementById('focus-on-modal-window')
const links = document.querySelectorAll('a[href]')
let win
listenToWindowBtn.addEventListener('click', () => {
const modalPath = 'https://electronjs.org'
win = new BrowserWindow({ width: 600, height: 400 })
const hideFocusBtn = () => {
focusModalBtn.classList.add('disappear')
focusModalBtn.classList.remove('smooth-appear')
focusModalBtn.removeEventListener('click', clickHandler)
}
const showFocusBtn = (btn) => {
if (!win) return
focusModalBtn.classList.add('smooth-appear')
focusModalBtn.classList.remove('disappear')
focusModalBtn.addEventListener('click', clickHandler)
}
win.on('focus', hideFocusBtn)
win.on('blur', showFocusBtn)
win.on('close', () => {
hideFocusBtn()
win = null
})
win.loadURL(modalPath)
win.show()
const clickHandler = () => { win.focus() }
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -76,7 +76,7 @@ that cache folder to provide custom builds of Electron or to avoid making contac
with the network at all.
* Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/`
* MacOS: `~/Library/Caches/electron/`
* macOS: `~/Library/Caches/electron/`
* Windows: `$LOCALAPPDATA/electron/Cache` or `~/AppData/Local/electron/Cache/`
On environments that have been using older versions of Electron, you might find the

View File

@@ -1,4 +1,4 @@
# MacOS Dock
# macOS Dock
Electron has APIs to configure the app's icon in the macOS Dock. A macOS-only
API exists to create a custom dock menu, but

View File

@@ -1,29 +1,40 @@
# Mojave Dark Mode
# Supporting macOS Dark Mode
In macOS 10.14 Mojave, Apple introduced a new [system-wide dark mode](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/)
for all macOS computers. If your app does have a dark mode, you can make your Electron app
follow the system-wide dark mode setting using [the nativeTheme api](../api/native-theme.md).
for all macOS computers. If your Electron app has a dark mode, you can make it follow the
system-wide dark mode setting using [the `nativeTheme` api](../api/native-theme.md).
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order
for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on Catalina you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your `Info.plist` file or be on Electron `>=7.0.0`.
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers.
In order for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on
Catalina, you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your
`Info.plist` file, or be on Electron `>=7.0.0`. Both [Electron Packager][electron-packager] and
[Electron Forge][electron-forge] have a [`darwinDarkModeSupport` option][packager-darwindarkmode-api]
to automate the `Info.plist` changes during app build time.
## Automatically updating the native interfaces
"Native Interfaces" include the file picker, window border, dialogs, context menus and more; basically anything where
the UI comes from macOS and not your app. The default behavior as of Electron 7.0.0 is to opt in to this automatic
theming from the OS. If you wish to opt out you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file
to `true`. Please note that once Electron starts building against the 10.14 SDK it will not be possible for you to opt
out of this theming.
"Native Interfaces" include the file picker, window border, dialogs, context menus and more; basically,
anything where the UI comes from macOS and not your app. As of Electron 7.0.0, the default behavior
is to opt in to this automatic theming from the OS. If you wish to opt out and are using Electron
&gt; 8.0.0, you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file to `true`.
Please note that Electron 8.0.0 and above will not let your opt out of this theming, due to the use
of the macOS 10.14 SDK.
## Automatically updating your own interfaces
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 listening for the theme updated event on Electron's `nativeTheme` module. E.g.
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 listening for the theme updated event on Electron's `nativeTheme` module.
```js
For example:
```javascript
const { nativeTheme } = require('electron')
nativeTheme.on('updated', function theThemeHasChanged () {
updateMyAppTheme(nativeTheme.shouldUseDarkColors)
})
```
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/electron-packager
[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport

View File

@@ -49,7 +49,7 @@ The library file `widevinecdm.dll` will be under
`Program Files(x86)/Google/Chrome/Application/CHROME_VERSION/WidevineCdm/_platform_specific/win_(x86|x64)/`
directory.
### On MacOS
### On macOS
The library file `libwidevinecdm.dylib` will be under
`/Applications/Google Chrome.app/Contents/Versions/CHROME_VERSION/Google Chrome Framework.framework/Versions/A/Libraries/WidevineCdm/_platform_specific/mac_(x86|x64)/`

View File

@@ -55,7 +55,9 @@ template("electron_extra_paks") {
output = "${invoker.output_dir}/resources.pak"
sources = [
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/dev_ui_content_resources.pak",
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
@@ -68,7 +70,9 @@ template("electron_extra_paks") {
"//components/resources",
"//content:content_resources",
"//content:dev_ui_content_resources",
"//content/browser/resources/media:media_internals_resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//electron:resources",
"//mojo/public/js:resources",
"//net:net_resources",
@@ -92,10 +96,14 @@ template("electron_extra_paks") {
}
if (enable_electron_extensions) {
sources += [
"$root_gen_dir/chrome/component_extension_resources.pak",
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
"$root_gen_dir/extensions/extensions_resources.pak",
]
deps += [ "//extensions:extensions_resources" ]
deps += [
"//chrome/browser/resources:component_extension_resources",
"//extensions:extensions_resources",
]
}
}
}

View File

@@ -17,7 +17,8 @@
<part file="electron_strings.grdp" />
</messages>
<includes>
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}\shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}/shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
<include name="IDR_PDF_MANIFEST" file="../chrome/browser/resources/pdf/manifest.json" type="BINDATA" />
</includes>
</release>
</grit>

View File

@@ -21,6 +21,7 @@ auto_filenames = {
"docs/api/dock.md",
"docs/api/download-item.md",
"docs/api/environment-variables.md",
"docs/api/extensions.md",
"docs/api/file-object.md",
"docs/api/frameless-window.md",
"docs/api/global-shortcut.md",
@@ -31,6 +32,8 @@ auto_filenames = {
"docs/api/locales.md",
"docs/api/menu-item.md",
"docs/api/menu.md",
"docs/api/message-channel-main.md",
"docs/api/message-port-main.md",
"docs/api/modernization",
"docs/api/native-image.md",
"docs/api/native-theme.md",
@@ -45,6 +48,7 @@ auto_filenames = {
"docs/api/remote.md",
"docs/api/sandbox-option.md",
"docs/api/screen.md",
"docs/api/service-workers.md",
"docs/api/session.md",
"docs/api/shell.md",
"docs/api/structures",
@@ -95,6 +99,7 @@ auto_filenames = {
"docs/api/structures/mime-typed-buffer.md",
"docs/api/structures/mouse-input-event.md",
"docs/api/structures/mouse-wheel-input-event.md",
"docs/api/structures/new-window-event.md",
"docs/api/structures/notification-action.md",
"docs/api/structures/point.md",
"docs/api/structures/printer-info.md",
@@ -110,6 +115,7 @@ auto_filenames = {
"docs/api/structures/remove-password.md",
"docs/api/structures/scrubber-item.md",
"docs/api/structures/segmented-control-segment.md",
"docs/api/structures/service-worker-info.md",
"docs/api/structures/shared-worker-info.md",
"docs/api/structures/shortcut-details.md",
"docs/api/structures/size.md",
@@ -128,20 +134,19 @@ auto_filenames = {
]
sandbox_bundle_deps = [
"lib/browser/api/module-keys.js",
"lib/browser/api/module-names.ts",
"lib/common/api/clipboard.js",
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/ipc-renderer.ts",
"lib/renderer/api/remote.js",
@@ -176,11 +181,8 @@ auto_filenames = {
isolated_bundle_deps = [
"lib/common/electron-binding-setup.ts",
"lib/isolated_renderer/init.js",
"lib/renderer/ipc-renderer-internal-utils.ts",
"lib/renderer/ipc-renderer-internal.ts",
"lib/renderer/web-view/web-view-constants.ts",
"lib/renderer/web-view/web-view-element.ts",
"lib/renderer/window-setup.ts",
"package.json",
"tsconfig.electron.json",
"tsconfig.json",
@@ -190,6 +192,7 @@ auto_filenames = {
"lib/common/electron-binding-setup.ts",
"lib/common/webpack-globals-provider.ts",
"lib/content_script/init.js",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/chrome-api.ts",
"lib/renderer/extensions/event.ts",
"lib/renderer/extensions/i18n.ts",
@@ -212,7 +215,7 @@ auto_filenames = {
"lib/browser/api/browser-view.js",
"lib/browser/api/browser-window.js",
"lib/browser/api/content-tracing.js",
"lib/browser/api/crash-reporter.js",
"lib/browser/api/crash-reporter.ts",
"lib/browser/api/dialog.js",
"lib/browser/api/exports/electron.ts",
"lib/browser/api/global-shortcut.js",
@@ -222,6 +225,7 @@ auto_filenames = {
"lib/browser/api/menu-item.js",
"lib/browser/api/menu-utils.js",
"lib/browser/api/menu.js",
"lib/browser/api/message-channel.ts",
"lib/browser/api/module-list.ts",
"lib/browser/api/native-theme.ts",
"lib/browser/api/net-log.js",
@@ -248,7 +252,6 @@ auto_filenames = {
"lib/browser/api/web-contents.js",
"lib/browser/chrome-extension-shim.js",
"lib/browser/chrome-extension.js",
"lib/browser/crash-reporter-init.js",
"lib/browser/default-menu.ts",
"lib/browser/desktop-capturer.ts",
"lib/browser/devtools.ts",
@@ -258,6 +261,7 @@ auto_filenames = {
"lib/browser/ipc-main-impl.ts",
"lib/browser/ipc-main-internal-utils.ts",
"lib/browser/ipc-main-internal.ts",
"lib/browser/message-port-main.ts",
"lib/browser/navigation-controller.js",
"lib/browser/remote/objects-registry.ts",
"lib/browser/remote/server.ts",
@@ -268,7 +272,6 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
@@ -285,13 +288,12 @@ auto_filenames = {
]
renderer_bundle_deps = [
"lib/browser/api/module-keys.js",
"lib/browser/api/module-names.ts",
"lib/common/api/clipboard.js",
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
@@ -300,7 +302,7 @@ auto_filenames = {
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/exports/electron.ts",
"lib/renderer/api/ipc-renderer.ts",
@@ -334,13 +336,12 @@ auto_filenames = {
]
worker_bundle_deps = [
"lib/browser/api/module-keys.js",
"lib/browser/api/module-names.ts",
"lib/common/api/clipboard.js",
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
@@ -348,7 +349,7 @@ auto_filenames = {
"lib/common/type-utils.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/exports/electron.ts",
"lib/renderer/api/ipc-renderer.ts",

View File

@@ -31,6 +31,8 @@ filenames = {
"shell/app/command_line_args.h",
"shell/app/electron_content_client.cc",
"shell/app/electron_content_client.h",
"shell/app/electron_crash_reporter_client.cc",
"shell/app/electron_crash_reporter_client.h",
"shell/app/electron_main_delegate.cc",
"shell/app/electron_main_delegate.h",
"shell/app/electron_main_delegate_mac.h",
@@ -51,6 +53,8 @@ filenames = {
"shell/browser/api/electron_api_content_tracing.cc",
"shell/browser/api/electron_api_cookies.cc",
"shell/browser/api/electron_api_cookies.h",
"shell/browser/api/electron_api_crash_reporter.cc",
"shell/browser/api/electron_api_crash_reporter.h",
"shell/browser/api/electron_api_data_pipe_holder.cc",
"shell/browser/api/electron_api_data_pipe_holder.h",
"shell/browser/api/electron_api_debugger.cc",
@@ -88,6 +92,8 @@ filenames = {
"shell/browser/api/electron_api_protocol.h",
"shell/browser/api/electron_api_screen.cc",
"shell/browser/api/electron_api_screen.h",
"shell/browser/api/electron_api_service_worker_context.cc",
"shell/browser/api/electron_api_service_worker_context.h",
"shell/browser/api/electron_api_session.cc",
"shell/browser/api/electron_api_session.h",
"shell/browser/api/electron_api_system_preferences.cc",
@@ -119,6 +125,8 @@ filenames = {
"shell/browser/api/gpu_info_enumerator.h",
"shell/browser/api/gpuinfo_manager.cc",
"shell/browser/api/gpuinfo_manager.h",
"shell/browser/api/message_port.cc",
"shell/browser/api/message_port.h",
"shell/browser/api/process_metric.cc",
"shell/browser/api/process_metric.h",
"shell/browser/api/save_page_handler.cc",
@@ -162,7 +170,6 @@ filenames = {
"shell/browser/electron_javascript_dialog_manager.h",
"shell/browser/electron_navigation_throttle.cc",
"shell/browser/electron_navigation_throttle.h",
"shell/browser/electron_paths.h",
"shell/browser/electron_permission_manager.cc",
"shell/browser/electron_permission_manager.h",
"shell/browser/electron_quota_permission_context.cc",
@@ -171,6 +178,7 @@ filenames = {
"shell/browser/electron_speech_recognition_manager_delegate.h",
"shell/browser/electron_web_ui_controller_factory.cc",
"shell/browser/electron_web_ui_controller_factory.h",
"shell/browser/extended_web_contents_observer.h",
"shell/browser/feature_list.cc",
"shell/browser/feature_list.h",
"shell/browser/font_defaults.cc",
@@ -234,12 +242,15 @@ filenames = {
"shell/browser/net/node_stream_loader.h",
"shell/browser/net/proxying_url_loader_factory.cc",
"shell/browser/net/proxying_url_loader_factory.h",
"shell/browser/net/proxying_websocket.cc",
"shell/browser/net/proxying_websocket.h",
"shell/browser/net/resolve_proxy_helper.cc",
"shell/browser/net/resolve_proxy_helper.h",
"shell/browser/net/system_network_context_manager.cc",
"shell/browser/net/system_network_context_manager.h",
"shell/browser/net/url_pipe_loader.cc",
"shell/browser/net/url_pipe_loader.h",
"shell/browser/net/web_request_api_interface.h",
"shell/browser/network_hints_handler_impl.cc",
"shell/browser/network_hints_handler_impl.h",
"shell/browser/node_debugger.cc",
@@ -276,6 +287,8 @@ filenames = {
"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/plugins/plugin_utils.cc",
"shell/browser/plugins/plugin_utils.h",
"shell/browser/pref_store_delegate.cc",
"shell/browser/pref_store_delegate.h",
"shell/browser/relauncher.cc",
@@ -326,6 +339,7 @@ filenames = {
"shell/browser/ui/devtools_manager_delegate.h",
"shell/browser/ui/devtools_ui.cc",
"shell/browser/ui/devtools_ui.h",
"shell/browser/ui/drag_util.cc",
"shell/browser/ui/drag_util.h",
"shell/browser/ui/drag_util_mac.mm",
"shell/browser/ui/drag_util_views.cc",
@@ -382,6 +396,8 @@ filenames = {
"shell/browser/ui/views/submenu_button.h",
"shell/browser/ui/views/win_frame_view.cc",
"shell/browser/ui/views/win_frame_view.h",
"shell/browser/ui/win/dialog_thread.cc",
"shell/browser/ui/win/dialog_thread.h",
"shell/browser/ui/win/electron_desktop_native_widget_aura.cc",
"shell/browser/ui/win/electron_desktop_native_widget_aura.h",
"shell/browser/ui/win/electron_desktop_window_tree_host_win.cc",
@@ -426,7 +442,6 @@ filenames = {
"shell/common/api/electron_api_clipboard.h",
"shell/common/api/electron_api_clipboard_mac.mm",
"shell/common/api/electron_api_command_line.cc",
"shell/common/api/electron_api_crash_reporter.cc",
"shell/common/api/electron_api_key_weak_map.h",
"shell/common/api/electron_api_native_image.cc",
"shell/common/api/electron_api_native_image.h",
@@ -436,6 +451,8 @@ filenames = {
"shell/common/api/electron_bindings.cc",
"shell/common/api/electron_bindings.h",
"shell/common/api/features.cc",
"shell/common/api/object_life_monitor.cc",
"shell/common/api/object_life_monitor.h",
"shell/common/application_info.cc",
"shell/common/application_info.h",
"shell/common/application_info_linux.cc",
@@ -449,22 +466,13 @@ filenames = {
"shell/common/asar/scoped_temporary_file.h",
"shell/common/color_util.cc",
"shell/common/color_util.h",
"shell/common/crash_reporter/crash_reporter.cc",
"shell/common/crash_reporter/crash_reporter.h",
"shell/common/crash_reporter/crash_reporter_linux.cc",
"shell/common/crash_reporter/crash_reporter_linux.h",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
"shell/common/crash_reporter/crash_reporter_win.cc",
"shell/common/crash_reporter/crash_reporter_win.h",
"shell/common/crash_reporter/linux/crash_dump_handler.cc",
"shell/common/crash_reporter/linux/crash_dump_handler.h",
"shell/common/crash_reporter/win/crash_service_main.cc",
"shell/common/crash_reporter/win/crash_service_main.h",
"shell/common/crash_keys.cc",
"shell/common/crash_keys.h",
"shell/common/electron_command_line.cc",
"shell/common/electron_command_line.h",
"shell/common/electron_constants.cc",
"shell/common/electron_constants.h",
"shell/common/electron_paths.h",
"shell/common/gin_converters/accelerator_converter.cc",
"shell/common/gin_converters/accelerator_converter.h",
"shell/common/gin_converters/blink_converter.cc",
@@ -472,8 +480,6 @@ filenames = {
"shell/common/gin_converters/callback_converter.h",
"shell/common/gin_converters/content_converter.cc",
"shell/common/gin_converters/content_converter.h",
"shell/common/gin_converters/extension_converter.cc",
"shell/common/gin_converters/extension_converter.h",
"shell/common/gin_converters/file_dialog_converter.cc",
"shell/common/gin_converters/file_dialog_converter.h",
"shell/common/gin_converters/file_path_converter.h",
@@ -488,6 +494,8 @@ filenames = {
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/time_converter.cc",
"shell/common/gin_converters/time_converter.h",
"shell/common/gin_converters/value_converter.cc",
"shell/common/gin_converters/value_converter.h",
"shell/common/gin_helper/arguments.cc",
@@ -506,8 +514,11 @@ filenames = {
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/function_template.cc",
"shell/common/gin_helper/function_template.h",
"shell/common/gin_helper/function_template_extensions.h",
"shell/common/gin_helper/locker.cc",
"shell/common/gin_helper/locker.h",
"shell/common/gin_helper/microtasks_scope.cc",
"shell/common/gin_helper/microtasks_scope.h",
"shell/common/gin_helper/object_template_builder.cc",
"shell/common/gin_helper/object_template_builder.h",
"shell/common/gin_helper/persistent_dictionary.cc",
@@ -524,6 +535,10 @@ filenames = {
"shell/common/key_weak_map.h",
"shell/common/keyboard_util.cc",
"shell/common/keyboard_util.h",
"shell/common/language_util.h",
"shell/common/language_util_linux.cc",
"shell/common/language_util_mac.mm",
"shell/common/language_util_win.cc",
"shell/common/mac/main_application_bundle.h",
"shell/common/mac/main_application_bundle.mm",
"shell/common/mouse_util.cc",
@@ -551,10 +566,14 @@ filenames = {
"shell/common/skia_util.h",
"shell/common/v8_value_converter.cc",
"shell/common/v8_value_converter.h",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/common/v8_value_serializer.cc",
"shell/common/v8_value_serializer.h",
"shell/common/world_ids.h",
"shell/renderer/api/context_bridge/object_cache.cc",
"shell/renderer/api/context_bridge/object_cache.h",
"shell/renderer/api/electron_api_context_bridge.cc",
"shell/renderer/api/electron_api_context_bridge.h",
"shell/renderer/api/electron_api_crash_reporter_renderer.cc",
"shell/renderer/api/electron_api_renderer_ipc.cc",
"shell/renderer/api/electron_api_spell_check_client.cc",
"shell/renderer/api/electron_api_spell_check_client.h",
@@ -591,44 +610,58 @@ filenames = {
]
lib_sources_extensions = [
"shell/browser/extensions/api/i18n/i18n_api.cc",
"shell/browser/extensions/api/i18n/i18n_api.h",
"shell/browser/extensions/api/resources_private/resources_private_api.cc",
"shell/browser/extensions/api/resources_private/resources_private_api.h",
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
"shell/browser/extensions/api/management/electron_management_api_delegate.cc",
"shell/browser/extensions/api/management/electron_management_api_delegate.h",
"shell/browser/extensions/api/tabs/tabs_api.cc",
"shell/browser/extensions/api/tabs/tabs_api.h",
"shell/browser/extensions/electron_extensions_browser_client.cc",
"shell/browser/extensions/electron_extensions_browser_client.h",
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
"shell/browser/extensions/api/streams_private/streams_private_api.h",
"shell/browser/extensions/electron_browser_context_keyed_service_factories.cc",
"shell/browser/extensions/electron_browser_context_keyed_service_factories.h",
"shell/browser/extensions/electron_component_extension_resource_manager.cc",
"shell/browser/extensions/electron_component_extension_resource_manager.h",
"shell/browser/extensions/electron_display_info_provider.cc",
"shell/browser/extensions/electron_display_info_provider.h",
"shell/browser/extensions/electron_extension_host_delegate.cc",
"shell/browser/extensions/electron_extension_host_delegate.h",
"shell/browser/extensions/electron_extension_loader.cc",
"shell/browser/extensions/electron_extension_loader.h",
"shell/browser/extensions/electron_extension_message_filter.cc",
"shell/browser/extensions/electron_extension_message_filter.h",
"shell/browser/extensions/electron_extension_system.cc",
"shell/browser/extensions/electron_extension_system.h",
"shell/browser/extensions/electron_extension_system_factory.cc",
"shell/browser/extensions/electron_extension_system_factory.h",
"shell/browser/extensions/electron_extension_web_contents_observer.cc",
"shell/browser/extensions/electron_extension_web_contents_observer.h",
"shell/browser/extensions/electron_navigation_ui_data.cc",
"shell/browser/extensions/electron_navigation_ui_data.h",
"shell/browser/extensions/electron_process_manager_delegate.cc",
"shell/browser/extensions/electron_process_manager_delegate.h",
"shell/browser/extensions/electron_extensions_api_client.cc",
"shell/browser/extensions/electron_extensions_api_client.h",
"shell/browser/extensions/electron_extensions_browser_api_provider.cc",
"shell/browser/extensions/electron_extensions_browser_api_provider.h",
"shell/browser/extensions/electron_extensions_browser_client.cc",
"shell/browser/extensions/electron_extensions_browser_client.h",
"shell/browser/extensions/electron_messaging_delegate.cc",
"shell/browser/extensions/electron_messaging_delegate.h",
"shell/browser/extensions/electron_navigation_ui_data.cc",
"shell/browser/extensions/electron_navigation_ui_data.h",
"shell/browser/extensions/electron_process_manager_delegate.cc",
"shell/browser/extensions/electron_process_manager_delegate.h",
"shell/common/extensions/electron_extensions_api_provider.cc",
"shell/common/extensions/electron_extensions_api_provider.h",
"shell/common/extensions/electron_extensions_client.cc",
"shell/common/extensions/electron_extensions_client.h",
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
"shell/renderer/extensions/electron_extensions_renderer_client.h",
"shell/common/gin_converters/extension_converter.cc",
"shell/common/gin_converters/extension_converter.h",
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.cc",
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.h",
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
"shell/renderer/extensions/electron_extensions_renderer_client.h",
]
app_sources = [

View File

@@ -44,7 +44,7 @@ hunspell_dictionaries = [
"//third_party/hunspell_dictionaries/ta-IN-3-0.bdic",
"//third_party/hunspell_dictionaries/tg-TG-5-0.bdic",
"//third_party/hunspell_dictionaries/tr-TR-4-0.bdic",
"//third_party/hunspell_dictionaries/uk-UA-3-0.bdic",
"//third_party/hunspell_dictionaries/uk-UA-4-0.bdic",
"//third_party/hunspell_dictionaries/vi-VN-3-0.bdic",
"//third_party/hunspell_dictionaries/xx-XX-3-0.bdic",
]

View File

@@ -1,21 +1,44 @@
import * as fs from 'fs'
import * as path from 'path'
import * as fs from 'fs';
import * as path from 'path';
import { deprecate, Menu } from 'electron'
import { EventEmitter } from 'events'
import { Menu } from 'electron';
import { EventEmitter } from 'events';
const bindings = process.electronBinding('app')
const commandLine = process.electronBinding('command_line')
const { app, App } = bindings
const bindings = process.electronBinding('app');
const commandLine = process.electronBinding('command_line');
const { app, App } = bindings;
// Only one app object permitted.
export default app
export default app;
let dockMenu: Electron.Menu | null = null
let dockMenu: Electron.Menu | null = null;
// App is an EventEmitter.
Object.setPrototypeOf(App.prototype, EventEmitter.prototype)
EventEmitter.call(app as any)
Object.setPrototypeOf(App.prototype, EventEmitter.prototype);
EventEmitter.call(app as any);
// Properties.
const nativeASGetter = app.isAccessibilitySupportEnabled;
const nativeASSetter = app.setAccessibilitySupportEnabled;
Object.defineProperty(App.prototype, 'accessibilitySupportEnabled', {
get: () => nativeASGetter.call(app),
set: (enabled) => nativeASSetter.call(app, enabled)
});
const nativeBCGetter = app.getBadgeCount;
const nativeBCSetter = app.setBadgeCount;
Object.defineProperty(App.prototype, 'badgeCount', {
get: () => nativeBCGetter.call(app),
set: (count) => nativeBCSetter.call(app, count)
});
const nativeNGetter = app.getName;
const nativeNSetter = app.setName;
Object.defineProperty(App.prototype, 'name', {
get: () => nativeNGetter.call(app),
set: (name) => nativeNSetter.call(app, name)
});
Object.assign(app, {
commandLine: {
@@ -24,99 +47,94 @@ Object.assign(app, {
appendSwitch: (theSwitch: string, value?: string) => commandLine.appendSwitch(String(theSwitch), typeof value === 'undefined' ? value : String(value)),
appendArgument: (arg: string) => commandLine.appendArgument(String(arg))
} as Electron.CommandLine
})
});
// we define this here because it'd be overly complicated to
// do in native land
Object.defineProperty(app, 'applicationMenu', {
get () {
return Menu.getApplicationMenu()
return Menu.getApplicationMenu();
},
set (menu: Electron.Menu | null) {
return Menu.setApplicationMenu(menu)
return Menu.setApplicationMenu(menu);
}
})
});
App.prototype.isPackaged = (() => {
const execFile = path.basename(process.execPath).toLowerCase()
const execFile = path.basename(process.execPath).toLowerCase();
if (process.platform === 'win32') {
return execFile !== 'electron.exe'
return execFile !== 'electron.exe';
}
return execFile !== 'electron'
})()
return execFile !== 'electron';
})();
app._setDefaultAppPaths = (packagePath) => {
// Set the user path according to application's name.
app.setPath('userData', path.join(app.getPath('appData'), app.name!))
app.setPath('userCache', path.join(app.getPath('cache'), app.name!))
app.setAppPath(packagePath)
app.setPath('userData', path.join(app.getPath('appData'), app.name!));
app.setPath('userCache', path.join(app.getPath('cache'), app.name!));
app.setAppPath(packagePath);
// Add support for --user-data-dir=
if (app.commandLine.hasSwitch('user-data-dir')) {
const userDataDir = app.commandLine.getSwitchValue('user-data-dir')
if (path.isAbsolute(userDataDir)) app.setPath('userData', userDataDir)
const userDataDir = app.commandLine.getSwitchValue('user-data-dir');
if (path.isAbsolute(userDataDir)) app.setPath('userData', userDataDir);
}
}
};
if (process.platform === 'darwin') {
const setDockMenu = app.dock!.setMenu
const setDockMenu = app.dock!.setMenu;
app.dock!.setMenu = (menu) => {
dockMenu = menu
setDockMenu(menu)
}
app.dock!.getMenu = () => dockMenu
dockMenu = menu;
setDockMenu(menu);
};
app.dock!.getMenu = () => dockMenu;
}
if (process.platform === 'linux') {
const patternVmRSS = /^VmRSS:\s*(\d+) kB$/m
const patternVmHWM = /^VmHWM:\s*(\d+) kB$/m
const patternVmRSS = /^VmRSS:\s*(\d+) kB$/m;
const patternVmHWM = /^VmHWM:\s*(\d+) kB$/m;
const getStatus = (pid: number) => {
try {
return fs.readFileSync(`/proc/${pid}/status`, 'utf8')
return fs.readFileSync(`/proc/${pid}/status`, 'utf8');
} catch {
return ''
return '';
}
}
};
const getEntry = (file: string, pattern: RegExp) => {
const match = file.match(pattern)
return match ? parseInt(match[1], 10) : 0
}
const match = file.match(pattern);
return match ? parseInt(match[1], 10) : 0;
};
const getProcessMemoryInfo = (pid: number) => {
const file = getStatus(pid)
const file = getStatus(pid);
return {
workingSetSize: getEntry(file, patternVmRSS),
peakWorkingSetSize: getEntry(file, patternVmHWM)
}
}
};
};
const nativeFn = app.getAppMetrics
const nativeFn = app.getAppMetrics;
app.getAppMetrics = () => {
const metrics = nativeFn.call(app)
const metrics = nativeFn.call(app);
for (const metric of metrics) {
metric.memory = getProcessMemoryInfo(metric.pid)
metric.memory = getProcessMemoryInfo(metric.pid);
}
return metrics
}
return metrics;
};
}
// Routes the events to webContents.
const events = ['certificate-error', 'select-client-certificate']
const events = ['certificate-error', 'select-client-certificate'];
for (const name of events) {
app.on(name as 'certificate-error', (event, webContents, ...args: any[]) => {
webContents.emit(name, event, ...args)
})
webContents.emit(name, event, ...args);
});
}
// Property Deprecations
deprecate.fnToProperty(App.prototype, 'accessibilitySupportEnabled', '_isAccessibilitySupportEnabled', '_setAccessibilitySupportEnabled')
deprecate.fnToProperty(App.prototype, 'badgeCount', '_getBadgeCount', '_setBadgeCount')
deprecate.fnToProperty(App.prototype, 'name', '_getName', '_setName')
// Wrappers for native classes.
const { DownloadItem } = process.electronBinding('download_item')
Object.setPrototypeOf(DownloadItem.prototype, EventEmitter.prototype)
const { DownloadItem } = process.electronBinding('download_item');
Object.setPrototypeOf(DownloadItem.prototype, EventEmitter.prototype);

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