Compare commits

...

338 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
c3d8337058 Bump v13.2.0 2021-08-17 01:25:11 -07:00
trop[bot]
b3eff8ef13 fix: handle nullish WebContentsView in UpdateDraggableRegions (#30557)
* fix: handle nullish WebContentsView in UpdateDraggableRegions

* build: nogncheck on webcontentsimpl include

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-08-17 01:23:26 -07:00
trop[bot]
6cef0d9118 fix: disable kWindowCaptureMacV2 for desktopCapturer (#30523)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-08-16 12:25:07 -07:00
trop[bot]
65d03deacd docs: uniformize tutorial titles (#30546)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-08-16 14:08:33 -04:00
trop[bot]
39e55225a0 docs: clarify usage of option (#30548)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-08-16 14:06:54 -04:00
Steven Barbaro
bb83758378 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>
2021-08-13 09:42:51 +09:00
trop[bot]
2716a25fcf feat: expose des-ede3 cipher (#30453)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-08-12 11:48:54 -07:00
Keeley Hammond
2745d70d25 fix: explicitly define REFGUID from ::GUID&, not base::GUID (#30442) (#30500)
* fix: explicitly define REFGUID from ::GUID&

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

* fix: duplicate GUID_NULL symbol, add comment
2021-08-11 15:07:59 -07:00
trop[bot]
b6ffa799c5 docs: add missing <webview> event documentation (#30465)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-08-11 09:44:29 +09:00
trop[bot]
c9bb6cd134 docs: fix camelcase in menu example (#30461)
* docs: fix camelcase in menu example and add hint to deal with TS error

hideothers -> hideOthers (the TS compiler caught this)
The TypeScript compiler also did not like the pattern used to
switch between platforms for submenus was loosing the type information
of the literal constants and generalized them as strings which
conflicts with the type definition of MenuItemConstructorOptions.

* docs: Fix spelling, added hint to TypeScript

Without explicitly stating the type for the const template TypeScript does not create a
with the correct shape due to generalization to strings.

* remove ts hints

Co-authored-by: a@b <a@b>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-08-11 09:39:32 +09:00
trop[bot]
ac2515dd0d chore: more crash-keys for gin::Wrappable debugging (#30421)
* chore: more crash-keys for gin::Wrappable debugging

* fix namespace for Event

* Update crash_keys.cc

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-08-10 09:50:46 +09:00
Sudowoodo Release Bot
49436f298b Bump v13.1.9 2021-08-09 16:03:12 -07:00
Sudowoodo Release Bot
542874d13b Revert "Bump v13.1.9"
This reverts commit 2a8e1a6de1.
2021-08-09 16:01:53 -07:00
Sudowoodo Release Bot
2a8e1a6de1 Bump v13.1.9 2021-08-09 16:00:57 -07:00
trop[bot]
f5bffae462 build: rebase release branch before reverting bump (#30418)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-08-09 09:54:52 +02:00
Steven Barbaro
9f80f4aa76 chore: cherry-pick e2123a8e0943 from chromium (#30452)
* chore: cherry-pick e2123a8e0943 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-09 09:50:39 +02:00
Cheng Zhao
736150672c fix: move window buttons in-place on macOS (#30393) 2021-08-09 16:00:43 +09:00
trop[bot]
7434547d97 build: fix building with enable_desktop_capturer = false (#30390)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-08-04 09:56:26 +09:00
Electron Bot
0436a27d4f Bump v13.1.8 2021-08-03 10:22:52 -07:00
trop[bot]
6627bebdbd fix: use contentAspectRatio not aspectRatio (#30330)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-02 09:59:14 +09:00
trop[bot]
4a24a28467 fix: guard against missing native view (#30326)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-02 09:57:25 +09:00
trop[bot]
390ed798f0 build: set the export goma auth fallback flag for the control process (#30317)
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-08-02 09:56:26 +09:00
trop[bot]
cdd2176bb6 chore: update deps (#30345)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-07-30 14:56:22 -07:00
Pedro Pontes
e57b74858f chore: cherry-pick 1168f81092 from sqlite (#30294)
* 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:50 +09:00
Robo
3805e3c0fc fix: update traffic lights position for macOS 11 (#30319)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-29 21:15:47 +09:00
trop[bot]
5fb34249c6 chore: add additional crash key to gin::Wrappable (#30224)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-29 19:46:47 +09:00
trop[bot]
06997edc3a chore: update publish to npm to use GitHub token (#30290)
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:24:55 -07:00
Pedro Pontes
e2b961d73c chore: cherry-pick e38d55313ad9 from v8 (#30246)
* chore: cherry-pick e38d55313ad9 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-28 15:56:40 +02:00
Pedro Pontes
867ea38cd0 chore: cherry-pick ac9dc1235e28 from chromium (#30265)
* chore: cherry-pick ac9dc1235e28 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-28 15:56:13 +02:00
trop[bot]
2e8f2a2f51 docs: update default branch for Electron Packager API links (#30187)
Co-authored-by: Mark Lee <electronjs@lazymalevolence.com>
2021-07-27 09:17:16 +09:00
trop[bot]
4da1162ffe fix: allow colored tray titles when font type is specified (#30163)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-27 09:14:51 +09:00
Pedro Pontes
9d3ebb1888 chore: cherry-pick cd98d7c0dae9 from chromium (#30251)
* 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:18 +09:00
trop[bot]
0b8971dec2 fix: increase stack size on windows x86 (#30241)
* 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:47:16 +09:00
Cheng Zhao
c8ab43a766 fix: pressing ESC should exit fullscreen from webview (#30128) 2021-07-26 17:34:04 +09:00
Jeremy Rose
64c6737bb2 chore: cherry-pick 5487040a284a from chromium (#30203) 2021-07-22 10:14:14 -07:00
Pedro Pontes
30b6330189 chore: cherry-pick e60cc80ff744 from chromium (#30229)
* chore: cherry-pick e60cc80ff744 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-22 11:08:12 -04:00
trop[bot]
177bdd207c build: handle release failure by existing with code 1 (#30221)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-07-21 11:15:06 -04:00
electron-roller[bot]
77fbad0333 chore: bump chromium to 91.0.4472.164 (13-x-y) (#30169)
* chore: bump chromium in DEPS to 91.0.4472.164

* chore: update patches

* fix DEPS

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-21 09:34:32 -04:00
Electron Bot
971ec77b96 Bump v13.1.7 2021-07-15 10:15:20 -07:00
trop[bot]
1b0c15f742 fix: double traffic lights on exit fullscreen (#30149)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-15 15:25:09 +09:00
trop[bot]
52cddbcd92 docs: add <webview> 'did-attach' event documentation (#30129)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-07-15 10:40:33 +09:00
trop[bot]
6d0feb8b79 docs: fix fiddle path (#30144)
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-14 17:51:08 -04:00
trop[bot]
2e096ac6bc fix: adjust initial webContents focus calculation (#29234)
* fix: adjust initial webContents focus calculation

* fix: active window check on mac

* fix: about:blank focus behavior

* chore: add spec

* fix: window ordering on mac

* chore: focus <webview> after navigation

* chore: fix flaky fullscreen inheritance test

* chore: disable fullscreen test on mac arm

* chore: simplify found-in-page spec

* chore: fix lint

* chore: move found-in-page spec to main process

* chore: fix lint

* chore: remove focus workaround

* chore: improve found-in-page spec

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-07-14 11:03:01 -07:00
trop[bot]
3afe390805 chore: update releases to 8 weeks in CONTRIBUTING (#30119)
* chore: update releases to 8 weeks in CONTRIBUTING

* chore: update support.md for four version support

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-07-14 08:09:55 -07:00
trop[bot]
d5097dd2e6 docs: Update timeline for E15 alpha announcement (#30117)
* docs: Update timeline for E15 alpha announcement

* fix line break

Co-authored-by: Sofia Nguy <sofianguy@gmail.com>
2021-07-14 08:09:28 -07:00
trop[bot]
257b214cb5 docs: update quick-start.md (#30133)
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:30 +09:00
Jeremy Rose
945ecdd709 fix: crash when invoking login callback synchronously (#30068) (#30091) 2021-07-14 20:48:16 +09:00
trop[bot]
cb614d15aa build: decode error output as utf8 (#30094)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-14 20:46:39 +09:00
trop[bot]
5fbcee074d fix: return RGBA values from getSystemColor (#30088)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-14 20:46:08 +09:00
trop[bot]
dc14161a98 test: disable failing node tests (#30098)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-13 09:05:14 -07:00
trop[bot]
299fa3a3c4 chore: cherry-pick 9bab573a37 from chromium (#30100)
* chore: cherry-pick 9bab573a37 from chromium

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

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-12 22:07:50 -07:00
trop[bot]
d09e7f851b docs: modernize protocol-handler docs (#30057)
* 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:36:51 -04:00
Shelley Vohr
84eea6fa79 fix: fsPromises.readFile renderer crash (#29928) 2021-07-06 10:36:31 +09:00
trop[bot]
0cd80cd424 docs: remove requestHeaders in webRequest.onHeadersReceived (#29933)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-07-06 10:34:58 +09:00
trop[bot]
78f037f639 fix: honor user-defined Downloads directory (#29968)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-05 15:53:55 -04:00
trop[bot]
fc75bf0a9e fix: webview should maximize on requestFullscreen (#29987)
* fix: webview should maximize on requestFullscreen

* 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 14:36:39 -04:00
Electron Bot
ddc44e1af4 Bump v13.1.6 2021-07-05 11:12:13 -07:00
trop[bot]
5ab2749acc fix: do not leak NSUUID (#30009)
* fix: do not leak NSUUID

* Fix build error

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-05 12:53:04 -04:00
trop[bot]
642c458c31 docs: remove Experimental from contextBridge.exposeInMainWorld (#30010)
The API has been around for about 3 years. It should no longer be
considered experimental.

Co-authored-by: Antón Molleda <amolleda@gmail.com>
2021-07-05 15:28:56 +09:00
trop[bot]
2195890a46 fix: self.module.paths not working in web workers (#30013)
* 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:20 +09:00
Samuel Attard
3413e89572 chore: cherry-pick cc20b36a5845 from chromium (#29997)
* chore: cherry-pick cc20b36a5845 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-07-05 08:45:52 +09:00
trop[bot]
7bf69ce4ee docs: remove mention of node-mac-notifier (#30002)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-05 08:44:20 +09:00
trop[bot]
49f5006ef0 fix: crash when clicking links with target=_blank from webview (#29951)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-07-01 19:57:59 -07:00
trop[bot]
fea59c5601 fix: correctly propagate title updates for window with no navigation entries (#29958)
* 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:58 +09:00
trop[bot]
6feed17387 fix: potential crash on macOS app exit (#29961)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-02 08:43:22 +09:00
Electron Bot
ec0fa836d2 Bump v13.1.5 2021-07-01 11:36:42 -07:00
trop[bot]
56a34d3b10 build: add support for spawning builds for a specific commit on appveyor (#29971) (#29983)
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-07-01 10:53:33 -07:00
Shelley Vohr
bde3d403a8 fix: child window alwaysOnTop level persistence (#29956) 2021-07-01 10:22:37 -04:00
John Kleinschmidt
8779a3ac0f ci: fixup arm testing (#29927)
* ci: fixup arm testing

* update patch for 13-x-y

* also check against kPartitionAllocPCScan
2021-06-30 14:12:47 -04:00
Omar Kilani
b465ee721e fix: geolocation crashes electron on macOS (#29343) (#29912) 2021-06-28 20:31:04 -07:00
trop[bot]
50b0750df3 docs: fix broken markdown in dialog.md (#29848)
* docs: fix broken markdown in dialog.md

* &#32;

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-06-29 09:15:47 +09:00
electron-roller[bot]
1a3da54563 chore: bump chromium to 91.0.4472.124 (13-x-y) (#29774)
* chore: bump chromium in DEPS to 91.0.4472.114

* chore: bump chromium in DEPS to 91.0.4472.124

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2021-06-28 14:06:13 -04:00
trop[bot]
fa3767564a fix: stop window.open from hanging when prevented (#29882)
* fix: stop window.open from hanging when prevented

* add test

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-28 15:24:18 +09:00
trop[bot]
85db7e7077 fix: properly order out child windows (#29888)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-25 17:55:45 +09:00
trop[bot]
9b1d2d5b88 fix: Inspector method overrides when contextIsolation enabled (#29885)
* fix: Inspector method overrides when contextIsolation enabled

* fix: handle DevToolsAPI call

* refactor: always use webFrame.executeJavaScript

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-25 17:50:39 +09:00
trop[bot]
e8621de3f5 fix: properly handle optional requestHeaders with onBeforeSendHeaders (#29836)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-23 10:09:25 +09:00
Electron Bot
9942b2ba80 Bump v13.1.4 2021-06-22 10:20:05 -07:00
trop[bot]
2bf125f82a fix: allow ppapi processes access to resource bundle on all platforms (#29830)
* wip: debug resource bundle failure

* fix: include ppapi subprocesses for windows resource bundle

* fix: allow ppapi plugin processes access to resource bundle on all platforms.

Aligns with chrome_main_delegate here: https://chromium-review.googlesource.com/c/chromium/src/+/2619003

* chore: remove incorrectly backported patches

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-06-22 14:59:06 +09:00
John Kleinschmidt
69493ac51e ci: run linux arm tests on CircleCI (#29766)
* ci: run linux arm tests on CircleCI

* cleanup electron dirs after testing

(cherry picked from commit 1c0a6045fb)

* use start-stop-daemon to kill Xvfb

(cherry picked from commit 1d10a68c31)
2021-06-22 14:58:07 +09:00
Electron Bot
6504c4bbc8 Bump v13.1.3 2021-06-21 10:03:02 -07:00
trop[bot]
5c1e1ee5ec fix: do not cancel CORS preflight request on proxy auth. (#29811)
* 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:05 +09:00
trop[bot]
f39ac0764d fix: update Squirel.Mac to fix CPU spin during update (#29805)
* fix: update Squirel.Mac to fix CPU spin during update

Refs: https://github.com/Squirrel/Squirrel.Mac/pull/259
Closes: #29119

* chore: update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-21 19:06:06 +09:00
trop[bot]
252805ddb4 fix: microtasks policy in CreateEnvironment (#29808)
* 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 15:49:17 +09:00
trop[bot]
df27597c05 docs: fix frontmatter for Tray tutorial (#29803)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-06-21 14:00:25 +09:00
trop[bot]
fa683ef8b7 fix: fix hover state not clear bug when BrowserWindow is not resizable (#611) (#29800)
Co-authored-by: sssooonnnggg <sssooonnnggg111@gmail.com>
2021-06-21 13:59:36 +09:00
trop[bot]
16b09a676f docs: clarify use of ELECTRON_SKIP_BINARY_DOWNLOAD (#29745)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-06-21 10:10:05 +09:00
George Xu
301108ece4 docs: Add clarification for Visual Zoom behavior (#28860) (#29764)
* Add clarification for visual zoom documentation

Co-authored-by: Michael Kozakov <michael.kozakov@snapchat.com>
2021-06-18 11:02:42 -07:00
Keeley Hammond
5d36cdf485 fix: color select eyedropper not working within DevTools (#29729) (#29760)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-18 11:34:03 +02:00
George Xu
c94ab729dd docs: added guide and updated docs for Tray (#29385) (#29762)
* docs: added guide and updated docs for Tray

* docs: improve clarity
2021-06-17 14:03:07 -07:00
trop[bot]
b35f904e58 fix: ensure detached devtools are not always draggable (#29737)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-06-17 15:29:27 +09:00
trop[bot]
b143042c7f fix: draggable regions with devtools open (#29734)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-17 15:21:27 +09:00
trop[bot]
10c238c0ea fix: potential crash when setting vibrancy (#29722)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-06-17 15:20:05 +09:00
trop[bot]
ad2f34491c fix setWindowOpenHandler call syntax (#29726)
Co-authored-by: kdau <kevin@kdau.com>
2021-06-16 10:13:02 -07:00
electron-roller[bot]
d6c51bc456 chore: bump chromium in DEPS to 91.0.4472.106 (#29700)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2021-06-15 13:23:07 -07:00
trop[bot]
f313d00083 docs: update WebPreferences default values for Electron 12 (#29710)
Updates the values for `contextIsolation` and `worldSafeExecuteJavaScript` for Electron 12.

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-06-15 16:15:51 -04:00
trop[bot]
2ef55e1e9e chore: disable default async spellchecker on Windows (#29706)
* chore: disable default async spellchecker on Windows

* chore: disable kWinRetrieveSuggestionsOnlyOnDemand in feature list

* chore: remove incorrectly backported patches

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-06-15 12:49:52 -07:00
Milan Burda
62402870fd fix: warnAboutRemoteModuleWithRemoteContent (#29691)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-06-15 12:02:03 +02:00
trop[bot]
7b2a4c9984 docs: Update represented-file fiddle tutorial (#29693)
* 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:36:57 +09:00
trop[bot]
7958f3efbb docs: fix typo in process-model.md (#29683)
Co-authored-by: Luke Ingalls <45518011+lukeingalls@users.noreply.github.com>
2021-06-14 10:12:58 -07:00
trop[bot]
3e90aff6fd docs: fix file mode of versioning-sketch-2.png (#29681)
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:35 -07:00
trop[bot]
192fc3ee2c fix: check DCHECK_IS_ON() instead of #ifdef DCHECK_IS_ON (#29674)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-14 21:00:20 +09:00
trop[bot]
e0e7b14bdc fix: use correct spelling of attachment with Content-Disposition header (#29672)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-14 20:59:05 +09:00
trop[bot]
4cecc87c55 fix: copy received data in URLPipeLoader to prevent corruption (#29669)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-14 17:47:17 +09:00
Shelley Vohr
46e7511af9 fix: ensure custom traffic lights float to top (#29663)
* fix: ensure custom traffic lights float to top

* chore: split into separate function
2021-06-14 09:36:15 +09:00
trop[bot]
72733bae8a docs: fix typo (#29582)
* Typo fix

* Update main.js

Co-authored-by: ZReC <contact.zrec@gmail.com>
2021-06-14 09:35:07 +09:00
trop[bot]
38fce95417 docs: fix image links in performance.md (#29631)
* 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:53 +09:00
electron-roller[bot]
54de33464d chore: bump chromium to 91.0.4472.101 (13-x-y) (#29629)
* chore: bump chromium in DEPS to 91.0.4472.101

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-10 15:59:28 -07:00
trop[bot]
6c4c66d2cd fix: select-bluetooth-device on Windows (#29611)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-06-09 12:48:41 -04:00
Electron Bot
839dcbbbdb Bump v13.1.2 2021-06-09 09:39:07 -07:00
trop[bot]
05ae55d131 fix: ensure fuse order is read in a stable way (#29615)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-06-09 09:26:51 -07:00
trop[bot]
d7736e5924 fix: improper wrapping of fs.promises.readFile (#29576) 2021-06-08 10:31:27 +02:00
trop[bot]
30921548ed fix: make intermediates work with 'select-client-certificate' (#29569)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-08 11:40:09 +09:00
Cheng Zhao
9059a50f93 fix: keep shifted character in menu accelerator (#29482)
* 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:25:35 -04:00
trop[bot]
78569e9b91 docs: Update notifications (renderer) docs (#29564)
* 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:43:42 +09:00
trop[bot]
07b8b2ffdd docs: Updated "recent documents" fiddle tutorial (#29561)
* 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:58 +09:00
trop[bot]
2d18829b43 build: Improve squirrel.mac BUILD.gn xcrun_action error (#29513)
Right now, if executing `xcrun` fails, then the error message prints the
second argument to the `xcrun.py` script, which is the first argument to
the tool that `xcrun` is executing, making the whole error message quite
confusing.

Consider the following error:

```
python ../../third_party/squirrel.mac/build/xcrun.py dtrace -h -s /private/tmp/20210531211008-def376dc/src/third_party/squirrel.mac/vendor/ReactiveObjC/ReactiveObjC/RACSignalProvider.d -o /private/tmp/20210531211008-def376dc/src/out/release/gen/third_party/squirrel.mac/dtrace/RACSignalProvider.h
xcrun script '-h' failed with code '71':
xcrun: error: can't exec '/tmp/20210531211008-def376dc/dtrace' (errno=Permission denied)
```

The command that `xcrun` is executing is `dtrace`, but the error just
mentions the `-h` flag.

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

Co-authored-by: Juan Cruz Viotti <jv@jviotti.com>
2021-06-07 10:23:51 +09:00
trop[bot]
f0a9e56741 chore: return early on promise rejection (#29538)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-07 10:17:15 +09:00
Samuel Attard
314e627df1 Revert "Revert "fix: change ASAR archive cache to per-process to fix leak (#29535)""
This reverts commit 0dcc660794.
2021-06-04 10:29:42 -07:00
Electron Bot
b5c79632ef Bump v13.1.1 2021-06-04 10:29:05 -07:00
Samuel Attard
0dcc660794 Revert "fix: change ASAR archive cache to per-process to fix leak (#29535)"
This reverts commit ff2a0a4bd3.
2021-06-04 10:28:20 -07:00
Samuel Attard
0753e4911c fix: disable CET as v8 deoptimization is incompatible with it (#29546) 2021-06-04 10:27:55 -07:00
trop[bot]
ff2a0a4bd3 fix: change ASAR archive cache to per-process to fix leak (#29535)
* 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

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-04 13:19:31 +09:00
trop[bot]
5860b70189 docs: link to IncomingMessage (#29516)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-03 16:19:49 +09:00
Milan Burda
d84b7fc4d4 test: add spec for --require filtering in NODE_OPTIONS (#29507) 2021-06-03 14:43:50 +09:00
Electron Bot
1873d8ec81 Bump v13.1.0 2021-06-02 18:07:41 -07:00
Samuel Attard
0c19db01d9 chore: cherry-pick 3299d70b7d0f from chromium (#29494)
* chore: cherry-pick 3299d70b7d0f 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-02 18:06:33 -07:00
Samuel Attard
2156a9064f feat: add experimental cookie encryption support (#29493)
* feat: add experimental cookie encryption support (#27524)

* feat: add experimental cookie encryption support on macOS

* chore: fix TODO

* update patches

* feat: make cookie encryption work on windows

* chore: update cookie encryption support comments

* fix: only call OSCrypt::Init on windows

* chore: make cookie encryption work on linux

* Update shell/browser/net/system_network_context_manager.cc

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

* chore: fix lint

* chore: update patches

* chore: update patches to upstreamed variants

* chore: use chrome ::switches constants

* chore: remove bad patch

* build: disable cookie encryption by default

* chore: update patches

* fix: provide std::string to NoDestructor

* chore: fix macos, nodestructor syntax

* build: fix macOS build due to mismatch in DEFINE

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* chore: update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-06-02 17:04:35 -07:00
Jeremy Rose
6e169089f0 feat: support loading debug urls with loadURL() (#29404) (#29491) 2021-06-02 17:03:01 -07:00
trop[bot]
6855004aa5 refactor: point prepare-release at main (#29496)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-02 14:05:17 -07:00
trop[bot]
93d9aaa99c chore: don't use after move (#29479)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-02 22:25:19 +09:00
trop[bot]
e4a3f064de build: Support building Electron on msys2 (#29478)
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:59 +09:00
trop[bot]
9265390164 docs: Updated "progress bar" fiddle feature in docs (#29470)
* 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:16 +09:00
trop[bot]
8e6819ae71 refactor: use main in release-notes (#29412)
* 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:07:09 -07:00
trop[bot]
f95d2bdfd1 chore: remove duplicate option get for CustomScheme (#29453)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-01 19:12:51 +09:00
trop[bot]
737b08d130 fix: Alt+Click should not toggle menu bar (#29450)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-06-01 19:12:23 +09:00
David Sanders
b44024d660 fix: add service worker schemes from command line in renderer (#29425) (#29446) 2021-06-01 17:51:39 +09:00
trop[bot]
d0d6e88e5a chore: use consistent parameter names (#29442)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-01 15:25:32 +09:00
trop[bot]
c647007ccc fix: correctly handle Alt+Key shortcuts (#29443)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-06-01 15:25:19 +09:00
trop[bot]
134c8b7ed3 Fixes issue with reference links (#29430)
Co-authored-by: Vishal <34849822+vthukral94@users.noreply.github.com>
2021-06-01 10:37:50 +09:00
trop[bot]
4f203eee4a refactor: publish-to-npm respects main (#29409) 2021-05-31 10:32:42 +02:00
trop[bot]
bb065beaa6 docs: update link to Chromium's coding style guide (#29397)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-05-31 10:19:55 +02:00
electron-roller[bot]
8481e5c08a chore: bump chromium in DEPS to 91.0.4472.77 (#29321)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2021-05-27 19:03:50 -07:00
trop[bot]
7276a1fd8c Update quick-start.md (#29372)
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:08 -07:00
trop[bot]
7d18988317 docs: fix typos in clang-tidy examples (#29354)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-05-27 18:52:34 -07:00
trop[bot]
68afcd16e4 refactor: version-utils respects main (#29391)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-27 18:44:53 -07:00
trop[bot]
72e336445a refactor: getCurrentBranch respects main (#29389)
* refactor: getCurrentBranch respects main

* add note about migration

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-27 18:44:28 -07:00
trop[bot]
3e658c4782 docs: remove freenode channel from support list (#29382)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-05-27 17:24:11 -07:00
Keeley Hammond
e7d3b43db0 docs: change 14.0.0 stable dates and currently supported versions (#29377)
* docs: update 14.0.0 stable dates (#29255)

* docs: update 14.0.0 stable dates

* Update docs/tutorial/electron-timelines.md

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

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

* docs: update currently supported versions for 13.0.0 release (#29295)

Co-authored-by: Sofia Nguy <sofianguy@gmail.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2021-05-27 13:48:28 -07:00
trop[bot]
6683606449 docs: Update notifications (main) docs (#29358)
* 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:30 -07:00
trop[bot]
7bcc2a2762 docs: fix link to docs/fiddle/quick-start (#29351)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-27 12:39:11 -07:00
trop[bot]
c04fa30944 build: ensure that mksnapshot for Apple Silicon has all of the needed files for snapshot generation (#29339)
* build: include mksnapshot args in arm64 mksnapshot.zip

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

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-05-26 16:36:28 -04:00
Electron Bot
51213f656b Bump v13.0.1 2021-05-25 09:58:02 -07:00
Samuel Attard
aba7834a17 chore: empty commit to force 13.0.1 2021-05-25 09:54:27 -07:00
Electron Bot
3651c0411f Bump v13.0.0 2021-05-24 09:04:22 -07:00
Keeley Hammond
cb798f26b8 test: rebuild nan tests with libc++ and libc++abi (#29294)
* test: rebuild nan tests with libc++ and libc++abi (#29281)

* test: re-enable nan test: typedarrays-test.js

Fixes #28414.

I've confirmed this fix wfm on Linux. Pushing into a PR to get CI to run
it out on Win and Mac platforms too.

* chore: clarify comment

* test: fix NAN test string alignment

* test: (wip) add ldflags, archive file for libc++

* test: (wip) add libc++ to CircleCI

* test: (wip) add llvm flags

* test: (wip) change ldflag syntax

* test: (wip) build libc++abi as static

* fix: correct ldflags

* test: add ld env

* fix: do not commit this

* test: add lld from src to circleci

* test: add lld link to ld

* chore: preserve third_party

* seems legit

* sam swears this works kinda sort of sometimes'
:

* build: add gn visibility patch

* chore: update patches

* build: check for flatten_relative_to = false

* build: upload zip files, add to release.js validation

* debug: what the hell gn

* build: add libcxx gni to lint ignore

Linting the file adjusted the licenses array, which only contains
one value, and causes the gn check to fail later

* build: also use nan-spec-runner flags on Windows

* build: add linked flags for win32 only

* build: build libc++ as source on win

* build: clean up patch, add -fPIC for IA32

* build: delete libcxx .a files from root

* build: rename libc++.zip, clean up upload per platform

* build: fix gni lint

* ci: add libcxx gen to circleci config

* build: correct libcxx-object syntax

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>

* build: correct libcxx_objects build action name

* build: only upload libcxx headers on linux

* build: ensure object files are included even if unparsable

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-05-24 11:28:09 -04:00
Electron Bot
215c2d3ec7 Revert "Bump v13.0.0-beta.29"
This reverts commit 9df6131352.
2021-05-24 06:57:12 -07:00
Electron Bot
9df6131352 Bump v13.0.0-beta.29 2021-05-24 06:32:56 -07:00
trop[bot]
4d7188fd2e docs: Update online detection doc and fiddle (#29309)
* 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:15 +09:00
Keeley Hammond
c69d0eea2e feat: add more info in setWindowOpenHandler details (#28518) (#29277)
* fix: invoke the window open handler for _blank links

* feat: add disposition to setWindowOpenHandler details

* fix: pass postData to new-window event

* postData can be heterogeneous

* fix type of postBody

* fix type of UploadFile and UploadRawData to be discriminated unions

* exclude the empty string from additionalFeatures

* add a test

* add postBody and referrer to setWindowOpenHandler args

* appease typescript

* Update api-browser-window-spec.ts

* update snapshots

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-05-24 16:49:52 +09:00
trop[bot]
1e54d19e8a Use path.join when logging screenshot path. (#29305)
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:45 +09:00
trop[bot]
a660598e4c docs: Update docs for keyboard shortcuts (#29303)
* 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:46:32 +09:00
trop[bot]
1ec2840da0 docs: rework introduction docs (#29301)
* 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

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>
2021-05-24 16:35:42 +09:00
electron-roller[bot]
1d3cd106d1 chore: bump chromium to 91.0.4472.69 (13-x-y) (#29158)
* chore: bump chromium in DEPS to 91.0.4472.57

* chore: update patches

* try disabling gpu on WOA to see if it helps with failures

* chore: bump chromium in DEPS to 91.0.4472.69

* update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Electron Bot <electron@github.com>
2021-05-21 17:30:12 -04:00
Robo
5c5f041731 fix: dnd for some wm that does not set _NET_CLIENT_LIST_STACKING (#29233)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/2844104
2021-05-20 22:33:43 -07:00
Electron Bot
325df5afcf Bump v13.0.0-beta.28 2021-05-20 06:32:42 -07:00
trop[bot]
e261519469 fix: pdf viewer permissions (#29252) 2021-05-20 07:29:11 +02:00
trop[bot]
042c04f95f docs: option title for showSaveDialog is not supported for some platforms (#29232) 2021-05-19 16:06:20 +02:00
trop[bot]
7a78506a7d docs: update style guide (#29228)
* 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:41 +09:00
trop[bot]
75b4db49df fix: window bounds not scaled from screen coordinates (#29227)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-05-19 16:19:11 +09:00
trop[bot]
0f8ac92b09 fix: AdjustAmountOfExternalAllocatedMemory regression in NativeImage destructor (#29223)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-19 11:55:07 +09:00
trop[bot]
119ce7d6da docs: Update the macos Dock Instructions (#29220)
* 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:22 +09:00
trop[bot]
daa075d020 docs: Update macos-dark-mode fiddle and guide content (#29219)
* 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:56 +09:00
trop[bot]
8d6b9155fb docs: update drag and drop tutorial (#29216)
* 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:17 +09:00
trop[bot]
cec2bfb9ec docs: mention Meta key in Accelerator (#29215)
`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:52 +09:00
trop[bot]
ff1cc3c60b docs: Improve description of findInPage options (#29146)
* docs: improve webContents.findInPage description

* docs: improve webview.findInPage description

Co-authored-by: PalmerAL <PalmerAL@users.noreply.github.com>
2021-05-19 10:32:51 +09:00
trop[bot]
b4bba38862 docs: revise Mac App Store Submission Guide (#29142)
* docs: revise Mac App Store Submission Guide

* chore: update repo URL

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

* chore: apply suggestions from code review

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

* chore: update to match style guide

* chore: add cross reference

* chore: fix inaccurate places

* chore: apply reviews

* chore: add link to provisioning profile

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-17 14:50:15 -04:00
trop[bot]
278ff8566c build: make patch auto fixes come from PatchUp rather than Electron Bot (#29156)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-05-17 14:44:55 -04:00
Electron Bot
323de2fbe7 Bump v13.0.0-beta.27 2021-05-17 06:31:57 -07:00
trop[bot]
cd673a3697 docs: --force-fieldtrials was h2 rather than h3 (#29181)
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:39 -07:00
trop[bot]
0097a370e3 fix: remove background color hack in vibrancy (#29165)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-05-14 18:30:27 -07:00
trop[bot]
692c510867 fix: illegal access errors with nodeIntegrationInSubFrames (#29170) 2021-05-14 17:43:18 +02:00
trop[bot]
e6f15c4380 fix: ensure extensions w/o a background page have file access (#29171)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-14 17:42:55 +02:00
Electron Bot
cce8dda92f Bump v13.0.0-beta.26 2021-05-13 06:32:01 -07:00
trop[bot]
034f750c46 Create README.md (#29149)
Co-authored-by: Ondreas <74183220+OndreasCZ@users.noreply.github.com>
2021-05-12 23:40:50 -07:00
Erick Zhao
120a8acfd0 docs: rework sandbox guide (#29104)
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:01 +09:00
trop[bot]
01992fd65c chore: remove no-op EnableWebComponentsV0 feature (#29127)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-05-13 11:07:09 +09:00
trop[bot]
af6a5e6c30 fix: Menu.setApplicationMenu can return a useless array 29088 (#29129)
Co-authored-by: tabishmahfuz1 <tabish.mahfuz1@gmail.com>
2021-05-12 17:35:23 -07:00
trop[bot]
caac2e8fc7 fix: prevent crash on web-contents creation when error is thrown (#29106)
* fix: prevent crash when error occurs during event emitter CallMethod

* wip: emit error event within trycatch

* fix: handle uncaught exceptions within node on web_contents init

* fix: create gin_helper::CallMethodCatchException

* test: add web-contents create crash to test cases

* test: clean up test data for web-contents crash

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

* fix: convert CatchException to WebContents static helper method

* fix: restore try_catch to callsite

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-05-12 12:03:34 -07:00
Jeremy Rose
9a4a049498 chore: cherry-pick 8089dbfc616f from chromium (#29109)
* chore: cherry-pick 8089dbfc616f from chromium

* resolve conflicts
2021-05-12 12:03:09 -07:00
trop[bot]
68059d69a5 build: merge double space in SHASUM validation logic (#29120)
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-05-12 01:53:51 -07:00
Electron Bot
0f7334a77e Bump v13.0.0-beta.25 2021-05-11 18:10:53 -07:00
Electron Bot
eee8bee71b Revert "Bump v13.0.0-beta.25"
This reverts commit 2795185d46.
2021-05-11 17:19:54 -07:00
Electron Bot
2795185d46 Bump v13.0.0-beta.25 2021-05-11 13:59:38 -07:00
trop[bot]
877f096d6b build: offload hash checking logic to lambda worker during release (#29105)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-05-11 13:57:32 -07:00
trop[bot]
b33bb3a860 fix: update NSView radii on fullscreen transition (#29099)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-11 16:44:18 +02:00
Milan Burda
86f4126051 fix: webFrame spell checker APIs crashing in sandboxed renderers (#29053) (#29087) 2021-05-10 16:42:30 -07:00
Electron Bot
f895162234 Bump v13.0.0-beta.24 2021-05-10 12:16:53 -07:00
Electron Bot
05e41f89b4 chore: bump chromium to 91.0.4472.38 (13-x-y) (#29045) 2021-05-07 09:29:33 -07:00
Electron Bot
d7378f953a Bump v13.0.0-beta.23 2021-05-07 00:28:38 -07:00
trop[bot]
ed0b654fee chore: cherry-pick 7abc7e45b2 from node (#29048)
Backports: https://github.com/nodejs/node/pull/38506

Co-authored-by: Fedor Indutny <fedor@indutny.com>
2021-05-07 00:19:03 -07:00
Electron Bot
c1c8cbf995 Bump v13.0.0-beta.22 2021-05-06 06:31:26 -07:00
trop[bot]
ab3aa3581a fix: drag region BrowserView calculations on macOS (#29017)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-06 20:29:06 +09:00
trop[bot]
20a43d9a72 fix: <webview> focus / blur events don't work with contextIsolation enabled (#29025)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-06 20:25:18 +09:00
trop[bot]
27d04084c2 docs: menu must be added on whenReady (#29043)
* 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:30 +09:00
trop[bot]
46649965c9 spec: attempt to fix flaky nativeTheme spec (#29036)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-05-05 21:49:48 -07:00
trop[bot]
bea84969d6 docs: link to BrowserView from webview page (#29008)
* docs: Link to `BrowserView` from `webview` page

* fix relative link

Co-authored-by: Hamish Macpherson <hamstu@gmail.com>
2021-05-05 11:30:52 -07:00
trop[bot]
ae67ec24f3 refactor: use "as const" for constant mappings (#29000)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-05 15:59:47 +09:00
Electron Bot
d379693967 Bump v13.0.0-beta.21 2021-05-04 14:15:15 -07:00
Keeley Hammond
2fe16c60ea revert: build: fix dump_syms.py to work with python 3 (#28998) 2021-05-04 14:07:32 -07:00
Electron Bot
0853536e04 Revert "Bump v13.0.0-beta.21"
This reverts commit 4e48867af8.
2021-05-04 13:19:01 -07:00
Electron Bot
4e48867af8 Bump v13.0.0-beta.21 2021-05-04 11:49:07 -07:00
Samuel Attard
6bb1d1c5b0 build: import execute method in symbols zip script 2021-05-04 11:40:21 -07:00
Samuel Attard
696cc7c414 build: delete dsyms after they have been zipped in release builds 2021-05-04 11:39:58 -07:00
Samuel Attard
c0c8116a29 build: free up space on macOS some more 2021-05-04 11:39:51 -07:00
trop[bot]
a98ed69874 build: disable pseudolocales in Electron (#28995)
* build: disable pseudolocales in Electron

* Update build/args/all.gn

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-05-04 11:38:43 -07:00
trop[bot]
3c230ad272 build: fix dump_syms.py to work with python 3 (#28996)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-05-04 11:38:30 -07:00
Electron Bot
f93a9607b5 Revert "Bump v13.0.0-beta.21"
This reverts commit e7a944e356.
2021-05-04 09:39:00 -07:00
Electron Bot
e7a944e356 Bump v13.0.0-beta.21 2021-05-04 08:09:51 -07:00
trop[bot]
9131a3216a docs: update REPL guide (#28986)
* docs: update REPL guide

* Update docs/tutorial/repl.md

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

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-05-04 09:57:46 -04:00
trop[bot]
288985f032 fix: close attached sheet on window close (#28988)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-04 09:31:42 -04:00
trop[bot]
9c1c8787e9 fix: allow Node.js to manage microtasks queue (#28973)
* 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:00:44 -07:00
trop[bot]
c55cfa7a9c chore: Browser::SetAppUserModelID is Windows only (#28970)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-05-03 18:52:49 -07:00
Electron Bot
f72597be06 chore: bump chromium to 91.0.4472.33 (13-x-y) (#28660)
* chore: bump chromium in DEPS to 91.0.4472.5

* chore: rebuild chromium/dcheck.patch with import-patches -3

Mechanical only; no code changes

(cherry picked from commit 68e369c945)

* chore: remove content_browser_main_loop.patch

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

The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.

NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.

(cherry picked from commit 5220829748)

* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3

Mechanical only; no code changes

(cherry picked from commit 7613ca268e)

* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3

Mechanical only; no code changes

(cherry picked from commit c0c5f45195)

* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch

Mechanical only; no code changes

(cherry picked from commit ea6f3e096e)

* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3

Mechanical only; no code changes

(cherry picked from commit 8d9aa4f1f2)

* chore: rebuild chromium/ui_gtk_public_header.patch manually

no code changes

(cherry picked from commit 79e84fb72b)

* chore: rebuild chromium/web_contents.patch with import-patches -3

Mechanical only; no code changes

(cherry picked from commit 543fb6dae7)

* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch

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

This patch has been merged upstream

(cherry picked from commit d36de6e2d6)

* chore: export patches

(cherry picked from commit 7c148e9102)

* chore: update add_trustedauthclient_to_urlloaderfactory.patch

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

Sync with removal of render_frame_id_

(cherry picked from commit fd954aefd4)

* chore: sync chromium/put_back_deleted_colors_for_autofill.patch

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

SkColorFromColorId() no longer takes theme, scheme args

(cherry picked from commit f676453fb8)

* chore: sync chromium/put_back_deleted_colors_for_autofill.patch

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

Change new calls to GetDarkSchemeColor to fit our patched call signature

(cherry picked from commit 27c5d9da5e)

* chore: update add_trustedauthclient_to_urlloaderfactory.patch

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

Sync with removal of render_frame_id_ in our mojom

(cherry picked from commit 285db29015)

* chore: update chromium/frame_host_manager.patch

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

UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool

(cherry picked from commit 06ac6c5d6a)

* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch

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

Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.

(cherry picked from commit 2b0cb2ca2a)

* chore: update permissions_to_register

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

Replace all uses of APIPermission::ID enum with Mojo type

(cherry picked from commit bfe55a9c68)

* refactor: update return type of PreMainMessageLoopRun()

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

Used to return void; now returns an int errorcode.

Note: 2725153 also has some nice doc updates about Browser's "stages"
(cherry picked from commit 2622e91c44)

* refactor: sync ElectronBrowserMainParts to MainParts changes

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

RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.

This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.

(cherry picked from commit 0497272fab)

* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun

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

BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().

(cherry picked from commit 77eacd8073)

* refactor: stop using CallbackList; it has been removed.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
(cherry picked from commit 4bcf9d58b0)

* refactor: update use of threadpools.

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

The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.

(cherry picked from commit 4e33ee0ad3)

* refactor: remove routing_id from CreateLoaderAndStart

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

NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.

(cherry picked from commit 70759ad342)

* refactor: sync to upstream ParittionOptions churn

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

PartitionOptions' enums have changed.

(cherry picked from commit 48f437b478)

* refactor: update Manifest::Location usage

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

tldr: s/Manifest::FOO/ManifestLocation::kFoo/
(cherry picked from commit 866e02999a)

* update patches

(cherry picked from commit 4444596af5)

* refactor: update extensions::Manifest to upstream

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

-  extensions::Manifest::COMPONENT
+  extensions::mojom::ManifestLocation::kExternalComponent

(cherry picked from commit c97cef7059)

* refactor: sync with upstream UrlInfo ctor changes

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

UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool

(cherry picked from commit 7effb909b6)

* chore: update invocation of convert_protocol_to_json.py

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

python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.

(cherry picked from commit a237fc9aff)

* chore: use extensions::mojom::APIPermissionID

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

tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo

(cherry picked from commit bf9ef3b636)

* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy

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

Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc

(cherry picked from commit c4558b031d)

* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun

(cherry picked from commit f509f1b8cc)

* chore: Use IDType for permission change subscriptions.

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

tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).

(cherry picked from commit 11608d2745)

* chore: sync PowerMonitor code to upstream refactor

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

tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.

(cherry picked from commit 2d4c79413b)

* chore: use PartitionOptions's new Cookies field

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
(cherry picked from commit f69e95824f)

* Revert "refactor: remove routing_id from CreateLoaderAndStart"

This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.

8c9773b was only a partial fix; reverting to start & try again.

(cherry picked from commit 96195f845b)

* update patches

(cherry picked from commit 5d64fa28d5)

* chore: update chromium/accelerator.patch

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

tldr: sync patch with upstream renamed variable & macro names.
(cherry picked from commit ce541697e5)

* chore: update chromium/gtk_visibility.patch

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

tldr: no code changes; just updating the diff to apply cleanly.

note: ooh upstream Wayland hacking!
(cherry picked from commit 6ec5c72878)

* chore: update chromium/picture-in-picture.patch

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

tldr: no code changes; just updating the diff to apply cleanly.
(cherry picked from commit 8ae0b0d740)

* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch

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

tldr: no code changes; just updating the diff to apply cleanly.
(cherry picked from commit d5b017208b)

* chore: export_all_patches

(cherry picked from commit 218952ec9d)

* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch

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

tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.

(cherry picked from commit 6fe734f5ca)

* chore: update ElectronBrowserClient w/upstream API

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

tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.

(cherry picked from commit b760f7162b)

* chore: handle new content::PermissionType::FILE_HANDLING in toV8()

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

`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc

(cherry picked from commit d9cdb18eb7)

* refactor: remove routing_id from CreateLoaderAndStart pt 1

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

Part 1: the easiest ones

(cherry picked from commit 6ee282b27a)

* 2796724: Support Python3

https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
(cherry picked from commit fbf5c04716)

* 2668974: WebShare: Implement SharingServicePicker

https://chromium-review.googlesource.com/c/chromium/src/+/2668974
(cherry picked from commit 74577f2156)

* 2802766: Apply modernize-make-unique to media/

https://chromium-review.googlesource.com/c/chromium/src/+/2802766
(cherry picked from commit 409328fc38)

* 2802823: Apply modernize-make-unique to gpu/

https://chromium-review.googlesource.com/c/chromium/src/+/2802823
(cherry picked from commit 43658b0ed3)

* 2803041: Apply modernize-make-unique to remaining files

https://chromium-review.googlesource.com/c/chromium/src/+/2803041
(cherry picked from commit 01f514f537)

* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks

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

* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed

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

* chore: update patch indices

(cherry picked from commit f078eddc2b)

* 2795107: Remove unused PermissionRequest IDs.

https://chromium-review.googlesource.com/c/chromium/src/+/2795107
(cherry picked from commit 93077afbfb)

* chore: fixup patch indices

(cherry picked from commit 8f2abcee38)

* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window

https://chromium-review.googlesource.com/c/chromium/src/+/2710023
(cherry picked from commit 4a4da7ad6a)

* fixup! refactor: remove routing_id from CreateLoaderAndStart

(cherry picked from commit a1f0bbb0b5)

* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader

(cherry picked from commit 186528aab9)

* fixup! chore: fixup patch indices

(cherry picked from commit 3129ea403d)

* 2724817: Expand scope of wasm-eval to all URLs

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

* 2797341: [ozone/x11] Enabled the global shortcut listener.

https://chromium-review.googlesource.com/c/chromium/src/+/2797341
(cherry picked from commit 945890fcf9)

* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1

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

* 2804366: PiP 1.5: Label back to tab button with origin and center it

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

* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget

https://chromium-review.googlesource.com/c/chromium/src/+/2784730
(cherry picked from commit 0fac051a0c)

* chore: update patch indices

(cherry picked from commit 01235ba336)

* 2810174: Add PdfAnnotationsEnabled policy.

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

* 2807829: Allow capturers to indicate if they want a WakeLock or not.

https://chromium-review.googlesource.com/c/chromium/src/+/2807829
(cherry picked from commit 39f0c263d7)

* update patches after cherry picks

* chore: icon_util_x11 is now icon_util_linux

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
(cherry picked from commit fa0d3a0f75)

* build: fix missing symbols on linux build

* use_ozone and use_x11 are not exclusive
* new button view to build for pip

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
(cherry picked from commit 28253c6ccc)

* chore: remove patch conflict

(cherry picked from commit 19c9e94014)

* chore: build bttlb on all platforms for pip

(cherry picked from commit ae70252e09)

* build: update linux manifests

(cherry picked from commit 88baf8835c)

* chore: update windows zip manifests

(cherry picked from commit 01a1c37999)

* chore: update mac zip manifests

(cherry picked from commit a203347075)

* chore: update is_media_key patch to handle new ozone impl

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
(cherry picked from commit 9d31092db8)

* build: update sysroots

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
(cherry picked from commit 4985c57685)

* build: add missing base include on windows

(cherry picked from commit ec782c1bde)

* fix: update frame host manager patch for new state transitions

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
(cherry picked from commit 2772241a2c)

* refactor: implement missing URLLoaderNetworkServiceObserver methods

It is against The Mojo Rules to leave hanging callbacks.  These always
have to be called.

Refs: 186528aab9
(cherry picked from commit 2ce2f73a0c)

* spec: fix locale test on local linux

(cherry picked from commit 898f8448f8)

* fix: pass the exit code correctly in new PreMainMessageLoopRun

Refs: 2622e91c44
(cherry picked from commit f8f388573c)

* fix: ensure we early-exit when request_handler_ is not provided

Refs: 93077afbfb
(cherry picked from commit 20cd4cb875)

* fix: strongly set result_code in the BrowserMainLoop

(cherry picked from commit a1d19bc212)

* fix: invalid usage of non-targetted PostTask

You must always either use a host threadpool or specify a target
thread.  In this case we did neither after this refactor.

Refs: 4e33ee0ad3
(cherry picked from commit 3632067c10)

* build: ensure CI is truthy in arm test env

(cherry picked from commit e455f68b64)

* chore: add mojo error code to url loader failure

(cherry picked from commit 60cc150a17)

* fix: handle windowCaptureMacV2 being enabled when fetching media source id

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
(cherry picked from commit f835dd1c2a)

* chore: fix broken gtk_util color patch

(cherry picked from commit e0720df6d4)

* chore: fix gn check

(cherry picked from commit 72ca89b311)

* chore: add node patches for V8 changes

(cherry picked from commit 96027e0186)

* chore: add thread_pool include for views delegate win

(cherry picked from commit 62faa304df)

* chore: remove stray .rej files in patch

(cherry picked from commit 52562150ca)

* chore: bump chromium in DEPS to 91.0.4472.10

* update patches

* Merge branch '13-x-y' into roller/chromium/13-x-y

* update patches

* try to track down WOA failures

* see if this helps websql failure

* chore: debug websql error on WOA

* Revert "chore: debug websql error on WOA"

This reverts commit 572987a15f.

* Revert "see if this helps websql failure"

This reverts commit f771dfe0ab.

* Revert "try to track down WOA failures"

This reverts commit d4eb5efdb3.

* chore: no long disable CalculateNativeWinOcclusion on WOA

This was resolved in https://chromium-review.googlesource.com/c/chromium/src/+/2478082

* run specs separately on WOA

* Update comment

* escape %

* specify files properly

* revert WOA testing changes

* chore: bump chromium in DEPS to 91.0.4472.33

* chore: update patches

* Trigger CI

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-05-03 20:09:30 -04:00
trop[bot]
5c12606b13 feat: add session.storagePath to get path on disk for session data (#28866)
* feat: add session.storagePath to get path on disk for session data

* spec: add session.storagePath tests

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-05-03 12:14:53 -04:00
trop[bot]
f9bf319e66 docs: remove reference to global Electron install (#28969)
* 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:38:53 -04:00
Electron Bot
b5c3ac3e7b Bump v13.0.0-beta.20 2021-05-03 08:01:43 -07:00
trop[bot]
824028a367 build: add release-env context to publish-macos (#28939)
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-04-29 15:24:01 -07:00
trop[bot]
2b23b145d9 docs: uniformize module API doc format (#28926)
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 13:38:32 -07:00
trop[bot]
128106520a build: fix npm-run python bytes error (#28936)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-29 13:34:05 -07:00
Electron Bot
7e4a9ebc27 Bump v13.0.0-beta.19 2021-04-29 08:03:10 -07:00
trop[bot]
87d3530d1b fix: provide no-op implementation of app.setUserModelId (#28921)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-29 09:56:20 +02:00
trop[bot]
bf9dfa8247 docs: remove api/locales page (#28919)
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:19 -07:00
trop[bot]
300e902066 fix: emit window-all-closed after closing the window (#28914)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-28 12:47:16 -07:00
trop[bot]
fa0f9e83f5 build: remove dead python methods and helper (#28895)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-28 02:13:38 -07:00
trop[bot]
d32aa032cd docs: the tools folder does not exist anymore (#28888)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-28 02:13:20 -07:00
trop[bot]
3fe41bb852 build: actually use SSL when downloading things via python (#28893)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-28 02:07:05 -07:00
trop[bot]
58b80c2c06 test: disable shell.trashItem in renderer test on win-ia32 (#28877)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-27 19:58:25 -04:00
trop[bot]
2ec3da29d3 build: fix releases that failed halfway through npm publish actions (#28855)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-26 20:38:07 -04:00
trop[bot]
499c1a5067 fix: only set backgroundColor in default-app for default index.html (#28842)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-04-26 11:34:48 -04:00
Electron Bot
544ea7a0c8 Bump v13.0.0-beta.18 2021-04-26 08:02:03 -07:00
trop[bot]
eca4a5cf4c fix: shell.trashItem crash when called in renderer (#28788)
* 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:01 +09:00
trop[bot]
56fc2bce30 docs: fix unintentional emoji in win.getMediaSourceId description (#28784)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-04-22 13:33:05 -07:00
Electron Bot
4eea01e9b0 Bump v13.0.0-beta.17 2021-04-22 08:01:53 -07:00
Shelley Vohr
232392ffa0 fix: handle async nature of [NSWindow -toggleFullScreen] (#25470) (#28763) 2021-04-22 09:53:46 -04:00
trop[bot]
7816fd240f fix: ensure widget size is set correctly on linux on small screens (#28756)
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 13:17:33 +02:00
Electron Bot
bcf2d0969c chore: cherry-pick 512cd5e179f4 from v8 (#28753)
* chore: cherry-pick 512cd5e179f4 from v8

* update patches
2021-04-21 12:29:38 +02:00
trop[bot]
ed7f5f3a0b fix: end attached sheet when calling window.hide() (#28694)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-21 11:20:31 +02:00
trop[bot]
1937aff793 build: fix docs only change script to pull all files not just 30 (#28744)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-19 18:28:58 -07:00
trop[bot]
cf493b995c docs(build-instructions): clarify that these are for building Electron itself (#28728)
Co-authored-by: Mark Lee <electronjs@lazymalevolence.com>
2021-04-19 20:10:37 -04:00
trop[bot]
5bbc64b416 build: read node files as binary files (#28735)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-19 20:01:27 -04:00
trop[bot]
287c9eb8c0 chore: clean up some spec things (#28731)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-19 12:55:01 -07:00
trop[bot]
f4d77d97e3 fix: do not handle write errors after request is aborted (#28720)
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:20 -07:00
Electron Bot
593af18528 Bump v13.0.0-beta.16 2021-04-19 08:01:28 -07:00
trop[bot]
df47f85646 fix: increase corner radius for vibrancy view on big sur (#28679)
* fix: increase corner radius for vibrancy view on big sur

* fix: revert git weirdness

Co-authored-by: Robin Fowler <robinfowler@Robins-MBP.broadband>
2021-04-15 15:58:42 -07:00
Electron Bot
bd3b70a6b5 Bump v13.0.0-beta.15 2021-04-15 08:04:17 -07:00
trop[bot]
9578943848 build: do not require vsts token for releases (#28648)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-14 11:44:43 +02:00
Electron Bot
91de226a62 Bump v13.0.0-beta.14 2021-04-13 13:39:59 -07:00
Electron Bot
7044cb69a8 chore: cherry-pick 02f84c745fc0 from v8 (#28637)
* chore: cherry-pick 02f84c745fc0 from v8

* update patches
2021-04-13 13:29:05 -07:00
Electron Bot
66a2218723 chore: bump chromium to 91.0.4448.0 (13-x-y) (#28127)
* chore: bump chromium in DEPS to 90.0.4430.19

* build: add 'use_rts' definition

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187
(cherry picked from commit b820b4078d)

* chore: bump chromium in DEPS to 91.0.4441.0

* chore: update patches

(cherry picked from commit 55e50a0879)

* chore: media_internal_resources becomes resources

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022
(cherry picked from commit e715b9c921)

* chore: update patches

(cherry picked from commit c8148febfa)

* refactor: extensions::ViewType moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351
(cherry picked from commit 87df2766ba)

* chore: might_have_observers has been removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839
(cherry picked from commit e900271bea)

* refactor: CertVerifier is not in the network namespace anymore

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805
(cherry picked from commit eccfa516c5)

* refactor: ExtensionUserScriptManager is now UserScriptManager

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617
(cherry picked from commit 2fed02556d)

* refactor: content::SiteInstance::GetSiteForURL was removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274
(cherry picked from commit 0d94e0d1d9)

* refactor: MenuItemType was moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443
(cherry picked from commit 1a296e59c2)

* refactor: extensions::ViewType was moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351
(cherry picked from commit dc36e8e6fc)

* refacotr: grit::ResourceMap replaced with webui::ResourcePath

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601
(cherry picked from commit 59669e99cb)

* refactor: blink::MenuItem::Type was moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443
(cherry picked from commit be627568b2)

* refactor: CreateDataPipe deprecated form was removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090
(cherry picked from commit 77ad17b383)

* refactor: DesktopMediaList::Type replaces content::DesktopMediaType_*

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637
(cherry picked from commit 4e02d9407a)

* chore: wire up activation_time in OSR

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372
(cherry picked from commit f51f427646)

* chore: remove deleted file from chromium_src list

(cherry picked from commit 59432fe30a)

* chore: fix lint

(cherry picked from commit 54cc68dd7a)

* update patches

(cherry picked from commit e99e6a5a8a)

* chore: update patches

(cherry picked from commit 1e16606524)

* fixup gn check

(cherry picked from commit 8f4e362d8f)

* update to xcode 12.4.0

Needed because of 8008deb41c

(cherry picked from commit fae4d87a5a)

* 2752406: [LSC] Replace base::string16 with std::u16string in //ui

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

* 2752406: [LSC] Replace base::string16 with std::u16string in //ui

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

* 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id.

https://chromium-review.googlesource.com/c/chromium/src/+/2752932
(cherry picked from commit 08036802cb)

* 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer.

https://chromium-review.googlesource.com/c/chromium/src/+/2651385
(cherry picked from commit 676f74f3dc)

* 2734095: Introduce StoragePartitionId type to wrap current string representation.

https://chromium-review.googlesource.com/c/chromium/src/+/2734095
(cherry picked from commit 76538d2d38)

* chore: bump chromium in DEPS to 90.0.4430.19

* chore: bump chromium in DEPS to 90.0.4430.30

* chore: bump chromium in DEPS to 90.0.4430.40

* chore: bump chromium in DEPS to 90.0.4430.51

* chore: bump chromium in DEPS to 91.0.4446.0

* chore: bump chromium in DEPS to 91.0.4448.0

(cherry picked from commit 003dd6c16c)

* Update patches

(cherry picked from commit 9f5e3f6685)

* 2743594: Remove WebSize from blink.

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

* 2725403: Add URLLoaderClient::OnReceiveEarlyHints()

https://chromium-review.googlesource.com/c/chromium/src/+/2725403
(cherry picked from commit 185c343b22)

* 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer.

https://chromium-review.googlesource.com/c/chromium/src/+/2651385
(cherry picked from commit 88bbe2a352)

* 2721718: Move HostID to extensions::mojom::HostID

https://chromium-review.googlesource.com/c/chromium/src/+/2721718
(cherry picked from commit 3010dd93e3)

* 2733070: Rename observer to URLLoaderNetworkServiceObserver

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

* Use nogncheck for content/browser/site_instance_impl.h

This is needed because  //content/browser:browser is not a visible target

(cherry picked from commit 5fc298ee5f)

* 2648046: Introduce alert notification helper .app

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

* 2752406: [LSC] Replace base::string16 with std::u16string in //ui

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

* only include mac notifications on mac

(cherry picked from commit 3160e608e2)

* add additional skipping of atk toolchain check

(cherry picked from commit 86d23cee40)

* 2757472: Reland "Reland "[LSC] Remove base::string16 alias""

https://chromium-review.googlesource.com/c/chromium/src/+/2757472
(cherry picked from commit 22d8f22cfb)

* 2757472: Reland "Reland "[LSC] Remove base::string16 alias""

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

* 2720306: [api] Remove deprecated [Shared]ArrayBuffer API

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

* Fixup 2721718: Move HostID to extensions::mojom::HostID

(cherry picked from commit 29dfabadfd)

* fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer

(cherry picked from commit 97b6868e9c)

* Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui

(cherry picked from commit b6d2ae0455)

* Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints()

(cherry picked from commit 7e961d8a37)

* update node headers

(cherry picked from commit c49bc282d5)

* 2693008: Fix loading non-system cursors on Windows on browser_tests

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

* 2757472: Reland "Reland "[LSC] Remove base::string16 alias""

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

* undo changes to WebContentsPreferences::GetPreloadPath to fix mac build

(cherry picked from commit deeb2de14b)

* fix StrCat issue

(cherry picked from commit 451e0931bf)

* incantations for WebContentsPreferences::GetPreloadPath wide strings

(cherry picked from commit 205f572181)

* bump nan

(cherry picked from commit 74318705c2)

* fix GetAsString maybe?

(cherry picked from commit ea62ecd188)

* windows build fixes

(cherry picked from commit 5b598037bb)

* more windows build fix

(cherry picked from commit 61cf1abd4d)

* SetAppUserModelID -> wstring

(cherry picked from commit 83d93bcbdc)

* upgrade nan dep in tests

(cherry picked from commit 4f97b9303c)

* update patch

* wstrings are cross-platform

(cherry picked from commit 7f7b1f6c8a)

* linter

(cherry picked from commit aaf03765ed)

* only bind setAppUserModelId on windows

(cherry picked from commit 640a145112)

* well that was an odyssey

(cherry picked from commit dd975328a0)

* backport fcdf35e from v8 to fix nan crash

(cherry picked from commit 606fd87d1e)

* disable typedarrays-test.js

(cherry picked from commit 01ca00ec82)

* don't defer in NSWindow creation

https://chromium-review.googlesource.com/c/chromium/src/+/2707696
(cherry picked from commit 3122820e58)

* use PartitionAllocator for ArrayBuffers in the main process

(cherry picked from commit 1f575ca3af)

* fix patches

(cherry picked from commit 54e72fa8e3)

* chore: omit some unnecessary conversions

(cherry picked from commit 0f3620099a)

* refactor: make LoginItemSettings::path a wstring

(cherry picked from commit 9127cff58b)

* refactor: make ShowTaskDialog take a wstr

(cherry picked from commit 1594c54933)

* Revert "refactor: make LoginItemSettings::path a wstring"

This reverts commit 9127cff58b.

(cherry picked from commit 9684d85101)

* fixup patches

This reverts commit 0cc08813a6.

* update patches after merge

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-04-13 11:29:10 -04:00
trop[bot]
1f95fdd5ca build: better error handling for release builds (#28626)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-13 09:49:04 -04:00
trop[bot]
b4e70c72a6 fix: crash on invalid select-serial-port callback (#28619)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-12 11:40:24 -04:00
Electron Bot
61bd57f851 Bump v13.0.0-beta.13 2021-04-12 08:02:26 -07:00
trop[bot]
5ab8cb7482 fix: load source maps from custom protocols and asar bundles (#28615)
* fix: load source maps from custom protocols and asar bundles

* chore: fix lint

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-04-12 06:18:34 -07:00
trop[bot]
d1bb54d175 docs: define the name of the preload script (#28609)
Co-authored-by: KSneijders <32707500+KSneijders@users.noreply.github.com>
2021-04-12 00:14:18 -07:00
trop[bot]
c104b510b0 docs: systemPreferences.subscribeWorkspaceNotification return type (#28613)
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-04-12 00:12:50 -07:00
trop[bot]
02a2d33edc build: give ASAN tests more memory to avoid SIGKILL or disabling tests (#28592)
* build: give ASAN tests more memory

* test: re-eanble asan tests

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-09 18:53:06 +09:00
trop[bot]
ad8f93517e chore: don't minimize js in development (#28586)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-09 16:09:53 +09:00
trop[bot]
a58b5ec3f0 docs: note that new-window event is deprecated (#28582)
* docs: note that new-window event is deprecated

* Update breaking-changes.md

* Update docs/breaking-changes.md

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-04-08 12:12:45 -04:00
Electron Bot
32e321cec1 Bump v13.0.0-beta.12 2021-04-08 08:01:27 -07:00
trop[bot]
aae1bfde05 fix: support wasm-eval csp behind WebAssemblyCSP flag (#28569)
* feat: support wasm-eval csp behind WebAssemblyCSP flag

* update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-04-08 04:32:39 -07:00
trop[bot]
5be9028c51 fix: allow accessing file:// when web security is disabled (#28557)
* fix: allow accessing file:// when web security is disabled

* test: fix webview tests on web security

* chore: remove unused attributes

* chore: cleanup RegisterURLLoaderFactories method

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-07 14:59:54 +09:00
Shelley Vohr
fa5bc2206c fix: errors thrown in functions over the contextBridge (#28446)
* fix: errors thrown in functions over the contextBridge

* spec: add a test

* fix: ensure exception is a v8::Object
2021-04-07 14:57:33 +09:00
trop[bot]
e3cbd70191 fix: call UnregisterIsolate consistently (#28554)
* 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:07:49 +09:00
trop[bot]
7ce5af334e fix: invoke the window open handler for _blank links (#28536)
* fix: invoke the window open handler for _blank links

* add test

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-07 10:05:12 +09:00
trop[bot]
5605358f99 fix: pass postData to new-window event (#28542)
* fix: pass postData to new-window event

* fix type of postBody

* fix type of UploadFile and UploadRawData to be discriminated unions

* exclude the empty string from additionalFeatures

* add a test

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-07 09:59:34 +09:00
trop[bot]
6f44fa6dbd fix: dialog DCHECK on Linux (#28534)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-07 09:49:17 +09:00
trop[bot]
6e66699822 ci: Add goma fallback flag (#28546)
* 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:12 +09:00
trop[bot]
71fda62839 test: disable "fs in renderer process" test under ASan (#28541)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-07 09:28:54 +09:00
trop[bot]
2b354894b2 fix: enable system maximization for frameless windows except if transparent (#28527)
* 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

Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-04-06 00:54:39 -07:00
trop[bot]
114643a624 fix: reject task append to JumpList when description exceeds 260 characters (#28526)
* 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:18 -07:00
trop[bot]
d32f37f549 docs: the minimum supported version of macOS is now 10.11 (#28516)
* 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-06 08:56:09 +09:00
trop[bot]
0cba5d7a71 fix: free IsolateData in ~NodeEnvironment (#28484)
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-06 08:55:02 +09:00
Electron Bot
d76937f2b9 Bump v13.0.0-beta.11 2021-04-05 08:02:44 -07:00
Electron Bot
2cf6909f48 Bump v13.0.0-beta.10 2021-04-01 08:02:20 -07:00
trop[bot]
fb1a41926a fix: put RemoteCertVerifier upstream from the caching and coalescing layers (#28433)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-31 10:26:07 -07:00
trop[bot]
c87ecabf19 chore: update Community link in default menu (#28459)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-03-31 01:31:51 -07:00
trop[bot]
798ef785b4 fix: handle an unparsable pdf manifest (#28453)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-30 23:21:17 -07:00
Antón Molleda
89e2fe2079 docs: backport current tutorials to 13-x-y (#28397) 2021-03-30 11:53:10 -07:00
trop[bot]
250438c2d9 refactor: remove more uses of v8::Isolate::GetCurrent() (#28429)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-30 00:29:28 -07:00
Electron Bot
1176449cc9 Bump v13.0.0-beta.9 2021-03-29 08:01:40 -07:00
Cheng Zhao
a06af22b99 test: load minimal dict for spellchecker (#28398) 2021-03-29 19:43:51 +09:00
trop[bot]
bda746f2e6 feat: initialize field trials from command line arguments (#28402)
Fixes: #27877

Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
2021-03-29 00:24:59 -07:00
trop[bot]
1f7f60d505 docs: add missing line in web-contents.md (#28399)
* 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-29 09:48:39 +09:00
trop[bot]
50cc80c44e fix: disappearing thumbar after win.hide() (#28390)
* fix: disappearing thumbar after win.hide()

* Add descriptive comment

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-25 12:16:13 -07:00
Electron Bot
00367f0b13 Bump v13.0.0-beta.8 2021-03-25 08:02:12 -07:00
Will Anderson
5d1ada085d docs: update Node API renderer example to use contextBridge (#28370) 2021-03-24 20:40:21 -04:00
trop[bot]
5b414b6f93 fix: isolate Pepper plugins (#28372)
* 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:53:52 -04:00
trop[bot]
831bbc4b55 feat: allow omitting submitURL when uploadToServer is false (#28283)
* feat: allow omitting submitURL when uploadToServer is false

* docs

* fix test

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-24 19:52:42 -04:00
trop[bot]
b89b463a63 doc: desktopCapturer menu position (#28365)
desktopCapturer can be used in both main process and renderer process

Co-authored-by: liulun <xland@live.cn>
2021-03-24 16:59:46 +09:00
trop[bot]
32d3e82d88 fix: make sure service worker scheme is registered with allowServiceWorkers (#28354)
* 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 16:55:13 +09:00
trop[bot]
38de02c50a fix: window.print() in pdf plugin (#28351)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-24 10:01:33 +09:00
trop[bot]
b8ef450cf6 ci: cleanup directories on arm64 machines after running tests (#28331)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-23 09:47:55 -04:00
trop[bot]
168bcaf8f3 fix: libuv hang on Windows (#28335)
* fix: libuv hang on Windows

* test: add a hang test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-23 05:16:04 -07:00
trop[bot]
19d26c4a0c fix: escape URL passed to shell.openExternal on windows (#28342)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-23 05:15:33 -07:00
trop[bot]
20bf768517 refactor: prefer embedder-focused InitializeNodeWithArgs (#28325)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-22 12:36:55 -07:00
Electron Bot
71f631641e Bump v13.0.0-beta.7 2021-03-22 08:02:25 -07:00
trop[bot]
5b3c90e6c6 fix: DesktopCapturer gc'd prior to capture completion (#28280)
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:03:24 +09:00
trop[bot]
fb298ca3db fix: drag region offsets in BrowserViews (#28298)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-22 10:59:47 +09:00
trop[bot]
5f07df4a3d fix: bad menu position when no positioning item specified (#28276)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-19 10:20:35 +09:00
trop[bot]
3ecccf2ad3 feat: add process.contextIsolated property (#28252)
* feat: add process.contextIsolation property

* chore: rename process.contextIsolation to process.contextIsolated

* thing

Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-18 14:01:06 -07:00
Electron Bot
4cafba5e46 Bump v13.0.0-beta.6 2021-03-18 08:01:58 -07:00
trop[bot]
3b049c9074 feat: add process.contextId used by @electron/remote (#28251)
* feat: add process.contextId used by @electron/remote

* Update docs/api/process.md

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

Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-03-18 15:16:46 +09:00
Will Anderson
0c1ee8ae8b docs: Update Quick Start Guide to work with contextIsolation (#28229)
* 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

* docs: add missing curly brace to quick start example code
2021-03-18 15:13:46 +09:00
trop[bot]
4cb842d5e3 fix: recalibrate simpleFullscreen when display metrics change (#28216)
* fix: recalibrate simpleFullscreen when display metrics change

* Address review feedback

* fix: compilation issues

* Address feedback from review

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-18 15:11:02 +09:00
trop[bot]
0ab21dfc98 test: disable some tests under ASan which might receive SIGKILL because of OOM (#28225)
* test: running child app under ASan might receive SIGKILL

* test: renderer process of webview might receive SIGKILL under ASan

* test: increase timeout for asan build

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-17 09:54:25 +09:00
trop[bot]
e3ef14e784 docs: document the parameter structure of hookWindowMessage (#28213)
Fixes #28178

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-16 19:21:21 +09:00
Electron Bot
a12d66d25e Bump v13.0.0-beta.5 2021-03-15 08:01:29 -07:00
trop[bot]
faa5d18389 fix: handle a nil backgroundColor in win.getBackgroundColor() (#28187)
* 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:02 +09:00
Cheng Zhao
042e81aecb test: reliably wait for spellchecker to load (#28168) 2021-03-15 10:28:06 +09:00
trop[bot]
a1b46ef8a2 chore: cherry-pick 1fe571a from node (#28110)
Backports https://github.com/nodejs/node/pull/37000

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-03-15 10:25:40 +09:00
trop[bot]
7f4ab06f11 fix: convert system colors to device color space in systemPreferences (#28173)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-13 05:00:50 -08:00
trop[bot]
c11d6813e4 fix: ensure child window transparency works (#28112)
* 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

* chore: update for PR comments

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-12 09:18:41 -08:00
trop[bot]
c10274663c fix: change #if defined(OS_MACOSX) to #if defined(OS_MAC) (#28153)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-03-12 16:44:25 +09:00
trop[bot]
839137c3f4 docs: fix cookies event documentation for type generation (#28140)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-11 16:22:45 -08:00
Electron Bot
529e7e7797 Bump v13.0.0-beta.4 2021-03-11 07:01:34 -08:00
John Kleinschmidt
2ce64944ab chore: bump chromium to 90.0.4415.0 (master) (#27694) (#28082)
* chore: bump chromium in DEPS to 520c02b46668fc608927e0fcd79b6a90885a48bf

* chore: bump chromium in DEPS to 90.0.4414.0

* resolve chromium conflicts

* resolve v8 conflicts

* fix node gn files

* 2673502: Remove RenderViewCreated use from ExtensionHost.

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

* 2676903: [mojo] Remove most legacy Binding classes.

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

* 2644847: Move self-deleting URLLoaderFactory base into //services/network.

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

* 2664006: Remove from mojo::DataPipe.

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

* 2674530: Remove CertVerifierService feature

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

* 2668748: Move OnSSLCertificateError to a new interface.

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

* 2672923: Remove RAPPOR reporting infrastructure.

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

* 2673502: Remove RenderViewCreated use from ExtensionHost.

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

* 2655126: Convert FrameHostMsg_ContextMenu and FrameMsg_ContextMenuClosed|CustomContextMenuAction to Mojo

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

* 2628705: Window Placement: Implement screen.isExtended and change event

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

* 2643161: Refactor storage::kFileSystem*Native*

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

* fix build

* only remove the biggest subdir of //ios

* chore: bump chromium in DEPS to 90.0.4415.0

* update patches

* update sysroots

* 2686147: Remove WebContentsObserver::RenderViewCreated().

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

* 2596429: Fixing how extension's split and spanning modes affect OriginAccessList.

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

* 2686026: [mojo] Delete AssociatedInterfacePtr (replaced by AssociatedRemote)

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

* 2651705: Move ui/base/dragdrop/file_info to ui/base/clipboard

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

* 358217: drawBitmap is deprecated

https://skia-review.googlesource.com/c/skia/+/358217

* fix gn check

* 2678098: Use gen/front_end as input to generate_devtools_grd

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

* 2674530: Remove CertVerifierService feature

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

* fixup 2664006: Remove from mojo::DataPipe.

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

* fixup build_add_electron_tracing_category.patch

* 2673415: [base] Prepare CrashReporterClient for string16 switch

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

* 2673413: Add CursorFactoryWin to handle Cursors on Windows

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

* 2668748: Move OnSSLCertificateError to a new interface.

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

* fix mas gn check

* update patch after merge

* Update node for .mjs files

* build: load v8_prof_processor dependencies as ESM

* chore: add patch to fix linux 32bit

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
(cherry picked from commit ca75bca667)

Co-authored-by: Electron Bot <electron@github.com>
2021-03-10 10:24:58 -08:00
trop[bot]
e6e1372ea7 fix: capturePage not resolving with hidden windows (#28076)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-09 13:13:33 -08:00
trop[bot]
9e723746e9 test: show full object diff (#28069)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-09 19:52:20 +09:00
trop[bot]
9a2ea12d71 chore: remove obsolete native node module patch (#28055)
* chore: remove obsolete native node module patch

* update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-03-09 17:05:15 +09:00
trop[bot]
877013efe4 build: call goma_ctl.py ensure_start directly (#28061)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-08 19:18:24 -08:00
trop[bot]
4c9317aea0 test: ignore the ready event from PDF Viewer (#28048)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-08 16:30:18 -05:00
trop[bot]
cc9b4dd968 docs: setWindowOpenHandler should show object return (#28035)
* 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:49:02 -05:00
Electron Bot
747842c930 Bump v13.0.0-beta.3 2021-03-08 07:01:55 -08:00
trop[bot]
174e939b26 test: exit after app.relaunch is called (#28031)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-07 19:45:31 +09:00
trop[bot]
f8df8ea9d5 test: fix contextIsolation value for later added test (#28004)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-05 10:10:59 +09:00
Electron Bot
da5e0e5ac2 Bump v13.0.0-beta.2 2021-03-04 07:01:51 -08:00
Electron Bot
b136c51747 Bump v13.0.0-beta.1 2021-03-03 13:38:42 -08:00
658 changed files with 12261 additions and 6288 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.
#
@@ -85,17 +95,17 @@ machine-linux-2xlarge: &machine-linux-2xlarge
machine-mac: &machine-mac
macos:
xcode: "12.2.0"
xcode: "12.4.0"
machine-mac-large: &machine-mac-large
resource_class: large
macos:
xcode: "12.2.0"
xcode: "12.4.0"
machine-mac-large-arm: &machine-mac-large-arm
resource_class: large
macos:
xcode: "12.2.0"
xcode: "12.4.0"
machine-mac-arm64: &machine-mac-arm64
resource_class: electronjs/macos-arm64
@@ -230,6 +240,25 @@ step-maybe-notify-slack-success: &step-maybe-notify-slack-success
fi
when: on_success
step-maybe-cleanup-arm64-mac: &step-maybe-cleanup-arm64-mac
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
@@ -266,7 +295,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
@@ -313,9 +342,11 @@ step-setup-goma-for-build: &step-setup-goma-for-build
npm install
mkdir third_party
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
node -e "require('./src/utils/goma.js').ensure()"
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
@@ -492,6 +523,7 @@ step-gn-check: &step-gn-check
gn check out/Default //electron/shell/common/api:mojo
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
node electron/script/gen-libc++-filenames.js --check
step-electron-build: &step-electron-build
run:
@@ -517,7 +549,10 @@ 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/gen
rm -rf out/Default/clang_x64_v8_arm64/obj
rm -rf out/Default/clang_x64/obj
# 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"
@@ -672,6 +707,11 @@ step-persist-data-for-tests: &step-persist-data-for-tests
- src/third_party/electron_node
- src/third_party/nan
- src/cross-arch-snapshots
- src/third_party/llvm-build
- src/build/linux
- src/buildtools/third_party/libc++
- src/buildtools/third_party/libc++abi
- src/out/Default/obj/buildtools/third_party
step-electron-dist-unzip: &step-electron-dist-unzip
run:
@@ -741,7 +781,7 @@ step-verify-mksnapshot: &step-verify-mksnapshot
command: |
if [ "$IS_ASAN" != "1" ]; then
cd src
if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
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
@@ -822,6 +862,17 @@ step-hunspell-store: &step-hunspell-store
path: src/out/Default/hunspell_dictionaries.zip
destination: hunspell_dictionaries.zip
step-maybe-generate-libcxx: &step-maybe-generate-libcxx
run:
name: maybe generate libcxx
command: |
cd src
if [ "`uname`" == "Linux" ]; then
ninja -C out/Default electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
fi
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
run:
name: Generate breakpad symbols
@@ -840,7 +891,7 @@ step-maybe-zip-symbols: &step-maybe-zip-symbols
export BUILD_PATH="$PWD/out/Default"
ninja -C out/Default electron:licenses
ninja -C out/Default electron:electron_version
electron/script/zip-symbols.py -b $BUILD_PATH
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
step-symbols-store: &step-symbols-store
store_artifacts:
@@ -875,28 +926,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
if [ x"$MAS_BUILD" == x"true" ]; then
export DEVOPS_BUILD="electron-mas-arm64-testing"
else
export DEVOPS_BUILD="electron-osx-arm64-testing"
fi
echo "Triggering $DEVOPS_BUILD build on Azure DevOps"
node electron/script/release/ci-release-build.js --job=$DEVOPS_BUILD --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
@@ -1018,7 +1047,7 @@ step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-c
name: Remove some unused data to avoid storing it in the workspace/cache
command: |
rm -rf src/android_webview
rm -rf src/ios
rm -rf src/ios/chrome
rm -rf src/third_party/blink/web_tests
rm -rf src/third_party/blink/perf_tests
rm -rf src/third_party/WebKit/LayoutTests
@@ -1311,7 +1340,7 @@ steps-tests: &steps-tests
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split)) 2>&1 | $ASAN_SYMBOLIZE
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split)) 2>&1 | $ASAN_SYMBOLIZE
else
if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
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)
@@ -1340,6 +1369,8 @@ steps-tests: &steps-tests
- *step-maybe-notify-slack-failure
- *step-maybe-cleanup-arm64-mac
steps-test-nan: &steps-test-nan
steps:
- attach_workspace:
@@ -1600,9 +1631,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:
@@ -1670,6 +1698,9 @@ commands:
- *step-hunspell-build
- *step-hunspell-store
# libcxx
- *step-maybe-generate-libcxx
# typescript defs
- *step-maybe-generate-typescript-defs
@@ -1943,7 +1974,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
@@ -2002,7 +2033,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
@@ -2311,7 +2342,7 @@ jobs:
<<: *steps-tests
linux-x64-testing-asan-tests:
<<: *machine-linux-medium
<<: *machine-linux-xlarge
environment:
<<: *env-linux-medium
<<: *env-headless-testing
@@ -2399,6 +2430,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:
@@ -2595,15 +2644,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 >>
@@ -2647,8 +2700,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

@@ -1,6 +1,7 @@
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//components/os_crypt/features.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//content/public/app/mac_helpers.gni")
import("//extensions/buildflags/buildflags.gni")
@@ -25,6 +26,8 @@ import("electron_paks.gni")
import("filenames.auto.gni")
import("filenames.gni")
import("filenames.hunspell.gni")
import("filenames.libcxx.gni")
import("filenames.libcxxabi.gni")
if (is_mac) {
import("//build/config/mac/rules.gni")
@@ -290,7 +293,7 @@ templated_file("electron_version_header") {
action("electron_fuses") {
script = "build/fuses/build.py"
inputs = [ "build/fuses/fuses.json" ]
inputs = [ "build/fuses/fuses.json5" ]
outputs = [
"$target_gen_dir/fuses.h",
@@ -329,6 +332,7 @@ source_set("electron_lib") {
"//components/network_hints/common:mojo_bindings",
"//components/network_hints/renderer",
"//components/network_session_configurator/common",
"//components/os_crypt",
"//components/pref_registry",
"//components/prefs",
"//components/upload_list",
@@ -402,7 +406,10 @@ source_set("electron_lib") {
}
if (!is_mas_build) {
deps += [ "//components/crash/core/app" ]
deps += [
"//components/crash/core/app",
"//components/crash/core/browser",
]
}
sources = filenames.lib_sources
@@ -440,6 +447,7 @@ source_set("electron_lib") {
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
"//components/remote_cocoa/browser",
"//content/common:mac_helpers",
"//ui/accelerated_widget_mac",
]
@@ -619,6 +627,9 @@ source_set("electron_lib") {
"//chrome/services/printing/public/mojom",
"//components/printing/common:mojo_interfaces",
]
if (is_mac) {
deps += [ "//chrome/services/mac_notifications/public/mojom" ]
}
}
if (enable_electron_extensions) {
@@ -632,6 +643,7 @@ source_set("electron_lib") {
"//components/zoom",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/browser/updater",
"//extensions/common",
"//extensions/common:core_api_provider",
"//extensions/renderer",
@@ -668,6 +680,10 @@ source_set("electron_lib") {
]
libs += [ "uxtheme.lib" ]
}
if (allow_runtime_configurable_key_storage) {
defines += [ "ALLOW_RUNTIME_CONFIGURABLE_KEY_STORAGE" ]
}
}
electron_paks("packed_resources") {
@@ -1284,13 +1300,18 @@ template("dist_zip") {
"testonly",
])
flatten = false
flatten_relative_to = false
if (defined(invoker.flatten)) {
flatten = invoker.flatten
if (defined(invoker.flatten_relative_to)) {
flatten_relative_to = invoker.flatten_relative_to
}
}
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
target_cpu,
target_os,
"$flatten",
"$flatten_relative_to",
]
}
}
@@ -1381,6 +1402,43 @@ dist_zip("hunspell_dictionaries_zip") {
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
}
copy("libcxx_headers") {
sources = libcxx_headers + libcxx_licenses
outputs = [ "$target_gen_dir/electron_libcxx_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
}
dist_zip("libcxx_headers_zip") {
data_deps = [ ":libcxx_headers" ]
flatten = true
flatten_relative_to = rebase_path(
"$target_gen_dir/electron_libcxx_include/buildtools/third_party/libc++/trunk",
"$root_out_dir")
outputs = [ "$root_build_dir/libcxx_headers.zip" ]
}
copy("libcxxabi_headers") {
sources = libcxxabi_headers + libcxxabi_licenses
outputs = [ "$target_gen_dir/electron_libcxxabi_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
}
dist_zip("libcxxabi_headers_zip") {
data_deps = [ ":libcxxabi_headers" ]
flatten = true
flatten_relative_to = rebase_path(
"$target_gen_dir/electron_libcxxabi_include/buildtools/third_party/libc++abi/trunk",
"$root_out_dir")
outputs = [ "$root_build_dir/libcxxabi_headers.zip" ]
}
action("libcxx_objects_zip") {
deps = [ "//buildtools/third_party/libc++" ]
script = "build/zip_libcxx.py"
outputs = [ "$root_build_dir/libcxx_objects.zip" ]
args = rebase_path(outputs)
}
group("electron") {
public_deps = [ ":electron_app" ]
}

View File

@@ -22,7 +22,7 @@ Issues are created [here](https://github.com/electron/electron/issues/new).
### Issue Closure
Bug reports will be closed if the issue has been inactive and the latest affected version no longer receives support. At the moment, Electron maintains its three latest major versions, with a new major version being released every 12 weeks. (For more information on Electron's release cadence, see [this blog post](https://electronjs.org/blog/12-week-cadence).)
Bug reports will be closed if the issue has been inactive and the latest affected version no longer receives support. At the moment, Electron maintains its three latest major versions, with a new major version being released every 8 weeks. (For more information on Electron's release cadence, see [this blog post](https://electronjs.org/blog/8-week-cadence).)
_If an issue has been closed and you still feel it's relevant, feel free to ping a maintainer or add a comment!_

11
DEPS
View File

@@ -10,17 +10,18 @@ gclient_gn_args = [
'checkout_openxr',
'checkout_google_benchmark',
'mac_xcode_version',
'generate_location_tags',
]
vars = {
'chromium_version':
'1f252b391a40e2681b0d9aff6497b7401863d1fc',
'91.0.4472.164',
'node_version':
'v14.16.0',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
'v2.14.2',
'squirrel.mac_version':
'cdc0729c8bf8576bfef18629186e1e9ecf1b0d9f',
'0e5d146ba13101a1302d59ea6e6e0b3cace4ae38',
'pyyaml_version': '3.12',
@@ -48,8 +49,12 @@ vars = {
# It's only needed to parse the native tests configurations.
'checkout_pyyaml': False,
'use_rts': False,
'mac_xcode_version': 'default',
'generate_location_tags': False,
# To allow running hooks without parsing the DEPS tree
'process_deps': True,

View File

@@ -1 +1 @@
13.0.0-nightly.20210303
13.2.0

View File

@@ -5,7 +5,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

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

View File

@@ -64,7 +64,7 @@ steps:
set npm_config_arch=arm64
cd electron
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion
node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion --disable-gpu
displayName: 'Run Electron tests'
env:
ELECTRON_OUT_DIR: Default

View File

@@ -19,4 +19,17 @@ enable_basic_printing = true
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
# This breaks native node modules
libcxx_abi_unstable = false
# These are disabled because they cause the zip manifest to differ between
# testing and release builds.
# See https://chromium-review.googlesource.com/c/chromium/src/+/2774898.
enable_pseudolocales = false
is_cfi = false
# Make application name configurable at runtime for cookie crypto
allow_runtime_configurable_key_storage = true
enable_cet_shadow_stack = false

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from collections import OrderedDict
import json
import os
import sys
@@ -49,8 +50,8 @@ const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version *
}
"""
with open(os.path.join(dir_path, "fuses.json"), 'r') as f:
fuse_defaults = json.load(f)
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:
fuse_defaults = json.loads(''.join(line for line in f.readlines() if not line.strip()[0] == "/"), object_pairs_hook=OrderedDict)
fuse_version = fuse_defaults['_version']
del fuse_defaults['_version']

View File

@@ -2,5 +2,6 @@
"_comment": "Modifying the fuse schema in any breaking way should result in the _version prop being incremented. NEVER remove a fuse or change its meaning, instead mark it as removed with 'r'",
"_schema": "0 == off, 1 == on, r == removed fuse",
"_version": 1,
"run_as_node": "1"
"run_as_node": "1",
"cookie_encryption": "0"
}

View File

@@ -8,6 +8,7 @@
# require any direct Cocoa locale support.
import os
import errno
import sys
@@ -16,7 +17,7 @@ def main(args):
try:
os.makedirs(dirname)
except OSError as e:
if e.errno == os.errno.EEXIST:
if e.errno == errno.EEXIST:
# It's OK if it already exists
pass
else:

View File

@@ -15,12 +15,6 @@ args = [cmd, "run",
try:
subprocess.check_output(args, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
print(
"NPM script '"
+ sys.argv[2]
+ "' failed with code '"
+ str(e.returncode)
+ "':\n"
+ e.output
)
error_msg = "NPM script '{}' failed with code '{}':\n".format(sys.argv[2], e.returncode)
print(error_msg + 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

@@ -39,6 +39,7 @@ PATHS_TO_SKIP = [
'./crashpad_handler',
# Skip because these are outputs that we don't need.
'resources/inspector',
'gen/third_party/devtools-frontend/src'
]
def skip_path(dep, dist_zip, target_cpu):
@@ -70,7 +71,7 @@ def execute(argv):
raise e
def main(argv):
dist_zip, runtime_deps, target_cpu, _, flatten_val = argv
dist_zip, runtime_deps, target_cpu, _, flatten_val, flatten_relative_to = argv
should_flatten = flatten_val == "true"
dist_files = set()
with open(runtime_deps) as f:
@@ -97,11 +98,18 @@ def main(argv):
if basename == 'chrome_sandbox'
else dep
)
name_to_write = arcname
if should_flatten:
if flatten_relative_to:
if name_to_write.startswith(flatten_relative_to):
name_to_write = name_to_write[len(flatten_relative_to):]
else:
name_to_write = os.path.basename(arcname)
else:
name_to_write = os.path.basename(arcname)
z.write(
dep,
os.path.basename(arcname)
if should_flatten
else arcname,
name_to_write,
)
if __name__ == '__main__':

47
build/zip_libcxx.py Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
import sys
import zipfile
def execute(argv):
try:
output = subprocess.check_output(argv, stderr=subprocess.STDOUT)
return output
except subprocess.CalledProcessError as e:
print(e.output)
raise e
def get_object_files(base_path, archive_name):
archive_file = os.path.join(base_path, archive_name)
output = execute(['nm', '-g', archive_file]).decode('ascii')
object_files = set()
lines = output.split("\n")
for line in lines:
if line.startswith(base_path):
object_file = line.split(":")[0]
object_files.add(object_file)
if line.startswith('nm: '):
object_file = line.split(":")[1].lstrip()
object_files.add(object_file)
return list(object_files) + [archive_file]
def main(argv):
dist_zip, = argv
out_dir = os.path.dirname(dist_zip)
base_path_libcxx = os.path.join(out_dir, 'obj/buildtools/third_party/libc++')
base_path_libcxxabi = os.path.join(out_dir, 'obj/buildtools/third_party/libc++abi')
object_files_libcxx = get_object_files(base_path_libcxx, 'libc++.a')
object_files_libcxxabi = get_object_files(base_path_libcxxabi, 'libc++abi.a')
with zipfile.ZipFile(
dist_zip, 'w', zipfile.ZIP_DEFLATED, allowZip64=True
) as z:
object_files_libcxx.sort()
for object_file in object_files_libcxx:
z.write(object_file, os.path.relpath(object_file, base_path_libcxx))
for object_file in object_files_libcxxabi:
z.write(object_file, os.path.relpath(object_file, base_path_libcxxabi))
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))

View File

@@ -2,6 +2,7 @@
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
import("//build/config/ozone.gni")
import("//build/config/ui.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//electron/buildflags/buildflags.gni")
@@ -16,8 +17,6 @@ static_library("chrome") {
"//chrome/browser/accessibility/accessibility_ui.h",
"//chrome/browser/browser_process.cc",
"//chrome/browser/browser_process.h",
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc",
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.h",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
@@ -46,7 +45,6 @@ static_library("chrome") {
"//chrome/browser/predictors/resolve_host_client_impl.h",
"//chrome/browser/ssl/security_state_tab_helper.cc",
"//chrome/browser/ssl/security_state_tab_helper.h",
"//chrome/browser/ssl/tls_deprecation_config.cc",
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
"//extensions/browser/app_window/size_constraints.cc",
@@ -95,12 +93,18 @@ static_library("chrome") {
if (is_linux) {
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
if (use_x11 || use_ozone) {
sources +=
[ "//chrome/browser/extensions/global_shortcut_listener_linux.cc" ]
}
if (use_x11) {
sources += [
"//chrome/browser/extensions/global_shortcut_listener_x11.cc",
"//chrome/browser/extensions/global_shortcut_listener_x11.h",
]
} else if (use_ozone) {
}
if (use_ozone) {
deps += [ "//ui/ozone" ]
sources += [
"//chrome/browser/extensions/global_shortcut_listener_ozone.cc",
"//chrome/browser/extensions/global_shortcut_listener_ozone.h",
@@ -141,6 +145,8 @@ 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",
@@ -191,7 +197,7 @@ static_library("chrome") {
}
if (is_linux) {
sources += [ "//chrome/browser/media/webrtc/window_icon_util_x11.cc" ]
sources += [ "//chrome/browser/media/webrtc/window_icon_util_linux.cc" ]
}
}
@@ -253,8 +259,12 @@ static_library("chrome") {
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.cc",
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.h",
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.h",
"//chrome/browser/ui/views/overlay/constants.h",
"//chrome/browser/ui/views/overlay/hang_up_button.cc",
"//chrome/browser/ui/views/overlay/hang_up_button.h",
"//chrome/browser/ui/views/overlay/overlay_window_views.cc",
"//chrome/browser/ui/views/overlay/overlay_window_views.h",
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
@@ -263,6 +273,10 @@ static_library("chrome") {
"//chrome/browser/ui/views/overlay/resize_handle_button.h",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.cc",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.h",
"//chrome/browser/ui/views/overlay/toggle_camera_button.cc",
"//chrome/browser/ui/views/overlay/toggle_camera_button.h",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.cc",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.h",
"//chrome/browser/ui/views/overlay/track_image_button.cc",
"//chrome/browser/ui/views/overlay/track_image_button.h",
]

View File

@@ -90,7 +90,7 @@ CertificateManagerModel::~CertificateManagerModel() = default;
int CertificateManagerModel::ImportFromPKCS12(
PK11SlotInfo* slot_info,
const std::string& data,
const base::string16& password,
const std::u16string& password,
bool is_extractable,
net::ScopedCERTCertificateList* imported_certs) {
return cert_db_->ImportFromPKCS12(slot_info, data, password, is_extractable,

View File

@@ -12,7 +12,6 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "net/cert/nss_cert_database.h"
namespace content {
@@ -46,7 +45,7 @@ class CertificateManagerModel {
// Returns a net error code on failure.
int ImportFromPKCS12(PK11SlotInfo* slot_info,
const std::string& data,
const base::string16& password,
const std::u16string& password,
bool is_extractable,
net::ScopedCERTCertificateList* imported_certs);

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,20 +18,14 @@ an issue:
## Guides and Tutorials
### Quickstart
### Getting started
* [Quick Start Guide](tutorial/quick-start.md)
* [Prerequisites](tutorial/quick-start.md#prerequisites)
* [Create a basic application](tutorial/quick-start.md#create-a-basic-application)
* [Run your application](tutorial/quick-start.md#run-your-application)
* [Package and distribute the application](tutorial/quick-start.md#package-and-distribute-the-application)
* [Introduction](tutorial/introduction.md)
* [Quick Start](tutorial/quick-start.md)
* [Process Model](tutorial/process-model.md)
### Learning the basics
* [Electron's Process Model](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)
* Adding Features to Your App
* [Notifications](tutorial/notifications.md)
* [Recent Documents](tutorial/recent-documents.md)
@@ -59,6 +53,7 @@ an issue:
* [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)
* [Manually Enabling Accessibility Features](tutorial/accessibility.md#manually-enabling-accessibility-features)
* [Testing and Debugging](tutorial/application-debugging.md)
@@ -68,6 +63,7 @@ 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)
@@ -126,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)
@@ -135,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)
@@ -144,15 +143,14 @@ These individual tutorials expand on topics discussed in the guide above.
### Modules for the Renderer Process (Web Page):
* [contextBridge](api/context-bridge.md)
* [desktopCapturer](api/desktop-capturer.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

View File

@@ -753,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).
@@ -929,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

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

@@ -187,9 +187,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `parent` BrowserWindow (optional) - Specify parent window. Default is `null`.
* `modal` Boolean (optional) - Whether this is a modal window. This only works when the
window is a child window. Default is `false`.
* `acceptFirstMouse` Boolean (optional) - Whether the web view accepts a single
mouse-down event that simultaneously activates the window. Default is
`false`.
* `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also
click through to the web contents. Default is `false` on macOS. This option is not
configurable on other platforms.
* `disableAutoHideCursor` Boolean (optional) - Whether to hide cursor when typing.
Default is `false`.
* `autoHideMenuBar` Boolean (optional) - Auto hide the menu bar unless the `Alt`
@@ -238,7 +238,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
window shadow and window animations. Default is `true`.
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
`menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that using `frame: false` in combination with a vibrancy value requires that you use a non-default `titleBarStyle` as well. Also note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
`menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
option-clicking the green stoplight button on the toolbar or by clicking the
Window > Zoom menu item. If `true`, the window will grow to the preferred
@@ -267,12 +267,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
@@ -339,7 +339,7 @@ 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 only have
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
@@ -351,8 +351,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
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
@@ -1301,7 +1300,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
@@ -1319,6 +1318,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.
@@ -1371,7 +1372,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])`
@@ -1380,7 +1381,7 @@ Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL.
* `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md)) (optional)
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional)
* `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files.
Returns `Promise<void>` - the promise will resolve when the page has finished loading

View File

@@ -71,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

@@ -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.
@@ -41,7 +41,7 @@ When `contextIsolation` is enabled in your `webPreferences`, your `preload` scri
The `contextBridge` module has the following methods:
### `contextBridge.exposeInMainWorld(apiKey, api)` _Experimental_
### `contextBridge.exposeInMainWorld(apiKey, api)`
* `apiKey` String - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
* `api` any - Your API, more information on what this API can be and how it works is available below.
@@ -50,7 +50,7 @@ The `contextBridge` module has the following methods:
### API
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api-experimental) must be a `Function`, `String`, `Number`, `Array`, `Boolean`, or an object
The `api` provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api) 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
@@ -110,3 +110,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

@@ -77,7 +77,8 @@ The `crashReporter` module has the following methods:
### `crashReporter.start(options)`
* `options` Object
* `submitURL` String - URL that crash reports will be sent to as POST.
* `submitURL` String (optional) - URL that crash reports will be sent to as
POST. Required unless `uploadToServer` is `false`.
* `productName` String (optional) - Defaults to `app.name`.
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
`{ globalExtra: { _companyName: ... } }`.

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

@@ -83,8 +83,10 @@ win.show()
blur effect to the content below the window (i.e. other applications open on
the user's system).
* The window will not be transparent when DevTools is opened.
* On Windows operating systems, transparent windows will not work when DWM is
* 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

@@ -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

@@ -1,3 +1,5 @@
# Menu
## Class: Menu
> Create native application menus and context menus.
@@ -160,7 +162,7 @@ const template = [
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }

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

@@ -30,11 +30,13 @@ In sandboxed renderers the `process` object contains only a subset of the APIs:
* `arch`
* `platform`
* `sandboxed`
* `contextIsolated`
* `type`
* `version`
* `versions`
* `mas`
* `windowsStore`
* `contextId`
## Events
@@ -43,19 +45,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_
@@ -93,6 +82,11 @@ A `String` representing the path to the resources directory.
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
otherwise it is `undefined`.
### `process.contextIsolated` _Readonly_
A `Boolean` that indicates whether the current renderer context has `contextIsolation` enabled.
It is `undefined` in the main process.
### `process.throwDeprecation`
A `Boolean` that controls whether or not deprecation warnings will be thrown as
@@ -133,6 +127,13 @@ A `String` representing Electron's version string.
A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
for otherwise it is `undefined`.
### `process.contextId` _Readonly_
A `String` (optional) representing a globally unique ID of the current JavaScript context.
Each frame has its own JavaScript context. When contextIsolation is enabled, the isolated
world also has a separate JavaScript context.
This property is only available in the renderer process.
## Methods
The `process` object has the following methods:

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

@@ -822,6 +822,11 @@ Returns `Extension[]` - A list of all loaded extensions.
**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.
#### `ses.getStoragePath()`
A `String | null` indicating the absolute file system path where data for this
session is persisted on disk. For in memory sessions this returns `null`.
### Instance Properties
The following properties are available on instances of `Session`:
@@ -835,6 +840,11 @@ code to the `setSpellCheckerLanguages` API that isn't in this array will result
A `Boolean` indicating whether builtin spell checker is enabled.
#### `ses.storagePath` _Readonly_
A `String | null` indicating the absolute file system path where data for this
session is persisted on disk. For in memory sessions this returns `null`.
#### `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

@@ -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 @@
# PostBody Object
* `data` Array<[PostData](./post-data.md)> - The post data to be sent to the
* `data` ([UploadRawData](upload-raw-data.md) | [UploadFile](upload-file.md))[] - The post data to be sent to the
new window.
* `contentType` String - The `content-type` header used for the data. One of
`application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to

View File

@@ -1,21 +0,0 @@
# PostData Object
* `type` String - One of the following:
* `rawData` - The data is available as a `Buffer`, in the `rawData` field.
* `file` - The object represents a file. The `filePath`, `offset`, `length`
and `modificationTime` fields will be used to describe the file.
* `blob` - The object represents a `Blob`. The `blobUUID` field will be used
to describe the `Blob`.
* `bytes` String (optional) - The raw bytes of the post data in a `Buffer`.
Required for the `rawData` type.
* `filePath` String (optional) - The path of the file being uploaded. Required
for the `file` type.
* `blobUUID` String (optional) - The `UUID` of the `Blob` being uploaded.
Required for the `blob` type.
* `offset` Integer (optional) - The offset from the beginning of the file being
uploaded, in bytes. Only valid for `file` types.
* `length` Integer (optional) - The length of the file being uploaded, in bytes.
If set to `-1`, the whole file will be uploaded. Only valid for `file` types.
* `modificationTime` Double (optional) - The modification time of the file
represented by a double, which is the number of seconds since the `UNIX Epoch`
(Jan 1, 1970). Only valid for `file` types.

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

@@ -914,7 +914,7 @@ in `webPreferences`.
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n".
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md)) (optional)
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Returns `Promise<void>` - the promise will resolve when the page has finished loading
@@ -1184,6 +1184,16 @@ 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()`.
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
`new-window`, `save-to-disk` or `other`.
* `referrer` [Referrer](structures/referrer.md) - The referrer that will be
passed to the new window. May or may not result in the `Referer` header being
sent, depending on the referrer policy.
* `postBody` [PostBody](structures/post-body.md) (optional) - The post data that
will be sent to the new window, along with the appropriate headers that will
be set. If no post data is to be sent, the value will be `null`. Only defined
when the window is being created by a form that set `target=_blank`.
Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
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
@@ -1320,8 +1330,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`.
@@ -1363,19 +1372,21 @@ Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
Returns `Boolean` - Whether this page is being captured. It returns true when the capturer count
is large then 0.
#### `contents.incrementCapturerCount([size, stayHidden])`
#### `contents.incrementCapturerCount([size, stayHidden, stayAwake])`
* `size` [Size](structures/size.md) (optional) - The preferred size for the capturer.
* `stayHidden` Boolean (optional) - Keep the page hidden instead of visible.
* `stayAwake` Boolean (optional) - Keep the system awake instead of allowing it to sleep.
Increase the capturer count by one. The page is considered visible when its browser window is
hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.
This also affects the Page Visibility API.
#### `contents.decrementCapturerCount([stayHidden])`
#### `contents.decrementCapturerCount([stayHidden, stayAwake])`
* `stayHidden` Boolean (optional) - Keep the page in hidden state instead of visible.
* `stayAwake` Boolean (optional) - Keep the system awake instead of allowing it to sleep.
Decrease the capturer count by one. The page will be set to hidden or occluded state when its
browser window is hidden or occluded and the capturer count reaches zero. If you want to

View File

@@ -62,6 +62,11 @@ Sets the maximum and minimum pinch-to-zoom level.
> webFrame.setVisualZoomLevelLimits(1, 3)
> ```
> **NOTE**: Visual zoom only applies to pinch-to-zoom behavior. Cmd+/-/0 zoom shortcuts are
> controlled by the 'zoomIn', 'zoomOut', and 'resetZoom' MenuItem roles in the application
> Menu. To disable shortcuts, manually [define the Menu](./menu.md#examples) and omit zoom roles
> from the definition.
### `webFrame.setSpellCheckProvider(language, provider)`
* `language` String

View File

@@ -154,7 +154,6 @@ response are visible by the time this listener is fired.
* `timestamp` Double
* `statusLine` String
* `statusCode` Integer
* `requestHeaders` Record<string, string>
* `responseHeaders` Record<string, string[]> (optional)
* `callback` Function
* `headersReceivedResponse` Object

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
@@ -274,7 +274,7 @@ webview.addEventListener('dom-ready', () => {
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url.
* `userAgent` String (optional) - A user agent originating the request.
* `extraHeaders` String (optional) - Extra headers separated by "\n"
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md)) (optional)
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional)
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
Returns `Promise<void>` - The promise will resolve when the page has finished loading
@@ -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:

View File

@@ -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

@@ -136,6 +136,22 @@ systemPreferences.isHighContrastColorScheme()
nativeTheme.shouldUseHighContrastColors
```
### Deprecated: WebContents `new-window` event
The `new-window` event of WebContents has been deprecated. It is replaced by [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler).
```js
// Deprecated in Electron 13
webContents.on('new-window', (event) => {
event.preventDefault()
})
// Replace with
webContents.setWindowOpenHandler((details) => {
return { action: 'deny' }
})
```
## Planned Breaking API Changes (12.0)
### Removed: Pepper Flash support
@@ -160,6 +176,9 @@ 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()`

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

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

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

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.

View File

@@ -33,8 +33,7 @@ contributing, and more. Please use the issue tracker for bugs only!
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](https://github.com/electron/electron/blob/master/.github/ISSUE_TEMPLATE/Bug_report.md)
that should be filled in.
will be presented with a template that should be filled in.
If you believe that you have found a bug in Electron, please fill out the template
to the best of your ability.

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

@@ -7,12 +7,9 @@
</head>
<body>
<h1>Hello World!</h1>
<p>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<a href="#" id="drag">Drag me</a>
<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

@@ -1,21 +1,28 @@
const { app, BrowserWindow, ipcMain, nativeImage, NativeImage } = require('electron')
const fs = require('fs');
const http = require('http');
const path = require('path')
const fs = require('fs')
const https = require('https')
function createWindow () {
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
}
const iconName = 'iconForDragAndDrop.png';
const icon = fs.createWriteStream(`${process.cwd()}/${iconName}`);
http.get('http://img.icons8.com/ios/452/drag-and-drop.png', (response) => {
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);
});
@@ -23,8 +30,8 @@ app.whenReady().then(createWindow)
ipcMain.on('ondragstart', (event, filePath) => {
event.sender.startDrag({
file: filePath,
icon: `${process.cwd()}/${iconName}`
file: path.join(__dirname, filePath),
icon: iconName,
})
})

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

@@ -1,9 +1,9 @@
const { ipcRenderer } = require('electron')
const fs = require('fs')
document.getElementById('drag').ondragstart = (event) => {
const fileName = 'drag-and-drop.md'
fs.writeFileSync(fileName, '# Test drag and drop');
document.getElementById('drag1').ondragstart = (event) => {
event.preventDefault()
ipcRenderer.send('ondragstart', process.cwd() + `/${fileName}`)
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

@@ -7,10 +7,6 @@
</head>
<body>
<h1>Hello World!</h1>
<p>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<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

@@ -4,9 +4,6 @@ function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('index.html')

View File

@@ -7,8 +7,6 @@
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
<p>Hit Ctrl+I to see a message printed to the console.</p>
</body>
</html>

View File

@@ -1,7 +1,7 @@
const { app, BrowserWindow } = require('electron')
app.whenReady().then(() => {
const win = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true } })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadFile('index.html')
win.webContents.on('before-input-event', (event, input) => {

View File

@@ -7,10 +7,6 @@
</head>
<body>
<h1>Hello World!</h1>
<p>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<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

@@ -4,9 +4,6 @@ function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('index.html')

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

@@ -1,11 +1,12 @@
const { app, BrowserWindow, ipcMain, nativeTheme } = require('electron')
const path = require('path')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
preload: path.join(__dirname, 'preload.js')
}
})
@@ -21,20 +22,22 @@ function createWindow () {
})
ipcMain.handle('dark-mode:system', () => {
nativeTheme.themeSouce = 'system'
nativeTheme.themeSource = 'system'
})
}
app.whenReady().then(createWindow)
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
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 { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('darkMode', {
toggle: () => ipcRenderer.invoke('dark-mode:toggle'),
system: () => ipcRenderer.invoke('dark-mode:system')
})

View File

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

View File

@@ -7,10 +7,6 @@
</head>
<body>
<h1>Hello World!</h1>
<p>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<p>Right click the dock icon to see the custom menu options.</p>
</body>
</html>

View File

@@ -4,9 +4,6 @@ function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('index.html')
@@ -27,7 +24,9 @@ const dockMenu = Menu.buildFromTemplate([
])
app.whenReady().then(() => {
app.dock.setMenu(dockMenu)
if (process.platform === 'darwin') {
app.dock.setMenu(dockMenu)
}
}).then(createWindow)
app.on('window-all-closed', () => {

View File

@@ -7,10 +7,6 @@
</head>
<body>
<h1>Hello World!</h1>
<p>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<p>After launching this application, you should see the system notification.</p>
</body>
</html>

View File

@@ -3,21 +3,17 @@ const { app, BrowserWindow, Notification } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
height: 600
})
win.loadFile('index.html')
}
const NOTIFICATION_TITLE = 'Basic Notification'
const NOTIFICATION_BODY = 'Notification from the Main process'
function showNotification () {
const notification = {
title: 'Basic Notification',
body: 'Notification from the Main process'
}
new Notification(notification).show()
new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
}
app.whenReady().then(createWindow).then(showNotification)

View File

@@ -7,11 +7,9 @@
</head>
<body>
<h1>Hello World!</h1>
<p>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<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

@@ -3,10 +3,7 @@ const { app, BrowserWindow } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
height: 600
})
win.loadFile('index.html')

View File

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

View File

@@ -1,15 +0,0 @@
<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>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
</body>
</html>

View File

@@ -1,5 +1,6 @@
const { app, BrowserWindow } = require('electron')
const fs = require('fs')
const path = require('path')
app.disableHardwareAcceleration()
@@ -12,7 +13,7 @@ app.whenReady().then(() => {
fs.writeFileSync('ex.png', image.toPNG())
})
win.webContents.setFrameRate(60)
console.log(`The screenshot has been successfully saved to ${process.cwd()}/ex.png`)
console.log(`The screenshot has been successfully saved to ${path.join(process.cwd(), 'ex.png')}`)
})
app.on('window-all-closed', () => {

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

@@ -1,17 +0,0 @@
<!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>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<script src="renderer.js"></script>
</body>
</html>

View File

@@ -1,24 +0,0 @@
const { app, BrowserWindow, ipcMain } = require('electron')
let onlineStatusWindow
app.whenReady().then(() => {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false, webPreferences: { nodeIntegration: true } })
onlineStatusWindow.loadURL(`file://${__dirname}/index.html`)
})
ipcMain.on('online-status-changed', (event, status) => {
console.log(status)
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -1,7 +0,0 @@
const { ipcRenderer } = require('electron')
const updateOnlineStatus = () => { ipcRenderer.send('online-status-changed', navigator.onLine ? 'online' : 'offline') }
window.addEventListener('online', updateOnlineStatus)
window.addEventListener('offline', updateOnlineStatus)
updateOnlineStatus()

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

@@ -1,17 +0,0 @@
<!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>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</p>
<script src="renderer.js"></script>
</body>
</html>

View File

@@ -1,20 +0,0 @@
const { app, BrowserWindow } = require('electron')
let onlineStatusWindow
app.whenReady().then(() => {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
onlineStatusWindow.loadURL(`file://${__dirname}/index.html`)
})
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