Compare commits

...

511 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
f86a8b21f5 Bump v12.1.2 2021-09-20 11:06:19 -07:00
Pedro Pontes
745a4f9695 chore: cherry pick 9723e3c13c from chromium (#30965) 2021-09-16 18:23:35 -04:00
Pedro Pontes
bf32321f4b chore: cherry-pick 034c2003be31 from v8 (#30940)
* chore: cherry-pick 034c2003be31 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-15 10:13:07 -04:00
Sudowoodo Release Bot
05c31e9121 Bump v12.1.1 2021-09-13 14:41:28 -07:00
trop[bot]
b4d322a505 fix: show maximized frameless window (#30863)
* fix: show maximized frameless window

* test: show maximized transparent window

* fix: test using wrong bounds

BrowserWindow will be sized to the workArea when the Windows taskbar is
visible.

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-09-08 08:43:05 +09:00
Pedro Pontes
5ff2f654d1 chore: cherry-pick d1eade9d39 from chromium (#30818) 2021-09-06 14:49:20 +09:00
Pedro Pontes
87b55ceacb chore: cherry-pick d727013bb543 from chromium (#30816)
* chore: cherry-pick d727013bb543 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-09-06 14:47:27 +09:00
Pedro Pontes
da5a627201 chore: cherry-pick fbfd2557c2ab from v8 (#30822)
* chore: cherry-pick fbfd2557c2ab from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-03 13:50:20 -07:00
trop[bot]
83a3a8995f chore: cherry-pick fix for 1231134 from chromium (#30762)
* chore: cherry-pick fix for 1231134 from chromium (#30637)

* chore: cherry-pick fix for 1231134 from chromium

* chore: update patches

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

* Update .patches

* chore: update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-02 12:10:59 -04:00
Sudowoodo Release Bot
ea234f9cb9 Bump v12.1.0 2021-08-31 12:05:51 -07:00
trop[bot]
013825c986 chore: cherry-pick fix for 1234770 from v8 (#30634)
* chore: cherry-pick fix for 1234770 from v8 (#30586)

* chore: cherry-pick fix for 1234770 from v8

* chore: update patches

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

* Update .patches

* chore: update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-30 21:26:02 +09:00
Cheng Zhao
c7d61b6ac6 chore: cherry-pick fix for 1234829 from angle (#30624)
* chore: cherry-pick fix for 1234829 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-30 19:34:03 +09:00
trop[bot]
cdf0387f6f chore: cherry-pick fix for 1234764 from v8 (#30660)
* chore: cherry-pick fix for 1234764 from v8 (#30587)

* chore: cherry-pick fix for 1234764 from v8

* chore: update patches

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

* Update .patches

* chore: update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-30 19:33:37 +09:00
Jeremy Rose
d3e7f2b302 fix: remove ipc wrapper for nativeImage.createThumbnailFromPath (#30737) 2021-08-30 19:32:36 +09:00
Sudowoodo Release Bot
21258845f0 Bump v12.0.18 2021-08-27 10:19:01 -07:00
trop[bot]
96bcadd290 fix: {exit|enter}-html-fullscreen emitted after esc in webview (#30669)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-24 10:47:02 +02:00
trop[bot]
ee1030e044 chore: cherry-pick fix for 1227933 from chromium (#30615)
* chore: cherry-pick 1227933 from chromium

* chore: update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-23 17:06:27 +09:00
trop[bot]
11d1bfa071 chore: cherry-pick 4ce2abc17078 from chromium (#30581)
* chore: cherry-pick 4ce2abc17078 from chromium (#30449)

* chore: cherry-pick 4ce2abc17078 from chromium

* chore: update patches

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

* Update .patches

* chore: update patches

Co-authored-by: Steven Barbaro <StevenEBarbaro@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-08-19 15:11:48 +09:00
trop[bot]
131be8cefd chore: cherry-pick e2123a8e0943 from chromium (#30580)
* chore: cherry-pick e2123a8e0943 from chromium

* chore: update patches

* chore: update patches

Co-authored-by: Steven Barbaro <StevenEBarbaro@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-19 08:25:58 +09:00
Sudowoodo Release Bot
61b6ede68c Bump v12.0.17 2021-08-17 15:41:48 -07:00
Keeley Hammond
c1c02e172e ci: update git on CI machines (#30526) (#30574) 2021-08-17 15:40:45 -07:00
Sudowoodo Release Bot
8c399548b5 Revert "Bump v12.0.17"
This reverts commit 118f8c4b88.
2021-08-17 09:30:33 -07:00
Sudowoodo Release Bot
118f8c4b88 Bump v12.0.17 2021-08-17 08:45:49 -07:00
trop[bot]
8210faeb09 fix: color select eyedropper not working within DevTools (#29729) (#30490)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-13 09:46:47 +09:00
Jeremy Rose
1c927dbbe8 fix: check DCHECK_IS_ON() instead of #ifdef DCHECK_IS_ON (#29674) (#30504)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2021-08-12 11:50:16 -07:00
Jeremy Rose
56cb0d52b9 build: decode error output as utf8 (#30093) (#30505) 2021-08-12 11:44:13 -07:00
Jeremy Rose
083913c738 test: disable failing node tests (#30098) (#30506)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2021-08-12 11:08:39 -04:00
trop[bot]
b164a0506d docs: add missing <webview> event documentation (#30464)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-08-10 10:20:48 +02:00
Jeremy Rose
494c3f8c04 fix: backport 774cfcb from sqlite (#30398) 2021-08-09 09:58:17 -07:00
trop[bot]
f5321177e7 build: rebase release branch before reverting bump (#30416)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-08-09 09:54:23 +02:00
Electron Bot
58f180201e Bump v12.0.16 2021-08-03 10:22:35 -07:00
trop[bot]
767f98b213 build: set the export goma auth fallback flag for the control process (#30316)
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-08-02 09:55:54 +09:00
trop[bot]
c8da588479 chore: update deps (#30343)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-07-30 14:56:49 -07:00
trop[bot]
d9538c7fd4 fix: use contentAspectRatio not aspectRatio (#30329)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-30 02:28:35 -07:00
Pedro Pontes
c51aec4911 chore: cherry-pick 1168f81092 from sqlite (#30295)
* chore: cherry-pick 1168f81092 from sqlite

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-30 09:00:28 +09:00
Pedro Pontes
73d9a14c6f chore: cherry-pick 24293de155 from chromium (#30261)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-30 08:57:53 +09:00
Pedro Pontes
02f9078c92 chore: cherry-pick e60cc80ff744 from chromium (#30227)
* chore: cherry-pick e60cc80ff744 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-07-29 19:46:14 +09:00
Pedro Pontes
9a77e2b07b chore: cherry-pick 0e7f91956cec from v8 (#30198) 2021-07-29 09:23:06 +09:00
Pedro Pontes
e2e85fb8fc chore: cherry-pick 3feda0244490 from chromium (#30195)
* chore: cherry-pick 3feda0244490 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-07-29 09:22:34 +09:00
trop[bot]
4e68a33c60 chore: update publish to npm to use GitHub token (#30289)
ensures that we don't get hit with a rate limit while trying to publish a release.

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-07-28 12:25:09 -07:00
Pedro Pontes
6e1e2399c7 chore: cherry-pick ac9dc1235e28 from chromium (#30266)
* chore: cherry-pick ac9dc1235e28 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-28 15:55:44 +02:00
Pedro Pontes
99413641d1 chore: cherry-pick 79fc7bcbc9 from chromium. (#30182) 2021-07-27 09:16:25 +09:00
Pedro Pontes
ab0f3fd8ff chore: cherry-pick cd98d7c0dae9 from chromium (#30252)
* chore: cherry-pick cd98d7c0dae9 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-26 17:50:45 +09:00
trop[bot]
9ce16a44db fix: increase stack size on windows x86 (#30244)
* fix: increace main thread stack size on windows x86

* chore: improve quit-on-crashed-event spec

* chore: add debug logs

* Revert "chore: add debug logs"

This reverts commit 0be81ae07c.

* chore: use a reliable crash endpoint

Co-authored-by: Stephen Wang <wangwenqiang.wwq@bytedance.com>
Co-authored-by: Deepak Mohan <hop2deep@gmail.com>
2021-07-26 17:49:23 +09:00
trop[bot]
f551883fb8 build: handle release failure by existing with code 1 (#30220)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-07-21 11:14:15 -04:00
Pedro Pontes
3ec9f58c8e chore: cherry-pick e76178b896f2 from v8 (#30185)
* chore: cherry-pick e76178b896f2 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-19 09:22:18 -07:00
Electron Bot
a52eaeb6e1 Bump v12.0.15 2021-07-15 10:18:21 -07:00
trop[bot]
08ce5bbd33 docs: fix fiddle path (#30143)
This is breaking the build in `electron/electronjs.org-new` and will
most likely not work when clicking the "Fiddle" button.

Rel: https://github.com/electron/electronjs.org-new/pull/65

Co-authored-by: Antón Molleda <amolleda@gmail.com>
2021-07-15 15:26:31 +09:00
Milan Burda
488fbfe469 fix: potential crash on macOS app exit (#29941) (#30138)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-15 11:42:24 +09:00
Milan Burda
705a9a39c4 fix: pressing ESC should exit fullscreen from webview (#30063) (#30137)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-15 11:42:02 +09:00
trop[bot]
d98b2a760c docs: add <webview> 'did-attach' event documentation (#30130)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-07-15 10:40:52 +09:00
trop[bot]
e48e899807 docs: update quick-start.md (#30132)
Change app-quit link definition, so both window-all-closed and app-quit redirects to appropriate sites.

Co-authored-by: Davenury <57959794+Davenury@users.noreply.github.com>
2021-07-14 22:26:01 +09:00
Jeremy Rose
d84ef8bfb3 fix: crash when invoking login callback synchronously (#30092) 2021-07-14 20:47:56 +09:00
trop[bot]
a8cdc21731 chore: cherry-pick 9bab573a37 from chromium (#30099)
* chore: cherry-pick 9bab573a37 from chromium

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

* Update .patches

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-13 10:54:43 -07:00
trop[bot]
fc06c55bc0 fix: window ordering on mac (#30067)
* fix: window ordering on mac

* chore: fix flaky fullscreen inheritance test

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-07-12 00:22:49 -07:00
trop[bot]
f459315060 docs: modernize protocol-handler docs (#30056)
* docs: modernize protocol-handler docs

* docs: iadd contextIsolation

* docs: add guide for launch-app-from-URL-in-other-app

* docs: address comments

* chore: fix brackets

* chore: add escaped brackets

Co-authored-by: George Xu <gxu@slack-corp.com>
2021-07-09 14:37:43 -04:00
Electron Bot
a4197c367d Bump v12.0.14 2021-07-06 08:16:17 -07:00
Shelley Vohr
b11025a539 fix: fsPromises.readFile renderer crash (#29929) 2021-07-06 10:36:55 +09:00
trop[bot]
ede6cb7edf docs: remove requestHeaders in webRequest.onHeadersReceived (#29932)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-07-06 10:35:14 +09:00
trop[bot]
961ce1ded1 fix: honor user-defined Downloads directory (#29966)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-06 10:33:11 +09:00
trop[bot]
c6e2cca8bc fix: do not leak NSUUID (#30007)
* fix: do not leak NSUUID

* Fix build error

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-05 15:43:37 -04:00
trop[bot]
f1f9a76579 fix: webview should maximize on requestFullscreen (#29988)
* fix: webview should maximize on requestFullscreen

* fix merge error

* chore: update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-05 13:42:35 -04:00
trop[bot]
1f21dfd838 fix: self.module.paths not working in web workers (#30012)
* fix: global.module.paths in workers

* spec: add a regression test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-05 15:27:34 +09:00
trop[bot]
5ba3bba53e docs: remove mention of node-mac-notifier (#30001)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-05 08:44:36 +09:00
trop[bot]
f740afcc67 docs: fix broken markdown in dialog.md (#29847)
* docs: fix broken markdown in dialog.md

* &#32;

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-07-02 09:52:35 +09:00
Pedro Pontes
822fcfe030 chore: cherry-pick 0f8d58300b from usrsctp (#29876) 2021-07-02 09:52:17 +09:00
trop[bot]
85e4bffabd fix: correctly propagate title updates for window with no navigation entries (#29960)
* fix: correctly propagate title updates for window with no navigation entries

* test

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-02 09:49:11 +09:00
trop[bot]
545aba8e16 build: add support for spawning builds for a specific commit on appveyor (#29971) (#29982)
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-07-01 10:53:24 -07:00
Shelley Vohr
574bd21696 fix: child window alwaysOnTop level persistence (#29957) 2021-07-01 11:51:27 -04:00
trop[bot]
bb149b0e93 fix: crash when clicking links with target=_blank from webview (#29950)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-06-30 09:41:23 -07:00
Pedro Pontes
a42ddbc98d chore: cherry-pick ee6aee64e24c from chromium (#29878)
* chore: cherry-pick ee6aee64e24c from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-29 15:14:38 -04:00
Electron Bot
14ae30aa9b Bump v12.0.13 2021-06-28 15:18:48 -07:00
John Kleinschmidt
e3a78f62b5 ci: fixup cross arch mksnapshot testing (#29923) 2021-06-28 16:53:10 -04:00
trop[bot]
5bef67a468 fix: stop window.open from hanging when prevented (#29881)
* fix: stop window.open from hanging when prevented

* add test

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-28 15:24:38 +09:00
trop[bot]
a6f26b5788 fix: properly order out child windows (#29887)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-25 17:55:22 +09:00
Pedro Pontes
54a7f6d865 chore: cherry-pick b77b38a3380c from chromium (#29822)
* chore: cherry-pick b77b38a3380c from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-06-23 15:08:18 +09:00
Pedro Pontes
de7ec574e2 chore: cherry-pick 50de6a8ddad9 from v8 (#29838)
* chore: cherry-pick 50de6a8ddad9 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-23 10:41:23 +09:00
Pedro Pontes
bfa682dfa3 chore: cherry-pick 910e9e40d376 from chromium (#29818)
* chore: cherry-pick 910e9e40d376 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-06-23 10:10:09 +09:00
trop[bot]
4baa634d7b fix: properly handle optional requestHeaders with onBeforeSendHeaders (#29834)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-23 10:08:34 +09:00
Pedro Pontes
3822bc8432 chore: cherry-pick d9556a80a790 from chromium (#29816)
* chore: cherry-pick d9556a80a790 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-22 15:11:05 +09:00
Pedro Pontes
1acec5d48b chore: cherry-pick b9ad6a864c79 from v8 (#29814)
* chore: cherry-pick b9ad6a864c79 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-22 15:08:30 +09:00
Pedro Pontes
31e8f75795 chore: cherry-pick 3d4f87ab5b9b from angle (#29789)
* chore: cherry-pick 3d4f87ab5b9b from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-22 15:00:28 +09:00
Pedro Pontes
905bc4a946 chore: cherry-pick d0aadee1a60a from v8 (#29784)
* chore: cherry-pick d0aadee1a60a from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-06-22 14:59:46 +09:00
John Kleinschmidt
9a48f2322f ci: run linux arm tests on CircleCI (#29767)
* ci: run linux arm tests on CircleCI

(cherry picked from commit c0d93a1772)

* cleanup electron dirs after testing

* use start-stop-daemon to kill Xvfb

(cherry picked from commit 1d10a68c31)

* actually call cleanup step
2021-06-22 14:58:00 +09:00
Electron Bot
088bc334f0 Bump v12.0.12 2021-06-21 10:04:07 -07:00
trop[bot]
8836c814b9 fix: do not cancel CORS preflight request on proxy auth. (#29810)
* fix: do not cancel CORS preflight request on proxy auth. (#29266)

* fix: do not cancel CORS preflight request on proxy auth.

If connecting via proxy, preflight request can receive 407
header response from proxy. This does not mean request
was finished even though it received headers (from proxy,
not the destination server), so prevent "completing"
and most importantly deleting it, which causes request
to be canceled in network layer. Just continue to monitor it
and await proper response from server. Also add circut breaker
to cancel request if proxy auth failed 3 times (for example
user keeps cancelling auth). This behavior happens only
when app registered WebRequest api listeners.

* Port chromium webrequest changes to electron code.

Move relevant parts of chromium WebRequestProxyingURLLoaderFactory from
https://chromium-review.googlesource.com/c/chromium/src/+/2011781
into electron ProxyingURLLoaderFactory.

* Update code to upstreamed version and remove retyr count failsafe.

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

* chore: add required header

Co-authored-by: marekharanczyk <48673767+marekharanczyk@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-06-21 21:20:27 +09:00
Pedro Pontes
5b6e117041 chore: cherry-pick 34d5af37f9ac from chromium (#29776)
* chore: cherry-pick 34d5af37f9ac from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-06-21 19:08:10 +09:00
trop[bot]
845716019a fix: microtasks policy in CreateEnvironment (#29807)
* fix: microtasks policy in CreateEnvironment

Microtasks policy should not be updated for the renderer because
`NodeBindings::CreateEnvironment` might be entered with or without
`UvRunOnce()` on stack. One of the examples of such calls is
`window.open()` which is possible to invoke while `uv_run()` is still
running (e.g. with `setImmediate()`).

All in all, it doesn't matter that much which policy we use since
`v8::MicrotasksScope` has a check for the policy in its destructor and
no commits will be made if the policy is `kExplicit`. It is important,
however, to not change the policy in the middle of `UvRunOnce()` so we
should respect whatever we currently have and move on.

Fix: #29463

* Move test to a better place

* Update spec-main/fixtures/crash-cases/setimmediate-window-open-crash/index.html

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

* Update spec-main/fixtures/crash-cases/setimmediate-window-open-crash/index.html

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

* simplify crash-case

* comment

* fix comment

Co-authored-by: Fedor Indutny <fedor@indutny.com>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Fedor Indutny <indutny@signal.org>
2021-06-21 19:06:50 +09:00
Pedro Pontes
308470c98d fix: cherry-pick 9a9c936879 from v8 (#29779)
* cherry-pick 9a9c936879 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-21 15:53:37 +09:00
Pedro Pontes
9a8ebbb471 chore: cherry-pick b7a1f498f1 and fad297a48a from chromium (#29786)
* cherry-pick b7a1f498f1 and fad297a48a from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-21 15:51:40 +09:00
trop[bot]
c90f41d0c4 fix: fix hover state not clear bug when BrowserWindow is not resizable (#611) (#29799)
Co-authored-by: sssooonnnggg <sssooonnnggg111@gmail.com>
2021-06-21 13:59:14 +09:00
trop[bot]
f275211555 fix: ensure detached devtools are not always draggable (#29736)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-06-17 15:29:49 +09:00
trop[bot]
5b04b64397 fix: draggable regions with devtools open (#29733)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-17 15:20:52 +09:00
trop[bot]
066f5136d5 fix setWindowOpenHandler call syntax (#29725)
Co-authored-by: kdau <kevin@kdau.com>
2021-06-16 10:13:12 -07:00
trop[bot]
c0cc008368 fix: don't warn about enableRemoteModule when it's undefined (#29701)
* fix: don't warn about enableRemoteModule when it's undefined

* fix tests

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-15 14:26:54 -07:00
Milan Burda
b8e7bcb621 fix: don't warn about enableRemoteModule when it's disabled at build time (#29712) 2021-06-15 14:26:44 -07:00
trop[bot]
170fb689c0 docs: coordinate system of Display.bounds and Display.workArea (#29708)
They are in DIP points (rather than screen points). We can use
screen.dipToScreen* to convert to screen points.

Co-authored-by: Jim Fisher <jameshfisher@gmail.com>
2021-06-15 16:17:49 -04:00
trop[bot]
15b11599a2 docs: Update represented-file fiddle tutorial (#29692)
* Update represented-file fiddle.

* add index and code back to guide

Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
2021-06-15 11:37:04 +09:00
trop[bot]
621cc90674 docs: fix file mode of versioning-sketch-2.png (#29680)
Unlike the other files, this file had its executable bit set in its file
mode. This change removes the executable bit to align its file mode with
the rest of the files.

Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2021-06-14 10:12:24 -07:00
trop[bot]
7d791b7f46 fix: use correct spelling of attachment with Content-Disposition header (#29671)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-14 20:59:20 +09:00
trop[bot]
4e61bc3cfd fix: copy received data in URLPipeLoader to prevent corruption (#29668)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-14 17:47:00 +09:00
trop[bot]
d82832d8bc fix: improper wrapping of fs.promises.readFile (#29575)
* fix: improper wrapping of fs.promises.readFile

* test: add a regression test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-14 09:35:35 +09:00
trop[bot]
7cb6f61af0 docs: fix image links in performance.md (#29630)
* docs: fix image links in performance.md

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

Signed-off-by: Darshan Sen <raisinten@gmail.com>

* Apply suggestions from code review

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

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-14 09:33:41 +09:00
trop[bot]
4ab2254879 fix: select-bluetooth-device on Windows (#29612)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-06-09 12:56:02 -04:00
Electron Bot
78ce1d9758 Bump v12.0.11 2021-06-09 09:39:24 -07:00
trop[bot]
3a1d65c7c3 docs: fix typo (#29581) 2021-06-08 10:32:31 +02:00
trop[bot]
7b6b15d1ca fix: make intermediates work with 'select-client-certificate' (#29568)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-08 11:39:33 +09:00
Cheng Zhao
b11aed574e fix: keep shifted character in menu accelerator (#29483)
* fix: keep shifted character in menu accelerator

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-07 10:36:35 -04:00
trop[bot]
61e987167c docs: Update notifications (renderer) docs (#29565)
* remove version information from html

* change format for readability

* clarify which console the message should appear in

* minor changes to renderer.md

* update UI on click instead of developer console

* remove node-integration and fix md

* update content

* chore: remove ****

Co-authored-by: Jeremy Foster <jeremy.foster@live.com>
Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-06-07 14:44:09 +09:00
trop[bot]
4e5ce3ff98 docs: Updated "recent documents" fiddle tutorial (#29560)
* Port recent-documents fiddle to 12-x-y.

* Update recent-documents tutorial.

* update for review comments

Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
2021-06-07 14:42:45 +09:00
David Sanders
7dfe949d39 fix: change ASAR archive cache to per-process to fix leak (#29548)
* fix: change ASAR archive cache to per-process to fix leak (#29292)

* chore: address code review comments

* chore: tighten up thread-safety

* chore: better address code review comments

* chore: more code review changes
2021-06-07 10:29:18 +09:00
trop[bot]
74216ec38b chore: return early on promise rejection (#29537)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-07 10:17:46 +09:00
Electron Bot
22e7d58365 Bump v12.0.10 2021-06-03 02:39:14 -07:00
trop[bot]
4514c34721 docs: link to IncomingMessage (#29515)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-03 16:19:25 +09:00
Milan Burda
43384a10f0 test: add spec for --require filtering in NODE_OPTIONS (#29506) 2021-06-03 14:45:01 +09:00
trop[bot]
6173129400 refactor: point prepare-release at main (#29497)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-02 14:05:20 -07:00
trop[bot]
cd75862431 build: Support building Electron on msys2 (#29477)
Electron already seems to support `cygwin`, so `msys` is a natural
addition. This is the only required change as far as I can see on my
local development environment, as otherwise the build scripts don't
realize that msys = windows.

Notes: none
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

Co-authored-by: Juan Cruz Viotti <jv@jviotti.com>
2021-06-02 22:24:44 +09:00
trop[bot]
c1a11c72e0 docs: Updated "progress bar" fiddle feature in docs (#29469)
* improve progress bar fiddle

* add comments to code snippet

* edits to progress-bar tutorial

* remove versions and nodeIntegration

* limit line length to 100

* implement standard linter suggestions

* add indeterminate and clear timers

* update to have reader replace all of main.js

* remove extra button

* loop the progress bar

* add logic to show reset state briefly

* Update docs/tutorial/progress-bar.md

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

* chore: fix lint

Co-authored-by: Jeremy Foster <jeremy.foster@live.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-06-02 16:17:03 +09:00
trop[bot]
473c394315 refactor: use main in release-notes (#29411)
* refactor: use main in release-notes

* fix: use default_branch in release-notes (#29415)

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-06-01 14:06:59 -07:00
trop[bot]
60e01470c7 chore: remove duplicate option get for CustomScheme (#29454)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-01 19:12:55 +09:00
trop[bot]
7c3b3a4b11 fix: Alt+Click should not toggle menu bar (#29451)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-06-01 19:12:10 +09:00
David Sanders
1ab28065bb fix: add service worker schemes from command line in renderer (#29425) (#29447) 2021-06-01 17:51:34 +09:00
Cheng Zhao
6d82808adc fix: correctly handle Alt+Key shortcuts (#29445) 2021-06-01 17:43:01 +09:00
trop[bot]
4ea8896c97 Fixes issue with reference links (#29431)
Co-authored-by: Vishal <34849822+vthukral94@users.noreply.github.com>
2021-06-01 10:37:21 +09:00
trop[bot]
d6324fb942 refactor: publish-to-npm respects main (#29407) 2021-05-31 10:33:36 +02:00
trop[bot]
454f78c7a6 docs: update link to Chromium's coding style guide (#29396)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-05-31 10:20:04 +02:00
trop[bot]
cff843ae18 Update quick-start.md (#29373)
In version 13.0.1 preload process should added to webPreferences.

Co-authored-by: aydon <41415004+congjiye@users.noreply.github.com>
2021-05-27 18:53:19 -07:00
trop[bot]
36793b7fb8 docs: fix typos in clang-tidy examples (#29352)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-05-27 18:52:24 -07:00
trop[bot]
66f0852fdf refactor: version-utils respects main (#29390)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-27 18:44:44 -07:00
trop[bot]
bf39abb5db refactor: getCurrentBranch respects main (#29388)
* refactor: getCurrentBranch respects main

* add note about migration

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-27 18:44:03 -07:00
trop[bot]
453a35ca13 docs: Update notifications (main) docs (#29356)
* remove version info from index.html page

* remove nodeIntegration

* format code and update readme

* add note to user in index.html

Co-authored-by: Jeremy Foster <jeremy.foster@live.com>
2021-05-27 12:41:37 -07:00
trop[bot]
5e1ccfa39a docs: fix link to docs/fiddle/quick-start (#29350)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-27 12:39:34 -07:00
John Kleinschmidt
8b02dba041 build: ensure that mksnapshot for Apple Silicon has all of the needed files for snapshot generation (#29338) (#29341)
* build: include mksnapshot args in arm64 mksnapshot.zip

* get gen/v8/embedded.S from proper location

(cherry picked from commit d0b9a931cc)
2021-05-26 19:03:41 -04:00
trop[bot]
c4b04c5d08 docs: rework introduction docs (#29300)
* docs: add 'introduction' doc

* note

* wip

* updates

* wip

* wip

* wip

* add missing code

* wip

* add image for chrome processes

* process model wip

* finish line?

* update links

* Update docs/README.md

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

* Update docs/tutorial/introduction.md

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

* Update docs/tutorial/quick-start.md

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

* Update docs/tutorial/process-model.md

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

* Update docs/tutorial/process-model.md

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

* Update docs/tutorial/process-model.md

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

* Update docs/tutorial/quick-start.md

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

* Update docs/tutorial/quick-start.md

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

* Update docs/tutorial/quick-start.md

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

* Update docs/tutorial/quick-start.md

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

* address code review

* Update docs/tutorial/application-distribution.md

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

* remove wip doc

* chore: fix lint error

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-05-24 20:29:45 +09:00
trop[bot]
a22bcb51b3 docs: Update online detection doc and fiddle (#29308)
* rework online detection doc and fiddle

* add footnote

* Update docs/tutorial/online-offline-events.md

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

* Update docs/tutorial/online-offline-events.md

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

* Update docs/tutorial/online-offline-events.md

* Update docs/tutorial/online-offline-events.md

* Update docs/tutorial/online-offline-events.md

* chore: fix lint error

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-05-24 20:29:07 +09:00
trop[bot]
f3a26f6911 Use path.join when logging screenshot path. (#29304)
Remove index.html from offscreen-rendering tutorial.
It is not used.

Update offscreen-rendering.md to reflect changes to fiddle.

Co-authored-by: Kevin Hartman <kevin@hart.mn>
2021-05-24 16:47:35 +09:00
trop[bot]
a4cc2af8f4 docs: Update docs for keyboard shortcuts (#29302)
* Update docs for keyboard shortcuts

* Add a fiddle for web-apis

* Apply suggestions from code review

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

* Cleanup a few formatting errors and missed copies

* Add descriptions to index.html

* Focus on renderer

Co-authored-by: Tony Ferrell <anf@microsoft.com>
Co-authored-by: Tony Ferrell <tonyjf@gmail.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-24 16:36:07 +09:00
trop[bot]
5cbfa5f975 fix: dnd for some wm that does not set _NET_CLIENT_LIST_STACKING (#29272)
* fix: dnd for some wm that does not set _NET_CLIENT_LIST_STACKING

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

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-05-21 15:19:39 -07:00
Andrey Belenko
354dab3bac chore: backport security fixes from Chromium release M90-3 (#29251)
* Backports of security fixes in Chromium release M90-3
https://chromereleases.googleblog.com/2021/05/stable-channel-update-for-desktop.html

Includes backports for the following Chromium issues:
https://crbug.com/1204071
https://crbug.com/1203590 (CVE-2021-30518)
https://crbug.com/1201446 (CVE-2021-30516)
https://crbug.com/1201073 (CVE-2021-30515)
https://crbug.com/1200490 (CVE-2021-30513)
https://crbug.com/1200019 (CVE-2021-30512)
https://crbug.com/1197436 (CVE-2021-30510)
https://crbug.com/1195340 (CVE-2021-30508)
https://crbug.com/1180126
https://crbug.com/1203667
https://crbug.com/1201340
https://crbug.com/1201938

* chore: update patches

* lint: remove trailing whitespaces

* chore: update patches

Co-authored-by: Andrey Belenko <anbelen@microsoft.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-05-20 10:50:38 -07:00
Electron Bot
30f82dd1cb Bump v12.0.9 2021-05-19 13:52:49 -07:00
Robo
c285da9071 fix: adjust initial webContents focus calculation (#29204) (#29235)
* fix: adjust initial webContents focus calculation

* fix: active window check on mac

* fix: about:blank focus behavior

* chore: add spec

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
2021-05-19 07:53:49 -07:00
trop[bot]
4590e51c53 docs: option title for showSaveDialog is not supported for some platforms (#29231) 2021-05-19 16:05:56 +02:00
trop[bot]
301ad4982a docs: update style guide (#29229)
* clearer heading rules

* docs: clarify documentation style guide rules

* Update docs/styleguide.md

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

* fixes

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-05-19 16:19:37 +09:00
trop[bot]
b530792f6c fix: window bounds not scaled from screen coordinates (#29226)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-05-19 16:18:40 +09:00
trop[bot]
eed685ca7a fix: AdjustAmountOfExternalAllocatedMemory regression in NativeImage destructor (#29222)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-19 11:55:03 +09:00
trop[bot]
419b675827 docs: Update the macos Dock Instructions (#29221)
* Update the macos Dock Instructions

* Remove preload and ;'s

* Mixed ;s

* Update dock doc

* Add informational text to index.html

Co-authored-by: Tony Ferrell <anf@microsoft.com>
2021-05-19 11:54:29 +09:00
trop[bot]
fe120bcd8d docs: Update macos-dark-mode fiddle and guide content (#29218)
* update macos dark mode docs for Electron v12

* pr review fixes

* more pr review fixes

* reorg paragraphs for better flow

* Update docs/tutorial/dark-mode.md

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

* pr fixes

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-19 11:53:44 +09:00
trop[bot]
8a0f89cfae docs: update drag and drop tutorial (#29217)
* Working

* Working

* Make the native-file drag and drop documents use context bridge

* Add per-file sections

* Use the updated link format

* Use path.join instead of string interpolation.

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Use fs.promises

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Update docs/tutorial/native-file-drag-drop.md

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* fix formatting

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Update docs/tutorial/native-file-drag-drop.md

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Use more path.join instead of interpolation

* Update with PR suggestions

* Remove process.cwd() and add more example elements

* Minor text fix

* Fix typo

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

Co-authored-by: Tony Ferrell <anf@microsoft.com>
Co-authored-by: Tony Ferrell <tonyjf@gmail.com>
Co-authored-by: Antón Molleda <molant@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-19 11:53:20 +09:00
trop[bot]
8e40d97538 Update accelerator.md (#29214)
`Meta` is a valid alternative for `Super` and should be listed as an available modifier.

Co-authored-by: Thomas Kainrad <7394822+tkainrad@users.noreply.github.com>
2021-05-19 11:52:34 +09:00
Jeremy Rose
a26758c44d chore: cherry-pick 8089dbfc616f from chromium (#29130)
* chore: cherry-pick 8089dbfc616f from chromium

* resolve conflicts
2021-05-17 15:42:42 -04:00
trop[bot]
f8fbb15b47 build: make patch auto fixes come from PatchUp rather than Electron Bot (#29155)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-05-17 14:45:34 -04:00
Electron Bot
343a879a97 Bump v12.0.8 2021-05-17 11:04:51 -07:00
trop[bot]
4877292934 docs: --force-fieldtrials was h2 rather than h3 (#29182)
All the other argument headers were h3 (`###`) but `--force-fieldtrials` was h2 (`##`) for some reason.
I changed it to make it consistent with the others.

Co-authored-by: Noelle Leigh <5957867+noelleleigh@users.noreply.github.com>
2021-05-16 18:15:46 -07:00
trop[bot]
8c23e08e67 fix: illegal access errors with nodeIntegrationInSubFrames (#29169)
* fix: illegal access errors with nodeIntegrationInSubFrames

* test: fixup on windows

* Address feedback from review

* Update shell/renderer/electron_render_frame_observer.cc

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2021-05-14 18:30:03 -07:00
trop[bot]
4b439def13 fix: ensure extensions w/o a background page have file access (#29172)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-14 15:32:04 +02:00
trop[bot]
eb5ce11b41 docs: Improve description of findInPage options (#29145) 2021-05-13 23:38:55 +02:00
trop[bot]
f537755314 docs: revise Mac App Store Submission Guide (#29141) 2021-05-13 10:47:16 +02:00
trop[bot]
59ad90d135 Create README.md (#29148)
Co-authored-by: Ondreas <74183220+OndreasCZ@users.noreply.github.com>
2021-05-12 23:40:47 -07:00
Erick Zhao
7eceb43859 docs: rework sandbox guide (#29103)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-13 11:08:37 +09:00
trop[bot]
23bfc37825 fix: Menu.setApplicationMenu can return a useless array 29088 (#29128)
Co-authored-by: tabishmahfuz1 <tabish.mahfuz1@gmail.com>
2021-05-12 17:35:28 -07:00
Milan Burda
5643831c14 fix: webFrame spell checker APIs crashing in sandboxed renderers (#29053) (#29086) 2021-05-10 18:21:08 -04:00
Shatyuka
63344fed13 fix: increase corner radius for vibrancy view on big sur (#29071) 2021-05-10 13:21:40 -04:00
Electron Bot
8d55658bfa Bump v12.0.7 2021-05-07 02:22:40 -07:00
trop[bot]
47431a5d96 chore: cherry-pick 7abc7e45b2 from node (#29047)
Backports: https://github.com/nodejs/node/pull/38506

Co-authored-by: Fedor Indutny <fedor@indutny.com>
2021-05-07 00:20:32 -07:00
trop[bot]
6fd4bb27e3 fix: drag region BrowserView calculations on macOS (#29019)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-06 20:29:36 +09:00
trop[bot]
546cb983be fix: <webview> focus / blur events don't work with contextIsolation enabled (#29024)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-06 20:25:33 +09:00
trop[bot]
c5426713af docs: menu must be added on whenReady (#29042)
* Add that that menu must be added on whenReady

When an application menu is added before 'whenReady' all items seem to work except 'recent documents'

This causes the issue listed here: https://github.com/electron/electron/issues/17388

* Make example more complete

* Remove semicolons

* Update docs/tutorial/recent-documents.md

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

Co-authored-by: Matthijs Groen <matthijs.groen@gmail.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-06 20:23:35 +09:00
trop[bot]
5512f1d11b spec: attempt to fix flaky nativeTheme spec (#29034)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-05-05 21:50:07 -07:00
Electron Bot
70e2fc58f9 Revert "Bump v12.0.7"
This reverts commit 37c30e1d91.
2021-05-05 20:01:58 -07:00
Electron Bot
37c30e1d91 Bump v12.0.7 2021-05-05 19:52:40 -07:00
Electron Bot
67e3206bd3 Revert "Bump v12.0.7"
This reverts commit 20ac113527.
2021-05-05 19:44:57 -07:00
Electron Bot
20ac113527 Bump v12.0.7 2021-05-05 19:33:33 -07:00
trop[bot]
405724cdd5 docs: link to BrowserView from webview page (#29009)
* docs: Link to `BrowserView` from `webview` page

* fix relative link

Co-authored-by: Hamish Macpherson <hamstu@gmail.com>
2021-05-05 10:57:34 -05:00
trop[bot]
9b98f906e0 refactor: use "as const" for constant mappings (#28999)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-05 15:59:52 +09:00
trop[bot]
2f93d874ef fix: close attached sheet on window close (#28989)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-04 09:58:45 -04:00
trop[bot]
9ae1cbebe0 docs: update REPL guide (#28985) 2021-05-04 11:51:16 +02:00
trop[bot]
a4c590e288 fix: allow Node.js to manage microtasks queue (#28972)
* fix: allow Node.js to manage microtasks queue

When `uv_run()` resulted in invocation of JS functions the microtask
queue checkpoint in Node's CallbackScope was a no-op because the
expected microtask queue policy was `kExplicit` and Electron ran under
`kScoped` policy. This change switches policy to `kExplicit` right
before `uv_run()` and reverts it back to original value after `uv_run()`
completes to provide better compatibility with Node.

* add comment

Co-authored-by: Fedor Indutny <fedor@indutny.com>
2021-05-03 23:01:13 -07:00
trop[bot]
1b9220525f docs: remove reference to global Electron install (#28968)
* docs: remove reference to global Electron install

This is a pattern that we actively want to discourage.

* docs: update as per review suggestion

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-03 11:39:24 -04:00
Electron Bot
00e846f6cc Bump v12.0.6 2021-04-30 11:57:27 -07:00
trop[bot]
d20fcb30ba build: add release-env context to publish-macos (#28941)
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-04-29 15:24:04 -07:00
trop[bot]
b95db701f1 docs: uniformize module API doc format (#28925)
This PR ensures that all API modules are present in the README doc,
as there were a couple missing. It also formats all modules to contain
a level-1 heading and a blockquote description.

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-04-29 17:33:13 +02:00
trop[bot]
fb436d81a4 docs: remove api/locales page (#28917)
This page is just a table writing out the contents of an array in
the Chromium source code. We don't actively maintain it, and
it's only referenced in one API, so it makes sense to just
link directly to the code here.

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-04-28 15:39:14 -07:00
Pedro Pontes
74fe6e024c chore: cherry-pick 7c299aede5 from v8 (#28901)
Co-authored-by: Electron Bot <electron@github.com>
2021-04-28 12:49:09 -07:00
trop[bot]
09267722f2 fix: emit window-all-closed after closing the window (#28913)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-28 12:47:30 -07:00
Pedro Pontes
8c87d0d3bb chore: cherry-pick 619083c7d8 from v8 (#28904) 2021-04-28 19:26:10 +02:00
trop[bot]
b2fe673d6c docs: the tools folder does not exist anymore (#28889)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-28 02:13:17 -07:00
trop[bot]
85103fdc60 test: disable shell.trashItem in renderer test on win-ia32 (#28878)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-28 11:12:36 +02:00
Pedro Pontes
cd093d2359 chore: cherry-pick c768895b3f, 58393127e7 and c2f6803bdd from chromium (#28821)
* chore: cherry-pick c768895b3f, 58393127e7 and c2f6803bdd from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-28 02:11:44 -07:00
Pedro Pontes
57a5a31139 chore: cherry-pick ed5f62c36d from angle. (#28872) 2021-04-28 02:11:12 -07:00
trop[bot]
2aef36998a build: actually use SSL when downloading things via python (#28892)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-28 02:06:57 -07:00
Shelley Vohr
e360f357b9 fix: recalibrate simpleFullscreen when display metrics change (#28869) 2021-04-27 20:12:08 -07:00
Pedro Pontes
9cdb4a37fa chore: cherry-pick aa2154a9c1 from v8 (#28861) 2021-04-27 10:17:35 -04:00
Pedro Pontes
089ccbff04 chore: cherry-pick 66b9ad64f4a4 from chromium (#28815)
* chore: cherry-pick 66b9ad64f4a4 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-27 16:47:34 +09:00
Pedro Pontes
3c841e7ded chore: cherry-pick 7dd3b1c86795 from chromium (#28818)
* chore: cherry-pick 7dd3b1c86795 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-27 09:49:19 +09:00
trop[bot]
ba255cd25b build: fix releases that failed halfway through npm publish actions (#28853)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-26 20:36:48 -04:00
Pedro Pontes
33036aa044 chore: cherry-pick 1536a564d959 from chromium (#28812)
* chore: cherry-pick 1536a564d959 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-26 20:09:17 +09:00
trop[bot]
37d42ec6a9 fix: only set backgroundColor in default-app for default index.html (#28841)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-04-26 11:48:58 +02:00
Shelley Vohr
8995a6b64a fix: handle async nature of [NSWindow -toggleFullScreen] (#28772) 2021-04-26 09:38:09 +02:00
Pedro Pontes
2ebd4ea9b5 chore: cherry-pick e4abe032f3ad from chromium (#28806)
* chore: cherry-pick e4abe032f3ad from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-26 16:33:19 +09:00
trop[bot]
70d3856829 fix: shell.trashItem crash when called in renderer (#28787)
* fix: shell.trashItem crash when called in renderer

* Update api-shell-spec.ts

* Update spec-main/api-shell-spec.ts

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-04-26 16:23:06 +09:00
Pedro Pontes
6ad59a30e6 chore: cherry-pick c87b3c1157 from v8 (#28809) 2021-04-26 09:16:46 +02:00
trop[bot]
909bfde816 docs: fix unintentional emoji in win.getMediaSourceId description (#28783)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-04-22 13:33:02 -07:00
trop[bot]
9702a90291 fix: ensure widget size is set correctly on linux on small screens (#28755)
When creating a widget on linux the bounds are restricted to the screen
size, when calling SetSize / SetBounds they are not.  This fixes this
initialization issue by calling SetBounds after widget creation.

Noticed this issue while running linux tests on xvfb with a screen size
smaller than the default electron window size (resulted in a failed
test).

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-21 11:53:48 -04:00
Electron Bot
84fe1d7c7b chore: cherry-pick 512cd5e179f4 from v8 (#28752)
* chore: cherry-pick 512cd5e179f4 from v8

* update patches
2021-04-21 11:00:08 -04:00
trop[bot]
393b3ecbdb fix: end attached sheet when calling window.hide() (#28695)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-21 12:03:11 +02:00
Electron Bot
258f245e74 Bump v12.0.5 2021-04-20 16:32:33 -07:00
trop[bot]
d0fdf5a374 build: fix docs only change script to pull all files not just 30 (#28742)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-19 18:28:45 -07:00
trop[bot]
3d82985602 docs(build-instructions): clarify that these are for building Electron itself (#28727)
Co-authored-by: Mark Lee <electronjs@lazymalevolence.com>
2021-04-19 20:11:13 -04:00
trop[bot]
93342d9302 build: read node files as binary files (#28736)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-19 19:58:40 -04:00
trop[bot]
50094b3a25 chore: clean up some spec things (#28730)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-19 12:54:54 -07:00
trop[bot]
13284a3a57 fix: do not handle write errors after request is aborted (#28721)
This fixes a flake on linux CI which started recently where the "write"
promise is being rejected after the request has been aborted /
cancelled.  In this case we should drop the error to the floor but
instead we pass it down the stack where it eventually emits a now
unhandled error event.

Example failure: https://app.circleci.com/pipelines/github/electron/electron/38072/workflows/c1faf19b-aa41-4f99-a564-165729222859/jobs/838813

Verified fix by running the test that caused it 10000 times before fix
and 10000 times after.  ~50 failures before, 0 after.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-19 11:26:16 -07:00
Keeley Hammond
5da6ee1fc1 fix: invoke the window open handler for _blank links (#28498) (#28664)
* fix: invoke the window open handler for _blank links

* add test
2021-04-15 14:22:14 -07:00
Electron Bot
4de3e451ac chore: bump chromium to 89.0.4389.128 (12-x-y) (#28659)
* chore: bump chromium in DEPS to 89.0.4389.128

* update patches
2021-04-14 13:27:11 -04:00
trop[bot]
d27046272e build: do not require vsts token for releases (#28650)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-14 11:44:27 +02:00
Electron Bot
9ce7c51247 Bump v12.0.4 2021-04-13 13:40:56 -07:00
Electron Bot
840ac755b8 chore: cherry-pick 02f84c745fc0 from v8 (#28638)
* chore: cherry-pick 02f84c745fc0 from v8

* update patches
2021-04-13 13:29:19 -07:00
Electron Bot
8115520d2a Bump v12.0.3 2021-04-13 07:40:27 -07:00
trop[bot]
92e3b1305c build: better error handling for release builds (#28628)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-13 10:27:57 -04:00
Michaela Laurencin
93dab148c8 fix: enable system maximization for frameless windows except if transparent (#28207) (#28622)
* fix: move widget maximization check

* fix linting error

* change workaround to only effect transparent windows

* disable menu maximize and restore for transparent windows

* disable double clicking title bar max/unmax for transparent windows

* add docs change and address review
2021-04-13 09:49:42 -04:00
trop[bot]
e100c22a26 fix: crash on invalid select-serial-port callback (#28618)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-12 11:58:25 -04:00
Jeremy Rose
4efeaa090a chore: cherry-pick 162efe98330e from chromium (#28601)
* chore: cherry-pick 162efe98330e from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-12 01:39:33 -07:00
trop[bot]
93c6c8c103 docs: define the name of the preload script (#28610)
Co-authored-by: KSneijders <32707500+KSneijders@users.noreply.github.com>
2021-04-12 00:13:53 -07:00
trop[bot]
df9a01bb53 docs: systemPreferences.subscribeWorkspaceNotification return type (#28614)
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-04-12 00:13:07 -07:00
Robo
5c10eb4c26 fix: load source maps from custom protocols and asar bundles (#28616) 2021-04-11 23:57:09 -07:00
trop[bot]
f836ef0f47 chore: don't minimize js in development (#28585)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-09 16:09:41 +09:00
Cheng Zhao
274f6f75b5 fix: allow accessing file:// when web security is disabled (#28560)
* fix: allow accessing file:// when web security is disabled

* fixup lint after merge

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-09 09:46:36 +09:00
Cheng Zhao
2f42c2c76e fix: support wasm-eval csp behind WebAssemblyCSP flag (#28575)
* feat: support wasm-eval csp behind WebAssemblyCSP flag

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-08 04:31:44 -07:00
Fedor Indutny
1cf09e7aab backport 3b21b6d from v8 to fix profiler crash (#28531) 2021-04-07 14:49:20 +09:00
trop[bot]
06580db96d fix: call UnregisterIsolate consistently (#28555)
* fix: call `UnregisterIsolate` consistently

`JavascriptEnvironment` is the class that calls `RegisterIsolate()`
so it should be the one to call `UnregisterIsolate`, and this can happen
right before disposing the aforementioned `isolate`.

See: https://github.com/electron/electron/pull/28468

* fix

Co-authored-by: Fedor Indutny <fedor@indutny.com>
2021-04-07 10:08:06 +09:00
Jeremy Rose
337e691089 fix: pass postData to new-window event (#28543)
* fix: pass postData to new-window event (#28513)

* Update api-browser-window-spec.ts
2021-04-07 10:00:16 +09:00
trop[bot]
731fe11db6 ci: Add goma fallback flag (#28545)
* ci: fallback to local compile if goma auth fails

* use correct flag

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-07 09:48:16 +09:00
trop[bot]
9e4f6bf8b4 fix: dialog DCHECK on Linux (#28533)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-06 11:30:33 -04:00
trop[bot]
59328b6f8f fix: reject task append to JumpList when description exceeds 260 characters (#28525)
* fix: reject task when description exceeds 260 characters

* Switched out wcslen() for size() [linear -> constant time]

* Included comment describing the need for the additional check

* Added information about character limit to documentation

* Added newline character to end of jump-list-category.md

Co-authored-by: SushiJackal <weingaben@gmail.com>
2021-04-05 23:57:13 -07:00
trop[bot]
facc12eafa docs: the minimum supported version of macOS is now 10.11 (#28515)
* chore: the minimum supported version is now 10.11

Chromium bumped this version back in December

* Update support.md

Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-04-05 13:03:41 -07:00
trop[bot]
d9ce3ac776 fix: free IsolateData in ~NodeEnvironment (#28483)
This seems to just have been missing here, leaking memory
(and breaking the API contract for Node.js embedding).

Co-authored-by: Anna Henningsen <anna@addaleax.net>
2021-04-02 00:15:54 -07:00
Jeremy Rose
6314637ae9 fix: put RemoteCertVerifier upstream from the caching and coalescing layers (#28358) (#28465) 2021-03-31 13:56:53 -07:00
Electron Bot
00d5c6ad53 chore: bump chromium to 89.0.4389.114 (12-x-y) (#28461)
* chore: bump chromium in DEPS to 89.0.4389.114

* update patches
2021-03-31 13:56:35 -07:00
Antón Molleda
7ac905dd77 docs: remove application-packaging.md (#28457)
This tutorial was removed as part of
https://github.com/electron/electron/pull/26239 but was not deleted when
the documentation was backported in
https://github.com/electron/electron/pull/28396
2021-03-31 01:33:29 -07:00
trop[bot]
d99ab3fb41 chore: update Community link in default menu (#28458)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-03-31 01:32:00 -07:00
trop[bot]
80ca7be524 fix: handle an unparsable pdf manifest (#28452)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-30 23:21:06 -07:00
Shelley Vohr
deb667054c fix: errors thrown in functions over the contextBridge (#28447)
* fix: errors thrown in functions over the contextBridge

* spec: add a test

* fix: ensure exception is a v8::Object
2021-03-30 23:20:43 -07:00
Antón Molleda
22f6abc4f5 docs: backport current tutorials to 12-x-y (#28396) 2021-03-30 11:53:59 -07:00
trop[bot]
c023c480bb feat: initialize field trials from command line arguments (#28403)
Fixes: #27877

Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
2021-03-29 00:25:36 -07:00
Erick Zhao
dd24a4b0f6 fix: make TouchBarPopover and TouchBarGroup work (#27901) (#28411)
* fix: use correct `orderedItem` touchbar property

* fix: correct parent in touchbar group and popover

* fix: preserve property hook order
2021-03-29 00:10:41 -07:00
trop[bot]
bb612d7a05 docs: add missing line in web-contents.md (#28400)
* Update web-contents.md

The text block was rendered as part of the `features` property, not the `handler`

* fix linting

Co-authored-by: Alexander Prinzhorn <alexander@prinzhorn.it>
2021-03-26 12:39:00 -05:00
trop[bot]
cf69f9a4ce fix: disappearing thumbar after win.hide() (#28389)
* fix: disappearing thumbar after win.hide()

* Add descriptive comment

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-25 12:16:53 -07:00
Will Anderson
d4eed90145 docs: update Node API renderer example to use contextBridge (#28371) 2021-03-24 19:42:47 -04:00
trop[bot]
8f05f313ce fix: isolate Pepper plugins (#28373)
* fix: isolate Pepper plugins

Following suit with a recent change to the same method in Chromium, we
should also isloate Pepper plugins.

* docs: add more context to comment

* fix: remove unsupported test flag behavior

Co-authored-by: clavin <cwatford@slack-corp.com>
2021-03-24 19:31:07 -04:00
trop[bot]
592a1aed0f doc: desktopCapturer menu position (#28363)
desktopCapturer can be used in both main process and renderer process

Co-authored-by: liulun <xland@live.cn>
2021-03-24 16:59:21 +09:00
Erick Zhao
fc2762c66a docs: MessagePorts guide (#27678) (#28357)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-03-24 10:44:50 +09:00
trop[bot]
9f48ef1c78 fix: make sure service worker scheme is registered with allowServiceWorkers (#28355)
* Fix custom scheme not registered as service worker scheme

* ServiceWorker loaders do not have WebContents associated

* Add test for service worker

* Revert "Fix custom scheme not registered as service worker scheme"

This reverts commit a249235b22.

* Add scheme to ServiceWorkerSchemes

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-24 10:43:20 +09:00
trop[bot]
574b705f22 fix: window.print() in pdf plugin (#28352)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-24 10:02:14 +09:00
Electron Bot
17c970b6a2 Bump v12.0.2 2021-03-23 12:19:10 -07:00
trop[bot]
1f4ffe4f68 fix: escape URL passed to shell.openExternal on windows (#28341)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-23 05:15:40 -07:00
trop[bot]
d121bcbbb5 fix: libuv hang on Windows (#28337)
* fix: libuv hang on Windows

* test: add a hang test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-23 03:00:36 -07:00
trop[bot]
d2a342c74d refactor: prefer embedder-focused InitializeNodeWithArgs (#28324)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-22 12:37:13 -07:00
trop[bot]
c19e1ee30e fix: DesktopCapturer gc'd prior to capture completion (#28281)
desktopCapture.getSources() returns a promise which should resolve
when capturing finishes. Internally it creates an instance of
DesktopCapturer which is responsible for resolving or rejecting
the promise.

Between the time DesktopCapturer starts capturing frames and when
it finishes, it's possible for its handle to be GC'd leading to
it never resolving.

These changes pin the instance of DesktopCapturer until it either
finishes or errors.

fixes #25595

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-03-22 11:02:51 +09:00
trop[bot]
508075f870 fix: drag region offsets in BrowserViews (#28296)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-22 10:58:58 +09:00
trop[bot]
c34103d912 test: use new uuid for each ServiceWorker test (#28311)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-22 10:57:16 +09:00
trop[bot]
7487fe91fe fix: bad menu position when no positioning item specified (#28277)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-19 10:21:10 +09:00
Will Anderson
7b21bc543b docs: Update Quick Start Guide for Electron 12 (#28227)
* docs: Update Quick Start Guide for Electron 12

With `contextIsolation` enabled by default in Electron 12, the Getting Started Guide no longer works as it is written. In order for the basic example to display values from `process.versions`, we need to add a `preload.js` to the example.

* Trigger Build
2021-03-18 15:12:27 +09:00
trop[bot]
6c09c2c644 docs: document the parameter structure of hookWindowMessage (#28214)
Fixes #28178

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-03-16 15:44:06 -07:00
trop[bot]
44eb30fa71 fix: revert "refactor: mmap asar files (#24470)" (#28202)
This reverts commit 01a2e23194.

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-16 19:21:02 +09:00
Electron Bot
c528ed5a8d chore: bump chromium to 89.0.4389.90 (12-x-y) (#28174)
* chore: bump chromium in DEPS to 89.0.4389.90

* update patches
2021-03-15 14:13:36 -04:00
trop[bot]
15f29aa971 chore: cherry-pick 1fe571a from node (#28109)
* chore: cherry-pick 1fe571a from node

Backports https://github.com/nodejs/node/pull/37000

* Fix merge error

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-15 11:53:06 -04:00
trop[bot]
312682d655 test: reliably wait for spellchecker to load (#28190)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-15 00:28:48 -07:00
trop[bot]
8397716dab fix: handle a nil backgroundColor in win.getBackgroundColor() (#28188)
* fix: handle a nil backgroundColor in win.getBackgroundColor()

* spec: add crash case

* fix: update to fix native_views transparent color

* chore: fix lint

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-03-15 11:45:19 +09:00
trop[bot]
23075f8620 fix: convert system colors to device color space in systemPreferences (#28172)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-13 05:01:19 -08:00
Erick Zhao
90d94e468e fix: delay emitting NotifyIcon events on Windows (#26668) (#28111)
* wip?

* attempt to use weakptr

* apply posttask change to other balloon events

* chore: add clarifying comment on weakptr

* refactor: move weakptr include to implementation

(it's not needed in the header file)

* refactor: use default initializer for weak factory

* refactor: move weakptr usage outside of loop

* fix: convert mouse events as well

* refactor: use member function for balloon events

* fix: check if wicon is truthy in callback

* refactor: bind mouse events with member function

* refactor: inline lparams

* refactor: inline getkeyboardmodifiers()

* chore: correct GetKeyboardModifiers typo
2021-03-13 10:47:07 +09:00
trop[bot]
5cc6d79d17 fix: change #if defined(OS_MACOSX) to #if defined(OS_MAC) (#28152)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-03-12 16:43:45 +09:00
trop[bot]
8f825d35f7 docs: fix cookies event documentation for type generation (#28139)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-11 16:22:39 -08:00
Electron Bot
05972074e3 Bump v12.0.1 2021-03-10 13:11:09 -08:00
Keeley Hammond
21ac61270a fix: ensure child window transparency (#28107)
* fix: ensure child window transparency works

Windows opened via window.open and intecepted via setWindowOpenHandler
or the `new-window` event should (a) have the correct background color
and (b) that background color should be transparent if specified.

The changes in api_web_contents fix (a) and the changes in
web_contents_preferences fix (b).

Notes: Child windows with specified background colors or transpency now
work as intended

* fix: set background_color in blink prefs apply logic

* fix: apply changes for 12

* fix: background_color patch simplification

* update patches

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-03-10 13:08:44 -08:00
trop[bot]
f0500fae4c fix: capturePage not resolving with hidden windows (#28075)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-10 09:38:30 +09:00
trop[bot]
5f2f4182c4 fix: pass IsScreen via parameter instead of sync IPC method (#28080)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-10 09:21:53 +09:00
Electron Bot
ac8db00a70 chore: bump chromium to 89.0.4389.82 (12-x-y) (#27960)
* chore: bump chromium in DEPS to 89.0.4389.72

* chore: bump chromium in DEPS to 89.0.4389.82
2021-03-09 11:08:06 -08:00
trop[bot]
ab5d0f4c8b chore: remove obsolete native node module patch (#28056)
* chore: remove obsolete native node module patch

* update patches

* Fix merge error

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-09 19:51:16 +09:00
trop[bot]
203116867b build: call goma_ctl.py ensure_start directly (#28060)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-09 16:05:42 +09:00
trop[bot]
67a67270f5 test: ignore the ready event from PDF Viewer (#28049)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-09 09:11:34 +09:00
trop[bot]
83a3eb64ec docs: setWindowOpenHandler should show object return (#28036)
* Should use object return

* Fix lint

Co-authored-by: Domenic Horner <domenic@tgxn.net>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-03-08 11:21:14 -05:00
trop[bot]
8b1260184a docs: update WebPreferences default values for Electron 12 (#28037)
Updates the values for `contextIsolation` and `worldSafeExecuteJavaScript` for Electron 12.

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-03-08 11:07:20 -05:00
trop[bot]
f13ddca55f fix: navigator.setAppBadge/clearAppBadge from a service worker (#28011)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-08 09:32:50 +09:00
trop[bot]
f1c4265072 chore: Add a condition to crashReporter deprecate log (#28013)
* Add a condition to crashReporter deprecate log

When developer set  submitURL to '' crash reports will be saved  at `...\AppData\Roaming\...\Crashpad\reports`, will not be uploaded to the server.
So  at this time `deprecate.log('Sending uncompressed crash reports....')`  is  unnecessary.

* Update lib/browser/api/crash-reporter.ts

change to check uploadToServer

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

Co-authored-by: liulun <xland@live.cn>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-07 16:31:37 +09:00
trop[bot]
f5de5e9131 fix: warning when worldSafeExecuteJavaScript is disabled (#27969)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-03-05 10:15:11 +09:00
trop[bot]
a73949315c test: fix contextIsolation value for later added test (#28005)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-05 10:03:25 +09:00
trop[bot]
189f7e0e4e feat: expose des-ede3 cipher (#27992)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-04 15:52:46 -05:00
Robo
2950f03e83 chore: cherry-pick 67fe5a41bff from chromium (#27991)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/2666008
2021-03-04 15:39:59 -05:00
trop[bot]
ca417e435c fix: check web_contents() for destroyed WebContents (#27966)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-04 17:01:15 +09:00
trop[bot]
5237108396 fix: offset browserview drag regions on macOS (#27988)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-04 16:33:11 +09:00
Electron Bot
3ae63c9a06 Bump v12.0.0 2021-03-01 16:47:13 -08:00
trop[bot]
8828382b23 feat: enable context isolation by default (#27949)
* feat: enable context isolation by default

* chore: set default in ctx iso getter

* spec: make all specs work with the new contextIsolation default

* spec: fix affinity specs

* spec: update tests for new ctx iso default

* spec: update tests for new ctx iso default

* spec: update tests for new ctx iso default

* spec: update tests for new ctx iso default

* chore: move stray prod deps to dev deps

* spec: update tests for new ctx iso default

* turn off contextIsolation for visibility tests

* turn off contextIsolation for <webview> tag nodeintegration attribute loads native modules when navigation happens

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-01 19:35:03 -05:00
trop[bot]
0e714d19c5 fix: ensure owner window valid (#27947)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-01 19:33:45 -05:00
Electron Bot
aec412e35d chore: bump chromium to 89.0.4389.69 (12-x-y) (#27907)
* chore: bump chromium in DEPS to 89.0.4389.69

* update patches

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-01 16:48:59 -05:00
John Kleinschmidt
4b2d791212 chore: revert webFrameMain.executeJavaScriptInIsolatedWorld method (#27926) (#27937)
(cherry picked from commit 84d0e827a3)

Co-authored-by: Keeley Hammond <VerteDinde@users.noreply.github.com>
2021-03-01 13:34:40 -08:00
Shelley Vohr
fd629c16cb fix: set WebContents background color ubiquitously #27592 (#27593) (#27942)
Move it from LoadURL to RenderViewCreated which is present
in all window creation cases and is called early enough to be
relevant from user prespective and after RenderWidgetHostView
is already present.

Co-authored-by: marekharanczyk <48673767+marekharanczyk@users.noreply.github.com>
2021-03-01 13:32:35 -08:00
Keeley Hammond
007c960f3c fix: values return from the ctx bridge with dynamic property support should themselves support dynamic properties (#27940)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-01 15:17:47 -05:00
Keeley Hammond
b2636e171a ci: ignore errors deleting user app directories on WOA testing (#27939) 2021-03-01 13:58:34 -05:00
Keeley Hammond
e7e1801443 fix: race-condition in electron.net (#27938) 2021-03-01 13:50:03 -05:00
Keeley Hammond
0baf9997ad fix: navigator.bluetooth.requestDevice (#27927)
* fix: navigator.bluetooth.requestDevice

* remove permission observer methods not implemented in 12-x-y

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-01 13:14:41 -05:00
Electron Bot
e65e989650 Bump v12.0.0-beta.31 2021-03-01 07:00:59 -08:00
Shelley Vohr
26a18c26d7 chore: bump node in DEPS to v14.16.0 (#27911)
* chore: bump node in DEPS to v14.16.0

* bootstrap: refactor to use more primordials

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

* chore: update filenames list

Co-authored-by: Electron Bot <electron@github.com>
2021-03-01 20:47:44 +09:00
Electron Bot
a52c88ec4d Bump v12.0.0-beta.30 2021-02-25 07:01:19 -08:00
Erick Zhao
0ee559cd29 fix: cherry-pick 5c7ad5393f74 from chromium (#27598)
* fix: cherry-pick 5c7ad5393f74 from chromium

* patch

* mas fix

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-02-24 12:44:13 -08:00
trop[bot]
dfed04b71b docs: fix header level of some events in app.md (#27887)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-02-24 20:36:34 +09:00
trop[bot]
d628fa07b5 fix: cap sendInputEvent text length at n-1 (#27855)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-24 18:07:27 +09:00
Jeremy Rose
f0c7789544 fix: ECDH.setPrivateKey correctly sets the key (#27688) (#27856)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-24 18:06:49 +09:00
trop[bot]
d00e869560 fix: isFullScreen typo (#27864)
* fix isFullScreen typo

* Update lib/browser/api/base-window.ts

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

Co-authored-by: Tony Wu <tonywoo@fb.com>
Co-authored-by: Tony <TonyWuu@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2021-02-24 18:05:32 +09:00
Shelley Vohr
b70e42024a fix: libuv hang when nodeIntegrationInSubframes enabled (#27879) 2021-02-24 17:58:32 +09:00
Electron Bot
44adc8ddb4 chore: bump chromium to 89.0.4389.58 (12-x-y) (#27759)
* chore: bump chromium in DEPS to 89.0.4389.47

* chore: bump chromium in DEPS to 89.0.4389.58

* update patches

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-02-23 16:27:25 -05:00
Electron Bot
9e30fe0f96 Bump v12.0.0-beta.29 2021-02-23 08:35:33 -08:00
Erick Zhao
7180b2b13f docs: remove v5 and v6 modernization docs (#27858) 2021-02-22 12:21:21 -08:00
trop[bot]
c734baf8d4 fix: gather crash data for unexpected helper path (#27828)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-22 11:42:25 -05:00
trop[bot]
a859436f7a revert: patch libuv to use posix_spawn on macOS (#27026) (#27810)
* Revert "perf: patch libuv to use posix_spawn on macOS (#27026)"

This reverts commit f69c11105f.

* Update .patches

Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2021-02-22 10:06:29 -05:00
Electron Bot
3144f992f7 Bump v12.0.0-beta.28 2021-02-22 07:01:39 -08:00
trop[bot]
98f57a20e7 fix: enableBlinkFeatures warning in webviews (#27790)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-19 15:46:36 +09:00
trop[bot]
f6007654f9 fix: don't create last saved path if none exists (#27806)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-19 15:44:10 +09:00
trop[bot]
84a4a7a944 fix: restore window event redispatching on mac (#27769)
Co-authored-by: clavin <cwatford@slack-corp.com>
2021-02-19 15:41:35 +09:00
Electron Bot
1b6e3596f2 Bump v12.0.0-beta.27 2021-02-18 07:01:33 -08:00
Eryk Rakowski
573784967c feat: add win.setTopBrowserView() so that BrowserViews can be raised (#27007) (#27713)
* feat: Raise a browser view via `BrowserWindow.setTopBrowserView()`.

This is similar to removing and re-adding a browser view, but avoids a visible flicker as the browser view is not removed from the window when using `setTopBrowserView`. Note: if the given browser view is not attached to the window, it will be added.

This commit contains the macOS implementation.

* feat: setTopBrowserView support for Windows and Linux

* docs: add info about setTopBrowserView

* docs: Clarify behavior when browserView is not yet attached.

* fix: throw en error when browserView is not attached to the window

* fix: build error

* fix: test

* fix: add test case

* fix: tests

* fix: reparenting

* fix: close second window in tests

Co-authored-by: sentialx <sentialx@gmail.com>

Co-authored-by: Stewart Lord <stew@offbynone.com>
2021-02-18 17:09:26 +09:00
trop[bot]
d55b399976 fix: check WebContents before emitting render-process-gone event (#27756)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-02-18 10:15:46 +09:00
trop[bot]
b8941d084d fix: pdf viewer missing resources (#27747)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-17 13:24:13 -08:00
trop[bot]
afffbadf5b test: fix flaky did-change-theme-color test (#27746)
* test: move did-change-theme-color test to main

* test: enable did-change-theme-color test for WOA

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-02-17 10:58:56 +09:00
Jeremy Rose
c3bce9c664 feat: implement allowFileAccess loadExtension option (#27702)
Co-authored-by: Сковорода Никита Андреевич <chalkerx@gmail.com>
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-02-16 15:20:20 -08:00
Electron Bot
33f6ff40fc chore: bump chromium to 89.0.4389.47 (12-x-y) (#27591)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-16 15:17:43 -08:00
Keeley Hammond
777f23af0d feat: add display-capture api to session permissions (#27696) 2021-02-16 08:00:15 -08:00
Electron Bot
f6992db54b Bump v12.0.0-beta.26 2021-02-15 07:01:13 -08:00
trop[bot]
8cdd20e97a feat: add exit code to render-process-gone details (#27677)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-15 09:39:49 +09:00
trop[bot]
962f1aa7d4 fix: crash in crypto.createDiffieHellman (#27700)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-11 11:04:27 -05:00
Electron Bot
0961044dc8 Bump v12.0.0-beta.25 2021-02-11 07:03:07 -08:00
trop[bot]
e1f06510f8 refactor: load preload script directly as a string (#27661)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-02-10 10:16:25 -06:00
trop[bot]
b6bdbcf485 chore: cherry-pick 0c8b6e41 from v8 (#27685)
* chore: cherry-pick 0c8b6e41 from v8

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

* update patches

* update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-02-09 20:55:49 -08:00
trop[bot]
417230a67a perf: patch libuv to use posix_spawn on macOS (#27656)
* perf: patch libuv to use posix_spawn on macOS

patch libuv to fix a performance regression in macOS >= 11

Spawning child processes in an Electron application with a hardened
runtime has become slow in macOS Big Sur. This patch is a squashed
version of https://github.com/libuv/libuv/pull/3064

This patch should be removed when libuv PR 3064 is merged.

Fixes: https://github.com/libuv/libuv/issues/3050
Fixes: https://github.com/electron/electron/issues/26143
PR-URL: https://github.com/libuv/libuv/pull/3064

Authored-by: Juan Pablo Canepa <jpcanepa@gmail.com>
Co-authored-by: Marcello Bastéa-Forte <marcello@descript.com>
Electron patch prepared by: Pat DeSantis <pdesantis3@gmail.com>

* Remove trailing whitespaces from patch file

* update patches

* Update patch description

Co-authored-by: Pat DeSantis <pdesantis3@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-02-09 20:52:23 -08:00
Shelley Vohr
fe876bd55b fix: BrowserView rendering flicker (#27658) 2021-02-09 15:05:40 -05:00
Electron Bot
4e372b888f Bump v12.0.0-beta.24 2021-02-09 08:41:06 -08:00
trop[bot]
74ef45315b perf: optimize data structures in context_bridge::ObjectCache (#27666)
* Use std::forward_list instead of base::LinkedList for better perf,
more consistent memory management.  Better than std::list because we
don't need the double-linked-list behavior of std::list
* Use std::unordered_map instead of std::map for the v8 hash table

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-02-09 08:32:34 -08:00
trop[bot]
f7d8c806ae fix: early GC of WebFrameMain instances (#27663)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-02-09 08:32:24 -08:00
trop[bot]
d4de0b5e50 build: make sure fuses.h gets generated (#27671)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-02-09 08:31:44 -08:00
trop[bot]
35daa4801a fix: do not run display check on "closed" windows in tray (#27668)
* fix: only run display check on restored wndow if minimized

* fix: don't run display check on hidden, non-minimized windows

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2021-02-08 14:01:43 -08:00
Electron Bot
5db929ffc1 Bump v12.0.0-beta.23 2021-02-08 07:02:02 -08:00
trop[bot]
f6b81990fc fix: memory leak in BrowserWindow (#27641)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-08 17:36:25 +09:00
trop[bot]
7c67c1d0ee fix: clean up base::LinkedList in context_bridge::ObjectCache (#27636)
base::LinkedList does not delete its members on destruction. We need to
manually ensure the linkedlist is empty when the ObjectCache is
destroyed.

Fixes #27039

Notes: Fixed memory leak when sending non-primitives over the context
bridge

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-02-05 14:24:50 -08:00
Erick Zhao
509efee4af fix: cherry-pick 5902d1aa722a from chromium (#27596)
* patch

* apply patch from CI?
2021-02-04 15:42:45 -05:00
Electron Bot
7fa87565c0 Bump v12.0.0-beta.22 2021-02-04 07:01:18 -08:00
trop[bot]
c67c3aaf74 build: fix buildflags.h generation on macos (#27595)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-02-03 16:30:04 +09:00
trop[bot]
cc4db3359d fix: crash when loadExtension fails (#27589)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-02-03 16:28:47 +09:00
Electron Bot
5dbb6356ef Bump v12.0.0-beta.21 2021-02-02 09:39:17 -08:00
Electron Bot
0c5b6bfd30 chore: bump chromium to 89.0.4388.2 (12-x-y) (#27280)
* chore: bump chromium in DEPS to 89.0.4386.0

* update patches

* 2596667: Reland "[printing] Mojofy PrintHostMsg_CheckForCancel"

https://chromium-review.googlesource.com/c/chromium/src/+/2596667
(cherry picked from commit 70fb0fe694)

* fixup for 2596667: Reland "[printing] Mojofy PrintHostMsg_CheckForCancel

* 2596880: Refactor frame detach helpers to return a bool indicating success.

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

* 2596880: Refactor frame detach helpers to return a bool indicating success.

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

* 2615203: [Code health] Convert DispatchCallback to OnceCallback

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

* 2587618: Refactor contrast tracking in NativeTheme

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

* 2596289: Use ContextMenuDataMediaType Mojo enum instead of the native one

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

* 2587049: Move blink.mojom.DragOperation to //ui/base/dragdrop

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

* 2585255: Move web_isolated_world_ids.h from public/platform to renderer/platform/bindings in blink

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

* 2602887: Convert CheckForUpdates callback to OnceCallback

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

* 2601061: Convert ChromeManagementAPIDelegate to OnceCallback

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

* 2600391: Convert MessagingDelegate to OnceCallback

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

* 2583590: webui: Remove UseWebUIBindingsForURL

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

* 2562002: Deprecate ResourceType in ExtensionsBrowserClient

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

* chore: handle AXPropertyFilter::SCRIPT in accessibility_ui

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

* chore: add DISPLAY_CAPTURE permission to converter

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

* fix: add utility class for linting

* 2614784: Remove SchemeRegistry APIs for handling local and secure schemes

Ref; https://chromium-review.googlesource.com/c/chromium/src/+/2614784

* chore: bump chromium in DEPS to 89.0.4387.0

* 2618392: Rename PAGE to ENTRY in NAVIGATION_TYPE values.

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

* 2616421: Factor out DnsConfigService::Watcher logic

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

* chore: update Chromium patch indices

* 2617866: Componentize OptimizationHintsComponentInstaller for reuse on iOS

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

* refactor: refactor x11 event handling, xeventobserver is now x11:eventobserver

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2577887
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2585750

* 2595524: [XProto] Use x11 namespace instead of gfx for //ui/gfx/x

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

* build: change ui namespace to x11

Ref: c38f8571a8:ui/gfx/x/xproto_util.h;dlc=ba9145d0c7f2b10e869e2ba482ca05b75ca35812

* 2600437: [XProto] Remove old property setters/getters from x11_util

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

* chore: remove deleted headers

* 2402398: Adding ViewsAXTreeManager output to chrome://accessibility

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

* chore: revert to old version of circleci for mac builds

Ref: https://gn.googlesource.com/gn/+/0d67e272bdb8145f87d238bc0b2cb8bf80ccec90

* fix: remove outdated --experimental-wasm-bigint flag

* chore: bump chromium in DEPS to 89.0.4389.0

* update patches

* 2592803: [Extensions] Use policy-enforced update URL in ManagementApi

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

* 2599731: Make network::DataElement a union with absl::variant

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

* 2614784: Remove SchemeRegistry APIs for handling local and secure schemes

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

* 2624711: Inline and remove peekLast()

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

* chore: add patch to fix blink prefs fetching during frame swap

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

* update patches

* fix: do not make invalid SKImageRep in FrameSubscriber

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

* Revert "2616421: Factor out DnsConfigService::Watcher logic"

This reverts commit 7214406ecb.

* 2616421: Factor out DnsConfigService::Watcher logic

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

* chore: bump chromium in DEPS to 89.0.4388.2

* chore: update patches

* 2581958: [api] Dehandlify FunctionTemplate initialization

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

* Revert "2592803: [Extensions] Use policy-enforced update URL in ManagementApi"

This reverts commit 00f4041cc9.

* 2572896: Prevent making invalid SkImageReps

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

* fix: sandbox exit event to preload test

* fix: restore clipboard_win patch

* ci: force delete user app data directories

* chore: clean up typing on webview-spec

* docs: undocument display-capture ses.permission option

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-02-01 16:42:43 -05:00
Electron Bot
9faf23509d Bump v12.0.0-beta.20 2021-02-01 07:01:03 -08:00
trop[bot]
b4ae35a63d fix: pass button callback in constructor (#27555)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-01-31 09:30:10 +09:00
trop[bot]
025abfc1ba docs: update Xcode / macOS SDK version in build-instructions-macos.md (#27536)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-29 12:49:12 -08:00
trop[bot]
563bb8559f docs: Update Readme, don't mention Electron < 2 (#27541)
* chore: Update Readme, don't mention Electron < 2

* chore: Add back versioning info

Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2021-01-29 12:44:08 -08:00
trop[bot]
30be5bfa4b fix: replace default frameName title with null check (#27552)
* refactor: replace default frameName title with null check

* add isNativeWindowOpen check in makeBrowserWindowOptions

* modify snapshot test files

* replace title with frame-name again for proxy - not native open

* modify proxy snapshot title key-value to come after height key-value

Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-01-29 12:42:34 -08:00
trop[bot]
28fa60fbcb feat: enable world safe JS by default (#27502)
* feat: enable world safe JS by default

* refactor: use the ctx bridge to send executeJavaScript results in a world safe way

* docs: add more info about the breaking change

* include default in IsEnabled check

* test: fix failing http spec

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-29 12:39:56 -08:00
Electron Bot
37c68d56d6 Bump v12.0.0-beta.19 2021-01-28 07:01:38 -08:00
trop[bot]
da58ded8f9 docs: update verb tenses for structured clone notes (#27501)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-01-27 17:06:17 +09:00
trop[bot]
80a3f10b6b docs: add missing contextBridge API to README (#27511)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-01-27 17:03:10 +09:00
Milan Burda
889abd0c8e docs: update OSR max FPS number (#26805) (#27508)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-01-27 16:34:45 +09:00
trop[bot]
0305f08888 refactor: cleanup WebFrameMain + improve tests (#27500)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-26 19:58:07 -08:00
Milan Burda
0604f8727c fix: CSP with unsafe-eval detection with Trusted Types (#27446) (#27471) 2021-01-26 21:42:16 -06:00
trop[bot]
551896c4ce build: fix build with enable_printing=false (#27474)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-26 14:12:05 -08:00
trop[bot]
c11a5dcf29 fix: hiddenInset missing maximize button (#27462)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-25 11:29:09 -08:00
trop[bot]
b86eb74fbf fix: don't throw on bad icons in BrowserWindow constructor (#27463)
* fix: do not throw if NativeImage conversion fails.

Throwing is an unannounced semver/major breaking change, so revert that
behavior but keep the rest of the #26546 refactor.
2021-01-25 11:32:32 -06:00
trop[bot]
e49a88ba53 fix: <webview> not working with Trusted Types (#27467)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-25 08:42:02 -08:00
Electron Bot
4ab817768d Bump v12.0.0-beta.18 2021-01-25 07:01:21 -08:00
trop[bot]
f730284113 fix: add eyedropper tool functionality to browser view (#27442)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-01-21 16:19:07 -08:00
trop[bot]
6122f4bece fix: actually clear pending requests in DevToolsAgentHost (#27440)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-21 13:58:16 -08:00
Milan Burda
017628f84d fix: apply tzdata2020f to ICU (#27370)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-01-21 13:01:01 -08:00
Electron Bot
eb132d8b3e Bump v12.0.0-beta.17 2021-01-21 11:21:36 -08:00
trop[bot]
f26025301a fix: enable navigator.setAppBadge/clearAppBadge (#27431)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-01-21 12:16:21 -05:00
John Kleinschmidt
a79750b871 Revert "Bump v12.0.0-beta.17"
This reverts commit 870d8c0307.
2021-01-21 10:29:05 -05:00
Electron Bot
870d8c0307 Bump v12.0.0-beta.17 2021-01-21 07:02:20 -08:00
trop[bot]
1f22b2bfdc feat: add frame and webContents to webRequest details (#27334)
* feat: add frame and webContents to webRequest details

* chore: use frame_converter.h

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-01-21 15:55:30 +09:00
Milan Burda
e25de07657 feat: add webFrameMain.send() / webFrameMain.postMessage() (#26807) (#27366) 2021-01-21 15:49:02 +09:00
trop[bot]
6bfccca157 fix: Shutdown crash in DownloadItem callback (#27418)
The call stack for one of our top crashes looks like this:

```
node::Abort (node_errors.cc:241)
node::Assert (node_errors.cc:256)
node::MakeCallback (callback.cc:226)
gin_helper::internal::CallMethodWithArgs (event_emitter_caller.cc:23)
gin_helper::EmitEvent<T> (event_emitter_caller.h:51)
gin_helper::EventEmitterMixin<T>::Emit<T> (event_emitter_mixin.h:81)
electron::api::DownloadItem::OnDownloadUpdated (electron_api_download_item.cc:115)
download::DownloadItemImpl::UpdateObservers (download_item_impl.cc:482)
content::DownloadManagerImpl::Shutdown (download_manager_impl.cc:508)
content::BrowserContext::~BrowserContext (browser_context.cc:476)
```

Full stack here: https://sentry.io/share/issue/9b030a0601b547188181b543c16ecda2/

During browser shutdown, the `DownloadManager` was being cleaned up
*after* the Node environment had already been destroyed. This caused the
`DownloadItem::OnDownloadUpdated` callback to crash when trying to emit
the JS `done` event.

To prevent this, we now manually shut down the `DownloadManager`
earlier. This is also mentioned in the comment on
`DownloadManager::Shutdown`:

```
// Shutdown the download manager. Content calls this when BrowserContext is
// being destructed. If the embedder needs this to be called earlier, it can
// call it. In that case, the delegate's Shutdown() method will only be called
// once.
```

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
2021-01-21 15:31:05 +09:00
Shelley Vohr
58c1ce50d4 fix: incorrect case in content::PermissionType mapping (#27422) 2021-01-20 15:59:05 -08:00
trop[bot]
c46ed96421 fix: increase stack size on windows (#27384)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-01-20 11:48:05 -05:00
trop[bot]
9278459c46 fix: prevent crash when keyboard event immediately precedes calling BrowserWindow.close() (#27359)
* fix: prevent crash when destroyed widget receives keyboard event

Activating a key to close a window will cause a silent crash. Handling the keyboard
event will lead to a nullptr dereferenced in Chromium code if the window widget has
already been destroyed.

* test: ensure BrowserWindow doesn't crash from keyboard events during close

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-01-19 15:51:09 +09:00
Milan Burda
a6af3bd8df chore: remove unused sendToAll + related APIs (#26771) (#27354) 2021-01-19 15:49:54 +09:00
trop[bot]
c74780117e feat: exposeInMainWorld allow to expose non-object APIs (#26834)
* feat: ExposeAPIInMainWorld allow to process non-object APIs cpp part

* fix: add IsTypedArray check before DeepFreeze of the api

* feat: ExposeAPIInMainWorld allow to process non-object APIs js part - ts types change

* test: add new context bridge tests

* docs: ctx bridge exposeInMainWorld change documentation for any API

Co-authored-by: nikitakot <nikitakot@microsoft.com>
2021-01-19 15:46:01 +09:00
Electron Bot
a6f01ded4d Bump v12.0.0-beta.16 2021-01-18 07:01:42 -08:00
trop[bot]
25e4475444 fix: crash in renderer process with non-context-aware modules (#27317)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-14 13:57:15 -08:00
Electron Bot
162d40cd23 Bump v12.0.0-beta.15 2021-01-14 07:02:37 -08:00
trop[bot]
a73f00cd47 Revert "test: use emittedUntil in PDF Viewer tests (#27248)" (#27316)
This reverts commit 36f4ee87df.

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-14 14:56:36 +09:00
Erick Zhao
897fd34253 docs: update devtools extension tutorial (#26326) (#27310)
* docs: update devtools extension tutorial

* Update docs/tutorial/devtools-extension.md

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

* update

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-14 14:54:25 +09:00
trop[bot]
0d48f3944d refactor: use platform-specific TaskRunner to print (#27307)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-13 13:45:06 -08:00
trop[bot]
82bc14362c test: disable flaky reporting API test (#27270)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-12 10:17:15 +09:00
Jeremy Rose
4010890edd chore: upgrade to chromium 89.0.4336.0 (#26700)
* chore: upgrade to chromium 89.0.4336.0

* update patches

* chore: use 'libvulkan.so.1' in the linux manifests

CL: https://chromium-review.googlesource.com/c/angle/angle/+/2538430

Upstream renamed libvulkan.so to libvulkan.so.1, so sync our manifests.

* chore: update expected window-open default policy.

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

Upstream CL contiues the work to make `strict-origin-when-cross-origin`
the default referrer policy. This commit changes our window-open tests
to expect that policy over the previous `no-referrer-when-downgrade`.

* chore: re-export chromium patches

No code changes; just line numbers. `git am` failed because the upstream
changes were just large enough to require patching to fail w/o fuzzing.

The broken patch was
patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch

* update patches

* update patches

* fixup! chore: update expected window-open default policy.

* chore: disallow copying CppHeapCreateParams

Experimental commit to resolve FTBS https://ci.appveyor.com/project/electron-bot/electron-ljo26/builds/36405680#L25345
which introduces a new struct CppHeapCreateParams that aggregates a
vector of unique_ptrs. Our Windows CI is unhappy that this struct
implicitly deletes its copy ctor, so this commit makes it explicit.

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

* update patches

* update patches

* fixup! chore: bump chromium to ac06d6903a2c981ab90a8162f1ba0 (master) (#26499)

* chore: update calls to gfx::RemoveAcceleratorChar.

The call signature for gfx::RemoveAccelerator changed in
https://chromium-review.googlesource.com/c/chromium/src/+/2546471 .
This commit updates use to match that.

* update patches

* update patches

* chore: update patches

* Remove most service manifest remnants from Content

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

* Reland "Portals: Fix a11y for orphaned portals"

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

* Convert CallbackList::Subscription to a standalone class.

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

* fix: actually apply the zlib patch

* chore: update patches

* chore: update patches

* clear out cache

* Revert "clear out cache"

This reverts commit 6e811fae4b7f4eeb736225ce2460857922763b66.

* Update to 89.0.4342.2

* Remove force_ignore_site_for_cookies until we figure out what to do instead

2499162: Remove |force_ignore_site_for_cookies| from IPCs (e.g. ResourceRequest). | https://chromium-review.googlesource.com/c/chromium/src/+/2499162
(cherry picked from commit 102a2a3b8d57b6cddb85e9d24e44de77730c81c3)

* Set site_for_cookies to request url so that URLLoader::ShouldForceIgnoreSiteForCookies returns true

(cherry picked from commit 7a2510a9f68339a252a25df3839e9e215a476d4b)

* 2485887: [Extensions][web_accessible_resources] Use |matches|.

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

* 2490383: a11y inspect reorg: implement accessible tree formatter factory

https://chromium-review.googlesource.com/c/chromium/src/+/2490383
(cherry picked from commit 8cd4ee013eec12205832d0f763ab4480cdb10c28)

* Disable CertVerifierService for now

2559260: Enable CertVerifierService by default | https://chromium-review.googlesource.com/c/chromium/src/+/2559260
(cherry picked from commit 56a4a87dec21c1332e508adae4638bf00371dc73)

* 2555005: [api] Simplify ScriptOrigin

https://chromium-review.googlesource.com/c/v8/v8/+/2555005
(cherry picked from commit 338d4304bc9c0abcd24306aa4901558b9db9368b)

* Actually apply nan patch

(cherry picked from commit bf20236386f83229ec09c434d21aca4712d0d53b)

* update patches

* update to 89.0.4348.1

see if this resolves Windows crashes

* Do not build MTLManagedObjectAdapter

It's been removed in newer Mantle versions and uses a deprecated enum

(cherry picked from commit 36accef04a9047da4f31f214f133866e48f7942c)

* 2569367: Remove dead fullscreen code in RenderWidgetHostView and friends

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

* 2563553: Remove Flash from PermissionRequestTypes and PermissionTypes.

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

* 2568359: mac: Ignore Wdeprecated-declarations for LSSharedFileList* functions.

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

* Remove deprecated performFileOperation usage

(cherry picked from commit d2dca0c24950cbc81cec80beac9ba640e200d6fa)

* 2546146: Remove browser-hosted InterfaceProvider

https://chromium-review.googlesource.com/c/chromium/src/+/2546146
(cherry picked from commit 944da70791253e9a564317f93814ab544c944a8e)

* fixup: Add disconnect logic to ElectronBrowserHandlerImpl

(cherry picked from commit e4582a10bbdd20d08d94389953cad8a4ea2b7a1d)

* 2561401: Add OutputPresenterX11 which uses X11 present extension.

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

* Allow local networking override for ATS

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
(cherry picked from commit f4a0b5834b78d189acb03d3b43b2160dcc749a7e)

* 2565511: [objects] Remove MakeExternal case for uncached internal strings

https://chromium-review.googlesource.com/c/v8/v8/+/2565511
(cherry picked from commit cf09a792f0)

* Update patches after rebase

* Refactor: clean up rfh getters in ElectronBrowserHandlerImpl

(cherry picked from commit be270753e1)

* Remove unneeded BindTo

(cherry picked from commit ca3287895a)

* Don't assign ElectronBrowserHandlerImpl at all

(cherry picked from commit 899ef067ed)

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-11 16:06:19 -05:00
trop[bot]
b10a908187 build: fix installing of code-signing identity on macOS (#27266)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-11 10:15:55 -08:00
Electron Bot
0e7ff69a4e Bump v12.0.0-beta.14 2021-01-11 07:01:53 -08:00
Milan Burda
f5af20d1d6 feat: add event.senderFrame property returning the originating webFrameMain (#26764) (#27047) 2021-01-11 14:31:23 +09:00
trop[bot]
3f2ccce9e1 fix: set presentationModeEnabled value for PDF viewer (#27262)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-11 12:24:01 +09:00
trop[bot]
8e7862ed4b test: use emittedUntil in PDF Viewer tests (#27261)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-11 12:23:39 +09:00
trop[bot]
48a8fdfdb6 feat: add webFrameMain.executeJavaScriptInIsolatedWorld() (#27195)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-11 10:47:42 +09:00
trop[bot]
e9c39163bf fix: broken PDF viewer (#27241)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-11 10:38:34 +09:00
trop[bot]
dc657515b7 test: skip media-started-playing media-paused events test when media not supported (#27236)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-08 09:31:06 -08:00
trop[bot]
8eb4ab0ae1 ci: fix broken homebrew cache (#27231) 2021-01-08 09:30:36 -08:00
trop[bot]
92c8614e14 test: skip PictureInPicture video when media not supported (#27233)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-07 21:39:15 -08:00
trop[bot]
f3ce79936a test: skip protocol.registerSchemesAsPrivileged stream test when media not supported (#27230)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-07 14:42:55 -08:00
trop[bot]
d498d4bf18 feat: make win.setAspectRatio() work on Windows (#27202) 2021-01-07 11:46:14 -08:00
Electron Bot
df21f17131 Bump v12.0.0-beta.13 2021-01-07 07:03:02 -08:00
trop[bot]
c6d144d550 fix: handle BrowserView reparenting (#27187)
* fix: handle BrowserView reparenting

* Fix case where webContents is destroyed

* Add a reparenting test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-05 14:11:17 -05:00
trop[bot]
6553c4418f docs: webFrameMain.fromId() can return undefined (#27193)
* docs: webFrameMain.fromId() can return undefined

* docs: webFrameMain.fromId() can return undefined

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-05 17:20:32 +09:00
trop[bot]
ecf981a91a docs: document frameId meaning (#27191)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-04 20:27:18 -08:00
trop[bot]
b5cfa03a63 fix: default offset when no drag regions (#27184)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-05 12:14:06 +09:00
trop[bot]
1bbf71c090 feat: add support for webContents option in BrowserView (#27032)
* feat: add support for webContents option in BrowserView

* tests: add tests

Co-authored-by: sentialx <sentialx@gmail.com>
2021-01-05 11:47:03 +09:00
trop[bot]
97b40e4e45 refactor: remove path from nativeImage converter (#27181)
* refactor: remove path from nativeImage converter

* chore: address some review feedback

* Abstract out conversion

* Use converter for DockSetIcon

* Fix startDrag error

* Remove unnecessary FromV8 converter

* Allow DockSetIcon to take null

* Update shell/browser/browser_mac.mm

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-01-05 11:43:24 +09:00
Eryk Rakowski
975123b6bf fix(extensions): implement missing web_request hooks (#22655) (#27098)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-01-05 11:30:01 +09:00
trop[bot]
011315574c fix: make webContents.id work even after destroy (#27070)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-05 11:14:00 +09:00
trop[bot]
cfd848c32f docs: update broken Chrome webview URL (#27179)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-01-04 14:05:59 -08:00
trop[bot]
81db78daec fix: unclickable regions in some draggable BrowserViews (#27177)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-04 14:04:32 -08:00
Electron Bot
ce0faeed90 Bump v12.0.0-beta.12 2020-12-21 07:01:39 -08:00
Electron Bot
e6885668d4 Bump v12.0.0-beta.11 2020-12-17 07:01:35 -08:00
trop[bot]
a1df860b66 refactor: remove last use of InternalCallbackScope (#27049)
* refactor: remove last use of InternalCallbackScope

* update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2020-12-17 20:29:43 +09:00
trop[bot]
ba76f6846e fix: memory leak in desktopCapturer.getSources (#27058)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-16 20:47:42 -08:00
trop[bot]
ce8d301921 fix: throw when using globalShortcut before ready (#27022)
* fix: throw when using globalShortcut before ready

* fix

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-17 10:06:32 +09:00
trop[bot]
39f865e4e3 fix: make protocol wrapper remote-friendly again (#27043)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-12-16 12:10:41 -08:00
trop[bot]
e6727fb7bd fix: crash on exit in Event destructor (#27034)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-16 17:29:04 +09:00
trop[bot]
c9564ff648 refactor: use public node::CallbackScope where possible (#27028)
* refactor: use public node::CallbackScope where possible

* Remove unused node_env() getter

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-15 16:36:51 -08:00
trop[bot]
76be3b9211 fix(asar): readdir(withFileTypes) fails on deep directory when using readdirSync on a deep directory within the archive, the code fails to get the stats of child paths. (#27011)
Co-authored-by: Avi Vahl <avi.vahl@wix.com>
2020-12-16 08:42:32 +09:00
trop[bot]
d132800944 ci: ignore failures on Ninja summary (#26994)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2020-12-15 13:50:54 -08:00
trop[bot]
558bcc65bc fix: window with CustomButtonsOnHover should have rounded corner (#26960)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-12-15 10:06:43 +09:00
trop[bot]
bf25d484a4 fix: add SafeForTerminationScopes for SIGINT interruptions (#26971)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-14 16:44:16 -08:00
Shelley Vohr
d2c4b594bd fix: screen EventEmitter methods with remote (#26988) 2020-12-14 11:51:20 -08:00
trop[bot]
601af0b016 fix: properly emit after hooks after exception (#26990)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-14 10:25:32 -08:00
trop[bot]
130a65d008 fix: Update Squirrel.mac to fix permissions bug. (#26968)
* fix: Update Squirrel.mac to fix permissions bug.

* Update patches.

Co-authored-by: Devin Foley <dfoley@slack-corp.com>
2020-12-14 08:23:15 -08:00
trop[bot]
fe022df628 fix: stack traces in non-Node.js contexts (#26912)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-14 11:19:37 -05:00
Electron Bot
5b47fd7cbf Bump v12.0.0-beta.10 2020-12-14 07:02:28 -08:00
Electron Bot
9b1913b613 Bump v12.0.0-beta.9 2020-12-11 13:02:55 -08:00
Jeremy Rose
36c695ce2a fix: restrict sendToFrame to same-process frames by default (#26875) (#26925) 2020-12-11 13:00:17 -08:00
trop[bot]
afcdf661a0 fix: Upload all *.dll.pdb to symbol server (#26966)
Fixes #26961.

Notes: Add Electron DLLs like libGLESv2.dll to symbol server

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
2020-12-11 12:53:54 -08:00
trop[bot]
3d01b83daa fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows (#26952)
This fixes #26905. The patch was obtained from @deepak1556, who in turn
got it from the Microsoft Teams folks.

I believe the crash started happening due to the changes in
5c6c8e994b%5E!/#F15

This affects Electron 9 and later.

Notes: Fix occasional crash on Windows

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
2020-12-11 12:52:33 -08:00
trop[bot]
e77d9ff3b9 docs: add missing deprecated systemPreferences APIs to breaking-changes (#26937)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-11 11:00:53 -08:00
trop[bot]
fb35356b47 fix: message box missing an "OK" button in GTK (#26917)
Co-authored-by: Mimi <1119186082@qq.com>
2020-12-10 13:06:29 -08:00
Electron Bot
37d21bb80e Bump v12.0.0-beta.8 2020-12-10 07:01:47 -08:00
trop[bot]
e84539f2e0 fix: systemPreferences.effectiveAppearance returning systemPreferences.getAppLevelAppearance() (#26879)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-09 14:58:52 +09:00
trop[bot]
d2591ed4f8 fix: handle security warnings promise when JS is disabled (#26869)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-12-07 13:03:48 -08:00
trop[bot]
6b54fe37de fix: add a "set" trap to the "screen" module proxy (#26868)
* fix: add a "set" trap to the "screen" module proxy

* fixup! fix: add a "set" trap to the "screen" module proxy

Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-12-07 10:52:51 -08:00
Electron Bot
561fe63813 Bump v12.0.0-beta.7 2020-12-07 07:00:58 -08:00
trop[bot]
9543f8b30a fix: send IPC_MESSAGES.RENDERER_RELEASE_CALLBACK as internal message (#26833)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-04 13:36:27 -08:00
Electron Bot
cec2c73733 Bump v12.0.0-beta.6 2020-12-03 07:01:08 -08:00
Erick Zhao
2e9305d964 docs: added fiddle support for code samples (#26767)
Co-authored-by: Antonio <bandantonio@users.noreply.github.com>
2020-12-03 15:54:43 +09:00
trop[bot]
0491cc6906 docs: fix contentTracing code sample (#26778)
According to the API docs, the property is called included_categories, not include_categories.

Co-authored-by: Jim Fisher <jameshfisher@gmail.com>
2020-12-02 14:29:54 -05:00
trop[bot]
badcdd6566 fix: draggable views on BrowserViews on Windows (#26775) 2020-12-01 21:34:52 -08:00
trop[bot]
a0d0bd60a5 docs: BrowserWindow extension APIs are deprecated in Electron 9 (#26783)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-01 21:31:36 -08:00
Vadim
c0f0a02419 fix: internalModuleReadJSON for unpacked JSON (#26750) 2020-12-01 18:21:28 -06:00
Michaela Laurencin
8046f0560a fix: add check in IsMaximized for non-WS_THICKFRAME windows (#26772) 2020-12-01 18:20:24 -06:00
trop[bot]
2a8961b52f fix: Add default Bluetooth permission strings (#26769)
Co-authored-by: PalmerAL <PalmerAL@users.noreply.github.com>
2020-12-01 15:02:12 -08:00
trop[bot]
36163af228 fix: draggable regions calculation in BrowserWindow/BrowserView (#26755)
* fix: draggable regions calculation in bw/bv

* Address review feedback

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-01 15:37:16 -06:00
trop[bot]
29f42e943e build: use all-for-one goma (#26741)
* Revert "Revert "build: use one-for-all goma (#26679)" (#26689)"

This reverts commit 38ab829ea6.

* build: ensure file descriptor limit is higher on macOS

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-11-30 14:25:38 -08:00
Electron Bot
4597cb6499 Bump v12.0.0-beta.5 2020-11-30 07:02:00 -08:00
trop[bot]
4ba78b81c1 fix: uaf in WebContents::DidStopLoading (#26733)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-11-30 19:30:26 +09:00
trop[bot]
80e0473649 chore: remove deprecated crashReporter APIs (#26709)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-11-30 16:54:17 +09:00
Electron Bot
db0d4c8224 Bump v12.0.0-beta.4 2020-11-26 07:01:59 -08:00
trop[bot]
4fbb58020c fix: make screen wrapper remote-friendly again (#26661)
This restores accessibility of screen methods via remote.screen.

Fixes #26610.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Co-authored-by: Anders Kaseorg <andersk@mit.edu>
2020-11-24 16:19:41 -05:00
trop[bot]
c9801ab5a5 fix: segfault on webContents.fromId(xxx) (#26651)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-11-24 16:12:53 -05:00
Jeremy Rose
46441c1bd7 chore: cherry-pick 47e21abe349a from chromium (#26653)
* chore: cherry-pick 47e21abe349a from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2020-11-23 17:17:06 -05:00
trop[bot]
1cac3354e7 fix: reject contentTracing.stopRecording on failure (#26656)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-11-23 12:20:42 -08:00
trop[bot]
57c69ab3ac build: fix build with enable_printing=false (#26600)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-11-23 14:11:56 -05:00
Electron Bot
39b9c40a05 Bump v12.0.0-beta.3 2020-11-23 07:01:30 -08:00
trop[bot]
66a22a28a5 docs: fix relative link (#26601)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-11-19 12:41:26 -05:00
Electron Bot
17a8b7724b Bump v12.0.0-beta.2 2020-11-19 07:01:18 -08:00
Electron Bot
c512995426 Bump v12.0.0-beta.1 2020-11-18 14:04:12 -08:00
David Sanders
e65341e282 chore: improve docs relative link linting (#26359) 2020-11-18 11:55:11 -08:00
NotWearingPants
d4e53925ba docs: add a white background to body (#26504) 2020-11-18 11:54:26 -08:00
Samuel Attard
f182a600e4 fix: use public APIs in place of private CTFontDescriptorIsSystemUIFont in ui/gfx (#26548) 2020-11-18 09:32:56 -08:00
Samuel Attard
dcc6196fe7 revert: disable rosetta as Electron does not run under rosetta
This reverts commit 4829b0f816.
2020-11-18 09:04:16 -08:00
Electron Bot
2bc859b884 Bump v12.0.0-nightly.20201118 2020-11-18 07:38:15 -08:00
Electron Bot
b8eea7e89b Revert "Bump v12.0.0-nightly.20201118"
This reverts commit 6a29e5d116.
2020-11-18 06:55:00 -08:00
Electron Bot
6a29e5d116 Bump v12.0.0-nightly.20201118 2020-11-18 06:31:52 -08:00
Shiranka Miskin
ec85a91472 docs: update contextIsolation documentation on access to globals (#19732) 2020-11-18 15:24:00 +09:00
Cheng Zhao
cc136f2acd fix: LC_ALL env should not be changed (#26507) 2020-11-18 11:13:01 +09:00
Antonio
968cb970fc docs: restructured docs directory (#26335)
* docs: first draft of the restructred docs directory

* docs: first working version of the restructred docs directory

* docs: finalized version of the restructred docs directory

* docs: reverted architecture section back to the toc
2020-11-18 10:13:03 +09:00
David Sanders
17df102a3b build: don't generate patches mtime cache if it already exists (#26468) 2020-11-18 09:50:31 +09:00
LuoJinghua
e1cc78f275 feat: allow setting the Origin header and Sec-Fetch-* headers in net.request() (#26135) 2020-11-17 14:25:41 -08:00
Jeremy Rose
b8372fdc29 refactor: rename managed_web_contents to inspectable_web_contents (#26525) 2020-11-17 14:15:20 -08:00
Jeremy Rose
29211a51df refactor: inline and rename findInPage request id (#26524) 2020-11-17 14:15:07 -08:00
Jeremy Rose
784172b6ca chore: remove redundant access modifier (#26523) 2020-11-17 14:14:57 -08:00
Jeremy Rose
ac6d301015 chore: remove undocumented tabTraverse method (#26522) 2020-11-17 14:14:46 -08:00
Jeremy Rose
92643a5a1c refactor: consolidate WebContents::{Create,New} (#26521) 2020-11-17 14:14:33 -08:00
Jeremy Rose
a303813d15 refactor: move GetPrinterList off WebContents (#26518) 2020-11-17 14:14:09 -08:00
bitdisaster
dbe0f06c3d fix: getLoginItemSettings() on windows (#26515)
* find by exe, detect taskmgr enable/disable

* tests
2020-11-17 14:13:08 -06:00
David Sanders
2b4ce387bc test: support for adding extra module paths (#26490) 2020-11-17 12:05:10 -08:00
Jeremy Rose
023c89265f refactor: move TerminationStatus converter (#26520) 2020-11-17 11:13:58 -08:00
Jeremy Rose
ead13791a8 fix: setCertVerifyProc canceling unrelated requests (#26517) 2020-11-17 11:12:50 -08:00
Jeremy Rose
7c2ac6b7c1 fix: BrowserWindow.fromBrowserView in multiple-BrowserView windows (#26493) 2020-11-17 11:12:02 -08:00
Jeremy Rose
040ee66678 docs: note about structured clone and DOM types (#26516) 2020-11-17 11:11:40 -08:00
Keeley Hammond
c78ac248dc docs: update breaking changes for Electron 11 (#26526)
* docs: update breaking changes for Electron 11

* docs: remove desktopCapture method, add destroy
2020-11-17 11:35:23 -05:00
Electron Bot
a74d0b29d5 chore: bump node to v14.15.1 (master) (#26533)
* chore: bump node in DEPS to v14.15.1

* update patches
2020-11-17 11:22:20 -05:00
Electron Bot
0c6b0596b5 Bump v12.0.0-nightly.20201117 2020-11-17 06:32:29 -08:00
Shelley Vohr
d97612ed21 fix: webContents interaction with draggable browserviews (#26496) 2020-11-16 20:41:37 -08:00
Electron Bot
cad2d8b4aa chore: bump chromium to ac06d6903a2c981ab90a8162f1ba0 (master) (#26499)
* chore: bump chromium in DEPS to c04c17506a1b5941370b91dfa44eda7ec31e9793

* update patches

* chore: bump chromium in DEPS to 8a4687263763f306659d04cef8f0a12a9e504d57

* chore: bump chromium in DEPS to 3a75ada69d1ac06d6903a2c981ab90a8162f1ba0

* update patches

* chore: sync StartRemoteDebuggingPipeHandler usage

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

Added 'on_disconnect' OnceClosure arg to StartRemoteDebuggingPipeHandler

* chore: add WebSocketHandshakeClient::OnFailurea

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

Add an empty stub to satisfy parent class' pure virtual method OnFailure().
NB: Use of empty impl comes from WebRequestProxyingWebSocket.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-11-16 19:57:42 -06:00
Jeremy Rose
a9924e1c32 feat: add powerMonitor.onBatteryPower (#26494) 2020-11-16 16:31:46 -08:00
Sofia Nguy
8594b55dee docs: update currently supported versions for 11.0.0 release (#26368) 2020-11-16 15:48:50 -08:00
Sofia Nguy
fabc51dc33 docs: update 12 stable dates (#26367) 2020-11-16 15:48:28 -08:00
Shelley Vohr
6f6c1b7ca6 feat: add displayFrequency to Display object (#26472) 2020-11-16 15:33:51 -08:00
John Kleinschmidt
f65db1df79 build: Use goma for all releases (#26476)
* build: use goma for all release builds

* Make sure goma is setup everywhere it is needed

* Show ninja stats on release builds
2020-11-16 14:23:23 -05:00
Shelley Vohr
ac35787bdb fix: Cannot read property 'setDockSide' of undefined (#26474) 2020-11-16 10:26:35 -08:00
Samuel Attard
358ab79778 fix: do not use crashpad APIs in the MAS build (#26491) 2020-11-16 11:47:09 -06:00
Electron Bot
900fbb99c9 Bump v12.0.0-nightly.20201116 2020-11-16 06:32:34 -08:00
Milan Burda
434f7749db build: fix build with enable_builtin_spellchecker=false (#26466) 2020-11-14 03:18:16 +03:00
Electron Bot
e017d8714e chore: bump chromium to adc5df74b86afdff676989ced8cd3 (master) (#26223)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-11-13 16:16:56 -08:00
Samuel Attard
d6019634f9 feat: add app.runningUnderRosettaTranslation to detect running under rosetta (#26444)
* feat: add app.isRunningUnderRosettaTranslation to detect running under rosetta

* chore: fixup

* chore: make const

* chore: add missing import
2020-11-13 12:53:32 -08:00
Electron Bot
d6431a0ff2 Bump v12.0.0-nightly.20201113 2020-11-13 06:33:13 -08:00
Electron Bot
3c7582173a Bump v12.0.0-nightly.20201112 2020-11-12 06:31:31 -08:00
Shelley Vohr
0448888fa5 chore: remove ScopedAllowBlockingForTesting (#26447) 2020-11-12 09:13:34 -05:00
David Sanders
1cda003e4d docs: update issue template (#26293)
* docs: update issue template

* chore: link to new issue template instead of embedding the content
2020-11-12 09:12:45 -05:00
Milan Burda
5ee9cc202b fix: ensure that internal messages are sent from the main process (#26429) 2020-11-12 06:20:01 +03:00
Samuel Maddock
83d30c5c2a feat: add 'resized' event to BrowserWindow (#26216)
Also adds 'moved' event to BrowserWindow on Windows.
2020-11-11 19:27:24 -05:00
Cheng Zhao
bb3fb548d8 feat: add APIs to enable/disable spell checker (#26276)
* feat: add APIs to enable/disable bulitin spell checker

* feat: add togglespellchecker menu item role
2020-11-11 10:29:18 -05:00
Samuel Attard
f77b56e926 chore: add patch description to gin allocator patch (#26415) 2020-11-11 09:48:51 -05:00
Electron Bot
044302e4ab Bump v12.0.0-nightly.20201111 2020-11-11 06:33:49 -08:00
736 changed files with 32696 additions and 6894 deletions

View File

@@ -57,6 +57,16 @@ parameters:
type: boolean
default: false
# Executors
executors:
linux-arm:
resource_class: electronjs/linux-arm
machine: true
linux-arm64:
resource_class: electronjs/linux-arm64
machine: true
# The config expects the following environment variables to be set:
# - "SLACK_WEBHOOK" Slack hook URL to send notifications.
#
@@ -69,7 +79,7 @@ parameters:
# Build machines configs.
docker-image: &docker-image
docker:
- image: electron.azurecr.io/build:4cec2c5ab66765caa724e37bae2bffb9b29722a5
- image: electron.azurecr.io/build:d818f06a9b1540c7fd38f75ad5a2c493dd6843b6
machine-linux-medium: &machine-linux-medium
<<: *docker-image
@@ -158,10 +168,6 @@ env-mas-apple-silicon: &env-mas-apple-silicon
TARGET_ARCH: arm64
USE_PREBUILT_V8_CONTEXT_SNAPSHOT: 1
# Misc build configuration options.
env-enable-sccache: &env-enable-sccache
USE_SCCACHE: true
env-send-slack-notifications: &env-send-slack-notifications
NOTIFY_SLACK: true
@@ -229,6 +235,25 @@ step-maybe-notify-slack-success: &step-maybe-notify-slack-success
fi
when: on_success
step-maybe-cleanup-arm: &step-maybe-cleanup-arm
run:
name: Cleanup after testing
command: |
if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
killall Electron || echo "No Electron processes left running"
killall Safari || echo "No Safari processes left running"
rm -rf ~/Library/Application\ Support/Electron*
rm -rf ~/Library/Application\ Support/electron*
elif [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
XVFB=/usr/bin/Xvfb
/sbin/start-stop-daemon --stop --exec $XVFB || echo "Xvfb not running"
pkill electron || echo "electron not running"
rm -rf ~/.config/Electron*
rm -rf ~/.config/electron*
fi
when: always
step-checkout-electron: &step-checkout-electron
checkout:
path: src/electron
@@ -265,7 +290,7 @@ step-gclient-sync: &step-gclient-sync
if ! git diff-index --quiet HEAD --; then
# There are changes to the patches. Make a git commit with the updated patches
git add patches
GIT_COMMITTER_NAME="Electron Bot" GIT_COMMITTER_EMAIL="electron@github.com" git commit -m "update patches" --author="Electron Bot <electron@github.com>"
GIT_COMMITTER_NAME="PatchUp" GIT_COMMITTER_EMAIL="73610968+patchup[bot]@users.noreply.github.com" git commit -m "chore: update patches" --author="PatchUp <73610968+patchup[bot]@users.noreply.github.com>"
# Export it
mkdir -p ../../patches
git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
@@ -295,26 +320,14 @@ step-setup-env-for-build: &step-setup-env-for-build
# To find `gn` executable.
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
if [ "$USE_SCCACHE" == "true" ]; then
# https://github.com/mozilla/sccache
SCCACHE_PATH="$PWD/src/electron/external_binaries/sccache"
echo 'export SCCACHE_PATH="'"$SCCACHE_PATH"'"' >> $BASH_ENV
if [ "$CIRCLE_PR_NUMBER" != "" ]; then
#if building a fork set readonly access to sccache
echo 'export SCCACHE_BUCKET="electronjs-sccache-ci"' >> $BASH_ENV
echo 'export SCCACHE_TWO_TIER=true' >> $BASH_ENV
fi
fi
step-setup-goma-for-build: &step-setup-goma-for-build
run:
name: Setup Goma
command: |
echo 'export USE_GOMA=true' >> $BASH_ENV
if [ "`uname`" == "Linux" ]; then
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
else
echo 'export NUMBER_OF_NINJA_PROCESSES=25' >> $BASH_ENV
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
if [ "`uname`" == "Darwin" ]; then
echo 'ulimit -n 10000' >> $BASH_ENV
echo 'sudo launchctl limit maxfiles 65536 200000' >> $BASH_ENV
fi
if [ ! -z "$RAW_GOMA_AUTH" ]; then
echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
@@ -323,24 +336,28 @@ step-setup-goma-for-build: &step-setup-goma-for-build
cd build-tools
npm install
mkdir third_party
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
node -e "require('./src/utils/goma.js').ensure()"
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
export GOMA_FALLBACK_ON_AUTH_FAILURE=true
third_party/goma/goma_ctl.py ensure_start
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV
cd ..
step-restore-brew-cache: &step-restore-brew-cache
restore_cache:
paths:
- /usr/local/Homebrew
- /usr/local/Cellar/gnu-tar
- /usr/local/bin/gtar
keys:
- v2-brew-cache-{{ arch }}
- v4-brew-cache-{{ arch }}
step-save-brew-cache: &step-save-brew-cache
save_cache:
paths:
- /usr/local/Homebrew
key: v2-brew-cache-{{ arch }}
- /usr/local/Cellar/gnu-tar
- /usr/local/bin/gtar
key: v4-brew-cache-{{ arch }}
name: Persisting brew cache
step-get-more-space-on-mac: &step-get-more-space-on-mac
@@ -461,9 +478,6 @@ step-fix-sync-on-mac: &step-fix-sync-on-mac
# Fix Clang Install (wrong binary)
rm -rf src/third_party/llvm-build
python src/tools/clang/scripts/update.py
# Fix Framework Header Installs (symlinks not retained)
rm -rf src/electron/external_binaries
python src/electron/script/update-external-binaries.py
fi
step-install-signing-cert-on-mac: &step-install-signing-cert-on-mac
@@ -480,8 +494,10 @@ step-install-gnutar-on-mac: &step-install-gnutar-on-mac
name: Install gnu-tar on macos
command: |
if [ "`uname`" == "Darwin" ]; then
brew update
brew install gnu-tar
if [ ! -d /usr/local/Cellar/gnu-tar/ ]; then
brew update
brew install gnu-tar
fi
ln -fs /usr/local/bin/gtar /usr/local/bin/tar
fi
@@ -490,11 +506,7 @@ step-gn-gen-default: &step-gn-gen-default
name: Default GN gen
command: |
cd src
if [ "$USE_GOMA" == "true" ]; then
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
else
gn gen out/Default --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
step-gn-check: &step-gn-check
run:
@@ -503,7 +515,6 @@ step-gn-check: &step-gn-check
cd src
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
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
@@ -532,14 +543,11 @@ step-electron-build: &step-electron-build
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
(cd out/Default; zip mksnapshot.zip mksnapshot_args clang_x64_v8_arm64/gen/v8/embedded.S)
rm -rf out/Default/clang_x64_v8_arm64/obj
# Regenerate because we just deleted some ninja files
if [ "$USE_GOMA" == "true" ]; then
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
else
gn gen out/Default --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi
# Regenerate because we just deleted some ninja files
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi
ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
node electron/script/check-symlinks.js
@@ -615,11 +623,7 @@ step-electron-maybe-chromedriver-gn-gen: &step-electron-maybe-chromedriver-gn-ge
command: |
cd src
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
if [ "$USE_GOMA" == "true" ]; then
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
else
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
fi
step-electron-chromedriver-build: &step-electron-chromedriver-build
@@ -694,6 +698,7 @@ step-persist-data-for-tests: &step-persist-data-for-tests
- src/electron
- src/third_party/electron_node
- src/third_party/nan
- src/cross-arch-snapshots
step-electron-dist-unzip: &step-electron-dist-unzip
run:
@@ -730,11 +735,7 @@ step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
name: ffmpeg GN gen
command: |
cd src
if [ "$USE_GOMA" == "true" ]; then
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS"
else
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") cc_wrapper=\"$SCCACHE_PATH\" $GN_EXTRA_ARGS"
fi
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS"
step-ffmpeg-build: &step-ffmpeg-build
run:
@@ -760,7 +761,11 @@ step-verify-mksnapshot: &step-verify-mksnapshot
name: Verify mksnapshot
command: |
cd src
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --snapshot-files-dir $PWD/cross-arch-snapshots
else
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
fi
step-verify-chromedriver: &step-verify-chromedriver
run:
@@ -777,21 +782,16 @@ step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
sh -e /etc/init.d/xvfb start
fi
step-show-sccache-stats: &step-show-sccache-stats
step-show-goma-stats: &step-show-goma-stats
run:
shell: /bin/bash
name: Check sccache/goma stats after build
command: |
if [ "$SCCACHE_PATH" != "" ]; then
$SCCACHE_PATH -s
fi
if [ "$USE_GOMA" == "true" ]; then
set +e
set +o pipefail
$LOCAL_GOMA_DIR/goma_ctl.py stat
$LOCAL_GOMA_DIR/diagnose_goma_log.py
true
fi
name: Check goma stats after build
command: |
set +e
set +o pipefail
$LOCAL_GOMA_DIR/goma_ctl.py stat
$LOCAL_GOMA_DIR/diagnose_goma_log.py
true
when: always
step-mksnapshot-build: &step-mksnapshot-build
@@ -892,23 +892,6 @@ step-maybe-cross-arch-snapshot-store: &step-maybe-cross-arch-snapshot-store
path: src/cross-arch-snapshots
destination: cross-arch-snapshots
step-maybe-trigger-arm-test: &step-maybe-trigger-arm-test
run:
name: Trigger an arm test on VSTS if applicable
command: |
cd src
# Only run for non-fork prs
if [ "$TRIGGER_ARM_TEST" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
#Trigger VSTS job, passing along CircleCI job number and branch to build
if [ "`uname`" == "Darwin" ]; then
echo "Triggering electron-arm2-testing build on Azure DevOps"
node electron/script/release/ci-release-build.js --job=electron-arm2-testing --ci=DevOps --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
else
echo "Triggering electron-$TARGET_ARCH-testing build on VSTS"
node electron/script/release/ci-release-build.js --job=electron-$TARGET_ARCH-testing --ci=VSTS --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
fi
fi
step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
run:
name: Generate type declarations
@@ -930,6 +913,8 @@ step-ninja-summary: &step-ninja-summary
run:
name: Print ninja summary
command: |
set +e
set +o pipefail
python depot_tools/post_build_ninja_summary.py -C src/out/Default
step-ninja-report: &step-ninja-report
@@ -1198,6 +1183,7 @@ steps-electron-gn-check: &steps-electron-gn-check
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-setup-goma-for-build
- *step-gn-gen-default
- *step-gn-check
@@ -1231,7 +1217,7 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-restore-brew-cache
- *step-setup-goma-for-build
- *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
@@ -1240,26 +1226,13 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
#Compile ts/js to verify doc change didn't break anything
- *step-ts-compile
steps-chromedriver-build: &steps-chromedriver-build
steps:
- attach_workspace:
at: .
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-fix-sync-on-mac
- *step-electron-maybe-chromedriver-gn-gen
- *step-electron-chromedriver-build
- *step-electron-chromedriver-store
- *step-maybe-notify-slack-failure
steps-native-tests: &steps-native-tests
steps:
- attach_workspace:
at: .
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-setup-goma-for-build
- *step-gn-gen-default
- run:
@@ -1267,7 +1240,7 @@ steps-native-tests: &steps-native-tests
command: |
cd src
ninja -C out/Default $BUILD_TARGET
- *step-show-sccache-stats
- *step-show-goma-stats
- *step-setup-linux-for-headless-testing
- run:
@@ -1333,8 +1306,14 @@ steps-tests: &steps-tests
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
command: |
cd src
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split))
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split))
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
export ELECTRON_SKIP_NATIVE_MODULE_TESTS=true
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging)
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging)
else
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split))
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split))
fi
- run:
name: Check test results existence
command: |
@@ -1355,6 +1334,8 @@ steps-tests: &steps-tests
- *step-maybe-notify-slack-failure
- *step-maybe-cleanup-arm
steps-test-nan: &steps-test-nan
steps:
- attach_workspace:
@@ -1572,7 +1553,7 @@ commands:
- *step-nodejs-headers-build
- *step-nodejs-headers-store
- *step-show-sccache-stats
- *step-show-goma-stats
# mksnapshot
- *step-mksnapshot-build
@@ -1627,9 +1608,6 @@ commands:
steps:
- *step-save-out-cache
# Trigger tests on arm hardware if needed
- *step-maybe-trigger-arm-test
- *step-maybe-notify-slack-failure
electron-publish:
@@ -1660,13 +1638,14 @@ commands:
- *step-gclient-sync
- *step-delete-git-directories
- *step-minimize-workspace-size-from-checkout
- *step-fix-sync-on-mac
- *step-fix-sync-on-mac
- *step-setup-env-for-build
- *step-setup-goma-for-build
- *step-gn-gen-default
# Electron app
- *step-electron-build
- *step-show-sccache-stats
- *step-show-goma-stats
- *step-maybe-generate-breakpad-symbols
- *step-maybe-electron-dist-strip
- *step-electron-dist-build
@@ -1850,14 +1829,6 @@ jobs:
<<: *env-testing-build
<<: *steps-electron-gn-check
linux-x64-chromedriver:
<<: *machine-linux-medium
environment:
<<: *env-linux-medium
<<: *env-release-build
<<: *env-send-slack-notifications
<<: *steps-chromedriver-build
linux-x64-release:
<<: *machine-linux-2xlarge
environment:
@@ -1877,8 +1848,8 @@ jobs:
<<: *env-linux-2xlarge-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_requests=True'
<<: *env-release-build
<<: *env-enable-sccache
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -1889,8 +1860,8 @@ jobs:
environment:
<<: *env-linux-2xlarge-release
<<: *env-release-build
<<: *env-enable-sccache
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -1910,15 +1881,6 @@ jobs:
checkout: true
use-out-cache: false
linux-ia32-chromedriver:
<<: *machine-linux-medium
environment:
<<: *env-linux-medium
<<: *env-ia32
<<: *env-release-build
<<: *env-send-slack-notifications
<<: *steps-chromedriver-build
linux-ia32-release:
<<: *machine-linux-2xlarge
environment:
@@ -1940,9 +1902,9 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_requests=True'
<<: *env-ia32
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -1954,9 +1916,9 @@ jobs:
<<: *env-linux-2xlarge-release
<<: *env-ia32
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -1973,19 +1935,10 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- electron-build:
persist: false
persist: true
checkout: true
use-out-cache: false
linux-arm-chromedriver:
<<: *machine-linux-medium
environment:
<<: *env-linux-medium
<<: *env-arm
<<: *env-release-build
<<: *env-send-slack-notifications
<<: *steps-chromedriver-build
linux-arm-release:
<<: *machine-linux-2xlarge
environment:
@@ -2006,10 +1959,10 @@ jobs:
<<: *env-linux-2xlarge-release
<<: *env-arm
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -2021,9 +1974,9 @@ jobs:
<<: *env-linux-2xlarge-release
<<: *env-arm
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -2040,7 +1993,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- electron-build:
persist: false
persist: true
checkout: true
use-out-cache: false
@@ -2052,15 +2005,6 @@ jobs:
<<: *env-testing-build
<<: *steps-electron-gn-check
linux-arm64-chromedriver:
<<: *machine-linux-medium
environment:
<<: *env-linux-medium
<<: *env-arm64
<<: *env-release-build
<<: *env-send-slack-notifications
<<: *steps-chromedriver-build
linux-arm64-release:
<<: *machine-linux-2xlarge
environment:
@@ -2081,9 +2025,9 @@ jobs:
<<: *env-linux-2xlarge-release
<<: *env-arm64
<<: *env-release-build
<<: *env-enable-sccache
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -2095,8 +2039,8 @@ jobs:
<<: *env-linux-2xlarge-release
<<: *env-arm64
<<: *env-release-build
<<: *env-enable-sccache
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -2143,9 +2087,9 @@ jobs:
environment:
<<: *env-mac-large-release
<<: *env-release-build
<<: *env-enable-sccache
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -2156,10 +2100,10 @@ jobs:
environment:
<<: *env-mac-large-release
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-apple-silicon
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -2170,8 +2114,8 @@ jobs:
environment:
<<: *env-mac-large-release
<<: *env-release-build
<<: *env-enable-sccache
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -2182,9 +2126,9 @@ jobs:
environment:
<<: *env-mac-large-release
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-apple-silicon
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -2251,9 +2195,9 @@ jobs:
<<: *env-mac-large-release
<<: *env-mas
<<: *env-release-build
<<: *env-enable-sccache
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -2265,9 +2209,9 @@ jobs:
<<: *env-mac-large-release
<<: *env-mas-apple-silicon
<<: *env-release-build
<<: *env-enable-sccache
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
@@ -2279,7 +2223,6 @@ jobs:
<<: *env-mac-large-release
<<: *env-mas
<<: *env-release-build
<<: *env-enable-sccache
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
steps:
- electron-publish:
@@ -2292,8 +2235,8 @@ jobs:
<<: *env-mac-large-release
<<: *env-mas-apple-silicon
<<: *env-release-build
<<: *env-enable-sccache
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: true
@@ -2438,6 +2381,24 @@ jobs:
<<: *env-send-slack-notifications
<<: *steps-verify-ffmpeg
linux-arm-testing-tests:
executor: linux-arm
environment:
<<: *env-arm
<<: *env-global
<<: *env-headless-testing
<<: *env-stack-dumping
<<: *steps-tests
linux-arm64-testing-tests:
executor: linux-arm64
environment:
<<: *env-arm64
<<: *env-global
<<: *env-headless-testing
<<: *env-stack-dumping
<<: *steps-tests
osx-testing-x64-tests:
<<: *machine-mac-large
environment:
@@ -2618,15 +2579,19 @@ workflows:
- osx-publish-x64-skip-checkout:
requires:
- mac-checkout
context: release-env
- mas-publish-x64-skip-checkout:
requires:
- mac-checkout
context: release-env
- osx-publish-arm64-skip-checkout:
requires:
- mac-checkout
context: release-env
- mas-publish-arm64-skip-checkout:
requires:
- mac-checkout
context: release-env
lint:
when: << pipeline.parameters.run-lint >>
@@ -2666,8 +2631,23 @@ workflows:
- linux-ia32-testing
- linux-arm-testing
- linux-arm-testing-tests:
filters:
branches:
# Do not run this on forked pull requests
ignore: /pull\/[0-9]+/
requires:
- linux-arm-testing
- linux-arm64-testing
- linux-arm64-testing-tests:
filters:
branches:
# Do not run this on forked pull requests
ignore: /pull\/[0-9]+/
requires:
- linux-arm64-testing
- linux-arm64-testing-gn-check:
requires:
- linux-checkout-fast

View File

@@ -4,4 +4,3 @@
APPVEYOR_CLOUD_TOKEN=
CIRCLE_TOKEN=
ELECTRON_GITHUB_TOKEN=
VSTS_TOKEN=

4
.gitignore vendored
View File

@@ -68,4 +68,6 @@ ts-gen
.depshash-target
# Used to accelerate builds after sync
patches/mtime-cache.json
patches/mtime-cache.json
spec/fixtures/logo.png

View File

@@ -265,21 +265,6 @@ if (is_linux) {
}
}
source_set("manifests") {
sources = [
"//electron/shell/app/manifests.cc",
"//electron/shell/app/manifests.h",
]
include_dirs = [ "//electron" ]
deps = [
"//electron/shell/common/api:mojo",
"//printing/buildflags",
"//services/service_manager/public/cpp",
]
}
npm_action("electron_version_args") {
script = "generate-version-json"
@@ -328,7 +313,6 @@ source_set("electron_lib") {
":electron_fuses",
":electron_js2c",
":electron_version_header",
":manifests",
":resources",
"buildflags",
"chromium_src:chrome",
@@ -353,7 +337,6 @@ source_set("electron_lib") {
"//components/viz/service",
"//content/public/browser",
"//content/public/child",
"//content/public/common:service_names",
"//content/public/gpu",
"//content/public/renderer",
"//content/public/utility",
@@ -508,6 +491,7 @@ source_set("electron_lib") {
}
}
if (is_linux) {
libs = [ "xshmfence" ]
deps += [
":libnotify_loader",
"//build/config/linux/gtk",
@@ -664,6 +648,7 @@ source_set("electron_lib") {
}
if (enable_pdf_viewer) {
deps += [
"//chrome/browser/resources/pdf:pdf_resources",
"//components/pdf/browser",
"//components/pdf/renderer",
"//pdf:pdf_ppapi",
@@ -1007,6 +992,9 @@ if (is_mac) {
deps = [
":electron_app_framework_bundle_data",
":electron_app_resources",
":electron_fuses",
"//base",
"//electron/buildflags",
]
if (is_mas_build) {
deps += [ ":electron_login_helper_app" ]
@@ -1170,6 +1158,19 @@ if (is_mac) {
ldflags += [ "/guard:cf,nolongjmp" ]
}
if (current_cpu == "x86") {
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB needed by
# Chrome's main thread. This saves significant memory on threads (like
# those in the Windows thread pool, and others) whose stack size we can
# only control through this setting. Because Chrome's main thread needs
# a minimum 1.5 MiB stack, the main thread (in 32-bit builds only) uses
# fibers to switch to a 1.5 MiB stack before running any other code.
ldflags += [ "/STACK:0x80000" ]
} else {
# Increase the initial stack size. The default is 1MB, this is 8MB.
ldflags += [ "/STACK:0x800000" ]
}
# This is to support renaming of electron.exe. node-gyp has hard-coded
# executable names which it will recognise as node. This module definition
# file claims that the electron executable is in fact named "node.exe",

6
DEPS
View File

@@ -14,13 +14,13 @@ gclient_gn_args = [
vars = {
'chromium_version':
'2a55c4f55b99b2191ea59cba1e2f6da4dbb7dee0',
'89.0.4389.128',
'node_version':
'v14.15.0',
'v14.16.0',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
'squirrel.mac_version':
'a3a5b3f03b824441c014893b18f99a103b2603e9',
'cdc0729c8bf8576bfef18629186e1e9ecf1b0d9f',
'pyyaml_version': '3.12',
'requests_version': 'e4d59bedfd3c7f4f254f4f5d036587bcd8152458',

View File

@@ -1 +1 @@
12.0.0-nightly.20201110
12.1.2

View File

@@ -6,7 +6,7 @@
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.com/invite/electron)
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹 🇵🇱.
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
The Electron framework lets you write cross-platform desktop applications
@@ -29,15 +29,12 @@ The preferred method is to install Electron as a development dependency in your
app:
```sh
npm install electron --save-dev [--save-exact]
npm install electron --save-dev
```
The `--save-exact` flag is recommended for Electron prior to version 2, as it does not follow semantic
versioning. As of version 2.0.0, Electron follows semver, so you don't need `--save-exact` flag. For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).
For more installation options and troubleshooting tips, see
[installation](docs/tutorial/installation.md).
[installation](docs/tutorial/installation.md). For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).
## Quick start & Electron Fiddle

View File

@@ -36,6 +36,7 @@ environment:
ELECTRON_ENABLE_STACK_DUMPING: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
GOMA_FALLBACK_ON_AUTH_FAILURE: true
notifications:
- provider: Webhook
url: https://electron-mission-control.herokuapp.com/rest/appveyor-hook
@@ -141,7 +142,8 @@ build_script:
- cd build-tools
- npm install
- mkdir third_party
- node -e "require('./src/utils/goma.js').downloadAndPrepare()"
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..
@@ -151,7 +153,6 @@ build_script:
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron:manifests
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )

View File

@@ -93,6 +93,6 @@ steps:
condition: always()
- powershell: |
Remove-Item -path $env:APPDATA/Electron* -Recurse
Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
displayName: 'Delete user app data directories'
condition: always()

View File

@@ -21,6 +21,6 @@ except subprocess.CalledProcessError as e:
+ "' failed with code '"
+ str(e.returncode)
+ "':\n"
+ e.output
+ e.output.decode('utf8')
)
sys.exit(e.returncode)

View File

@@ -163,7 +163,7 @@ if ((globalThis.process || binding.process).argv.includes("--profile-electron-in
setImmediate: false
},
optimization: {
minimize: true,
minimize: env.mode === 'production',
minimizer: [
new TerserPlugin({
terserOptions: {

View File

@@ -22,6 +22,11 @@ template("webpack_build") {
"//electron/typings/internal-electron.d.ts",
] + invoker.inputs
mode = "development"
if (is_official_build) {
mode = "production"
}
args = [
"--config",
rebase_path(invoker.config_file),
@@ -29,6 +34,7 @@ template("webpack_build") {
"--output-path=" + rebase_path(get_path_info(invoker.out_file, "dir")),
"--env.buildflags=" +
rebase_path("$target_gen_dir/buildflags/buildflags.h"),
"--env.mode=" + mode,
]
deps += [ "buildflags" ]

View File

@@ -139,14 +139,23 @@ static_library("chrome") {
if (enable_color_chooser) {
sources += [
"//chrome/browser/devtools/devtools_eye_dropper.cc",
"//chrome/browser/devtools/devtools_eye_dropper.h",
"//chrome/browser/platform_util.cc",
"//chrome/browser/platform_util.h",
"//chrome/browser/ui/browser_dialogs.h",
"//chrome/browser/ui/color_chooser.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.h",
]
if (use_aura) {
sources += [ "//chrome/browser/platform_util_aura.cc" ]
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
]
if (!is_win) {
sources += [
@@ -163,6 +172,8 @@ static_library("chrome") {
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
"//chrome/browser/ui/cocoa/color_chooser_mac.h",
"//chrome/browser/ui/cocoa/color_chooser_mac.mm",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm",
]
deps += [
"//components/remote_cocoa/app_shim",
@@ -208,8 +219,6 @@ static_library("chrome") {
"//chrome/browser/printing/print_view_manager_basic.h",
"//chrome/browser/printing/printer_query.cc",
"//chrome/browser/printing/printer_query.h",
"//chrome/browser/printing/printing_message_filter.cc",
"//chrome/browser/printing/printing_message_filter.h",
"//chrome/browser/printing/printing_service.cc",
"//chrome/browser/printing/printing_service.h",
]
@@ -286,13 +295,15 @@ static_library("chrome") {
}
}
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ]
if (is_mac) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ]
} else if (is_win) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_win.cc" ]
} else {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ]
if (!is_mas_build) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ]
if (is_mac) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ]
} else if (is_win) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_win.cc" ]
} else {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ]
}
}
}

View File

@@ -41,14 +41,14 @@ ipcMain.handle('bootstrap', (event) => {
return isTrustedSender(event.sender) ? electronPath : null;
});
async function createWindow () {
async function createWindow (backgroundColor?: string) {
await app.whenReady();
const options: Electron.BrowserWindowConstructorOptions = {
width: 960,
height: 620,
autoHideMenuBar: true,
backgroundColor: '#2f3241',
backgroundColor,
webPreferences: {
preload: path.resolve(__dirname, 'preload.js'),
contextIsolation: true,
@@ -96,7 +96,7 @@ export const loadURL = async (appUrl: string) => {
};
export const loadFile = async (appPath: string) => {
mainWindow = await createWindow();
mainWindow = await createWindow(appPath === 'index.html' ? '#2f3241' : undefined);
mainWindow.loadFile(appPath);
mainWindow.focus();
};

View File

@@ -18,27 +18,14 @@ an issue:
## Guides and Tutorials
* [Setting up the Development Environment](tutorial/development-environment.md)
* [Setting up macOS](tutorial/development-environment.md#setting-up-macos)
* [Setting up Windows](tutorial/development-environment.md#setting-up-windows)
* [Setting up Linux](tutorial/development-environment.md#setting-up-linux)
* [Choosing an Editor](tutorial/development-environment.md#a-good-editor)
* [Creating your First App](tutorial/quick-start.md)
* [Prerequisites](tutorial/quick-start.md#prerequisites)
* [Create a basic application](tutorial/quick-start.md#create-a-basic-application)
* [Package and distribute the application](tutorial/quick-start.md#package-and-distribute-the-application)
* [Boilerplates and CLIs](tutorial/boilerplates-and-clis.md)
* [Boilerplate vs CLI](tutorial/boilerplates-and-clis.md#boilerplate-vs-cli)
* [electron-forge](tutorial/boilerplates-and-clis.md#electron-forge)
* [electron-builder](tutorial/boilerplates-and-clis.md#electron-builder)
* [electron-react-boilerplate](tutorial/boilerplates-and-clis.md#electron-react-boilerplate)
* [Other Tools and Boilerplates](tutorial/boilerplates-and-clis.md#other-tools-and-boilerplates)
* [Application Architecture](tutorial/quick-start.md#application-architecture)
* [Main and Renderer Processes](tutorial/quick-start.md#main-and-renderer-processes)
* [Electron API](tutorial/quick-start.md#electron-api)
* [Node.js API](tutorial/quick-start.md#nodejs-api)
* [Using Native Node.js Modules](tutorial/using-native-node-modules.md)
* [Performance Strategies](tutorial/performance.md)
### Getting started
* [Introduction](tutorial/introduction.md)
* [Quick Start](tutorial/quick-start.md)
* [Process Model](tutorial/process-model.md)
### Learning the basics
* Adding Features to Your App
* [Notifications](tutorial/notifications.md)
* [Recent Documents](tutorial/recent-documents.md)
@@ -53,9 +40,21 @@ an issue:
* [Offscreen Rendering](tutorial/offscreen-rendering.md)
* [Dark Mode](tutorial/dark-mode.md)
* [Web embeds in Electron](tutorial/web-embeds.md)
* [Boilerplates and CLIs](tutorial/boilerplates-and-clis.md)
* [Boilerplate vs CLI](tutorial/boilerplates-and-clis.md#boilerplate-vs-cli)
* [electron-forge](tutorial/boilerplates-and-clis.md#electron-forge)
* [electron-builder](tutorial/boilerplates-and-clis.md#electron-builder)
* [electron-react-boilerplate](tutorial/boilerplates-and-clis.md#electron-react-boilerplate)
* [Other Tools and Boilerplates](tutorial/boilerplates-and-clis.md#other-tools-and-boilerplates)
### Advanced steps
* Application Architecture
* [Using Native Node.js Modules](tutorial/using-native-node-modules.md)
* [Performance Strategies](tutorial/performance.md)
* [Security Strategies](tutorial/security.md)
* [Process Sandboxing](tutorial/sandbox.md)
* [Accessibility](tutorial/accessibility.md)
* [Spectron](tutorial/accessibility.md#spectron)
* [Devtron](tutorial/accessibility.md#devtron)
* [Manually Enabling Accessibility Features](tutorial/accessibility.md#manually-enabling-accessibility-features)
* [Testing and Debugging](tutorial/application-debugging.md)
* [Debugging the Main Process](tutorial/debugging-main-process.md)
@@ -64,17 +63,13 @@ an issue:
* [Testing on Headless CI Systems (Travis, Jenkins)](tutorial/testing-on-headless-ci.md)
* [DevTools Extension](tutorial/devtools-extension.md)
* [Automated Testing with a Custom Driver](tutorial/automated-testing-with-a-custom-driver.md)
* [REPL](tutorial/repl.md)
* [Distribution](tutorial/application-distribution.md)
* [Supported Platforms](tutorial/support.md#supported-platforms)
* [Code Signing](tutorial/code-signing.md)
* [Mac App Store](tutorial/mac-app-store-submission-guide.md)
* [Windows Store](tutorial/windows-store-guide.md)
* [Snapcraft](tutorial/snapcraft.md)
* [Security](tutorial/security.md)
* [Reporting Security Issues](tutorial/security.md#reporting-security-issues)
* [Chromium Security Issues and Upgrades](tutorial/security.md#chromium-security-issues-and-upgrades)
* [Electron Security Warnings](tutorial/security.md#electron-security-warnings)
* [Security Checklist](tutorial/security.md#checklist-security-recommendations)
* [Updates](tutorial/updates.md)
* [Deploying an Update Server](tutorial/updates.md#deploying-an-update-server)
* [Implementing Updates in Your App](tutorial/updates.md#implementing-updates-in-your-app)
@@ -92,11 +87,6 @@ These individual tutorials expand on topics discussed in the guide above.
* Electron Releases & Developer Feedback
* [Versioning Policy](tutorial/electron-versioning.md)
* [Release Timelines](tutorial/electron-timelines.md)
* [Packaging App Source Code with asar](tutorial/application-packaging.md)
* [Generating asar Archives](tutorial/application-packaging.md#generating-asar-archives)
* [Using asar Archives](tutorial/application-packaging.md#using-asar-archives)
* [Limitations](tutorial/application-packaging.md#limitations-of-the-node-api)
* [Adding Unpacked Files to asar Archives](tutorial/application-packaging.md#adding-unpacked-files-to-asar-archives)
* [Testing Widevine CDM](tutorial/testing-widevine-cdm.md)
---
@@ -132,6 +122,8 @@ These individual tutorials expand on topics discussed in the guide above.
* [ipcMain](api/ipc-main.md)
* [Menu](api/menu.md)
* [MenuItem](api/menu-item.md)
* [MessageChannelMain](api/message-channel-main.md)
* [MessagePortMain](api/message-port-main.md)
* [net](api/net.md)
* [netLog](api/net-log.md)
* [nativeTheme](api/native-theme.md)
@@ -141,6 +133,7 @@ These individual tutorials expand on topics discussed in the guide above.
* [protocol](api/protocol.md)
* [screen](api/screen.md)
* [session](api/session.md)
* [ShareMenu](api/share-menu.md)
* [systemPreferences](api/system-preferences.md)
* [TouchBar](api/touch-bar.md)
* [Tray](api/tray.md)
@@ -149,15 +142,15 @@ These individual tutorials expand on topics discussed in the guide above.
### Modules for the Renderer Process (Web Page):
* [desktopCapturer](api/desktop-capturer.md)
* [contextBridge](api/context-bridge.md)
* [ipcRenderer](api/ipc-renderer.md)
* [remote](api/remote.md)
* [webFrame](api/web-frame.md)
### Modules for Both Processes:
* [clipboard](api/clipboard.md)
* [crashReporter](api/crash-reporter.md)
* [desktopCapturer](api/desktop-capturer.md)
* [nativeImage](api/native-image.md)
* [shell](api/shell.md)

View File

@@ -35,7 +35,7 @@ Linux and Windows to define some accelerators.
Use `Alt` instead of `Option`. The `Option` key only exists on macOS, whereas
the `Alt` key is available on all platforms.
The `Super` key is mapped to the `Windows` key on Windows and Linux and
The `Super` (or `Meta`) key is mapped to the `Windows` key on Windows and Linux and
`Cmd` on macOS.
## Available modifiers
@@ -48,6 +48,7 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and
* `AltGr`
* `Shift`
* `Super`
* `Meta`
## Available key codes

27
docs/api/app.md Normal file → Executable file
View File

@@ -391,7 +391,7 @@ which contains more information about why the render process disappeared. 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'
### Event: 'render-process-gone'
Returns:
@@ -406,11 +406,14 @@ Returns:
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Integer - The exit code of the process, unless `reason` is
`launch-failed`, in which case `exitCode` will be a platform-specific
launch failure error code.
Emitted when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
#### Event: 'child-process-gone'
### Event: 'child-process-gone'
Returns:
@@ -750,7 +753,8 @@ Overrides the current application's name.
### `app.getLocale()`
Returns `String` - The current application locale. Possible return values are documented [here](locales.md).
Returns `String` - The current application locale, fetched using Chromium's `l10n_util` library.
Possible return values are documented [here](https://source.chromium.org/chromium/chromium/src/+/master:ui/base/l10n/l10n_util.cc).
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](https://github.com/electron/electron/blob/master/docs/api/command-line-switches.md).
@@ -926,6 +930,10 @@ re-add a removed item to a custom category earlier than that will result in the
entire custom category being omitted from the Jump List. The list of removed
items can be obtained using `app.getJumpListSettings()`.
**Note:** The maximum length of a Jump List item's `description` property is
260 characters. Beyond this limit, the item will not be added to the Jump
List, nor will it be displayed.
Here's a very simple example of creating a custom Jump List:
```javascript
@@ -1174,9 +1182,9 @@ For `infoType` equal to `basic`:
Using `basic` should be preferred if only basic information like `vendorId` or `driverId` is needed.
### `app.setBadgeCount(count)` _Linux_ _macOS_
### `app.setBadgeCount([count])` _Linux_ _macOS_
* `count` Integer
* `count` Integer (optional) - If a value is provided, set the badge to the provided value otherwise, on macOS, display a plain white dot (e.g. unknown number of notifications). On Linux, if a value is not provided the badge will not display.
Returns `Boolean` - Whether the call succeeded.
@@ -1489,3 +1497,12 @@ which native modules you can use in the renderer process. For more information
on the direction Electron is going with renderer process restarts and usage of
native modules in the renderer process please check out this
[Tracking Issue](https://github.com/electron/electron/issues/18397).
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_
A `Boolean` which when `true` indicates that the app is currently running
under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)).
You can use this property to prompt users to download the arm64 version of
your application when they are running the x64 version under Rosetta
incorrectly.

View File

@@ -1,14 +1,16 @@
## Class: BrowserView
> Create and control views.
Process: [Main](../glossary.md#main-process)
# BrowserView
A `BrowserView` can be used to embed additional web content into a
[`BrowserWindow`](browser-window.md). It is like a child window, except that it is positioned
relative to its owning window. It is meant to be an alternative to the
`webview` tag.
## Class: BrowserView
> Create and control views.
Process: [Main](../glossary.md#main-process)
### Example
```javascript

View File

@@ -265,12 +265,12 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
be the absolute file path to the script.
When node integration is turned off, the preload script can reintroduce
Node global symbols back to the global scope. See example
[here](process.md#event-loaded).
[here](context-bridge.md#exposing-node-global-symbols).
* `sandbox` Boolean (optional) - If set, this will sandbox the renderer
associated with the window, making it compatible with the Chromium
OS-level sandbox and disabling the Node.js engine. This is not the same as
the `nodeIntegration` option and the APIs available to the preload script
are more limited. Read more about the option [here](sandbox-option.md).
are more limited. Read more about the option [here](../tutorial/sandbox.md).
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
Default is `false`.
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
@@ -337,21 +337,19 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
more details.
* `contextIsolation` Boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults
to `false`. The context that the `preload` script runs in will still
have full access to the `document` and `window` globals but it will use
its own set of JavaScript builtins (`Array`, `Object`, `JSON`, etc.)
and will be isolated from any changes made to the global environment
by the loaded page. The Electron API will only be available in the
`preload` script and not the loaded page. This option should be used when
loading potentially untrusted remote content to ensure the loaded content
cannot tamper with the `preload` script and any Electron APIs being used.
This option uses the same technique used by [Chrome Content Scripts][chrome-content-scripts].
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.
to `true`. The context that the `preload` script runs in will only have
access to its own dedicated `document` and `window` globals, as well as
its own set of JavaScript builtins (`Array`, `Object`, `JSON`, etc.),
which are all invisible to the loaded content. The Electron API will only
be available in the `preload` script and not the loaded page. This option
should be used when loading potentially untrusted remote content to ensure
the loaded content cannot tamper with the `preload` script and any
Electron APIs being used. This option uses the same technique used by
[Chrome Content Scripts][chrome-content-scripts]. 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_
can't unsafely cross between worlds when using `contextIsolation`. Defaults 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
@@ -544,6 +542,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
Emitted after the window has been resized.
#### Event: 'resized' _macOS_ _Windows_
Emitted once when the window has finished being resized.
This is usually emitted when the window has been resized manually. On macOS, resizing the window with `setBounds`/`setSize` and setting the `animate` parameter to `true` will also emit this event once resizing has finished.
#### Event: 'will-move' _macOS_ _Windows_
Returns:
@@ -559,12 +563,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
Emitted when the window is being moved to a new position.
__Note__: On macOS this event is an alias of `moved`.
#### Event: 'moved' _macOS_
#### Event: 'moved' _macOS_ _Windows_
Emitted once when the window is moved to a new position.
__Note__: On macOS this event is an alias of `move`.
#### Event: 'enter-full-screen'
Emitted when the window enters a full-screen state.
@@ -730,7 +734,7 @@ The method will also not return if the extension's manifest is missing or incomp
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.loadExtension(path)`](session.md#sesloadextensionpath).
[`ses.loadExtension(path)`](session.md#sesloadextensionpath-options).
#### `BrowserWindow.removeExtension(name)` _Deprecated_
@@ -772,7 +776,7 @@ The method will also not return if the extension's manifest is missing or incomp
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.loadExtension(path)`](session.md#sesloadextensionpath).
[`ses.loadExtension(path)`](session.md#sesloadextensionpath-options).
#### `BrowserWindow.removeDevToolsExtension(name)` _Deprecated_
@@ -1046,7 +1050,7 @@ Returns `Boolean` - Whether the window is in simple (pre-Lion) fullscreen mode.
Returns `Boolean` - Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).
#### `win.setAspectRatio(aspectRatio[, extraSize])` _macOS_ _Linux_
#### `win.setAspectRatio(aspectRatio[, extraSize])`
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
content view.
@@ -1067,6 +1071,9 @@ the player itself we would call this function with arguments of 16/9 and
are within the content view--only that they exist. Sum any extra width and
height areas you have within the overall content view.
The aspect ratio is not respected when window is resized programmingly with
APIs like `win.setSize`.
#### `win.setBackgroundColor(backgroundColor)`
* `backgroundColor` String - Window's background color as a hexadecimal value,
@@ -1379,7 +1386,7 @@ can be be used to listen to changes to tablet mode.
#### `win.getMediaSourceId()`
Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1234:0".
Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1324:0".
More precisely the format is `window:id:other_id` where `id` is `HWND` on
Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
@@ -1397,6 +1404,8 @@ The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
* `message` Integer
* `callback` Function
* `wParam` any - The `wParam` provided to the WndProc
* `lParam` any - The `lParam` provided to the WndProc
Hooks a windows message. The `callback` is called when
the message is received in the WndProc.
@@ -1449,7 +1458,7 @@ Returns `Boolean` - Whether the window's document has been edited.
Returns `Promise<NativeImage>` - Resolves with a [NativeImage](native-image.md)
Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page.
Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty.
#### `win.loadURL(url[, options])`
@@ -1859,6 +1868,13 @@ Replacement API for setBrowserView supporting work with multi browser views.
* `browserView` [BrowserView](browser-view.md)
#### `win.setTopBrowserView(browserView)` _Experimental_
* `browserView` [BrowserView](browser-view.md)
Raises `browserView` above other `BrowserView`s attached to `win`.
Throws an error if `browserView` is not attached to `win`.
#### `win.getBrowserViews()` _Experimental_
Returns `BrowserView[]` - an array of all BrowserViews that have been attached

View File

@@ -47,6 +47,7 @@ following properties:
be aborted. When mode is `manual` the redirection will be cancelled unless
[`request.followRedirect`](#requestfollowredirect) is invoked synchronously
during the [`redirect`](#event-redirect) event. Defaults to `follow`.
* `origin` String (optional) - The origin URL of the request.
`options` properties such as `protocol`, `host`, `hostname`, `port` and `path`
strictly follow the Node.js model as described in the
@@ -70,7 +71,7 @@ const request = net.request({
Returns:
* `response` IncomingMessage - An object representing the HTTP response message.
* `response` [IncomingMessage](incoming-message.md) - An object representing the HTTP response message.
#### Event: 'login'

View File

@@ -80,6 +80,12 @@ This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
environment variable to achieve the same effect.
### --force-fieldtrials=`trials`
Field trials to be forcefully enabled or disabled.
For example: `WebRTC-Audio-Red-For-Opus/Enabled/`
### --host-rules=`rules`
A comma-separated list of `rules` that control how hostnames are mapped.
@@ -136,7 +142,8 @@ proxy server flags that are passed.
### --no-sandbox
Disables Chromium sandbox, which is now enabled by default.
Disables the Chromium [sandbox](https://www.chromium.org/developers/design-documents/sandbox).
Forces renderer process and Chromium helper processes to run un-sandboxed.
Should only be used for testing.
### --proxy-bypass-list=`hosts`

View File

@@ -16,7 +16,7 @@ const { app, contentTracing } = require('electron')
app.whenReady().then(() => {
(async () => {
await contentTracing.startRecording({
include_categories: ['*']
included_categories: ['*']
})
console.log('Tracing started')
await new Promise(resolve => setTimeout(resolve, 5000))

View File

@@ -33,7 +33,7 @@ page you load in your renderer executes code in this world.
### Isolated World
When `contextIsolation` is enabled in your `webPreferences`, your `preload` scripts run in an
When `contextIsolation` is enabled in your `webPreferences` (this is the default behavior since Electron 12.0.0), your `preload` scripts run in an
"Isolated World". You can read more about context isolation and what it affects in the
[security](../tutorial/security.md#3-enable-context-isolation-for-remote-content) docs.
@@ -44,19 +44,19 @@ The `contextBridge` module has the following methods:
### `contextBridge.exposeInMainWorld(apiKey, api)` _Experimental_
* `apiKey` String - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
* `api` Record<String, any> - Your API object, more information on what this API can be and how it works is available below.
* `api` any - Your API, more information on what this API can be and how it works is available below.
## Usage
### API Objects
### API
The `api` object provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api-experimental) must be an object
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api-experimental) must be a `Function`, `String`, `Number`, `Array`, `Boolean`, or an object
whose keys are strings and values are a `Function`, `String`, `Number`, `Array`, `Boolean`, or another nested object that meets the same conditions.
`Function` values are proxied to the other context and all other values are **copied** and **frozen**. Any data / primitives sent in
the API object become immutable and updates on either side of the bridge do not result in an update on the other side.
the API become immutable and updates on either side of the bridge do not result in an update on the other side.
An example of a complex API object is shown below:
An example of a complex API is shown below:
```javascript
const { contextBridge } = require('electron')
@@ -109,3 +109,22 @@ has been included below for completeness:
| `Symbol` | N/A | ❌ | ❌ | Symbols cannot be copied across contexts so they are dropped |
If the type you care about is not in the above table, it is probably not supported.
### Exposing Node Global Symbols
The `contextBridge` can be used by the preload script to give your renderer access to Node APIs.
The table of supported types described above also applies to Node APIs that you expose through `contextBridge`.
Please note that many Node APIs grant access to local system resources.
Be very cautious about which globals and APIs you expose to untrusted remote content.
```javascript
const { contextBridge } = require('electron')
const crypto = require('crypto')
contextBridge.exposeInMainWorld('nodeCrypto', {
sha256sum (data) {
const hash = crypto.createHash('sha256')
hash.update(data)
return hash.digest('hex')
}
})
```

View File

@@ -45,6 +45,8 @@ The following events are available on instances of `Cookies`:
#### Event: 'changed'
Returns:
* `event` Event
* `cookie` [Cookie](structures/cookie.md) - The cookie that was changed.
* `cause` String - The cause of the change with one of the following values:

View File

@@ -128,7 +128,7 @@ 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.
**Note:** This method is only available in the main process.
### `crashReporter.getLastCrashReport()`
@@ -137,7 +137,7 @@ 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.
**Note:** This method is only available in the main process.
### `crashReporter.getUploadedReports()`
@@ -146,14 +146,14 @@ 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.
**Note:** This method is only available in the main process.
### `crashReporter.getUploadToServer()`
Returns `Boolean` - Whether reports should be submitted to the server. Set through
the `start` method or `setUploadToServer`.
**Note:** Calling this method from the renderer process is deprecated.
**Note:** This method is only available in the main process.
### `crashReporter.setUploadToServer(uploadToServer)`
@@ -162,13 +162,7 @@ the `start` method or `setUploadToServer`.
This would normally be controlled by user preferences. This has no effect if
called before `start` is called.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getCrashesDirectory()` _Deprecated_
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
**Note:** This method is deprecated, use `app.getPath('crashDumps')` instead.
**Note:** This method is only available in the main process.
### `crashReporter.addExtraParameter(key, value)`

View File

@@ -24,7 +24,7 @@ The `dialog` module has the following methods:
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` [FileFilter[]](structures/file-filter.md) (optional)
* `properties` String[] (optional) - Contains which features the dialog should
* `properties` String[]&#32;(optional) - Contains which features the dialog should
use. The following values are supported:
* `openFile` - Allow files to be selected.
* `openDirectory` - Allow directories to be selected.
@@ -87,7 +87,7 @@ dialog.showOpenDialogSync(mainWindow, {
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` [FileFilter[]](structures/file-filter.md) (optional)
* `properties` String[] (optional) - Contains which features the dialog should
* `properties` String[]&#32;(optional) - Contains which features the dialog should
use. The following values are supported:
* `openFile` - Allow files to be selected.
* `openDirectory` - Allow directories to be selected.
@@ -112,7 +112,7 @@ Returns `Promise<Object>` - Resolve with an object containing the following:
* `canceled` Boolean - whether or not the dialog was canceled.
* `filePaths` String[] - An array of file paths chosen by the user. If the dialog is cancelled this will be an empty array.
* `bookmarks` String[] (optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see [table here](#bookmarks-array).)
* `bookmarks` String[]&#32;(optional) _macOS_ _mas_ - An array matching the `filePaths` array of base64 encoded strings which contains security scoped bookmark data. `securityScopedBookmarks` must be enabled for this to be populated. (For return values, see [table here](#bookmarks-array).)
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
@@ -154,7 +154,7 @@ dialog.showOpenDialog(mainWindow, {
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `title` String (optional)
* `title` String (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
* `defaultPath` String (optional) - Absolute directory path, absolute file
path, or file name to use by default.
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
@@ -165,7 +165,7 @@ dialog.showOpenDialog(mainWindow, {
displayed in front of the filename text field.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box,
defaults to `true`.
* `properties` String[] (optional)
* `properties` String[]&#32;(optional)
* `showHiddenFiles` - Show hidden files in dialog.
* `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
@@ -185,7 +185,7 @@ The `filters` specifies an array of file types that can be displayed, see
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `title` String (optional)
* `title` String (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
* `defaultPath` String (optional) - Absolute directory path, absolute file
path, or file name to use by default.
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
@@ -195,7 +195,7 @@ The `filters` specifies an array of file types that can be displayed, see
* `nameFieldLabel` String (optional) _macOS_ - Custom label for the text
displayed in front of the filename text field.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box, defaults to `true`.
* `properties` String[] (optional)
* `properties` String[]&#32;(optional)
* `showHiddenFiles` - Show hidden files in dialog.
* `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
@@ -227,7 +227,7 @@ expanding and collapsing the dialog.
`"warning"`. On Windows, `"question"` displays the same icon as `"info"`, unless
you set an icon using the `"icon"` option. On macOS, both `"warning"` and
`"error"` display the same warning icon.
* `buttons` String[] (optional) - Array of texts for buttons. On Windows, an empty array
* `buttons` String[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
will result in one button labeled "OK".
* `defaultId` Integer (optional) - Index of the button in the buttons array which will
be selected by default when the message box opens.
@@ -273,7 +273,7 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
`"warning"`. On Windows, `"question"` displays the same icon as `"info"`, unless
you set an icon using the `"icon"` option. On macOS, both `"warning"` and
`"error"` display the same warning icon.
* `buttons` String[] (optional) - Array of texts for buttons. On Windows, an empty array
* `buttons` String[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
will result in one button labeled "OK".
* `defaultId` Integer (optional) - Index of the button in the buttons array which will
be selected by default when the message box opens.

View File

@@ -15,7 +15,7 @@ extension capabilities.
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):
[`ses.loadExtension`](session.md#sesloadextensionpath-options):
```js
const { session } = require('electron')
@@ -115,3 +115,9 @@ The following methods of `chrome.management` are supported:
- `chrome.management.getPermissionWarningsByManifest`
- `chrome.management.onEnabled`
- `chrome.management.onDisabled`
### `chrome.webRequest`
All features of this API are supported.
> **NOTE:** Electron's [`webRequest`](web-request.md) module takes precedence over `chrome.webRequest` if there are conflicting handlers.

View File

@@ -82,8 +82,11 @@ win.show()
* The `blur` filter only applies to the web page, so there is no way to apply
blur effect to the content below the window (i.e. other applications open on
the user's system).
* On Windows operating systems, transparent windows will not work when DWM is
* The window will not be transparent when DevTools is opened.
* On Windows operating systems,
* transparent windows will not work when DWM is
disabled.
* transparent windows can not be maximized using the Windows system menu or by double clicking the title bar. The reasoning behind this can be seen on [this pull request](https://github.com/electron/electron/pull/28207).
* On Linux, users have to put `--enable-transparent-visuals --disable-gpu` in
the command line to disable GPU and allow ARGB to make transparent window,
this is caused by an upstream bug that [alpha channel doesn't work on some

View File

@@ -9,7 +9,7 @@ with the operating system so that you can customize the operations for various
shortcuts.
**Note:** The shortcut is global; it will work even if the app does
not have the keyboard focus. You should not use this module until the `ready`
not have the keyboard focus. This module cannot be used before the `ready`
event of the app module is emitted.
```javascript

View File

@@ -61,9 +61,13 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process handles it by listening for `channel` with the
[`ipcMain`](ipc-main.md) module.
@@ -85,9 +89,13 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process should listen for `channel` with
[`ipcMain.handle()`](ipc-main.md#ipcmainhandlechannel-listener).
@@ -124,9 +132,13 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process handles it by listening for `channel` with [`ipcMain`](ipc-main.md) module,
and replies by setting `event.returnValue`.

View File

@@ -1,142 +0,0 @@
# Locales
> Locale values returned by `app.getLocale()`.
Electron uses Chromium's `l10n_util` library to fetch the locale. Possible
values are listed below:
| Language Code | Language Name |
|---------------|---------------|
| af | Afrikaans |
| am | Amharic |
| ar | Arabic |
| az | Azerbaijani |
| be | Belarusian |
| bg | Bulgarian |
| bh | Bihari |
| bn | Bengali |
| br | Breton |
| bs | Bosnian |
| ca | Catalan |
| co | Corsican |
| cs | Czech |
| cy | Welsh |
| da | Danish |
| de | German |
| de-AT | German (Austria) |
| de-CH | German (Switzerland) |
| de-DE | German (Germany) |
| el | Greek |
| en | English |
| en-AU | English (Australia) |
| en-CA | English (Canada) |
| en-GB | English (UK) |
| en-NZ | English (New Zealand) |
| en-US | English (US) |
| en-ZA | English (South Africa) |
| eo | Esperanto |
| es | Spanish |
| es-419 | Spanish (Latin America) |
| et | Estonian |
| eu | Basque |
| fa | Persian |
| fi | Finnish |
| fil | Filipino |
| fo | Faroese |
| fr | French |
| fr-CA | French (Canada) |
| fr-CH | French (Switzerland) |
| fr-FR | French (France) |
| fy | Frisian |
| ga | Irish |
| gd | Scots Gaelic |
| gl | Galician |
| gn | Guarani |
| gu | Gujarati |
| ha | Hausa |
| haw | Hawaiian |
| he | Hebrew |
| hi | Hindi |
| hr | Croatian |
| hu | Hungarian |
| hy | Armenian |
| ia | Interlingua |
| id | Indonesian |
| is | Icelandic |
| it | Italian |
| it-CH | Italian (Switzerland) |
| it-IT | Italian (Italy) |
| ja | Japanese |
| jw | Javanese |
| ka | Georgian |
| kk | Kazakh |
| km | Cambodian |
| kn | Kannada |
| ko | Korean |
| ku | Kurdish |
| ky | Kyrgyz |
| la | Latin |
| ln | Lingala |
| lo | Laothian |
| lt | Lithuanian |
| lv | Latvian |
| mk | Macedonian |
| ml | Malayalam |
| mn | Mongolian |
| mo | Moldavian |
| mr | Marathi |
| ms | Malay |
| mt | Maltese |
| nb | Norwegian (Bokmal) |
| ne | Nepali |
| nl | Dutch |
| nn | Norwegian (Nynorsk) |
| no | Norwegian |
| oc | Occitan |
| om | Oromo |
| or | Oriya |
| pa | Punjabi |
| pl | Polish |
| ps | Pashto |
| pt | Portuguese |
| pt-BR | Portuguese (Brazil) |
| pt-PT | Portuguese (Portugal) |
| qu | Quechua |
| rm | Romansh |
| ro | Romanian |
| ru | Russian |
| sd | Sindhi |
| sh | Serbo-Croatian |
| si | Sinhalese |
| sk | Slovak |
| sl | Slovenian |
| sn | Shona |
| so | Somali |
| sq | Albanian |
| sr | Serbian |
| st | Sesotho |
| su | Sundanese |
| sv | Swedish |
| sw | Swahili |
| ta | Tamil |
| te | Telugu |
| tg | Tajik |
| th | Thai |
| ti | Tigrinya |
| tk | Turkmen |
| to | Tonga |
| tr | Turkish |
| tt | Tatar |
| tw | Twi |
| ug | Uighur |
| uk | Ukrainian |
| ur | Urdu |
| uz | Uzbek |
| vi | Vietnamese |
| xh | Xhosa |
| yi | Yiddish |
| yo | Yoruba |
| zh | Chinese |
| zh-CN | Chinese (Simplified) |
| zh-TW | Chinese (Traditional) |
| zu | Zulu |

View File

@@ -88,6 +88,7 @@ The `role` property can have following values:
* `resetZoom` - Reset the focused page's zoom level to the original size.
* `zoomIn` - Zoom in the focused page by 10%.
* `zoomOut` - Zoom out the focused page by 10%.
* `toggleSpellChecker` - Enable/disable builtin spell checker.
* `fileMenu` - Whole default "File" menu (Close / Quit)
* `editMenu` - Whole default "Edit" menu (Undo, Copy, etc.).
* `viewMenu` - Whole default "View" menu (Reload, Toggle Developer Tools, etc.)

View File

@@ -1,3 +1,5 @@
# Menu
## Class: Menu
> Create native application menus and context menus.

View File

@@ -9,12 +9,15 @@ channel messaging.
## Class: MessageChannelMain
> Channel interface for channel messaging in the main process.
Process: [Main](../glossary.md#main-process)
Example:
```js
// Main process
const { MessageChannelMain } = require('electron')
const { port1, port2 } = new MessageChannelMain()
w.webContents.postMessage('port', null, [port2])
port1.postMessage({ some: 'message' })

View File

@@ -14,6 +14,8 @@ channel messaging.
## Class: MessagePortMain
> Port interface for channel messaging in the main process.
Process: [Main](../glossary.md#main-process)
### Instance Methods

View File

@@ -1,10 +0,0 @@
## Modernization
The Electron team is currently undergoing an initiative to modernize our API in a few concrete ways. These include: updating our modules to use idiomatic JS properties instead of separate `getPropertyX` and `setPropertyX`, converting callbacks to promises, and removing some other anti-patterns present in our APIs. The current status of the Promise initiative can be tracked in the [promisification](promisification.md) tracking file.
As we work to perform these updates, we seek to create the least disruptive amount of change at any given time, so as many changes as possible will be introduced in a backward compatible manner and deprecated after enough time has passed to give users a chance to upgrade their API calls.
This document and its child documents will be updated to reflect the latest status of our API changes.
* [Promisification](promisification.md)
* [Property Updates](property-updates.md)

View File

@@ -1,42 +0,0 @@
## Promisification
The Electron team recently underwent an initiative to convert callback-based APIs to Promise-based ones. See converted functions below:
- [app.getFileIcon(path[, options], callback)](https://github.com/electron/electron/blob/master/docs/api/app.md#getFileIcon)
- [contents.capturePage([rect, ]callback)](https://github.com/electron/electron/blob/master/docs/api/web-contents.md#capturePage)
- [contents.executeJavaScript(code[, userGesture, callback])](https://github.com/electron/electron/blob/master/docs/api/web-contents.md#executeJavaScript)
- [contents.printToPDF(options, callback)](https://github.com/electron/electron/blob/master/docs/api/web-contents.md#printToPDF)
- [contents.savePage(fullPath, saveType, callback)](https://github.com/electron/electron/blob/master/docs/api/web-contents.md#savePage)
- [contentTracing.getCategories(callback)](https://github.com/electron/electron/blob/master/docs/api/content-tracing.md#getCategories)
- [contentTracing.startRecording(options, callback)](https://github.com/electron/electron/blob/master/docs/api/content-tracing.md#startRecording)
- [contentTracing.stopRecording(resultFilePath, callback)](https://github.com/electron/electron/blob/master/docs/api/content-tracing.md#stopRecording)
- [contentTracing.getTraceBufferUsage(callback)](https://github.com/electron/electron/blob/master/docs/api/content-tracing.md#getTraceBufferUsage)
- [cookies.flushStore(callback)](https://github.com/electron/electron/blob/master/docs/api/cookies.md#flushStore)
- [cookies.get(filter, callback)](https://github.com/electron/electron/blob/master/docs/api/cookies.md#get)
- [cookies.remove(url, name, callback)](https://github.com/electron/electron/blob/master/docs/api/cookies.md#remove)
- [cookies.set(details, callback)](https://github.com/electron/electron/blob/master/docs/api/cookies.md#set)
- [debugger.sendCommand(method[, commandParams, callback])](https://github.com/electron/electron/blob/master/docs/api/debugger.md#sendCommand)
- [desktopCapturer.getSources(options, callback)](https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md#getSources)
- [dialog.showOpenDialog([browserWindow, ]options[, callback])](https://github.com/electron/electron/blob/master/docs/api/dialog.md#showOpenDialog)
- [dialog.showSaveDialog([browserWindow, ]options[, callback])](https://github.com/electron/electron/blob/master/docs/api/dialog.md#showSaveDialog)
- [inAppPurchase.purchaseProduct(productID, quantity, callback)](https://github.com/electron/electron/blob/master/docs/api/in-app-purchase.md#purchaseProduct)
- [inAppPurchase.getProducts(productIDs, callback)](https://github.com/electron/electron/blob/master/docs/api/in-app-purchase.md#getProducts)
- [dialog.showMessageBox([browserWindow, ]options[, callback])](https://github.com/electron/electron/blob/master/docs/api/dialog.md#showMessageBox)
- [dialog.showCertificateTrustDialog([browserWindow, ]options, callback)](https://github.com/electron/electron/blob/master/docs/api/dialog.md#showCertificateTrustDialog)
- [netLog.stopLogging([callback])](https://github.com/electron/electron/blob/master/docs/api/net-log.md#stopLogging)
- [protocol.isProtocolHandled(scheme, callback)](https://github.com/electron/electron/blob/master/docs/api/protocol.md#isProtocolHandled)
- [ses.clearHostResolverCache([callback])](https://github.com/electron/electron/blob/master/docs/api/session.md#clearHostResolverCache)
- [ses.clearStorageData([options, callback])](https://github.com/electron/electron/blob/master/docs/api/session.md#clearStorageData)
- [ses.setProxy(config, callback)](https://github.com/electron/electron/blob/master/docs/api/session.md#setProxy)
- [ses.resolveProxy(url, callback)](https://github.com/electron/electron/blob/master/docs/api/session.md#resolveProxy)
- [ses.getCacheSize(callback)](https://github.com/electron/electron/blob/master/docs/api/session.md#getCacheSize)
- [ses.clearAuthCache(options[, callback])](https://github.com/electron/electron/blob/master/docs/api/session.md#clearAuthCache)
- [ses.clearCache(callback)](https://github.com/electron/electron/blob/master/docs/api/session.md#clearCache)
- [ses.getBlobData(identifier, callback)](https://github.com/electron/electron/blob/master/docs/api/session.md#getBlobData)
- [shell.openExternal(url[, options, callback])](https://github.com/electron/electron/blob/master/docs/api/shell.md#openExternal)
- [webFrame.executeJavaScript(code[, userGesture, callback])](https://github.com/electron/electron/blob/master/docs/api/web-frame.md#executeJavaScript)
- [webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture, callback])](https://github.com/electron/electron/blob/master/docs/api/web-frame.md#executeJavaScriptInIsolatedWorld)
- [webviewTag.capturePage([rect, ]callback)](https://github.com/electron/electron/blob/master/docs/api/webview-tag.md#capturePage)
- [webviewTag.executeJavaScript(code[, userGesture, callback])](https://github.com/electron/electron/blob/master/docs/api/webview-tag.md#executeJavaScript)
- [webviewTag.printToPDF(options, callback)](https://github.com/electron/electron/blob/master/docs/api/webview-tag.md#printToPDF)
- [win.capturePage([rect, ]callback)](https://github.com/electron/electron/blob/master/docs/api/browser-window.md#capturePage)

View File

@@ -1,41 +0,0 @@
## Property Updates
The Electron team is currently undergoing an initiative to convert separate getter and setter functions in Electron to bespoke properties with `get` and `set` functionality. During this transition period, both the new properties and old getters and setters of these functions will work correctly and be documented.
## Candidates
* `BrowserWindow`
* `menubarVisible`
* `crashReporter` module
* `uploadToServer`
* `webFrame` modules
* `zoomFactor`
* `zoomLevel`
* `audioMuted`
* `<webview>`
* `zoomFactor`
* `zoomLevel`
* `audioMuted`
## Converted Properties
* `app` module
* `accessibilitySupport`
* `applicationMenu`
* `badgeCount`
* `name`
* `DownloadItem` class
* `savePath`
* `BrowserWindow` module
* `autoHideMenuBar`
* `resizable`
* `maximizable`
* `minimizable`
* `fullscreenable`
* `movable`
* `closable`
* `backgroundThrottling`
* `NativeImage`
* `isMacTemplateImage`
* `SystemPreferences` module
* `appLevelAppearance`

View File

@@ -65,3 +65,18 @@ before considered idle. `locked` is available on supported systems only.
Returns `Integer` - Idle time in seconds
Calculate system idle time in seconds.
### `powerMonitor.isOnBatteryPower()`
Returns `Boolean` - Whether the system is on battery power.
To monitor for changes in this property, use the `on-battery` and `on-ac`
events.
## Properties
### `powerMonitor.onBatteryPower`
A `Boolean` property. True if the system is on battery power.
See [`powerMonitor.isOnBatteryPower()`](#powermonitorisonbatterypower).

View File

@@ -42,19 +42,6 @@ In sandboxed renderers the `process` object contains only a subset of the APIs:
Emitted when Electron has loaded its internal initialization script and is
beginning to load the web page or the main script.
It can be used by the preload script to add removed Node global symbols back to
the global scope when node integration is turned off:
```javascript
// preload.js
const _setImmediate = setImmediate
const _clearImmediate = clearImmediate
process.once('loaded', () => {
global.setImmediate = _setImmediate
global.clearImmediate = _clearImmediate
})
```
## Properties
### `process.defaultApp` _Readonly_

View File

@@ -1,182 +0,0 @@
# `sandbox` Option
> Create a browser window with a sandboxed renderer. With this
option enabled, the renderer must communicate via IPC to the main process in order to access node APIs.
One of the key security features of Chromium is that all blink rendering/JavaScript
code is executed within a sandbox. This sandbox uses OS-specific features to ensure
that exploits in the renderer process cannot harm the system.
In other words, when the sandbox is enabled, the renderers can only make changes
to the system by delegating tasks to the main process via IPC.
[Here's](https://www.chromium.org/developers/design-documents/sandbox) more
information about the sandbox.
Since a major feature in Electron is the ability to run Node.js in the
renderer process (making it easier to develop desktop applications using web
technologies), the sandbox is disabled by electron. This is because
most Node.js APIs require system access. `require()` for example, is not
possible without file system permissions, which are not available in a sandboxed
environment.
Usually this is not a problem for desktop applications since the code is always
trusted, but it makes Electron less secure than Chromium for displaying
untrusted web content. For applications that require more security, the
`sandbox` flag will force Electron to spawn a classic Chromium renderer that is
compatible with the sandbox.
A sandboxed renderer doesn't have a Node.js environment running and doesn't
expose Node.js JavaScript APIs to client code. The only exception is the preload script,
which has access to a subset of the Electron renderer API.
Another difference is that sandboxed renderers don't modify any of the default
JavaScript APIs. Consequently, some APIs such as `window.open` will work as they
do in Chromium (i.e. they do not return a [`BrowserWindowProxy`](browser-window-proxy.md)).
## Example
To create a sandboxed window, pass `sandbox: true` to `webPreferences`:
```js
let win
app.whenReady().then(() => {
win = new BrowserWindow({
webPreferences: {
sandbox: true
}
})
win.loadURL('http://google.com')
})
```
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 behavior (by default Electron creates a [`BrowserWindow`](browser-window.md)
and returns a proxy to this via `window.open`).
[`app.enableSandbox`](app.md#appenablesandbox) can be used to force `sandbox: true` for all `BrowserWindow` instances.
```js
let win
app.enableSandbox()
app.whenReady().then(() => {
// no need to pass `sandbox: true` since `app.enableSandbox()` was called.
win = new BrowserWindow()
win.loadURL('http://google.com')
})
```
## Preload
An app can make customizations to sandboxed renderers using a preload script.
Here's an example:
```js
let win
app.whenReady().then(() => {
win = new BrowserWindow({
webPreferences: {
sandbox: true,
preload: path.join(app.getAppPath(), 'preload.js')
}
})
win.loadURL('http://google.com')
})
```
and preload.js:
```js
// This file is loaded whenever a javascript context is created. It runs in a
// private scope that can access a subset of Electron renderer APIs. Without
// contextIsolation enabled, it's possible to accidentally leak privileged
// globals like ipcRenderer to web content.
const { ipcRenderer } = require('electron')
const defaultWindowOpen = window.open
window.open = function customWindowOpen (url, ...args) {
ipcRenderer.send('report-window-open', location.origin, url, args)
return defaultWindowOpen(url + '?from_electron=1', ...args)
}
```
Important things to notice in the preload script:
- Even though the sandboxed renderer doesn't have Node.js running, it still has
access to a limited node-like environment: `Buffer`, `process`, `setImmediate`,
`clearImmediate` and `require` are available.
- The preload script must be contained in a single script, but it is possible to have
complex preload code composed with multiple modules by using a tool like
webpack or browserify. An example of using browserify is below.
To create a browserify bundle and use it as a preload script, something like
the following should be used:
```sh
browserify preload/index.js \
-x electron \
--insert-global-vars=__filename,__dirname -o preload.js
```
The `-x` flag should be used with any required module that is already exposed in
the preload scope, and tells browserify to use the enclosing `require` function
for it. `--insert-global-vars` will ensure that `process`, `Buffer` and
`setImmediate` are also taken from the enclosing scope(normally browserify
injects code for those).
Currently the `require` function provided in the preload scope exposes the
following modules:
- `electron`
- `crashReporter`
- `desktopCapturer`
- `ipcRenderer`
- `nativeImage`
- `webFrame`
- `events`
- `timers`
- `url`
More may be added as needed to expose more Electron APIs in the sandbox.
## Rendering untrusted content
Rendering untrusted content in Electron is still somewhat uncharted territory,
though some apps are finding success (e.g. Beaker Browser). Our goal is to get
as close to Chrome as we can in terms of the security of sandboxed content, but
ultimately we will always be behind due to a few fundamental issues:
1. We do not have the dedicated resources or expertise that Chromium has to
apply to the security of its product. We do our best to make use of what we
have, to inherit everything we can from Chromium, and to respond quickly to
security issues, but Electron cannot be as secure as Chromium without the
resources that Chromium is able to dedicate.
2. Some security features in Chrome (such as Safe Browsing and Certificate
Transparency) require a centralized authority and dedicated servers, both of
which run counter to the goals of the Electron project. As such, we disable
those features in Electron, at the cost of the associated security they
would otherwise bring.
3. There is only one Chromium, whereas there are many thousands of apps built
on Electron, all of which behave slightly differently. Accounting for those
differences can yield a huge possibility space, and make it challenging to
ensure the security of the platform in unusual use cases.
4. We can't push security updates to users directly, so we rely on app vendors
to upgrade the version of Electron underlying their app in order for
security updates to reach users.
Here are some things to consider before rendering untrusted content:
- A preload script can accidentally leak privileged APIs to untrusted code,
unless [`contextIsolation`](../tutorial/security.md#3-enable-context-isolation-for-remote-content)
is also enabled.
- Some bug in the V8 engine may allow malicious code to access the renderer
preload APIs, effectively granting full access to the system through the
`remote` module. Therefore, it is highly recommended to [disable the `remote`
module](../tutorial/security.md#15-disable-the-remote-module).
If disabling is not feasible, you should selectively [filter the `remote`
module](../tutorial/security.md#16-filter-the-remote-module).
- While we make our best effort to backport Chromium security fixes to older
versions of Electron, we do not make a guarantee that every fix will be
backported. Your best chance at staying secure is to be on the latest stable
version of Electron.

View File

@@ -483,6 +483,8 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
})
```
> **NOTE:** The result of this procedure is cached by the network service.
#### `ses.setPermissionRequestHandler(handler)`
* `handler` Function | null
@@ -490,6 +492,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `permission` String - The type of requested permission.
* `clipboard-read` - Request access to read from the clipboard.
* `media` - Request access to media devices such as camera, microphone and speakers.
* `display-capture` - Request access to capture the screen.
* `mediaKeySystem` - Request access to DRM protected content.
* `geolocation` - Request access to user's current location.
* `notifications` - Request notification creation and the ability to display them in the user's system tray.
@@ -673,6 +676,16 @@ this session just before normal `preload` scripts run.
Returns `String[]` an array of paths to preload scripts that have been
registered.
#### `ses.setSpellCheckerEnabled(enable)`
* `enable` Boolean
Sets whether to enable the builtin spell checker.
#### `ses.isSpellCheckerEnabled()`
Returns `Boolean` - Whether the builtin spell checker is enabled.
#### `ses.setSpellCheckerLanguages(languages)`
* `languages` String[] - An array of language codes to enable the spellchecker for.
@@ -730,9 +743,13 @@ 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)`
#### `ses.loadExtension(path[, options])`
* `path` String - Path to a directory containing an unpacked Chrome extension
* `options` Object (optional)
* `allowFileAccess` Boolean - Whether to allow the extension to read local files over `file://`
protocol and inject content scripts into `file://` pages. This is required e.g. for loading
devtools extensions on `file://` URLs. Defaults to false.
Returns `Promise<Extension>` - resolves when the extension is loaded.
@@ -755,7 +772,11 @@ const { app, session } = require('electron')
const path = require('path')
app.on('ready', async () => {
await session.defaultSession.loadExtension(path.join(__dirname, 'react-devtools'))
await session.defaultSession.loadExtension(
path.join(__dirname, 'react-devtools'),
// allowFileAccess is required to load the devtools extension on file:// URLs.
{ allowFileAccess: true }
)
// Note that in order to use the React DevTools extension, you'll need to
// download and unzip a copy of the extension.
})
@@ -803,6 +824,10 @@ The following properties are available on instances of `Session`:
A `String[]` array which consists of all the known available spell checker languages. Providing a language
code to the `setSpellCheckerLanguages` API that isn't in this array will result in an error.
#### `ses.spellCheckerEnabled`
A `Boolean` indicating whether builtin spell checker is enabled.
#### `ses.cookies` _Readonly_
A [`Cookies`](cookies.md) object for this session.

View File

@@ -1,8 +1,4 @@
## Class: ShareMenu
> Create share menu on macOS.
Process: [Main](../glossary.md#main-process)
# ShareMenu
The `ShareMenu` class creates [Share Menu][share-menu] on macOS, which can be
used to share information from the current context to apps, social media
@@ -11,6 +7,12 @@ accounts, and other services.
For including the share menu as a submenu of other menus, please use the
`shareMenu` role of [`MenuItem`](menu-item.md).
## Class: ShareMenu
> Create share menu on macOS.
Process: [Main](../glossary.md#main-process)
### `new ShareMenu(sharingItem)`
* `sharingItem` SharingItem - The item to share.

View File

@@ -10,9 +10,10 @@
* `colorSpace` String - represent a color space (three-dimensional object which contains all realizable color combinations) for the purpose of color conversions
* `colorDepth` Number - The number of bits per pixel.
* `depthPerComponent` Number - The number of bits per color component.
* `bounds` [Rectangle](rectangle.md)
* `displayFrequency` Number - The display refresh rate.
* `bounds` [Rectangle](rectangle.md) - the bounds of the display in DIP points.
* `size` [Size](size.md)
* `workArea` [Rectangle](rectangle.md)
* `workArea` [Rectangle](rectangle.md) - the work area of the display in DIP points.
* `workAreaSize` [Size](size.md)
* `internal` Boolean - `true` for an internal display and `false` for an external display

View File

@@ -1,8 +1,10 @@
# IpcMainEvent Object extends `Event`
* `processId` Integer - The internal ID of the renderer process that sent this message
* `frameId` Integer - The ID of the renderer frame that sent this message
* `returnValue` any - Set this to the value to be returned in a synchronous message
* `sender` WebContents - Returns the `webContents` that sent the message
* `senderFrame` WebFrameMain _Readonly_ - The frame that sent this message
* `ports` MessagePortMain[] - A list of MessagePorts that were transferred with this message
* `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

View File

@@ -1,4 +1,6 @@
# IpcMainInvokeEvent Object extends `Event`
* `processId` Integer - The internal ID of the renderer process that sent this message
* `frameId` Integer - The ID of the renderer frame that sent this message
* `sender` WebContents - Returns the `webContents` that sent the message
* `senderFrame` WebFrameMain _Readonly_ - The frame that sent this message

View File

@@ -19,3 +19,7 @@
property set then its `type` is assumed to be `tasks`. If the `name` property
is set but the `type` property is omitted then the `type` is assumed to be
`custom`.
**Note:** The maximum length of a Jump List item's `description` property is
260 characters. Beyond this limit, the item will not be added to the Jump
List, nor will it be displayed.

View File

@@ -17,7 +17,7 @@
* `title` String (optional) - The text to be displayed for the item in the Jump List.
Should only be set if `type` is `task`.
* `description` String (optional) - Description of the task (displayed in a tooltip).
Should only be set if `type` is `task`.
Should only be set if `type` is `task`. Maximum length 260 characters.
* `iconPath` String (optional) - The absolute path to an icon to be displayed in a
Jump List, which can be an arbitrary resource file that contains an icon
(e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to

View File

@@ -1,6 +1,6 @@
# UploadFile Object
* `type` String - `file`.
* `type` 'file' - `file`.
* `filePath` String - Path of file to be uploaded.
* `offset` Integer - Defaults to `0`.
* `length` Integer - Number of bytes to read from `offset`.

View File

@@ -1,4 +1,4 @@
# UploadRawData Object
* `type` String - `rawData`.
* `type` 'rawData' - `rawData`.
* `bytes` Buffer - Data to be uploaded.

View File

@@ -13,7 +13,7 @@ either process type.
The basic rule is: if a module is [GUI][gui] or low-level system related, then
it should be only available in the main process. You need to be familiar with
the concept of [main process vs. renderer process](../tutorial/quick-start.md#main-and-renderer-processes)
the concept of main process vs. renderer process
scripts to be able to use those modules.
The main process script is like a normal Node.js script:
@@ -43,8 +43,6 @@ extra ability to use node modules if `nodeIntegration` is enabled:
</html>
```
To run your app, read [Run your app](../tutorial/quick-start.md#run-your-application).
## Destructuring assignment
As of 0.37, you can use

View File

@@ -130,6 +130,8 @@ This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
* `userInfo` Record<String, unknown>
* `object` String
Returns `Number` - The ID of this subscription
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
This is necessary for events such as `NSWorkspaceDidActivateApplicationNotification`.

View File

@@ -1,3 +1,5 @@
# TouchBar
## Class: TouchBar
> Create TouchBar layouts for native macOS applications

View File

@@ -1,3 +1,5 @@
# Tray
## Class: Tray
> Add icons and context menus to the system's notification area.

View File

@@ -42,7 +42,8 @@ returns `null`.
* `id` Integer
Returns `WebContents` - A WebContents instance with the given ID.
Returns `WebContents` | undefined - A WebContents instance with the given ID, or
`undefined` if there is no WebContents associated with the given ID.
## Class: WebContents
@@ -155,7 +156,7 @@ Returns:
be set. If no post data is to be sent, the value will be `null`. Only defined
when the window is being created by a form that set `target=_blank`.
Deprecated in favor of [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandler-handler).
Deprecated in favor of [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler).
Emitted when the page requests to open a new window for a `url`. It could be
requested by `window.open` or an external link like `<a target='_blank'>`.
@@ -203,7 +204,7 @@ Returns:
BrowserWindow. They are merged in increasing precedence: options inherited
from the parent, parsed options from the `features` string from
`window.open()`, and options given by
[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandler-handler).
[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler).
Unrecognized options are not filtered out.
* `additionalFeatures` String[] - The non-standard features (features not
handled Chromium or Electron) _Deprecated_
@@ -220,7 +221,7 @@ Returns:
Emitted _after_ successful creation of a window via `window.open` in the renderer.
Not emitted if the creation of the window is canceled from
[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandler-handler).
[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler).
See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `webContents.setWindowOpenHandler`.
@@ -401,6 +402,9 @@ Returns:
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Integer - The exit code of the process, unless `reason` is
`launch-failed`, in which case `exitCode` will be a platform-specific
launch failure error code.
Emitted when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
@@ -1165,6 +1169,7 @@ Ignore application menu shortcuts while this web contents is focused.
* `url` String - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
* `frameName` String - Name of the window provided in `window.open()`
* `features` String - Comma separated list of window features provided to `window.open()`.
Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
Returning an unrecognized value such as a null, undefined, or an object
@@ -1301,8 +1306,7 @@ Inserts `text` to the focused element.
* `text` String - Content to be searched, must not be empty.
* `options` Object (optional)
* `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean (optional) - Whether the operation is first request or a follow up,
defaults to `false`.
* `findNext` Boolean (optional) - Whether to begin a new text finding session with this request. Should be `true` for initial requests, and `false` for follow-up requests. Defaults to `false`.
* `matchCase` Boolean (optional) - Whether search should be case-sensitive,
defaults to `false`.
@@ -1657,8 +1661,7 @@ included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> special Electron objects will throw an exception.
The renderer process can handle the message by listening to `channel` with the
[`ipcRenderer`](ipc-renderer.md) module.
@@ -1694,7 +1697,9 @@ app.whenReady().then(() => {
#### `contents.sendToFrame(frameId, channel, ...args)`
* `frameId` Integer
* `frameId` Integer | [number, number] - the ID of the frame to send to, or a
pair of `[processId, frameId]` if the frame is in a different process to the
main frame.
* `channel` String
* `...args` any[]
@@ -1704,9 +1709,8 @@ Send an asynchronous message to a specific frame in a renderer process via
chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or
WeakSets will throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
The renderer process can handle the message by listening to `channel` with the
[`ipcRenderer`](ipc-renderer.md) module.
@@ -1869,7 +1873,7 @@ Returns `Boolean` - If *offscreen rendering* is enabled returns whether it is cu
* `fps` Integer
If *offscreen rendering* is enabled sets the frame rate to the specified number.
Only values between 1 and 60 are accepted.
Only values between 1 and 240 are accepted.
#### `contents.getFrameRate()`
@@ -1967,7 +1971,7 @@ The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
#### `contents.frameRate`
An `Integer` property that sets the frame rate of the web contents to the specified number.
Only values between 1 and 60 are accepted.
Only values between 1 and 240 are accepted.
Only applicable if *offscreen rendering* is enabled.

View File

@@ -26,7 +26,7 @@ win.webContents.on(
)
```
You can also access frames of existing pages by using the `webFrame` property
You can also access frames of existing pages by using the `mainFrame` property
of [`WebContents`](web-contents.md).
```javascript
@@ -57,13 +57,14 @@ These methods can be accessed from the `webFrameMain` module:
### `webFrameMain.fromId(processId, routingId)`
* `processId` Integer - An `Integer` representing the id of the process which owns the frame.
* `routingId` Integer - An `Integer` representing the unique frame id in the
* `processId` Integer - An `Integer` representing the internal ID of the process which owns the frame.
* `routingId` Integer - An `Integer` representing the unique frame ID in the
current renderer process. Routing IDs can be retrieved from `WebFrameMain`
instances (`frame.routingId`) and are also passed by frame
specific `WebContents` navigation events (e.g. `did-frame-navigate`).
Returns `WebFrameMain` - A frame with the given process and routing IDs.
Returns `WebFrameMain | undefined` - A frame with the given process and routing IDs,
or `undefined` if there is no WebFrameMain associated with the given IDs.
## Class: WebFrameMain
@@ -89,6 +90,47 @@ this limitation.
Returns `boolean` - Whether the reload was initiated successfully. Only results in `false` when the frame has no history.
#### `frame.send(channel, ...args)`
* `channel` String
* `...args` any[]
Send an asynchronous message to the renderer 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
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
The renderer process can handle the message by listening to `channel` with the
[`ipcRenderer`](ipc-renderer.md) module.
#### `frame.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.mainFrame.postMessage('port', { message: 'hello' }, [port1])
// Renderer process
ipcRenderer.on('port', (e, msg) => {
const [port] = e.ports
// ...
})
```
### Instance Properties
#### `frame.url` _Readonly_

View File

@@ -51,6 +51,8 @@ The following methods are available on instances of `WebRequest`:
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
@@ -94,6 +96,8 @@ Some examples of valid `urls`:
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
@@ -121,6 +125,8 @@ The `callback` has to be called with a `response` object.
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
@@ -141,12 +147,13 @@ response are visible by the time this listener is fired.
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
* `statusLine` String
* `statusCode` Integer
* `requestHeaders` Record<string, string>
* `responseHeaders` Record<string, string[]> (optional)
* `callback` Function
* `headersReceivedResponse` Object
@@ -173,6 +180,8 @@ The `callback` has to be called with a `response` object.
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
@@ -197,6 +206,8 @@ and response headers are available.
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
@@ -222,6 +233,8 @@ redirect is about to occur.
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double
@@ -245,6 +258,8 @@ completed.
* `url` String
* `method` String
* `webContentsId` Integer (optional)
* `webContents` WebContents (optional)
* `frame` WebFrameMain (optional)
* `resourceType` String
* `referrer` String
* `timestamp` Double

View File

@@ -5,7 +5,7 @@
Electron's `webview` tag is based on [Chromium's `webview`][chrome-webview], which
is undergoing dramatic architectural changes. This impacts the stability of `webviews`,
including rendering, navigation, and event routing. We currently recommend to not
use the `webview` tag and to consider alternatives, like `iframe`, Electron's `BrowserView`,
use the `webview` tag and to consider alternatives, like `iframe`, [Electron's `BrowserView`](browser-view.md),
or an architecture that avoids embedded content altogether.
## Enabling
@@ -515,8 +515,7 @@ Inserts `text` to the focused element.
* `text` String - Content to be searched, must not be empty.
* `options` Object (optional)
* `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
* `findNext` Boolean (optional) - Whether the operation is first request or a follow up,
defaults to `false`.
* `findNext` Boolean (optional) - Whether to begin a new text finding session with this request. Should be `true` for initial requests, and `false` for follow-up requests. Defaults to `false`.
* `matchCase` Boolean (optional) - Whether search should be case-sensitive,
defaults to `false`.
@@ -719,6 +718,10 @@ Corresponds to the points in time when the spinner of the tab starts spinning.
Corresponds to the points in time when the spinner of the tab stops spinning.
### Event: 'did-attach'
Fired when attached to the embedder web contents.
### Event: 'dom-ready'
Fired when document in the given frame is loaded.
@@ -839,6 +842,19 @@ this purpose.
Calling `event.preventDefault()` does __NOT__ have any effect.
### Event: 'did-start-navigation'
Returns:
* `url` String
* `isInPlace` Boolean
* `isMainFrame` Boolean
* `frameProcessId` Integer
* `frameRoutingId` Integer
Emitted when any frame (including main) starts navigating. `isInPlace` will be
`true` for in-page navigations.
### Event: 'did-navigate'
Returns:
@@ -851,6 +867,23 @@ This event is not emitted for in-page navigations, such as clicking anchor links
or updating the `window.location.hash`. Use `did-navigate-in-page` event for
this purpose.
### Event: 'did-frame-navigate'
Returns:
* `url` String
* `httpResponseCode` Integer - -1 for non HTTP navigations
* `httpStatusText` String - empty for non HTTP navigations,
* `isMainFrame` Boolean
* `frameProcessId` Integer
* `frameRoutingId` Integer
Emitted when any frame navigation is done.
This event is not emitted for in-page navigations, such as clicking anchor links
or updating the `window.location.hash`. Use `did-navigate-in-page` event for
this purpose.
### Event: 'did-navigate-in-page'
Returns:
@@ -966,4 +999,4 @@ Emitted when DevTools is closed.
Emitted when DevTools is focused / opened.
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
[chrome-webview]: https://developer.chrome.com/apps/tags/webview
[chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/

View File

@@ -26,7 +26,7 @@ BrowserWindow constructor options are set by, in increasing precedence
order: options inherited from the parent, parsed options
from the `features` string from `window.open()`, security-related webPreferences
inherited from the parent, and options given by
[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandler-handler).
[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler).
Note that `webContents.setWindowOpenHandler` has final say and full privilege
because it is invoked in the main process.
@@ -83,9 +83,9 @@ const mainWindow = new BrowserWindow()
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith('https://github.com/')) {
return true
return { action: 'allow' }
}
return false
return { action: 'deny' }
})
mainWindow.webContents.on('did-create-window', (childWindow) => {
@@ -117,15 +117,18 @@ const mainWindow = new BrowserWindow({
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
if (url === 'about:blank') {
return {
frame: false,
fullscreenable: false,
backgroundColor: 'black',
webPreferences: {
preload: 'my-child-window-preload-script.js'
action: 'allow',
overrideBrowserWindowOptions: {
frame: false,
fullscreenable: false,
backgroundColor: 'black',
webPreferences: {
preload: 'my-child-window-preload-script.js'
}
}
}
}
return false
return { action: 'deny' }
})
```

View File

@@ -6,14 +6,52 @@ Breaking changes will be documented here, and deprecation warnings added to JS c
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.
* **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 (14.0)
### API Changed: `window.(open)`
The optional parameter `frameName` will no longer set the title of the window. This now follows the specification described by the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) under the corresponding parameter `windowName`.
If you were using this parameter to set the title of a window, you can instead use [win.setTitle(title)](https://www.electronjs.org/docs/api/browser-window#winsettitletitle).
### Removed: `worldSafeExecuteJavaScript`
In Electron 14, `worldSafeExecuteJavaScript` will be removed. There is no alternative, please
ensure your code works with this property enabled. It has been enabled by default since Electron
12.
You will be affected by this change if you use either `webFrame.executeJavaScript` or `webFrame.executeJavaScriptInIsolatedWorld`. You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) as these methods use the same value passing semantics.
## Planned Breaking API Changes (13.0)
### API Changed: `session.setPermissionCheckHandler(handler)`
The `handler` methods first parameter was previously always a `webContents`, it can now sometimes be `null`. You should use the `requestingOrigin`, `embeddingOrigin` and `securityOrigin` properties to respond to the permission check correctly. As the `webContents` can be `null` it can no longer be relied on.
```js
// Old code
session.setPermissionCheckHandler((webContents, permission) => {
if (webContents.getURL().startsWith('https://google.com/') && permission === 'notification') {
return true
}
return false
})
// Replace with
session.setPermissionCheckHandler((webContents, permission, requestingOrigin) => {
if (new URL(requestingOrigin).hostname === 'google.com' && permission === 'notification') {
return true
}
return false
})
```
### Removed: `shell.moveItemToTrash()`
The deprecated synchronous `shell.moveItemToTrash()` API has been removed. Use
@@ -26,6 +64,78 @@ shell.moveItemToTrash(path)
shell.trashItem(path).then(/* ... */)
```
### Removed: `BrowserWindow` extension APIs
The deprecated extension APIs have been removed:
* `BrowserWindow.addExtension(path)`
* `BrowserWindow.addDevToolsExtension(path)`
* `BrowserWindow.removeExtension(name)`
* `BrowserWindow.removeDevToolsExtension(name)`
* `BrowserWindow.getExtensions()`
* `BrowserWindow.getDevToolsExtensions()`
Use the session APIs instead:
* `ses.loadExtension(path)`
* `ses.removeExtension(extension_id)`
* `ses.getAllExtensions()`
```js
// Removed in Electron 13
BrowserWindow.addExtension(path)
BrowserWindow.addDevToolsExtension(path)
// Replace with
session.defaultSession.loadExtension(path)
```
```js
// Removed in Electron 13
BrowserWindow.removeExtension(name)
BrowserWindow.removeDevToolsExtension(name)
// Replace with
session.defaultSession.removeExtension(extension_id)
```
```js
// Removed in Electron 13
BrowserWindow.getExtensions()
BrowserWindow.getDevToolsExtensions()
// Replace with
session.defaultSession.getAllExtensions()
```
### Removed: methods in `systemPreferences`
The following `systemPreferences` methods have been deprecated:
* `systemPreferences.isDarkMode()`
* `systemPreferences.isInvertedColorScheme()`
* `systemPreferences.isHighContrastColorScheme()`
Use the following `nativeTheme` properties instead:
* `nativeTheme.shouldUseDarkColors`
* `nativeTheme.shouldUseInvertedColorScheme`
* `nativeTheme.shouldUseHighContrastColors`
```js
// Removed in Electron 13
systemPreferences.isDarkMode()
// Replace with
nativeTheme.shouldUseDarkColors
// Removed in Electron 13
systemPreferences.isInvertedColorScheme()
// Replace with
nativeTheme.shouldUseInvertedColorScheme
// Removed in Electron 13
systemPreferences.isHighContrastColorScheme()
// Replace with
nativeTheme.shouldUseHighContrastColors
```
## Planned Breaking API Changes (12.0)
### Removed: Pepper Flash support
@@ -34,6 +144,15 @@ Chromium has removed support for Flash, and so we must follow suit. See
Chromium's [Flash Roadmap](https://www.chromium.org/flash-roadmap) for more
details.
### Default Changed: `worldSafeExecuteJavaScript` defaults to `true`
In Electron 12, `worldSafeExecuteJavaScript` will be enabled by default. To restore
the previous behavior, `worldSafeExecuteJavaScript: false` must be specified in WebPreferences.
Please note that setting this option to `false` is **insecure**.
This option will be removed in Electron 14 so please migrate your code to support the default
value.
### Default Changed: `contextIsolation` defaults to `true`
In Electron 12, `contextIsolation` will be enabled by default. To restore
@@ -41,19 +160,34 @@ the previous behavior, `contextIsolation: false` must be specified in WebPrefere
We [recommend having contextIsolation enabled](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
Another implication is that `require()` cannot be used in the renderer process unless
`nodeIntegration` is `true` and `contextIsolation` is `false`.
For more details see: https://github.com/electron/electron/issues/23506
### Removed: `crashReporter.getCrashesDirectory()`
The `crashReporter.getCrashesDirectory` method has been removed. Usage
should be replaced by `app.getPath('crashDumps')`.
```js
// Removed in Electron 12
crashReporter.getCrashesDirectory()
// Replace with
app.getPath('crashDumps')
```
### 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`
* `crashReporter.start`
* `crashReporter.getLastCrashReport`
* `crashReporter.getUploadedReports`
* `crashReporter.getUploadToServer`
* `crashReporter.setUploadToServer`
* `crashReporter.getCrashesDirectory`
They should be called only from the main process.
@@ -103,7 +237,13 @@ shell.trashItem(path).then(/* ... */)
## Planned Breaking API Changes (11.0)
There are no breaking changes planned for 11.0.
### Removed: `BrowserView.{destroy, fromId, fromWebContents, getAllViews}` and `id` property of `BrowserView`
The experimental APIs `BrowserView.{destroy, fromId, fromWebContents, getAllViews}`
have now been removed. Additionally, the `id` property of `BrowserView`
has also been removed.
For more detailed information, see [#23578](https://github.com/electron/electron/pull/23578).
## Planned Breaking API Changes (10.0)
@@ -138,12 +278,12 @@ app.getPath('crashDumps')
Calling the following `crashReporter` methods from the renderer process is
deprecated:
- `crashReporter.start`
- `crashReporter.getLastCrashReport`
- `crashReporter.getUploadedReports`
- `crashReporter.getUploadToServer`
- `crashReporter.setUploadToServer`
- `crashReporter.getCrashesDirectory`
* `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`.
@@ -185,6 +325,7 @@ 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.
@@ -197,14 +338,23 @@ 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.
@@ -246,6 +396,47 @@ 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).
### Deprecated: `BrowserWindow` extension APIs
The following extension APIs have been deprecated:
* `BrowserWindow.addExtension(path)`
* `BrowserWindow.addDevToolsExtension(path)`
* `BrowserWindow.removeExtension(name)`
* `BrowserWindow.removeDevToolsExtension(name)`
* `BrowserWindow.getExtensions()`
* `BrowserWindow.getDevToolsExtensions()`
Use the session APIs instead:
* `ses.loadExtension(path)`
* `ses.removeExtension(extension_id)`
* `ses.getAllExtensions()`
```js
// Deprecated in Electron 9
BrowserWindow.addExtension(path)
BrowserWindow.addDevToolsExtension(path)
// Replace with
session.defaultSession.loadExtension(path)
```
```js
// Deprecated in Electron 9
BrowserWindow.removeExtension(name)
BrowserWindow.removeDevToolsExtension(name)
// Replace with
session.defaultSession.removeExtension(extension_id)
```
```js
// Deprecated in Electron 9
BrowserWindow.getExtensions()
BrowserWindow.getDevToolsExtensions()
// Replace with
session.defaultSession.getAllExtensions()
```
### Removed: `<webview>.getWebContents()`
This API, which was deprecated in Electron 8.0, is now removed.
@@ -298,7 +489,7 @@ Clone Algorithm][SCA], the same algorithm used to serialize messages for
`postMessage`. This brings about a 2x performance improvement for large
messages, but also brings some breaking changes in behavior.
- Sending Functions, Promises, WeakMaps, WeakSets, or objects containing any
* Sending Functions, Promises, WeakMaps, WeakSets, or objects containing any
such values, over IPC will now throw an exception, instead of silently
converting the functions to `undefined`.
@@ -312,21 +503,21 @@ ipcRenderer.send('channel', { value: 3, someFunction: () => {} })
// => throws Error("() => {} could not be cloned.")
```
- `NaN`, `Infinity` and `-Infinity` will now be correctly serialized, instead
* `NaN`, `Infinity` and `-Infinity` will now be correctly serialized, instead
of being converted to `null`.
- Objects containing cyclic references will now be correctly serialized,
* Objects containing cyclic references will now be correctly serialized,
instead of being converted to `null`.
- `Set`, `Map`, `Error` and `RegExp` values will be correctly serialized,
* `Set`, `Map`, `Error` and `RegExp` values will be correctly serialized,
instead of being converted to `{}`.
- `BigInt` values will be correctly serialized, instead of being converted to
* `BigInt` values will be correctly serialized, instead of being converted to
`null`.
- Sparse arrays will be serialized as such, instead of being converted to dense
* Sparse arrays will be serialized as such, instead of being converted to dense
arrays with `null`s.
- `Date` objects will be transferred as `Date` objects, instead of being
* `Date` objects will be transferred as `Date` objects, instead of being
converted to their ISO string representation.
- Typed Arrays (such as `Uint8Array`, `Uint16Array`, `Uint32Array` and so on)
* Typed Arrays (such as `Uint8Array`, `Uint16Array`, `Uint32Array` and so on)
will be transferred as such, instead of being converted to Node.js `Buffer`.
- Node.js `Buffer` objects will be transferred as `Uint8Array`s. You can
* Node.js `Buffer` objects will be transferred as `Uint8Array`s. You can
convert a `Uint8Array` back to a Node.js `Buffer` by wrapping the underlying
`ArrayBuffer`:
@@ -392,6 +583,55 @@ in Electron 8.x, and cease to exist 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).
### Deprecated events in `systemPreferences`
The following `systemPreferences` events have been deprecated:
* `inverted-color-scheme-changed`
* `high-contrast-color-scheme-changed`
Use the new `updated` event on the `nativeTheme` module instead.
```js
// Deprecated
systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ })
systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ })
// Replace with
nativeTheme.on('updated', () => { /* ... */ })
```
### Deprecated: methods in `systemPreferences`
The following `systemPreferences` methods have been deprecated:
* `systemPreferences.isDarkMode()`
* `systemPreferences.isInvertedColorScheme()`
* `systemPreferences.isHighContrastColorScheme()`
Use the following `nativeTheme` properties instead:
* `nativeTheme.shouldUseDarkColors`
* `nativeTheme.shouldUseInvertedColorScheme`
* `nativeTheme.shouldUseHighContrastColors`
```js
// Deprecated
systemPreferences.isDarkMode()
// Replace with
nativeTheme.shouldUseDarkColors
// Deprecated
systemPreferences.isInvertedColorScheme()
// Replace with
nativeTheme.shouldUseInvertedColorScheme
// Deprecated
systemPreferences.isHighContrastColorScheme()
// Replace with
nativeTheme.shouldUseHighContrastColors
```
## Planned Breaking API Changes (7.0)
### Deprecated: Atom.io Node Headers URL
@@ -491,6 +731,55 @@ 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)).
### API Changed: Callback-based versions of promisified APIs
Electron 5 and Electron 6 introduced Promise-based versions of existing
asynchronous APIs and deprecated their older, callback-based counterparts.
In Electron 7, all deprecated callback-based APIs are now removed.
These functions now only return Promises:
* `app.getFileIcon()` [#15742](https://github.com/electron/electron/pull/15742)
* `app.dock.show()` [#16904](https://github.com/electron/electron/pull/16904)
* `contentTracing.getCategories()` [#16583](https://github.com/electron/electron/pull/16583)
* `contentTracing.getTraceBufferUsage()` [#16600](https://github.com/electron/electron/pull/16600)
* `contentTracing.startRecording()` [#16584](https://github.com/electron/electron/pull/16584)
* `contentTracing.stopRecording()` [#16584](https://github.com/electron/electron/pull/16584)
* `contents.executeJavaScript()` [#17312](https://github.com/electron/electron/pull/17312)
* `cookies.flushStore()` [#16464](https://github.com/electron/electron/pull/16464)
* `cookies.get()` [#16464](https://github.com/electron/electron/pull/16464)
* `cookies.remove()` [#16464](https://github.com/electron/electron/pull/16464)
* `cookies.set()` [#16464](https://github.com/electron/electron/pull/16464)
* `debugger.sendCommand()` [#16861](https://github.com/electron/electron/pull/16861)
* `dialog.showCertificateTrustDialog()` [#17181](https://github.com/electron/electron/pull/17181)
* `inAppPurchase.getProducts()` [#17355](https://github.com/electron/electron/pull/17355)
* `inAppPurchase.purchaseProduct()`[#17355](https://github.com/electron/electron/pull/17355)
* `netLog.stopLogging()` [#16862](https://github.com/electron/electron/pull/16862)
* `session.clearAuthCache()` [#17259](https://github.com/electron/electron/pull/17259)
* `session.clearCache()` [#17185](https://github.com/electron/electron/pull/17185)
* `session.clearHostResolverCache()` [#17229](https://github.com/electron/electron/pull/17229)
* `session.clearStorageData()` [#17249](https://github.com/electron/electron/pull/17249)
* `session.getBlobData()` [#17303](https://github.com/electron/electron/pull/17303)
* `session.getCacheSize()` [#17185](https://github.com/electron/electron/pull/17185)
* `session.resolveProxy()` [#17222](https://github.com/electron/electron/pull/17222)
* `session.setProxy()` [#17222](https://github.com/electron/electron/pull/17222)
* `shell.openExternal()` [#16176](https://github.com/electron/electron/pull/16176)
* `webContents.loadFile()` [#15855](https://github.com/electron/electron/pull/15855)
* `webContents.loadURL()` [#15855](https://github.com/electron/electron/pull/15855)
* `webContents.hasServiceWorker()` [#16535](https://github.com/electron/electron/pull/16535)
* `webContents.printToPDF()` [#16795](https://github.com/electron/electron/pull/16795)
* `webContents.savePage()` [#16742](https://github.com/electron/electron/pull/16742)
* `webFrame.executeJavaScript()` [#17312](https://github.com/electron/electron/pull/17312)
* `webFrame.executeJavaScriptInIsolatedWorld()` [#17312](https://github.com/electron/electron/pull/17312)
* `webviewTag.executeJavaScript()` [#17312](https://github.com/electron/electron/pull/17312)
* `win.capturePage()` [#15743](https://github.com/electron/electron/pull/15743)
These functions now have two forms, synchronous and Promise-based asynchronous:
* `dialog.showMessageBox()`/`dialog.showMessageBoxSync()` [#17298](https://github.com/electron/electron/pull/17298)
* `dialog.showOpenDialog()`/`dialog.showOpenDialogSync()` [#16973](https://github.com/electron/electron/pull/16973)
* `dialog.showSaveDialog()`/`dialog.showSaveDialogSync()` [#17054](https://github.com/electron/electron/pull/17054)
## Planned Breaking API Changes (6.0)
### API Changed: `win.setMenu(null)` is now `win.removeMenu()`
@@ -502,19 +791,6 @@ win.setMenu(null)
win.removeMenu()
```
### API Changed: `contentTracing.getTraceBufferUsage()` is now a promise
```js
// Deprecated
contentTracing.getTraceBufferUsage((percentage, value) => {
// do something
})
// Replace with
contentTracing.getTraceBufferUsage().then(infoObject => {
// infoObject has percentage and value fields
})
```
### API Changed: `electron.screen` in the renderer process should be accessed via `remote`
```js
@@ -653,6 +929,31 @@ webFrame.setSpellCheckProvider('en-US', {
})
```
### API Changed: `webContents.getZoomLevel` and `webContents.getZoomFactor` are now synchronous
`webContents.getZoomLevel` and `webContents.getZoomFactor` no longer take callback parameters,
instead directly returning their number values.
```js
// Deprecated
webContents.getZoomLevel((level) => {
console.log(level)
})
// Replace with
const level = webContents.getZoomLevel()
console.log(level)
```
```js
// Deprecated
webContents.getZoomFactor((factor) => {
console.log(factor)
})
// Replace with
const factor = webContents.getZoomFactor()
console.log(factor)
```
## Planned Breaking API Changes (4.0)
The following list includes the breaking API changes made in Electron 4.0.

View File

@@ -1,6 +1,8 @@
# Build Instructions
Follow the guidelines below for building Electron.
Follow the guidelines below for building **Electron itself**, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
[application-distribution]: ../tutorial/application-distribution.md
## Platform prerequisites
@@ -86,8 +88,6 @@ $ gclient sync -f
```sh
$ cd src
$ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
# this next line is needed only if building with sccache
$ export GN_EXTRA_ARGS="${GN_EXTRA_ARGS} cc_wrapper=\"${PWD}/electron/external_binaries/sccache\""
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") $GN_EXTRA_ARGS"
```
@@ -141,12 +141,6 @@ This will build all of what was previously 'libchromiumcontent' (i.e. the
`content/` directory of `chromium` and its dependencies, incl. WebKit and V8),
so it will take a while.
To speed up subsequent builds, you can use [sccache][sccache]. Add the GN arg
`cc_wrapper = "sccache"` by running `gn args out/Testing` to bring up an
editor and adding a line to the end of the file.
[sccache]: https://github.com/mozilla/sccache
The built executable will be under `./out/Testing`:
```sh
@@ -189,7 +183,6 @@ Not all combinations of source and target CPU/OS are supported by Chromium.
| Windows x64 | Windows x86 | Automatically tested |
| Linux x64 | Linux x86 | Automatically tested |
If you test other combinations and find them to work, please update this document :)
See the GN reference for allowable values of [`target_os`][target_os values]

View File

@@ -1,6 +1,8 @@
# Build Instructions (Linux)
Follow the guidelines below for building Electron on Linux.
Follow the guidelines below for building **Electron itself** on Linux, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
[application-distribution]: ../tutorial/application-distribution.md
## Prerequisites
@@ -55,6 +57,15 @@ $ sudo dnf install clang dbus-devel gtk3-devel libnotify-devel \
nss-devel python-dbusmock openjdk-8-jre
```
On Arch Linux / Manjaro, install the following libraries:
```sh
$ sudo pacman -Syu base-devel clang libdbus gtk2 libnotify \
libgnome-keyring alsa-lib libcap libcups libxtst \
libxss nss gcc-multilib curl gperf bison \
python2 python-dbusmock jdk8-openjdk
```
Other distributions may offer similar packages for installation via package
managers such as pacman. Or one can compile from source code.

View File

@@ -1,6 +1,8 @@
# Build Instructions (macOS)
Follow the guidelines below for building Electron on macOS.
Follow the guidelines below for building **Electron itself** on macOS, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
[application-distribution]: ../tutorial/application-distribution.md
## Prerequisites
@@ -42,7 +44,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 12.2](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip), and the macOS 11.0 SDK. Building with a newer SDK works too, but the releases currently use the 11.0 SDK.
## Building Electron

View File

@@ -1,6 +1,8 @@
# Build Instructions (Windows)
Follow the guidelines below for building Electron on Windows.
Follow the guidelines below for building **Electron itself** on Windows, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
[application-distribution]: ../tutorial/application-distribution.md
## Prerequisites

View File

@@ -10,12 +10,12 @@ files, you need to have built Electron so that it knows which compiler flags
were used. There is one required option for the script `--output-dir`, which
tells the script which build directory to pull the compilation information
from. A typical usage would be:
`npm run lint:clang-tiy --out-dir ../out/Testing`
`npm run lint:clang-tidy --out-dir ../out/Testing`
With no filenames provided, all C/C++/Objective-C files will be checked.
You can provide a list of files to be checked by passing the filenames after
the options:
`npm run lint:clang-tiy --out-dir ../out/Testing shell/browser/api/electron_api_app.cc`
`npm run lint:clang-tidy --out-dir ../out/Testing shell/browser/api/electron_api_app.cc`
While `clang-tidy` has a
[long list](https://clang.llvm.org/extra/clang-tidy/checks/list.html)

View File

@@ -25,7 +25,7 @@ You can run `npm run lint` to show any style issues detected by `cpplint` and
## C++ and Python
For C++ and Python, we follow Chromium's [Coding
Style](https://www.chromium.org/developers/coding-style). You can use
Style](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/styleguide/styleguide.md). You can use
[clang-format](clang-format.md) to format the C++ code automatically. There is
also a script `script/cpplint.py` to check whether all files conform.
@@ -66,11 +66,11 @@ formatted correctly.
Electron APIs uses the same capitalization scheme as Node.js:
- When the module itself is a class like `BrowserWindow`, use `PascalCase`.
- When the module is a set of APIs, like `globalShortcut`, use `camelCase`.
- When the API is a property of object, and it is complex enough to be in a
* When the module itself is a class like `BrowserWindow`, use `PascalCase`.
* When the module is a set of APIs, like `globalShortcut`, use `camelCase`.
* When the API is a property of object, and it is complex enough to be in a
separate chapter like `win.webContents`, use `mixedCase`.
- For other non-module APIs, use natural titles, like `<webview> Tag` or
* For other non-module APIs, use natural titles, like `<webview> Tag` or
`Process Object`.
When creating a new API, it is preferred to use getters and setters instead of

View File

@@ -35,46 +35,8 @@ To submit a bug report:
When opening a new issue in the [`electron/electron` issue tracker](https://github.com/electron/electron/issues/new/choose), users
will be presented with a template that should be filled in.
```markdown
<!--
Thanks for opening an issue! A few things to keep in mind:
- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->
* Electron version:
* Operating system:
### Expected behavior
<!-- What do you think should happen? -->
### Actual behavior
<!-- What actually happens? -->
### How to reproduce
<!--
Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.
You can fork https://github.com/electron/electron-quick-start and include a link to the branch with your changes.
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
-->
```
If you believe that you have found a bug in Electron, please fill out this
form to the best of your ability.
If you believe that you have found a bug in Electron, please fill out the template
to the best of your ability.
The two most important pieces of information needed to evaluate the report are
a description of the bug and a simple test case to recreate it. It is easier to fix

View File

@@ -36,9 +36,9 @@ $ 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 Linux](https://electronjs.org/docs/development/build-instructions-linux)
* [Building on Windows](https://electronjs.org/docs/development/build-instructions-windows)
* [Building on macOS](build-instructions-macos.md)
* [Building on Linux](build-instructions-linux.md)
* [Building on Windows](build-instructions-windows.md)
Once you've built the project locally, you're ready to start making changes!
@@ -63,7 +63,7 @@ or tests in the `spec/` folder.
Please be sure to run `npm run lint` from time to time on any code changes
to ensure that they follow the project's code style.
See [coding style](https://electronjs.org/docs/development/coding-style) for
See [coding style](coding-style.md) for
more information about best practice when modifying code in different parts of
the project.
@@ -91,29 +91,29 @@ Before a pull request can be merged, it **must** have a pull request title with
Examples of commit messages with semantic prefixes:
- `fix: don't overwrite prevent_default if default wasn't prevented`
- `feat: add app.isPackaged() method`
- `docs: app.isDefaultProtocolClient is now available on Linux`
* `fix: don't overwrite prevent_default if default wasn't prevented`
* `feat: add app.isPackaged() method`
* `docs: app.isDefaultProtocolClient is now available on Linux`
Common prefixes:
- fix: A bug fix
- feat: A new feature
- docs: Documentation changes
- test: Adding missing tests or correcting existing tests
- build: Changes that affect the build system
- ci: Changes to our CI configuration files and scripts
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (linting)
- vendor: Bumping a dependency like libchromiumcontent or node
* fix: A bug fix
* feat: A new feature
* docs: Documentation changes
* test: Adding missing tests or correcting existing tests
* build: Changes that affect the build system
* ci: Changes to our CI configuration files and scripts
* perf: A code change that improves performance
* refactor: A code change that neither fixes a bug nor adds a feature
* style: Changes that do not affect the meaning of the code (linting)
* vendor: Bumping a dependency like libchromiumcontent or node
Other things to keep in mind when writing a commit message:
1. The first line should:
- contain a short description of the change (preferably 50 characters or less,
* contain a short description of the change (preferably 50 characters or less,
and no more than 72 characters)
- be entirely in lowercase with the exception of proper nouns, acronyms, and
* be entirely in lowercase with the exception of proper nouns, acronyms, and
the words that refer to code, like function/variable names
2. Keep the second line blank.
3. Wrap all other lines at 72 columns.
@@ -144,7 +144,7 @@ master.
### Step 7: Test
Bug fixes and features should always come with tests. A
[testing guide](https://electronjs.org/docs/development/testing) has been
[testing guide](testing.md) has been
provided to make the process easier. Looking at other tests to see how they
should be structured can also help.

View File

@@ -100,7 +100,5 @@ script/ - The set of all scripts Electron runs for a variety of purposes.
└── uploaders/ - Uploads various release-related files during release.
```
* **tools** - Helper scripts used by GN files.
* Scripts put here should never be invoked by users directly, unlike those in `script`.
* **typings** - TypeScript typings for Electron's internal code.
* **vendor** - Source code for some third party dependencies.

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>Drag the boxes below to somewhere in your OS (Finder/Explorer, Desktop, etc.) to copy an example markdown file.</p>
<div style="border:2px solid black;border-radius:3px;padding:5px;display:inline-block" draggable="true" id="drag1">Drag me - File 1</div>
<div style="border:2px solid black;border-radius:3px;padding:5px;display:inline-block" draggable="true" id="drag2">Drag me - File 2</div>
<script src="renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,48 @@
const { app, BrowserWindow, ipcMain, nativeImage, NativeImage } = require('electron')
const path = require('path')
const fs = require('fs')
const https = require('https')
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
}
const iconName = path.join(__dirname, 'iconForDragAndDrop.png');
const icon = fs.createWriteStream(iconName);
// Create a new file to copy - you can also copy existing files.
fs.writeFileSync(path.join(__dirname, 'drag-and-drop-1.md'), '# First file to test drag and drop')
fs.writeFileSync(path.join(__dirname, 'drag-and-drop-2.md'), '# Second file to test drag and drop')
https.get('https://img.icons8.com/ios/452/drag-and-drop.png', (response) => {
response.pipe(icon);
});
app.whenReady().then(createWindow)
ipcMain.on('ondragstart', (event, filePath) => {
event.sender.startDrag({
file: path.join(__dirname, filePath),
icon: iconName,
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,8 @@
const { contextBridge, ipcRenderer } = require('electron')
const path = require('path')
contextBridge.exposeInMainWorld('electron', {
startDrag: (fileName) => {
ipcRenderer.send('ondragstart', fileName)
}
})

View File

@@ -0,0 +1,9 @@
document.getElementById('drag1').ondragstart = (event) => {
event.preventDefault()
window.electron.startDrag('drag-and-drop-1.md')
}
document.getElementById('drag2').ondragstart = (event) => {
event.preventDefault()
window.electron.startDrag('drag-and-drop-2.md')
}

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>Hit Alt+Ctrl+I on Windows or Opt+Cmd+I on Mac to see a message printed to the console.</p>
</body>
</html>

View File

@@ -0,0 +1,28 @@
const { app, BrowserWindow, globalShortcut } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
globalShortcut.register('Alt+CommandOrControl+I', () => {
console.log('Electron loves global shortcuts!')
})
}).then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>Hit Ctrl+I to see a message printed to the console.</p>
</body>
</html>

View File

@@ -0,0 +1,13 @@
const { app, BrowserWindow } = require('electron')
app.whenReady().then(() => {
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadFile('index.html')
win.webContents.on('before-input-event', (event, input) => {
if (input.control && input.key.toLowerCase() === 'i') {
console.log('Pressed Control+I')
event.preventDefault()
}
})
})

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>Hit Alt+Shift+I on Windows, or Opt+Cmd+I on mac to see a message printed to the console.</p>
</body>
</html>

View File

@@ -0,0 +1,36 @@
const { app, BrowserWindow, Menu, MenuItem } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
})
win.loadFile('index.html')
}
const menu = new Menu()
menu.append(new MenuItem({
label: 'Electron',
submenu: [{
role: 'help',
accelerator: process.platform === 'darwin' ? 'Alt+Cmd+I' : 'Alt+Shift+I',
click: () => { console.log('Electron rocks!') }
}]
}))
Menu.setApplicationMenu(menu)
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<p>Hit any key with this window focused to see it captured here.</p>
<div><span>Last Key Pressed: </span><span id="last-keypress"></span></div>
<script src="./renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,35 @@
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
}
// 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()
app.on('activate', function () {
// On macOS 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 (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

View File

@@ -0,0 +1,7 @@
function handleKeyPress (event) {
// You can put code here to handle the keypress.
document.getElementById("last-keypress").innerText = event.key
console.log(`You pressed ${event.key}`)
}
window.addEventListener('keyup', handleKeyPress, true)

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<p>Current theme source: <strong id="theme-source">System</strong></p>
<button id="toggle-dark-mode">Toggle Dark Mode</button>
<button id="reset-to-system">Reset to System Theme</button>
<script src="renderer.js"></script>
</body>
</body>
</html>

View File

@@ -0,0 +1,43 @@
const { app, BrowserWindow, ipcMain, nativeTheme } = require('electron')
const path = require('path')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
ipcMain.handle('dark-mode:toggle', () => {
if (nativeTheme.shouldUseDarkColors) {
nativeTheme.themeSource = 'light'
} else {
nativeTheme.themeSource = 'dark'
}
return nativeTheme.shouldUseDarkColors
})
ipcMain.handle('dark-mode:system', () => {
nativeTheme.themeSource = 'system'
})
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})

View File

@@ -0,0 +1,6 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('darkMode', {
toggle: () => ipcRenderer.invoke('dark-mode:toggle'),
system: () => ipcRenderer.invoke('dark-mode:system')
})

View File

@@ -0,0 +1,9 @@
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
const isDarkMode = await window.darkMode.toggle()
document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'
})
document.getElementById('reset-to-system').addEventListener('click', async () => {
await window.darkMode.system()
document.getElementById('theme-source').innerHTML = 'System'
})

View File

@@ -0,0 +1,7 @@
@media (prefers-color-scheme: dark) {
body { background: #333; color: white; }
}
@media (prefers-color-scheme: light) {
body { background: #ddd; color: black; }
}

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>Right click the dock icon to see the custom menu options.</p>
</body>
</html>

View File

@@ -0,0 +1,42 @@
const { app, BrowserWindow, Menu } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
})
win.loadFile('index.html')
}
const dockMenu = Menu.buildFromTemplate([
{
label: 'New Window',
click () { console.log('New Window') }
}, {
label: 'New Window with Settings',
submenu: [
{ label: 'Basic' },
{ label: 'Pro' }
]
},
{ label: 'New Command...' }
])
app.whenReady().then(() => {
if (process.platform === 'darwin') {
app.dock.setMenu(dockMenu)
}
}).then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>After launching this application, you should see the system notification.</p>
</body>
</html>

View File

@@ -0,0 +1,31 @@
const { app, BrowserWindow, Notification } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.loadFile('index.html')
}
const NOTIFICATION_TITLE = 'Basic Notification'
const NOTIFICATION_BODY = 'Notification from the Main process'
function showNotification () {
new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
}
app.whenReady().then(createWindow).then(showNotification)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>After launching this application, you should see the system notification.</p>
<p id="output">Click it to see the effect in this interface.</p>
<script src="renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,24 @@
const { app, BrowserWindow } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,6 @@
const NOTIFICATION_TITLE = 'Title'
const NOTIFICATION_BODY = 'Notification from the Renderer process. Click to log to console.'
const CLICK_MESSAGE = 'Notification clicked!'
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY })
.onclick = () => document.getElementById("output").innerText = CLICK_MESSAGE

View File

@@ -0,0 +1,29 @@
const { app, BrowserWindow } = require('electron')
const fs = require('fs')
const path = require('path')
app.disableHardwareAcceleration()
let win
app.whenReady().then(() => {
win = new BrowserWindow({ webPreferences: { offscreen: true } })
win.loadURL('https://github.com')
win.webContents.on('paint', (event, dirty, image) => {
fs.writeFileSync('ex.png', image.toPNG())
})
win.webContents.setFrameRate(60)
console.log(`The screenshot has been successfully saved to ${path.join(process.cwd(), 'ex.png')}`)
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Connection status: <strong id='status'></strong></h1>
<script src="renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,26 @@
const { app, BrowserWindow } = require('electron')
function createWindow () {
const onlineStatusWindow = new BrowserWindow({
width: 300,
height: 200
})
onlineStatusWindow.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})

View File

@@ -0,0 +1,8 @@
function onlineStatusIndicator () {
document.getElementById('status').innerHTML = navigator.onLine ? 'online' : 'offline'
}
window.addEventListener('online', onlineStatusIndicator)
window.addEventListener('offline', onlineStatusIndicator)
onlineStatusIndicator()

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
<p>Keep an eye on the dock (Mac) or taskbar (Windows, Unity) for this application!</p>
<p>It should indicate a progress that advances from 0 to 100%.</p>
<p>It should then show indeterminate (Windows) or pin at 100% (other operating systems)
briefly and then loop.</p>
</body>
</html>

View File

@@ -0,0 +1,48 @@
const { app, BrowserWindow } = require('electron')
let progressInterval
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.loadFile('index.html')
const INCREMENT = 0.03
const INTERVAL_DELAY = 100 // ms
let c = 0
progressInterval = setInterval(() => {
// update progress bar to next value
// values between 0 and 1 will show progress, >1 will show indeterminate or stick at 100%
win.setProgressBar(c)
// increment or reset progress bar
if (c < 2) {
c += INCREMENT
} else {
c = (-INCREMENT * 5) // reset to a bit less than 0 to show reset state
}
}, INTERVAL_DELAY)
}
app.whenReady().then(createWindow)
// before the app is terminated, clear both timers
app.on('before-quit', () => {
clearInterval(progressInterval)
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

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