Compare commits

...

927 Commits

Author SHA1 Message Date
Electron Bot
02acc6240c Bump v11.4.9 2021-06-21 10:36:11 -07:00
Pedro Pontes
8117de4f3a chore: cherry-pick 0e36d324d6ef from chromium (#29777)
* chore: cherry-pick 0e36d324d6ef from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-06-21 19:07:29 +09:00
Pedro Pontes
8dc67102e7 fix: cherry-pick 951a47c530 from v8 (#29780)
* cherry-pick 951a47c530 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-21 15:54:23 +09:00
Pedro Pontes
41069568e6 chore: cherry-pick 1856470e25 and 9037876f53 from chromium (#29787)
* cherry-pick 1856470e25 and 9037876f53 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-06-21 15:52:05 +09:00
trop[bot]
0724cac92b fix: copy received data in URLPipeLoader to prevent corruption (#29667)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2021-06-14 17:46:42 +09:00
Milan Burda
bb0ec12273 test: add spec for --require filtering in NODE_OPTIONS (#29505) 2021-06-04 08:14:53 +09:00
Electron Bot
2c8f2f9b28 Bump v11.4.8 2021-06-03 02:39:35 -07:00
Milan Burda
f0bef96223 fix: pass updated NODE_OPTIONS to Node.js (#29419) 2021-06-03 14:55:25 +09:00
trop[bot]
2d0b649227 refactor: point prepare-release at main (#29495)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-06-02 14:05:14 -07:00
trop[bot]
df27544988 refactor: use main in release-notes (#29413)
* 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:13 -07:00
trop[bot]
b4757c778f refactor: publish-to-npm respects main (#29406) 2021-05-31 10:33:04 +02:00
trop[bot]
b4131bb4a0 refactor: version-utils respects main (#29393)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-27 18:45:04 -07:00
trop[bot]
1859c4a82f refactor: getCurrentBranch respects main (#29387)
* refactor: getCurrentBranch respects main

* add note about migration

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-27 18:43:56 -07:00
trop[bot]
ad07075de6 build: ensure that mksnapshot for Apple Silicon has all of the needed files for snapshot generation (#29338) (#29347)
* build: include mksnapshot args in arm64 mksnapshot.zip

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

(cherry picked from commit d0b9a931cc)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-05-27 11:47:01 -04:00
trop[bot]
23c84be4b2 fix: dnd for some wm that does not set _NET_CLIENT_LIST_STACKING (#29271)
* fix: dnd for some wm that does not set _NET_CLIENT_LIST_STACKING

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

* Update .patches

* chore: update patches

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

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

* chore: update patches

* fix patch for 1200490

* chore: update patches

Co-authored-by: Andrey Belenko <anbelen@microsoft.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-05-20 11:04:40 -07:00
trop[bot]
d76dd6bcba docs: option title for showSaveDialog is not supported for some platforms (#29230) 2021-05-19 16:05:30 +02:00
trop[bot]
487cb46f9c fix: window bounds not scaled from screen coordinates (#29225)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-05-19 16:18:21 +09:00
Electron Bot
717b5263d5 Bump v11.4.7 2021-05-17 11:05:46 -07:00
trop[bot]
108e20a623 docs: --force-fieldtrials was h2 rather than h3 (#29180)
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:32 -07:00
trop[bot]
966a8623ab docs: Improve description of findInPage options (#29144) 2021-05-13 23:38:37 +02:00
Milan Burda
74ac9c2e13 fix: [webview] fix missing properties on events when contextIsolation: true (#26289) (#29150)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-05-13 23:38:17 +02:00
trop[bot]
776a6102e6 build: make patch auto fixes come from PatchUp rather than Electron Bot (#29157)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-05-13 23:37:57 +02:00
Jeremy Rose
2ed8e63cfe fix: don't warn about enableRemoteModule when it's undefined (#29023)
* fix: don't warn about enableRemoteModule when it's undefined

* fix tests
2021-05-13 10:46:59 +02:00
trop[bot]
90b6db93a2 Create README.md (#29147)
Co-authored-by: Ondreas <74183220+OndreasCZ@users.noreply.github.com>
2021-05-12 23:40:44 -07:00
Shatyuka
48605866c4 fix: increase corner radius for vibrancy view on big sur (#29072) 2021-05-10 18:11:52 -04:00
Electron Bot
38020822e1 Bump v11.4.6 2021-05-07 14:55:35 -07:00
Electron Bot
04852b8efc Revert "Bump v11.4.6"
This reverts commit 19156d793b.
2021-05-07 13:05:27 -07:00
Electron Bot
19156d793b Bump v11.4.6 2021-05-07 12:54:03 -07:00
trop[bot]
0af1751932 fix: drag region BrowserView calculations on macOS (#29018)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-05-06 20:29:27 +09:00
Milan Burda
ecb162ccea fix: <webview> focus / blur events don't work with contextIsolation enabled (#29004) (#29027) 2021-05-06 20:24:16 +09:00
trop[bot]
8545815af3 spec: attempt to fix flaky nativeTheme spec (#29035)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-05-05 21:49:53 -07:00
trop[bot]
e5f7f68b95 docs: link to BrowserView from webview page (#29010)
* docs: Link to `BrowserView` from `webview` page

* fix relative link

Co-authored-by: Hamish Macpherson <hamstu@gmail.com>
2021-05-05 11:30:56 -07:00
Electron Bot
a4674b4bc4 Bump v11.4.5 2021-05-04 14:18:46 -07:00
Samuel Attard
1e77167863 build: Use goma for all releases (#26476) (#28976)
* build: use goma for all release builds

* Make sure goma is setup everywhere it is needed

* Show ninja stats on release builds

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-05-03 18:01:29 -07:00
trop[bot]
d86d3aa565 fix: allow Node.js to manage microtasks queue (#28974)
* 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 19:58:05 -04:00
Samuel Attard
ade351d562 Revert "Bump v11.4.5"
This reverts commit 0f35811af2.
2021-05-03 16:04:25 -07:00
Electron Bot
0f35811af2 Bump v11.4.5 2021-04-30 11:55:47 -07:00
Pedro Pontes
2b2f0c67aa chore: cherry-pick f37149c4434f from chromium (#28948)
* chore: cherry-pick f37149c4434f from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-30 09:36:57 -07:00
trop[bot]
cdf32f2567 build: add release-env context to publish-macos (#28940)
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-04-29 15:23:57 -07:00
Pedro Pontes
99b1d18d3f chore: cherry-pick 668cf831e912 from chromium (#28930)
* chore: cherry-pick 668cf831e912 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-29 13:38:01 -07:00
Pedro Pontes
03f74ae307 chore: cherry-pick 02f5ef8c88d7 from chromium (#28934)
* chore: cherry-pick 02f5ef8c88d7 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-29 19:20:40 +02:00
Pedro Pontes
af85dc602f chore: cherry-pick 619083c7d8 from v8 (#28905)
Co-authored-by: Electron Bot <electron@github.com>
2021-04-28 15:40:18 -07:00
trop[bot]
215324a035 docs: remove api/locales page (#28918)
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:17 -07:00
trop[bot]
bb031bf7a2 fix: libuv hang on Windows (#28336)
* fix: libuv hang on Windows

* test: add a hang test

* fix: contextIsolation issue

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-28 17:22:45 -04:00
Pedro Pontes
f5533950d6 chore: cherry-pick 00245033cf from v8 (#28902) 2021-04-28 12:49:48 -07:00
trop[bot]
698fc73c23 fix: emit window-all-closed after closing the window (#28912)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-04-28 12:48:05 -07:00
trop[bot]
8cf127de07 build: actually use SSL when downloading things via python (#28890)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-28 02:06:52 -07:00
Pedro Pontes
a03607cacc chore: cherry-pick 406ae3e8a9a8 from chromium (#28813)
* chore: cherry-pick 406ae3e8a9a8 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-04-28 00:45:40 -07:00
Pedro Pontes
7ea754dbed chore: cherry-pick 809231f0c9 from chromium. (#28801)
* chore: cherry-pick 809231f0c9 from chromium.

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-27 21:04:53 -07:00
Pedro Pontes
67dbb7b0ba chore: cherry-pick aa2154a9c1 from v8 (#28862) 2021-04-27 20:07:16 -04:00
Shelley Vohr
66667d29e2 fix: recalibrate simpleFullscreen when display metrics change (#28870) 2021-04-27 20:06:32 -04:00
Pedro Pontes
8ef702ab17 chore: cherry-pick ed5f62c36d from angle. (#28873) 2021-04-27 20:02:37 -04:00
Electron Bot
a0f594184d Bump v11.4.4 2021-04-27 07:58:49 -07:00
Pedro Pontes
21f79de667 chore: cherry-pick 1028ffc9bd83 from chromium (#28816)
* chore: cherry-pick 1028ffc9bd83 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-27 14:24:01 +02:00
Pedro Pontes
d124760879 chore: cherry-pick f79751ee25 from chromium (#28779)
* chore: cherry-pick f79751ee25 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-27 16:47:19 +09:00
Pedro Pontes
e90fd172b6 chore: cherry-pick 8f054c5df2 and de1dbdb608 from chromium (#28822)
* chore: cherry-pick 8f054c5df2 and de1dbdb608 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-26 20:51:23 -04:00
trop[bot]
37bcb55f15 build: fix releases that failed halfway through npm publish actions (#28852)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-26 20:34:35 -04:00
Pedro Pontes
c19f0073fd chore: cherry-pick 7dd3b1c86795 from chromium (#28819)
* chore: cherry-pick 7dd3b1c86795 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-26 11:32:52 -04:00
Pedro Pontes
3db858c6a2 chore: cherry-pick ffde6ee0e4 from v8 (#28799)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-26 20:09:27 +09:00
Pedro Pontes
c9dba4862b chore: cherry-pick fe85e04a1797 from chromium (#28797)
* chore: cherry-pick fe85e04a1797 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-04-26 20:09:06 +09:00
trop[bot]
6b7acbee4f fix: only set backgroundColor in default-app for default index.html (#28843)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-04-26 11:48:13 +02:00
Pedro Pontes
d18cd4c8b9 chore: cherry-pick d5d222b6ca and 1627015c84 from webrtc (#28796)
* chore: cherry-pick d5d222b6ca and 1627015c84 from webrtc

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-26 16:21:30 +09:00
Pedro Pontes
4b6b82d9c5 chore: cherry-pick 8ebd894186 and 1e35f64725 from v8 (#28810)
* chore: cherry-pick 8ebd894186 and 1e35f64725 from v8

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-26 09:17:06 +02:00
Pedro Pontes
f5811f1a3a chore: cherry-pick 6b84dc72351b from chromium (#28807)
* chore: cherry-pick 6b84dc72351b from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-26 09:16:26 +02:00
Shelley Vohr
e1a71b065d fix: handle async nature of [NSWindow -toggleFullScreen] (#28773) 2021-04-22 20:19:44 +02:00
Pedro Pontes
7202213ce0 chore: cherry-pick 74c9ad9a53 from chromium (#28760) 2021-04-22 10:29:09 -04:00
Pedro Pontes
0eb29dd13e chore: cherry-pick 6a6361c9f31c from chromium (#28702)
* chore: cherry-pick 6a6361c9f31c from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-21 13:13:24 -04:00
trop[bot]
35a559a988 fix: ensure widget size is set correctly on linux on small screens (#28757)
When creating a widget on linux the bounds are restricted to the screen
size, when calling SetSize / SetBounds they are not.  This fixes this
initialization issue by calling SetBounds after widget creation.

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-21 11:52:59 -04:00
Pedro Pontes
36f3ae0803 chore: cherry-pick 8c3eb9d1c409 from chromium (#28704)
* chore: cherry-pick 8c3eb9d1c409 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-21 10:52:34 -04:00
Electron Bot
be663f71db chore: cherry-pick 512cd5e179f4 from v8 (#28751)
* chore: cherry-pick 512cd5e179f4 from v8

* update patches
2021-04-21 12:23:58 +02:00
Pedro Pontes
26da9c8b74 chore: cherry-pick 254c7945ee from v8 (#28697) 2021-04-20 11:51:41 -04:00
Pedro Pontes
f9744a8865 chore: cherry-pick 012e9baf46c9 from chromium (#28724)
* chore: cherry-pick 012e9baf46c9 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-20 11:50:46 -04:00
Pedro Pontes
dee9c62ed4 chore: cherry-pick 872b8c13d7 from skia (#28738) 2021-04-20 11:49:32 -04:00
Cheng Zhao
4887d50726 fix: backport patch to fix crash on m1 mac (#28745)
* fix: backport patch to fix crash on m1 mac

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-20 11:47:18 -04:00
trop[bot]
04991376d5 build: fix docs only change script to pull all files not just 30 (#28743)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-04-19 18:28:52 -07:00
trop[bot]
946d2cbd9f build: read node files as binary files (#28734)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-04-19 20:09:41 -04:00
trop[bot]
487c5c9352 fix: do not handle write errors after request is aborted (#28722)
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:12 -07:00
trop[bot]
758c8e6327 fix: end attached sheet when calling window.hide() (#28696)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-19 13:59:07 -04:00
Pedro Pontes
fb0b474368 chore: cherry-pick 3c80bb2a594f from chromium (#28689)
* chore: cherry-pick 3c80bb2a594f from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-19 09:52:46 -04:00
trop[bot]
21d45e613a build: do not require vsts token for releases (#28649)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-14 11:44:40 +02:00
Electron Bot
f28dab8881 Bump v11.4.3 2021-04-13 13:38:27 -07:00
Electron Bot
3b063d6bbb chore: cherry-pick 02f84c745fc0 from v8 (#28639)
* chore: cherry-pick 02f84c745fc0 from v8

* update patches
2021-04-13 13:29:27 -07:00
trop[bot]
086d5563a1 fix: enable system maximization for frameless windows except if transparent (#28207) (#28635)
* 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: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2021-04-13 11:55:00 -04:00
trop[bot]
b9cc819362 build: better error handling for release builds (#28627)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-13 11:15:52 -04:00
trop[bot]
491e391cde docs: systemPreferences.subscribeWorkspaceNotification return type (#28612)
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-04-12 00:12:45 -07:00
Cheng Zhao
6252a9f734 fix: allow accessing file:// when web security is disabled (#28589) 2021-04-09 11:02:54 -04:00
Cheng Zhao
b91354b9e0 fix: support wasm-eval csp behind WebAssemblyCSP flag (#28576)
* fix: support wasm-eval csp behind WebAssemblyCSP flag

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-04-08 11:54:51 -04:00
trop[bot]
ce6af063a7 fix: call UnregisterIsolate consistently (#28556)
* fix: call `UnregisterIsolate` consistently

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

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

* fix

Co-authored-by: Fedor Indutny <fedor@indutny.com>
2021-04-07 10:08:30 +09:00
trop[bot]
b5a7944d7c ci: Add goma fallback flag (#28544)
* 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:19 +09:00
Jeremy Rose
b660d2db3e fix: put RemoteCertVerifier upstream from the caching and coalescing layers (#28470) 2021-04-06 14:22:53 -07:00
trop[bot]
834f27c12b fix: dialog DCHECK on Linux (#28532)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-06 11:26:51 -04:00
trop[bot]
932aef2db2 fix: reject task append to JumpList when description exceeds 260 characters (#28524)
* 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:56:44 -07:00
trop[bot]
0ae60390da fix: free IsolateData in ~NodeEnvironment (#28482)
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:54:25 +09:00
Electron Bot
d6fe972744 Bump v11.4.2 2021-04-02 10:02:59 -07:00
Fedor Indutny
c4116a22b9 Remove cleanup now in FreeEnvironment (#28471)
d7bc5816a5

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-04-01 18:00:16 -07:00
trop[bot]
2f25c10818 feat: initialize field trials from command line arguments (#28401)
Fixes: #27877

Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
2021-03-29 19:44:56 +09:00
Erick Zhao
bc3b181575 fix: make TouchBarPopover and TouchBarGroup work (#27901) (#28412)
* fix: use correct `orderedItem` touchbar property

* fix: correct parent in touchbar group and popover

* fix: preserve property hook order
2021-03-29 03:11:24 -07:00
trop[bot]
ea778bea3a fix: disappearing thumbar after win.hide() (#28391)
* fix: disappearing thumbar after win.hide()

* Add descriptive comment

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-25 12:16:28 -07:00
trop[bot]
86658890fe doc: desktopCapturer menu position (#28364)
desktopCapturer can be used in both main process and renderer process

Co-authored-by: liulun <xland@live.cn>
2021-03-24 16:59:50 +09:00
trop[bot]
ea1b8a32bb fix: make sure service worker scheme is registered with allowServiceWorkers (#28353)
* 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

* Errors are not catched in executeJavaScript

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-24 16:54:34 +09:00
Electron Bot
bbdd71dd54 Bump v11.4.1 2021-03-23 08:10:33 -07:00
trop[bot]
0a6d4a9875 fix: escape URL passed to shell.openExternal on windows (#28340)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-23 00:04:45 -07:00
Pedro Pontes
3159edeff6 chore: cherry-pick a66dbdcf6493 from chromium (#28294)
* chore: cherry-pick a66dbdcf6493 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-22 08:09:05 -07:00
trop[bot]
6665d2be19 fix: DesktopCapturer gc'd prior to capture completion (#28282)
desktopCapture.getSources() returns a promise which should resolve
when capturing finishes. Internally it creates an instance of
DesktopCapturer which is responsible for resolving or rejecting
the promise.

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

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

fixes #25595

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-03-22 11:02:33 +09:00
Pedro Pontes
bf3ddcaeb8 chore: cherry-pick 93ce5606cd9a from chromium (#28247)
* chore: cherry-pick 93ce5606cd9a from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-22 11:00:28 +09:00
trop[bot]
2783fbf550 fix: drag region offsets in BrowserViews (#28297)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-22 10:59:12 +09:00
trop[bot]
3cba3f4d7e test: use new uuid for each ServiceWorker test (#28310)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-22 10:58:00 +09:00
trop[bot]
418e0c174f fix: bad menu position when no positioning item specified (#28278)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-19 10:22:00 +09:00
Pedro Pontes
c38a7c1a7a chore: cherry-pick c6d6f7aee733 from chromium (#28249)
* chore: cherry-pick c6d6f7aee733 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-18 16:53:05 -04:00
Pedro Pontes
18e10fe1a9 chore: cherry-pick 53c4d05797 and 6e8f04c980 from v8 (#28236)
* cherry-pick 53c4d05797 and 6e8f04c980 from v8

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-18 15:15:03 +09:00
Pedro Pontes
5fa579c607 chore: cherry-pick e1505713dc31 from chromium (#28233)
* chore: cherry-pick e1505713dc31 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-18 15:14:20 +09:00
trop[bot]
27045abeeb docs: document the parameter structure of hookWindowMessage (#28212)
Fixes #28178

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-16 19:20:41 +09:00
Keeley Hammond
fce83c48f2 fix: values return from the ctx bridge with dynamic property support should themselves support dynamic properties (#28161)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-16 17:33:12 +09:00
Pedro Pontes
f790637e12 chore: cherry-pick 33861dcf6d15 from chromium (#28132)
* chore: cherry-pick 33861dcf6d15 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-16 17:32:10 +09:00
Pedro Pontes
56c9e259a1 chore: cherry-pick 5651fb858b75 from chromium (#28198)
* chore: cherry-pick 5651fb858b75 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-15 20:35:21 -04:00
Electron Bot
f1f0ed1ecd Bump v11.4.0 2021-03-15 10:25:31 -07:00
Pedro Pontes
570db18ef2 chore: cherry-pick 6e8856624cbb from chromium (#28165)
* chore: cherry-pick 6e8856624cbb from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-15 11:52:18 -04:00
trop[bot]
43b9988c57 chore: cherry-pick 1fe571a from node (#28108)
* chore: cherry-pick 1fe571a from node

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

* Fix merge error

* update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-03-15 04:39:08 -07:00
trop[bot]
b740cd2202 fix: handle a nil backgroundColor in win.getBackgroundColor() (#28186)
* 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:08:12 +09:00
trop[bot]
592430f918 fix: convert system colors to device color space in systemPreferences (#28171)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-13 05:01:23 -08:00
Pedro Pontes
3445fbf7dc chore: cherry-pick 18d3f86206e8 from chromium (#28097)
* chore: cherry-pick 18d3f86206e8 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-13 10:44:25 +09:00
Pedro Pontes
df5ff97144 cherry-pick 157601b9b9 from pdfium (#28101) 2021-03-12 09:24:23 -08:00
Pedro Pontes
3bb800ce04 chore: cherry-pick eb0c0353bf24 from chromium (#28093)
* chore: cherry-pick eb0c0353bf24 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-12 19:44:21 +09:00
trop[bot]
413fbcfa18 fix: change #if defined(OS_MACOSX) to #if defined(OS_MAC) (#28151)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-03-12 16:43:24 +09:00
Pedro Pontes
8877087e51 chore: cherry-pick 38781b86f0 from chromium (#28050) 2021-03-12 16:37:40 +09:00
trop[bot]
275eecdfcb docs: fix cookies event documentation for type generation (#28138)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-03-11 16:22:53 -08:00
Pedro Pontes
6ecf43c8c4 chore: cherry-pick aeb6bc551b60 from chromium (#28089)
* chore: cherry-pick aeb6bc551b60 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-10 13:43:25 -05:00
Pedro Pontes
aec62a9874 chore: cherry-pick 6ed1c0c425e0 from chromium (#28091)
* chore: cherry-pick 6ed1c0c425e0 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-10 11:26:03 -05:00
trop[bot]
291b4f9980 fix: capturePage not resolving with hidden windows (#28074)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-09 13:42:49 -08:00
trop[bot]
a841bd195c build: call goma_ctl.py ensure_start directly (#28058)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-03-09 16:05:36 +09:00
Pedro Pontes
4a5a18f003 chore: cherry-pick 7e0e52df283c from chromium (#28046)
* chore: cherry-pick 7e0e52df283c from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-03-08 16:58:37 -05:00
trop[bot]
5c29d3b533 chore: Add a condition to crashReporter deprecate log (#28012)
* Add a condition to crashReporter deprecate log

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

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

change to check uploadToServer

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

Co-authored-by: liulun <xland@live.cn>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-07 16:31:27 +09:00
trop[bot]
e0172c45f0 fix: warning when worldSafeExecuteJavaScript is disabled (#27968)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-03-05 10:14:47 +09:00
trop[bot]
3fa9826b8b feat: expose des-ede3 cipher (#27993)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-03-04 15:38:42 -05:00
trop[bot]
e262b5040a fix: ensure owner window valid (#27948)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-04 16:39:08 +09:00
trop[bot]
e5eafc8ee9 fix: check web_contents() for destroyed WebContents (#27965)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-03-04 16:33:37 +09:00
trop[bot]
2bcf583bcf fix: offset browserview drag regions on macOS (#27987)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-03-04 16:32:45 +09:00
Shelley Vohr
c50d0e49c1 fix: set WebContents background color ubiquitously (#27944)
Move it from LoadURL to RenderViewCreated which is present
in all window creation cases and is called early enough to be
relevant from user prespective and after RenderWidgetHostView
is already present.

Co-authored-by: marekharanczyk <48673767+marekharanczyk@users.noreply.github.com>
2021-03-01 13:21:16 -08:00
John Kleinschmidt
26c5cc2801 fix: navigator.bluetooth.requestDevice crash (#27941)
* fix: navigator.bluetooth.requestDevice crash

* update bluetooth test to handle bluetooth permission denied

(cherry picked from commit 1c7ca277cc)
2021-03-01 12:39:54 -08:00
trop[bot]
fb5822af43 docs: fix header level of some events in app.md (#27886)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-02-24 20:36:19 +09:00
trop[bot]
97626aeac8 fix: isFullScreen typo (#27863)
* fix isFullScreen typo

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

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

Co-authored-by: Tony Wu <tonywoo@fb.com>
Co-authored-by: Tony <TonyWuu@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2021-02-24 18:05:16 +09:00
Shelley Vohr
b8d136aeea fix: libuv hang when nodeIntegrationInSubframes enabled (#27880) 2021-02-24 17:58:56 +09:00
Erick Zhao
eed55d5923 docs: remove v5 and v6 modernization docs (#27857) 2021-02-22 12:21:16 -08:00
trop[bot]
ef4d98ac7f fix: cap sendInputEvent text length at n-1 (#27853)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-22 11:54:10 -08:00
Michaela Laurencin
8ae9c5c7cf fix: replace default frameName title with null check (#27813)
* fix: replace default frameName title with null check (#27521)

* refactor: replace default frameName title with null check

* add isNativeWindowOpen check in makeBrowserWindowOptions

* modify snapshot test files

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

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

* add nativewindowopen check to null title

* fix lint and json formatting

* reformat test cases for this branch

the merged changes included some rearrangements to the json items that
do not apply to this branch, so the items were reordered according to
this branch's previous files.

* remove default frameName title for native open call and modify test txts
2021-02-22 11:07:18 -05:00
Electron Bot
1631fc9b0c Bump v11.3.0 2021-02-19 11:40:19 -08:00
trop[bot]
cc0848a86e revert: patch libuv to use posix_spawn on macOS (#27026) (#27809)
* Revert "perf: patch libuv to use posix_spawn on macOS (#27026)"

This reverts commit f69c11105f.

* Update .patches

Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2021-02-19 09:50:35 -08:00
trop[bot]
c7a2b32c5a docs: update menu item '&' escaping (#27817)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-02-19 09:44:41 -08:00
trop[bot]
18cfdb1c82 fix: enableBlinkFeatures warning in webviews (#27789)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-19 15:46:47 +09:00
trop[bot]
1105931d0a fix: don't create last saved path if none exists (#27808)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-02-19 15:44:44 +09:00
Robo
234309497e chore: cherry-pick b712f9fd66 from chromium (#27781)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/2690730
2021-02-18 17:23:41 -08:00
Calvin
6fa2ab2edd fix: restore window event redispatching on mac (#27787) 2021-02-18 16:19:13 -08:00
Robo
527c767107 chore: cherry-pick 202b40b9ae, 135a6e537f from chromium (#27780)
* chore: cherry-pick 202b40b9ae, 135a6e537f from chromium

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

* update patches

* fix: compilation errors

Co-authored-by: Electron Bot <electron@github.com>
2021-02-18 15:34:00 -08:00
Robo
15468432c8 chore: cherry-pick 59f3ca2780 from chromium (#27778)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/2679121
2021-02-18 14:11:11 -08:00
Robo
af34655cb7 chore: cherry-pick 3a6f6fbfd8 from chromium (#27776)
* chore: cherry-pick 3a6f6fbfd8 from chromium

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

* fix: compilation errors
2021-02-18 13:41:13 -08:00
Robo
111b737ae4 chore: cherry-pick 84853ff62a from v8 (#27777)
Backports https://chromium-review.googlesource.com/c/v8/v8/+/2689191
2021-02-18 13:21:49 -08:00
Robo
e33df2c7b6 chore: cherry-pick 62bda83979 from chromium (#27779)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/2651183
2021-02-18 11:11:08 -08:00
Robo
f30018b4b0 fix: crash in crypto.createDiffieHellman (#27766) 2021-02-18 10:34:56 +09:00
Eryk Rakowski
795200a838 feat: add win.setTopBrowserView() so that BrowserViews can be raised (#27007) (#27712)
* feat: Raise a browser view via `BrowserWindow.setTopBrowserView()`.

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

This commit contains the macOS implementation.

* feat: setTopBrowserView support for Windows and Linux

* docs: add info about setTopBrowserView

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

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

* fix: build error

* fix: test

* fix: add test case

* fix: tests

* fix: reparenting

* fix: close second window in tests

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

Co-authored-by: Stewart Lord <stew@offbynone.com>
2021-02-18 10:20:55 +09:00
trop[bot]
64d4e5969f fix: check WebContents before emitting render-process-gone event (#27757)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-02-18 10:17:03 +09:00
trop[bot]
be670059a6 test: fix flaky did-change-theme-color test (#27767)
* test: move did-change-theme-color test to main

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

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-02-18 10:15:15 +09:00
Jeremy Rose
5d64c42801 chore: cherry-pick 76cb1cc32baa from chromium (#27750)
* chore: cherry-pick 76cb1cc32baa from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-02-17 10:22:14 -08:00
Jeremy Rose
5b81463423 feat: implement allowFileAccess loadExtension option (#27703)
Co-authored-by: Сковорода Никита Андреевич <chalkerx@gmail.com>
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-02-16 15:32:37 -08:00
Erick Zhao
92df786066 PATCH (#27558) 2021-02-15 11:59:18 +09:00
trop[bot]
59aaa65381 ci: ignore errors deleting user app directories on WOA testing (#27728)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-02-15 11:49:23 +09:00
Raymond Zhao
715ffe4e51 fix: Replace ClearFilterData with InvalidateFilterData (#27699) 2021-02-15 09:54:48 +09:00
trop[bot]
51bb0ad36d docs: remove references to remote from docs (#27715)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-12 11:41:22 -06:00
Jeremy Rose
4636dfe68e chore: cherry-pick df438f22f7d2 from chromium (#27609) 2021-02-11 16:37:05 -08:00
Jeremy Rose
e3f6b2b082 chore: cherry-pick b0d3d3e85fa6 from skia (#27614)
* chore: cherry-pick b0d3d3e85fa6 from skia

* Update config.json

* resolve conflict
2021-02-11 15:58:51 -08:00
trop[bot]
968db9285f docs: update menu example to avoid remote (#27714)
* docs: update menu example to avoid remote

* Update menu.md

* lint

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-02-11 13:48:56 -08:00
trop[bot]
19f8ea37a5 perf: patch libuv to use posix_spawn on macOS (#27654)
* perf: patch libuv to use posix_spawn on macOS

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

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

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

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

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

* Remove trailing whitespaces from patch file

* update patches

* Update patch description

* Update .patches

Co-authored-by: Pat DeSantis <pdesantis3@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2021-02-10 16:53:51 -08:00
trop[bot]
99eb8ac059 chore: cherry-pick 0c8b6e41 from v8 (#27684)
* chore: cherry-pick 0c8b6e41 from v8

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

* update patches

* Update .patches

* update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-02-10 16:53:22 -08:00
Shelley Vohr
3bcdc276e1 fix: BrowserView rendering flicker (#27659) 2021-02-10 08:02:24 -08:00
trop[bot]
85dad8fb18 refactor: load preload script directly as a string (#27662)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-02-09 14:14:38 -08:00
trop[bot]
5f60640ddc perf: optimize data structures in context_bridge::ObjectCache (#27664)
* Use std::forward_list instead of base::LinkedList for better perf,
more consistent memory management.  Better than std::list because we
don't need the double-linked-list behavior of std::list
* Use std::unordered_map instead of std::map for the v8 hash table

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-02-09 08:31:59 -08:00
trop[bot]
f9e6e6eff9 fix: do not run display check on "closed" windows in tray (#27669)
* fix: only run display check on restored wndow if minimized

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

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2021-02-09 08:31:10 -08:00
Raymond Zhao
7695f3f1ee fix: Backport SVG filter invalidation fix from Chromium (#27635) 2021-02-08 10:15:12 -05:00
trop[bot]
3492077f33 fix: memory leak in BrowserWindow (#27640)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-02-08 17:36:00 +09:00
trop[bot]
0933c6796c fix: clean up base::LinkedList in context_bridge::ObjectCache (#27638)
base::LinkedList does not delete its members on destruction. We need to
manually ensure the linkedlist is empty when the ObjectCache is
destroyed.

Fixes #27039

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

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-02-05 14:25:13 -08:00
Electron Bot
137f45750f Bump v11.2.3 2021-02-05 10:09:13 -08:00
Jeremy Rose
a0175137fb chore: cherry-pick 36abafa0a316 from v8 (#27624) 2021-02-05 09:43:20 -08:00
Erick Zhao
90eee5f909 fix: cherry-pick 5c7ad5393f74 from chromium (#27584)
* patch

* patch more

* patch more more
2021-02-03 20:47:35 -08:00
trop[bot]
a09dada8e4 fix: crash when loadExtension fails (#27588)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-02-03 16:28:28 +09:00
Electron Bot
805e442ff8 Bump v11.2.2 2021-02-02 09:38:53 -08:00
trop[bot]
02a1b42db3 docs: update Xcode / macOS SDK version in build-instructions-macos.md (#27537)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-29 12:44:40 -08:00
trop[bot]
5c44dc2a0a docs: Update Readme, don't mention Electron < 2 (#27539)
* chore: Update Readme, don't mention Electron < 2

* chore: Add back versioning info

Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2021-01-29 12:44:15 -08:00
Erick Zhao
210c406ab1 docs: update verb tenses for structured clone notes (#27519) 2021-01-27 11:49:39 -08:00
trop[bot]
15a96413b6 docs: add missing contextBridge API to README (#27510)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-01-27 17:02:49 +09:00
Pedro Pontes
13e017c861 chore: cherry-pick 4af9de9806 and 115eccc0c6 from chromium. (#27494)
* chore: cherry-pick 4af9de9806 and 115eccc0c6 from chromium.

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-01-27 16:38:31 +09:00
Milan Burda
bb1299bbb5 build: fix build with enable_printing=false (#27456) (#27504) 2021-01-27 16:35:21 +09:00
Milan Burda
42d15f0536 fix: add eyedropper tool functionality to browser view (#27275) (#27509)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-01-27 16:34:26 +09:00
Pedro Pontes
70526f8070 chore: cherry-pick 2c26785, b03de8b and a3c3ef6 from usrsctp. (#27491)
* chore: cherry-pick 2c26785, b03de8b and a3c3ef6 from usrsctp.

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-01-26 09:25:57 -08:00
Charles Kerr
47640eaa9a fix: don't throw on bad icons in BrowserWindow constructor (#27441) (#27478) 2021-01-25 14:44:04 -06:00
Pedro Pontes
1f5a8b6894 chore: cherry-pick 3f7b67374a11 from chromium (#27406)
* chore: cherry-pick 3f7b67374a11 from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-25 11:29:44 -08:00
trop[bot]
b1f438245f fix: CSP with unsafe-eval detection with Trusted Types (#27469)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-25 10:25:29 -08:00
Pedro Pontes
a73d563390 chore: cherry-pick 44d052c and 0919d75 from v8. (#27415)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-25 08:43:33 -08:00
trop[bot]
6a1ef337a7 fix: <webview> not working with Trusted Types (#27464)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-25 08:26:16 -08:00
Pedro Pontes
63677086c2 chore: cherry-pick 06fe641d21bd from chromium (#27401)
* chore: cherry-pick 06fe641d21bd from chromium

* update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-01-25 13:34:30 +09:00
Electron Bot
8805b996e0 Bump v11.2.1 2021-01-22 15:55:24 -08:00
Pedro Pontes
47adc0a2b7 chore: cherry-pick f9add3b8e5 from chromium. (#27443) 2021-01-22 12:13:16 -08:00
Pedro Pontes
1559dc74da chore: cherry-pick f62f983b56623f0e from sqlite. (#27424)
* chore: cherry-pick f62f983b56623f0e from sqlite.

* Fix missing comma

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-22 11:36:15 -08:00
trop[bot]
207dbb8d4e fix: actually clear pending requests in DevToolsAgentHost (#27439)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-21 14:00:17 -08:00
Pedro Pontes
3bda527e83 chore: cherry-pick 96db1e0, fd08636 and bc9cb11 from chromium. (#27437) 2021-01-21 12:55:49 -08:00
Pedro Pontes
e3b76f71de chore: cherry-pick ffd6ff5a61b9 from v8 (#27411)
* chore: cherry-pick ffd6ff5a61b9 from v8

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2021-01-21 15:56:27 +09:00
Milan Burda
6be5244111 fix: apply tzdata2020f to ICU (#27369)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-01-21 15:45:28 +09:00
Shelley Vohr
f398ba08a9 fix: incorrect case in content::PermissionType mapping (#27423) 2021-01-21 15:31:56 +09:00
trop[bot]
aa4f3550fd fix: Shutdown crash in DownloadItem callback (#27419)
The call stack for one of our top crashes looks like this:

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

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

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

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

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

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
2021-01-21 15:30:29 +09:00
trop[bot]
095de8114e ci: fix broken homebrew cache (#27409)
Backport of #27224

Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-01-20 14:00:06 -08:00
trop[bot]
5737bac6f4 fix: increase stack size on windows (#27385)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-01-20 11:50:49 -08:00
trop[bot]
c95eda8420 fix: prevent crash when keyboard event immediately precedes calling BrowserWindow.close() (#27357)
* fix: prevent crash when destroyed widget receives keyboard event

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

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

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-01-19 15:50:21 +09:00
Shelley Vohr
7fb97f041b refactor: use platform-specific TaskRunner to print (#27326) 2021-01-19 11:34:00 +09:00
Erick Zhao
b4ea9e0fc8 docs: update devtools extension tutorial (#26326) (#27311)
* docs: update devtools extension tutorial

* Update docs/tutorial/devtools-extension.md

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

* update

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-14 14:54:45 +09:00
Charles Kerr
19b7336fc3 chore: fix patch whitespace warnings (#27314) 2021-01-13 13:50:15 -08:00
trop[bot]
f809e74905 build: fix installing of code-signing identity on macOS (#27292)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-13 13:45:55 -08:00
trop[bot]
f6eb88ac08 test: disable flaky reporting API test (#27271)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-12 10:17:33 +09:00
Electron Bot
56e926ce23 Bump v11.2.0 2021-01-11 14:54:54 -08:00
Shelley Vohr
5e0e91510a Revert "Bump v11.1.2"
This reverts commit 9bfd5d4a4b.
2021-01-11 14:27:05 -08:00
Electron Bot
9bfd5d4a4b Bump v11.1.2 2021-01-11 09:32:26 -08:00
trop[bot]
8afd7877f6 test: skip PictureInPicture video when media not supported (#27235)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-07 21:38:48 -08:00
trop[bot]
bf0b82dc8e test: skip media-started-playing media-paused events test when media not supported (#27237)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-07 21:38:05 -08:00
Shelley Vohr
122d8910d5 refactor: remove path from nativeImage converter (#27217) 2021-01-07 13:14:29 -08:00
trop[bot]
cb281b7954 test: skip protocol.registerSchemesAsPrivileged stream test when media not supported (#27229)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-01-07 13:04:24 -08:00
Electron Bot
91cfa96c80 chore: bump chromium in DEPS to 87.0.4280.141 (#27213) 2021-01-07 11:48:53 -08:00
trop[bot]
a21ed83751 feat: make win.setAspectRatio() work on Windows (#27203) 2021-01-07 11:46:04 -08:00
Shelley Vohr
c0b48658d8 fix: handle BrowserView reparenting (#27219) 2021-01-07 11:43:46 -08:00
trop[bot]
c68f0f04d0 docs: document frameId meaning (#27189)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-05 17:19:19 +09:00
Eryk Rakowski
a2b61f9b97 feat: add support for webContents option in BrowserView (#26802) (#27095)
* feat: add support for webContents option in BrowserView

* tests: add tests
2021-01-05 17:17:50 +09:00
trop[bot]
fc478f4e96 fix: default offset when no drag regions (#27183)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-05 12:13:54 +09:00
trop[bot]
b710412e7b fix: unclickable regions in some draggable BrowserViews (#27178)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-01-05 11:44:12 +09:00
Eryk Rakowski
9a7bda51a3 fix(extensions): implement missing web_request hooks (#22655) (#27096)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-01-05 11:27:48 +09:00
trop[bot]
615e467a15 fix: make webContents.id work even after destroy (#27069)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-01-05 11:13:21 +09:00
trop[bot]
f8a900fdde docs: update broken Chrome webview URL (#27180)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-01-04 14:05:26 -08:00
trop[bot]
c188ed065d fix: sync devtools frontend mime types with upstream (#27102)
* fix: sync devtools frontend mime types with upstream

* fix header

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-22 14:13:17 -08:00
Electron Bot
dcd216984f Bump v11.1.1 2020-12-21 09:33:17 -08:00
Shelley Vohr
e012f61aee refactor: remove last use of InternalCallbackScope (#27050)
* refactor: remove last use of InternalCallbackScope

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2020-12-17 13:06:33 -06:00
Erick Zhao
50e3a2ae20 docs: update OSR max FPS number (#26805) (#27059) 2020-12-17 20:30:31 +09:00
trop[bot]
b4413e9398 fix: memory leak in desktopCapturer.getSources (#27056)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-16 20:47:57 -08:00
trop[bot]
25df0f5d31 fix: throw when using globalShortcut before ready (#27021)
* fix: throw when using globalShortcut before ready

* fix

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-17 10:07:10 +09:00
trop[bot]
6b91371b6e fix: make protocol wrapper remote-friendly again (#27044)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-12-16 12:10:07 -08:00
trop[bot]
8e6d332e96 fix: crash on exit in Event destructor (#27035)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-12-16 17:29:57 +09:00
trop[bot]
eebd7cfa05 refactor: use public node::CallbackScope where possible (#27027)
* refactor: use public node::CallbackScope where possible

* Remove unused node_env() getter

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-16 08:39:49 +09:00
Shelley Vohr
a4d73be9c5 fix: stack traces in non-Node.js contexts (#26997)
* fix: stack traces in non-Node.js contexts

* update patches

Co-authored-by: Electron Bot <electron@github.com>
2020-12-16 08:38:39 +09:00
trop[bot]
0e9214a82b fix(asar): readdir(withFileTypes) fails on deep directory when using readdirSync on a deep directory within the archive, the code fails to get the stats of child paths. (#27010)
Co-authored-by: Avi Vahl <avi.vahl@wix.com>
2020-12-15 09:18:00 -08:00
trop[bot]
24c7365bef fix: add SafeForTerminationScopes for SIGINT interruptions (#26972)
* fix: add SafeForTerminationScopes for SIGINT interruptions

* update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2020-12-14 16:43:56 -08:00
trop[bot]
686aefb2cd ci: ignore failures on Ninja summary (#26996)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2020-12-14 13:44:49 -05:00
Shelley Vohr
0e0a1421fd fix: screen EventEmitter methods with remote (#26989) 2020-12-14 10:39:43 -08:00
trop[bot]
c4e8c0fd0e fix: properly emit after hooks after exception (#26991)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-12-14 10:24:25 -08:00
Electron Bot
101a2282ab Bump v11.1.0 2020-12-11 13:03:56 -08:00
Jeremy Rose
429400040e fix: restrict sendToFrame to same-process frames by default (#26875) (#26926) 2020-12-11 13:01:31 -08:00
trop[bot]
ca7528a2d0 fix: Upload all *.dll.pdb to symbol server (#26965)
Fixes #26961.

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

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
2020-12-11 12:53:27 -08:00
trop[bot]
d58812b517 fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows 10 (#26951)
* fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows

This fixes #26905. The patch was obtained from @deepak1556, who in turn
got it from the Microsoft Teams folks.

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

This affects Electron 9 and later.

Notes: Fix occasional crash on Windows

* update patches

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Electron Bot <electron@github.com>
2020-12-11 12:51:23 -08:00
trop[bot]
5942c84288 docs: add missing deprecated systemPreferences APIs to breaking-changes (#26936)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-11 10:59:00 -08:00
trop[bot]
f920463b47 fix: message box missing an "OK" button in GTK (#26916)
Co-authored-by: Mimi <1119186082@qq.com>
2020-12-10 13:06:03 -08:00
Electron Bot
296cba563e Bump v11.0.5 2020-12-10 09:47:04 -08:00
trop[bot]
90a96c0b73 fix: systemPreferences.effectiveAppearance returning systemPreferences.getAppLevelAppearance() (#26878)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-09 14:58:44 +09:00
Milan Burda
2c325cd654 fix: send IPC_MESSAGES.RENDERER_RELEASE_CALLBACK as internal message (#26808) (#26836) 2020-12-08 13:29:50 +09:00
Electron Bot
c26b78bbc0 chore: bump chromium to 87.0.4280.88 (11-x-y) (#26817)
* chore: bump chromium in DEPS to 87.0.4280.88

* update patches

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-12-07 16:46:44 -08:00
Alexey Kuzmin
6951c09b61 fix: add a "set" trap to the "screen" module proxy (#26873) 2020-12-07 16:46:05 -08:00
trop[bot]
fe21892974 fix: handle security warnings promise when JS is disabled (#26870)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-12-07 13:03:40 -08:00
Electron Bot
0fd6a8ca83 Bump v11.0.4 2020-12-07 10:06:44 -08:00
Erick Zhao
de12232df5 docs: added fiddle support for code samples (#26766)
Co-authored-by: Antonio <bandantonio@users.noreply.github.com>
2020-12-03 15:54:49 +09:00
trop[bot]
d12674f9f1 docs: fix contentTracing code sample (#26777)
According to the API docs, the property is called included_categories, not include_categories.

Co-authored-by: Jim Fisher <jameshfisher@gmail.com>
2020-12-02 14:29:00 -05:00
Samuel Attard
75cdd02697 build: use all-for-one goma (#26699) (#26770)
* Revert "Revert "build: use one-for-all goma (#26679)" (#26689)"

This reverts commit 38ab829ea6.

* build: ensure file descriptor limit is higher on macOS
2020-12-02 11:18:56 -05:00
trop[bot]
08b7f5a569 fix: draggable views on BrowserViews on Windows (#26774) 2020-12-01 21:35:53 -08:00
trop[bot]
a5077e2586 docs: BrowserWindow extension APIs are deprecated in Electron 9 (#26782)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-12-01 21:31:57 -08:00
trop[bot]
4fa9122151 fix: add check in IsMaximized for non-WS_THICKFRAME windows (#26780)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2020-12-01 21:30:59 -08:00
Vadim
56fa037a46 fix: internalModuleReadJSON for unpacked JSON (#26751) 2020-12-01 18:24:22 -06:00
trop[bot]
13a9e15a27 fix: Add default Bluetooth permission strings (#26768) 2020-12-01 15:02:25 -08:00
trop[bot]
badc01c2d8 fix: draggable regions calculation in BrowserWindow/BrowserView (#26754) 2020-12-01 11:29:55 -08:00
Electron Bot
b0862a6e63 Bump v11.0.3 2020-11-23 17:01:12 -08:00
trop[bot]
18cde2ef04 fix: make screen wrapper remote-friendly again (#26660)
This restores accessibility of screen methods via remote.screen.

Fixes #26610.

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

Co-authored-by: Anders Kaseorg <andersk@mit.edu>
2020-11-23 18:27:16 -05:00
Jeremy Rose
e6c94854a0 chore: cherry-pick 47e21abe349a from chromium (#26654)
* chore: cherry-pick 47e21abe349a from chromium

* resolve conflicts
2020-11-23 17:23:57 -05:00
trop[bot]
94d8b7d4c1 fix: reject contentTracing.stopRecording on failure (#26655)
* fix: reject contentTracing.stopRecording on failure

* hacks to account for std::moved promise

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-11-23 15:36:17 -05:00
John Kleinschmidt
c0769d77e5 build: remove no longer needed arm64 macos patches (#26650) 2020-11-23 12:13:25 -08:00
Jeremy Rose
2a6c3bb7d1 fix: segfault on webContents.fromId(xxx) (#26652) 2020-11-23 11:41:09 -08:00
Milan Burda
d892fde98b fix: <webview> render-process-gone event dispatch (#26578)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2020-11-19 10:29:58 -08:00
Electron Bot
edb6723157 Bump v11.0.2 2020-11-19 10:19:12 -08:00
Samuel Attard
9dda9a894a Revert "Bump v11.0.2"
This reverts commit 4dc98f1347.
2020-11-19 10:17:40 -08:00
Electron Bot
90ab868b50 chore: bump chromium to 87.0.4280.67 (11-x-y) (#26565)
* chore: bump chromium in DEPS to 87.0.4280.66

* chore: bump chromium in DEPS to 87.0.4280.67
2020-11-19 11:25:16 -05:00
Electron Bot
4dc98f1347 Bump v11.0.2 2020-11-18 13:06:12 -08:00
trop[bot]
2189ddb14e fix: LC_ALL env should not be changed (#26551)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-11-18 11:44:04 -08:00
trop[bot]
680569e404 test: support for adding extra module paths (#26543)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-11-18 11:43:53 -08:00
trop[bot]
e119699ae2 revert: disable rosetta as Electron does not run under rosetta
This reverts commit 4829b0f816.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-11-18 11:18:49 -08:00
trop[bot]
63e6f08768 fix: use public APIs in place of private CTFontDescriptorIsSystemUIFont in ui/gfx (#26574)
* fix: use public APIs in place of private CTFontDescriptorIsSystemUIFont in ui/gfx

* Update .patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2020-11-18 11:18:05 -08:00
trop[bot]
b14c57e30c fix: getLoginItemSettings() on windows (#26538)
* find by exe, detect taskmgr enable/disable

* tests

* revert

* oops

Co-authored-by: Jan Hannemann <jan.hannemann@outlook.com>
2020-11-18 11:15:24 +09:00
Electron Bot
8a68a304e0 chore: bump chromium to 87.0.4280.63 (11-x-y) (#26534)
* chore: bump chromium in DEPS to 87.0.4280.63

* update patches
2020-11-17 14:29:42 -05:00
trop[bot]
60cef385d5 fix: webContents interaction with draggable browserviews (#26528)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-11-17 10:16:53 -05:00
Electron Bot
4f281e3d31 Bump v11.0.1 2020-11-17 02:20:52 -08:00
trop[bot]
eb2710e483 fix: Cannot read property 'setDockSide' of undefined (#26514)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-11-16 16:05:51 -05:00
trop[bot]
7a15dca09c fix: do not use crashpad APIs in the MAS build (#26513)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-11-16 11:39:56 -08:00
Electron Bot
387a15f582 Bump v11.0.0 2020-11-16 06:29:41 -08:00
Jeremy Rose
38fab63863 chore: cherry-pick 275865e8c237 from chromium (#26470)
* chore: cherry-pick 275865e8c237 from chromium

* resolve conflict

* update patches

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Electron Bot <electron@github.com>
2020-11-16 09:27:25 -05:00
Milan Burda
1b156c53fd fix: ensure that internal messages are sent from the main process (#26440) 2020-11-16 15:30:47 +09:00
Electron Bot
e4f3f9e1db chore: bump chromium to 87.0.4280.60 (11-x-y) (#26483) 2020-11-13 15:36:26 -08:00
Jeremy Rose
612acc04b0 fix: cherry-pick 8f5a08079948 from chromium (#26469) 2020-11-13 15:14:18 -08:00
Electron Bot
717271095e Bump v11.0.0-beta.23 2020-11-13 13:53:04 -08:00
trop[bot]
76e54ae0c8 feat: add app.runningUnderRosettaTranslation to detect running under rosetta (#26492)
* feat: add app.isRunningUnderRosettaTranslation to detect running under rosetta

* chore: fixup

* chore: make const

* chore: add missing import

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-11-13 13:51:05 -08:00
Electron Bot
0c21ce02c1 Bump v11.0.0-beta.22 2020-11-12 07:01:59 -08:00
trop[bot]
01fa45fc50 feat: add 'resized' event to BrowserWindow (#26454)
Also adds 'moved' event to BrowserWindow on Windows.

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2020-11-12 09:47:01 -05:00
trop[bot]
832ce14bda build: fix usage of octokit/rest and make uploading better (#26389)
* build: fix usage of octokit/rest and make uploading better

* Pull in change from #26414

* Update with changes from #26425

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2020-11-11 14:30:58 -05:00
trop[bot]
07318e5146 fix: renderer crash on setImmediate (#26424)
* fix: renderer crash on setImmediate

* spec: add a crash case

* fix: ensure env exists

* Update spec-main/fixtures/crash-cases/setimmediate-renderer-crash/index.js

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>
2020-11-11 10:23:30 -05:00
trop[bot]
79dff5f782 chore(extensions): remove old renderer code (#26441)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2020-11-11 10:15:27 -05:00
Samuel Attard
9c9e40294e build: auto-push patch file changes (#26235) (#26431)
* build: auto-push patch file changes

* chore: change patch for testing purposes

* build: remove stray log

* build: push as electron bot

* build: suppress all output of the push-patch script

* chore: fix linting
2020-11-10 13:47:51 -08:00
trop[bot]
5b617a7f39 chore: synchronously destroy WebContents on event prevented (#26418)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-11-10 11:27:32 -05:00
trop[bot]
ff717d4a93 chore: cleanup inline HTML in docs (#26392)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-11-10 10:49:47 -05:00
trop[bot]
51bced4ee3 fix: make draggable regions work when devtools is opened on macOS (#26395)
* fix: make draggable region work when devtools is open

* fix: update draggable regions when resizing

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-11-10 10:46:40 -05:00
Shelley Vohr
b0fd7cf430 fix: honor pageRanges when printing (#25600)
* fix: honor pageRanges when printing

* Update docs/api/web-contents.md

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

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2020-11-10 10:06:57 -05:00
Electron Bot
a56c1d3f2f Bump v11.0.0-beta.21 2020-11-09 07:02:10 -08:00
John Kleinschmidt
98b6403e3b feat: correctly identify permissions when using setPermissionRequestHandler (#26172) (#26353)
(cherry picked from commit 7f9b21daa0)
2020-11-09 09:58:35 -05:00
trop[bot]
e9c12688e6 refactor: store <webview> attributes as typed Map (#26330)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-11-05 15:29:06 -05:00
Electron Bot
8d88d1e2ed chore: bump chromium to 87.0.4280.47 (11-x-y) (#26351)
* chore: bump chromium in DEPS to 87.0.4280.47

* update patches

* Make sure angle has full git info

Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-11-05 15:11:11 -05:00
Electron Bot
2e730fe48b Bump v11.0.0-beta.20 2020-11-05 07:01:36 -08:00
Electron Bot
88de23b241 chore: bump chromium to 87.0.4280.40 (11-x-y) (#26280)
* chore: bump chromium in DEPS to 87.0.4280.40

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-11-04 15:35:28 -05:00
trop[bot]
3faa2c2a46 fix: window.open not accepting size values with "px" at the end (#26334)
* fix: use parseInt to parse sizes

* fix: pass radix to parseInt

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

Co-authored-by: Abhishek Shingane <abhisheks@iitbhilai.ac.in>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-11-04 10:59:49 -08:00
trop[bot]
cab14277b8 fix: draggable region edge calculation on resize (#26320)
* fix: draggable region edge calculation on resize

* Feedback from review

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-11-04 11:17:14 +09:00
Electron Bot
ce243f8172 Bump v11.0.0-beta.19 2020-11-02 07:01:23 -08:00
Shelley Vohr
da4790d944 build: only check patch diffs in testing builds (#26283)
* build: only check patch diffs in testing builds

* Fixup patch indices
2020-11-02 18:56:13 +09:00
Charles Kerr
4088566a4d fix: nativeTheme.themeSource = 'dark' on windows (#26238)
Manually backports #25373.
2020-11-02 16:20:57 +09:00
Shelley Vohr
ac425c0cf3 fix: draggable regions exclusively on BrowserViews (#26259) 2020-11-02 16:07:04 +09:00
trop[bot]
ccb471e5d5 chore: change some for loops to range-based (#26263)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-10-30 09:58:39 -07:00
Robo
f44880f065 fix: Initialize logging for crashpad (#26250)
* fix: Initialize logging for crashpad

* chore: update mini_chromium

* conditionally access CommandLine because crashpad doesn't initialize one.

https://chromium-review.googlesource.com/c/chromium/src/+/2490880
2020-10-29 16:23:51 -07:00
trop[bot]
7ec001486e fix: hover text only working when VO enabled (#26246)
* fix: hover text only working when VO enabled

* chore: simplify conditional

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-29 08:51:45 -07:00
David Sanders
dd3fbae447 chore: use auto to avoid repeating type (#26254) 2020-10-29 08:50:27 -07:00
Electron Bot
e9710f6a77 Bump v11.0.0-beta.18 2020-10-29 08:01:25 -07:00
trop[bot]
699a771288 fix: transparently package bundles as zip archives (#26217)
* refactor: move FileSelectHelper to own file

* fix: zip packages on macOS

* Thread safety, it's good actually

* misc cleanup

* Remove some unused includes

* Better ref management

* Use upstream file_select_helper_mac

* Small fixes

* Put back file_select_helper_mac

* observe RenderWidgetHost

* fix ref-counting and add some guards

* Address review

* Remove refcounting for FileSelectHelper

* Remove unnecessary GetWeakPtr

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-10-29 10:01:32 -04:00
trop[bot]
f679dd8ad7 fix: build with printing disabled (#26249)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-10-29 02:18:26 -07:00
trop[bot]
9f1b913793 fix: set app locale after user's script is loaded (#26226)
* fix: set app locale after user's script is loaded

* fix: set LC_ALL env on Linux

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-10-28 15:20:10 -04:00
Charles Kerr
9328725e93 perf: improve heap snapshot performance (#26230)
Fixes #24509.

cherry-pick 2e2dc98 from v8
2020-10-28 12:07:48 -07:00
trop[bot]
cea757f59c fix: delay emitting powerMonitor events on windows (#26181)
* fix: delay emitting powerMonitor events

* Update electron_api_power_monitor_win.cc

* Update electron_api_power_monitor_win.cc

* syntax

* Update electron_api_power_monitor_win.cc

* Update electron_api_power_monitor_win.cc

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-10-28 12:39:49 -05:00
trop[bot]
d93cb942fc build: rename the v8 context snapshot on arm64 macOS builds (#26202)
* chore: rename the v8 context snapshot on arm64 macOS builds

* build: update zip manifests

* build: update to upstream patch

* chore: update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-10-27 20:11:24 -04:00
trop[bot]
4d280ed483 docs: fix app 'ready' event arguments (#26174)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-26 20:38:42 -07:00
David Sanders
bb69770267 chore: bump @electron/docs-parser version (#26155) 2020-10-26 11:50:00 -07:00
David Sanders
d4112d38de chore: prefer empty() check for readability (#26157) 2020-10-26 11:48:12 -07:00
Electron Bot
b1eec448f0 Bump v11.0.0-beta.17 2020-10-26 08:01:55 -07:00
trop[bot]
becfe25528 fix: wasm code generation in the renderer (#25829)
* fix: wasm code generation in the renderer

* Fixup patches

* update patches

* update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-10-26 18:19:09 +09:00
Shelley Vohr
a461001677 fix: crash in printing on Windows (#26062)
* fix: crash in printing on Windows

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-10-26 12:11:36 +09:00
Electron Bot
aa15eeed78 Bump v11.0.0-beta.16 2020-10-23 13:10:26 -07:00
Samuel Attard
6daac26f49 Revert "Bump v11.0.0-beta.16"
This reverts commit 2b1004919d.
2020-10-23 13:09:17 -07:00
trop[bot]
3551c81cc5 fix: setSimpleFullScreen shows traffic light in frameless window (#26127)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-23 11:06:24 -07:00
Electron Bot
2b1004919d Bump v11.0.0-beta.16 2020-10-23 10:20:48 -07:00
Samuel Attard
d200b9192a revert: "fix: reply notifs sometimes destroyed too early" (#25247) (#26131)
* Revert "fix: reply notifs sometimes destroyed too early (#25086)"

This reverts commit bea6c9e4e1.

* nothing
2020-10-23 10:18:42 -07:00
Samuel Attard
c2e8704683 fix: re-enable the spellchecker when new language list set (#26119) (#26129)
* fix: re-enable the spellchecker when new language list set

Chromium recently added prefs logic to disable the spellchecker if the list of languages is empty, but the logic to re-enable if the languages are provided again lives in another part of Chromium.  This change makes it so our API re-enables the spellchecker correctly when required.

* chore: fix lint
2020-10-23 10:18:30 -07:00
Electron Bot
0b2862b184 chore: bump chromium to 87.0.4280.27 (11-x-y) (#25993)
* chore: bump chromium in DEPS to 87.0.4280.20

* update patches

* test: disable flaky arm tests (#26046)

* tests: disable flaking test on all arm platforms

* tests: disable flaky did-change-theme-color tests on WOA

(cherry picked from commit 4ce7ca6cfb)

* 2478082: Make window cloaking and uncloaking trigger occlusion calculation

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

Fixes visibility issues.

* Revert "2478082: Make window cloaking and uncloaking trigger occlusion calculation"

This reverts commit 5ff8cc8c83.

* ci: disable CalculateNativeWinOcclusion for woa (#26001)

(cherry picked from commit 708cf44d19)

* Update appveyor.yml

disable CalculateNativeWinOcclusion due to visibility issues

* chore: bump chromium in DEPS to 87.0.4280.27

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2020-10-22 17:01:59 -04:00
trop[bot]
d959222bb8 fix: return early on promise rejection (#26111)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-10-22 13:32:06 -07:00
Jeremy Rose
e5550e5bad chore: backport fix for ARIA TreeGrid rows not being announced by VoiceOver (#26036)
* chore: cherry-pick 2f5b8357dca2 from chromium

* update patches
2020-10-22 12:57:31 -07:00
trop[bot]
8546f98a87 fix: release NSAlert properly (#26099)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-10-22 08:09:21 -07:00
Electron Bot
7a6965087c Bump v11.0.0-beta.15 2020-10-22 08:02:26 -07:00
trop[bot]
2558455be4 fix: crash when printing (#26047)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-20 09:08:14 -07:00
trop[bot]
65fdfc1e16 perf: remove GC timer that fired once per minute. (#26051)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-10-20 14:35:51 +09:00
trop[bot]
139e20367f fix: update squirrel.mac to handle bug in Big Sur (#25906)
Fixes #25626

This is not the greatest workaround but at least it works.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-10-20 10:50:22 +09:00
trop[bot]
e84aa04bb5 fix: Save As PDF from PDF Preview (#26012)
* fix: Save As PDF from PDF Preview

* Address review feedback

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-20 10:45:34 +09:00
David Sanders
7a06ae575e chore: bump @electron/docs-parser to get fix (#25974) 2020-10-20 10:34:33 +09:00
trop[bot]
460594480f build: fix invocation of cpplint on Windows (#26041)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2020-10-19 19:17:57 -05:00
trop[bot]
6e676c3695 chore: tweak branch detection in release notes. (#26037)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-10-19 15:36:12 -07:00
Michaela Laurencin
e6fa69bfd2 fix: correct null pointer checks in autoresizing browser views (#25956)
Co-authored-by: mlaurencin <mlaurencin@microsoft.com>
2020-10-19 09:26:13 -07:00
Electron Bot
df3fa7ddb7 Bump v11.0.0-beta.14 2020-10-19 08:01:43 -07:00
Robo
c090fbfd11 chore: fix visibility tests on windows (#25991)
* disable CalculateNativeWinOcclusion on win ci

* Update appveyor.yml

* disable CalculateNativeWinOcclusion for woa

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-10-16 11:13:31 -07:00
trop[bot]
6d99158379 fix: maximized frameless window bleeding to other monitors (#25978)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-10-15 20:05:03 -07:00
Electron Bot
bb11bdce36 Bump v11.0.0-beta.13 2020-10-15 08:02:38 -07:00
trop[bot]
ca163f9cf7 docs: move breaking-changes-ns.md contents to breaking-changes.md (#25947)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-15 10:51:21 +09:00
trop[bot]
5598025884 fix: pass module resolution paths to wrapped function (#25945)
Co-authored-by: Matt Kane <matt@gatsbyjs.com>
2020-10-15 10:49:07 +09:00
trop[bot]
df82bbab43 feat: add support for preventing the system context menu (#25835)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-10-14 18:37:41 -07:00
Michaela Laurencin
ed5fd9c910 fix: notifications successfully never timeout with included flag (#25902)
* Backport changes for notification timeout neber to version 11

* fix: notifications successfully never timeout with included flag

* Add back SetXmlAudioSilent

Co-authored-by: mlaurencin <mlaurencin@microsoft.com>
2020-10-13 18:22:33 -07:00
Shelley Vohr
0ac14ce30c fix: uv loop polling when render process reuse enabled (#25922) 2020-10-14 10:18:42 +09:00
trop[bot]
3793cfc0ff fix: NativeImage.getScaleFactors returns correct scales (#25903) 2020-10-13 15:24:11 -07:00
Electron Bot
1c8377967d Bump v11.0.0-beta.12 2020-10-13 13:39:53 -07:00
John Kleinschmidt
485612ae68 build: fix 11-x-y compiler errors (#25927)
* Add whole src\third_party\angle\.git directory

This directory is needed in order to properly generate gen/angle/angle_commit.h

* fix: correct calling convention for Windows on Arm

https://chromium-review.googlesource.com/c/v8/v8/+/2440717
(cherry picked from commit 0041f5aaa6)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-13 16:37:27 -04:00
John Kleinschmidt
4016def2d0 Revert "Bump v11.0.0-beta.12"
This reverts commit 7a669cbbb0.
2020-10-13 16:36:33 -04:00
John Kleinschmidt
c35a67f31e Revert "Bump v11.0.0-beta.13"
This reverts commit fd5896919b.
2020-10-13 16:36:22 -04:00
Electron Bot
fd5896919b Bump v11.0.0-beta.13 2020-10-12 08:02:17 -07:00
Electron Bot
7a669cbbb0 Bump v11.0.0-beta.12 2020-10-09 14:21:33 -07:00
Electron Bot
8acf548c62 Revert "Bump v11.0.0-beta.12"
This reverts commit dc9282d6ff.
2020-10-09 14:15:32 -07:00
Electron Bot
dc9282d6ff Bump v11.0.0-beta.12 2020-10-09 12:12:22 -07:00
Electron Bot
a4cb3e2af9 chore: bump chromium to 87.0.4280.11 (11-x-y) (#25802)
* chore: bump chromium in DEPS to 87.0.4280.6

* chore: bump chromium in DEPS to 87.0.4280.11

* chore: update patches

* Add deprecated_default_sources_assignment_filter variable

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

* 2426564: Remove global sources assignment filter value

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

* Remove set_sources_filter import

* chore: fixup printing patch

* Add DragOperation and AllowedDragOperations Mojo types

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

* Add DragOperation and AllowedDragOperations Mojo types

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

* Remove several references to BrowserPlugin from content

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

* Remove SurfaceEmbeddingTime and LocalSurfaceIdAllocation

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

* Remove several references to BrowserPlugin from content

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

* Service Manager embedders switches have been removed or moved

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

* Remove SurfaceEmbeddingTime and LocalSurfaceIdAllocation

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

* [XProto] Remove usage of Xlib Visuals

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

* Implement tabs.removeCSS in electrons TabsExecuteScriptFunction

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

* Remove lossy ConvertSizeToPixel() methods

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

* Remove all keyboard related usage of Xlib

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

* fix: use parent namespace for zygote switches

* ConvertRectToPixel methods have been removed

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

* impl SortingLSH service

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

* chore: update patches

* chore: fix servicemanager removed namespace

* chore: revert removed methods

* chore: update patches

* ExtensionURLLoaderFactory is now owned by its receivers

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

* chore: fix linting

* Skip Angle manifest file

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-10-09 12:06:07 -07:00
trop[bot]
1eea063c3a fix: suppress worldSafe warning emitted from security checks (#25828)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-10-08 20:12:33 -07:00
trop[bot]
583e2b76d9 ci: fixup doc only check on Windows (#25838)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-10-08 21:38:27 -04:00
trop[bot]
ca215070e9 test: improve app 'session-created' event spec (#25803)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-08 09:39:05 -07:00
trop[bot]
9852e1f190 fix: window.open doesn't work correctly in child window (#25816)
If speculative render view host is deleted during naviagation to
page we try to open with call to window.open window is destroyed
right after it is created. It may happen when naviagation triggers
redirect from http to https. To void that we should emit event
current-render-view-deleted only when render view host which was
destroyed is the current webcontent's rvh.

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
2020-10-08 09:38:42 -07:00
trop[bot]
9ce7d133d8 chore: use noop ShouldAbortOnUncaughtException cb (#25792)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-06 14:30:20 -07:00
Electron Bot
c157521bd0 chore: bump chromium to 87.0.4276.0 (11-x-y) (#25488)
* chore: bump chromium in DEPS to 87.0.4265.1

* chore: bump chromium in DEPS to 87.0.4266.2

* chore: bump chromium in DEPS to 87.0.4267.1

* update patches

* chore: bump chromium in DEPS to 87.0.4270.0

* Update patches

* Move content::WebPreferences struct to Blink

https://chromium-review.googlesource.com/c/chromium/src/+/2397670
(cherry picked from commit 5c98c5ebf4)

* viz: Rename RenderPass to CompositorRenderPass (and related types).

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

* 2320268: Migrate DragHostMsg_StartDragging to Mojo

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

* Make FileURLLoaderFactory always owned by its |receivers_|.

https://chromium-review.googlesource.com/c/chromium/src/+/2337411
(cherry picked from commit 284abad17d)

* fix: add a patch to remove deprecated factory

(cherry picked from commit 98c9616829)
Co-Authored-By: Robo <hop2deep@gmail.com>

* fixup patch

(cherry picked from commit 98c9616829)
Co-Authored-By: Robo <hop2deep@gmail.com>

* Add MIME sniffer overloads that take base::StringPieces

https://chromium-review.googlesource.com/c/chromium/src/+/2382896
(cherry picked from commit 211fd4f8f0)

* chore: implement GetSurveyAPIKey

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2362182
(cherry picked from commit 6c539bc6fc)

* 2415752: Reland "Reland "OOR-CORS: Remove BlinkCORS supporting code outside Blink""

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

* Make FileURLLoaderFactory always owned by its |receivers_|.

https://chromium-review.googlesource.com/c/chromium/src/+/2337411
(cherry picked from commit 507eb0965f)

* fixup! Make FileURLLoaderFactory always owned by its |receivers_|.

(cherry picked from commit e19400b4e2)

* 2418471: PDF Viewer update: Add missing aria-labels to various buttons.

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

* chore: bump chromium in DEPS to 87.0.4271.0

* Refactor WebContentSettingsClient to dedupe AllowXYZ methods

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

* 2402123: Use end date when deleting http auth cache

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

* [printing] Move PrintHostMsg_PreviewIds to print.mojom

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

* update patches

* 2401303: Move content/browser/frame_host/* over to content/browser/renderer_host/

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

* Introduce NonNetworkURLLoaderFactoryBase class.

https://chromium-review.googlesource.com/c/chromium/src/+/2357559
(cherry picked from commit 33e2e12114)

* fix: add a patch to remove deprecated factory

(cherry picked from commit 98c9616829)

* chore: non_network_url_loader_factory_base was moved

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

* chore: replace CreateWebUIURLLoader with CreateWebUIURLLoaderFactory

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2358309
(cherry picked from commit 40bfaa5ea4)

* 2346803: Study whether blocking of requests via webRequest is fingerprintable

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

* lint cleanup

* chore: bump chromium in DEPS to 87.0.4272.0

* update patches

* 2387901: Accessing C++ enums in Java for WebBluetooth

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

* chore: bump chromium in DEPS to 87.0.4273.0

* Update patches

(cherry picked from commit b389d4adca71e268c390c41370e87033b69c649c)

* chore: bump chromium in DEPS to 87.0.4274.0

* chore: bump chromium in DEPS to 87.0.4275.0

* chore: bump chromium in DEPS to 87.0.4276.0

* update patches

* 2418443: Explicit use of deprecated global sources assignment filter

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

* fixup 2418443: Explicit use of deprecated global sources assignment filter

* Use 87.0.4274.2 for now

* 2401847: Cache Storage Permissions on ContentSettingsClientImpl

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

* 2418568: Remove ConvertPointToPixel() methods.

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

* 2419388: Rename Button methods to be suitable for builders and properties.

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

* [XProto] Remove usage of all Xlib headers

https: //chromium-review.googlesource.com/c/chromium/src/+/2392140
Co-Authored-By: Robo <hop2deep@gmail.com>

* service_manager::kCrashDumpSignal -> kCrashDumpSignal

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2417073
(cherry picked from commit 7d9d2a172f50e12830a2b8fbfbb2fe344756c377)

* gfx::ConvertPointToPixel -> gfx::ConvertPointToPixels

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

* Fixup [XProto] Remove usage of all Xlib headers

* Set appid on Pip windows.

https: //chromium-review.googlesource.com/c/chromium/src/+/2388274
Co-Authored-By: Robo <hop2deep@gmail.com>

* chore: update node patches for common.gypi

Co-Authored-By: Samuel Attard <MarshallOfSound@users.noreply.github.com>

* Try using lower number of processes for linux

* fixup call to diagnose_goma_log.py

* Use larger machines on linux to work around goma issue

* Don't fail on goma stats

* don't exit immediately

* turn off pipefail

* always return true

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: Samuel Attard <MarshallOfSound@users.noreply.github.com>
2020-10-06 15:43:56 -04:00
trop[bot]
309df5a99d fix: nativeImage.crop().toBitmap() returning garbage (#25774)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-10-06 09:40:56 +09:00
trop[bot]
f298d4d54f feat: add webContents.forcefullyCrashRenderer() to forcefully terminate a renderer process (#25756)
* feat: add webContents.crashProcess() to forcefully terminate a renderer process

* chore: fix up docs and tests

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-10-05 13:00:36 -07:00
Electron Bot
ca227ede76 Bump v11.0.0-beta.11 2020-10-05 08:01:36 -07:00
trop[bot]
7120698f1f docs: rename launch-failure -> launch-failed to match C++ code (#25730)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-02 13:58:27 -07:00
trop[bot]
5eb225b5ae fix: crash when application launched from UNUserNotificationCenter notification (#25738)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-10-02 13:58:01 -07:00
trop[bot]
71c26dab90 build: move to ACR for docker image storage (#25731)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-10-02 13:28:35 -07:00
Shelley Vohr
f8ee8b2ee2 chore: fix nmv for Electron v11 (#25748) 2020-10-02 12:50:33 -07:00
Robert Borg
639fb15dc4 fix: gdi printing in silent printing mode (#25744)
for windows print_text_with_gdi is set to the value of is_modifiable
but this code path is not taken for silent printing
2020-10-02 08:30:59 -07:00
Electron Bot
c6fa081558 Bump v11.0.0-beta.10 2020-10-01 08:01:18 -07:00
trop[bot]
dcbca5448a fix: ensure ready-to-show event is fired (#25672) 2020-09-29 16:46:11 -07:00
trop[bot]
0667110350 fix: submenu should be autoreleased (#25688)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-29 12:57:40 -07:00
trop[bot]
e089cab8cd docs: command line flags for GPU controls (#25686)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-29 13:52:09 -04:00
Electron Bot
634b76e5a2 Bump v11.0.0-beta.9 2020-09-28 08:01:11 -07:00
trop[bot]
11c20477e4 refactor: add a wrapper for wrangling uv handles. (#25661) 2020-09-27 19:12:17 -07:00
trop[bot]
fca920de40 chore: improve renderer crash logging (#25619)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-09-24 12:55:57 -07:00
Electron Bot
ce5660db36 Bump v11.0.0-beta.8 2020-09-24 08:32:12 -07:00
Shelley Vohr
f8bdaa04d8 Revert "Bump v11.0.0-beta.8"
This reverts commit 69ded48ce4.
2020-09-24 08:28:59 -07:00
Shelley Vohr
08ebf7c03b Revert "Bump v11.0.0-beta.9"
This reverts commit 8bdff7acbc.
2020-09-24 08:28:52 -07:00
Shelley Vohr
9f164607b7 Revert "Bump v11.0.0-beta.10"
This reverts commit d88ce0be9c.
2020-09-24 08:28:45 -07:00
Electron Bot
d88ce0be9c Bump v11.0.0-beta.10 2020-09-24 08:03:12 -07:00
trop[bot]
e17b770690 docs: pepper flash plugin info appears at chrome://version now (#25608)
`chrome://flash` doesn't seem to exist anymore, but similar information
appears at `chrome://version`.

Co-authored-by: Joe Duncko <JoeDuncko@users.noreply.github.com>
2020-09-23 13:51:18 -07:00
trop[bot]
ff97c5255b fix: decompress devtools discovery html (#25602)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-09-23 12:38:36 -07:00
trop[bot]
2ab7143b69 fix: update node certdata to NSS 3.56 (#25362)
* fix: update node certdata to NSS 3.56

* Update .patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-09-23 12:25:26 -07:00
Jeremy Rose
96f258b866 fix: check for destroyed webcontents in converter (#25598) 2020-09-23 12:23:37 -07:00
trop[bot]
e6d5fc23a7 docs: remove unused StreamProtocolResponse / StringProtocolResponse (#25583)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-09-23 12:18:01 -07:00
trop[bot]
fe1b40ce9e fix: order menu items before filtering excess separators (#25599)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-09-23 12:12:15 -07:00
trop[bot]
fb7f783ee1 fix: unsubscribe from observers when window is closing (#25585)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-23 10:00:22 -04:00
trop[bot]
9ff208f898 fix: NOTREACHED in content::ChildProcessHost::GetChildPath when enable_plugins=false (#25552)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-09-23 10:46:00 +09:00
trop[bot]
a8dc3ae5c2 fix: check printer list when no default printers (#25562)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-22 11:53:49 -07:00
trop[bot]
07ec50b547 build: use newer xCode image (#25571)
* build: use newer xCode image

* build: log changed file paths

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-09-22 11:48:22 -05:00
Electron Bot
8bdff7acbc Bump v11.0.0-beta.9 2020-09-21 08:02:16 -07:00
trop[bot]
a66ba564fd test: retry the "v8 samples" test for a few times (#25514)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-21 09:36:18 +09:00
trop[bot]
0f4f5ac32c fix: prevent destroyed view references from causing crashes (#25509)
* fix: prevent destroyed view references from causing crashes

* Remove extraneous comments

* Relocate crash test to proper location

* Add WebContentsObserver

* Add nullptr check and inspectable observer

* Remote initial test file

* Add test cases to test file

* Rename and move testing file

* Fix linting errors

* Make functions exit early on check

* Fix setBackgroundColor function call in test file

* Fix styling of test file

* Fix mac name mismatch and make variable name more clear

Co-authored-by: Michaela Laurencin <mlaurencin@microsoft.com>
2020-09-21 09:33:39 +09:00
trop[bot]
4e080c4b15 fix: app.importCertificate crash on Linux (#25537)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-19 21:00:39 -06:00
trop[bot]
7e40dc2237 fix: close window when leave fs crash (#25524)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-19 15:23:49 -06:00
trop[bot]
e2b90ee28c build: fix build with enable_pdf_viewer=false (#25507)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-09-17 14:55:29 -06:00
Electron Bot
69ded48ce4 Bump v11.0.0-beta.8 2020-09-17 08:02:47 -07:00
trop[bot]
a22dfc813f fix: disable CORS when webSecurity is disabled (#25504)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-17 10:22:25 +09:00
trop[bot]
c1d04d8e49 chore: log hint on renderer crash (#25474)
* chore: log hint on renderer crash

* Address feedback from review

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-16 07:58:48 -06:00
trop[bot]
80efb6d9da fix: call node::Stop on exit (#25459)
* fix: call node::Stop on exit

* also call Stop in node_main

* oop, we were already calling set_can_call_into_js(false)??

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-09-16 09:25:51 +09:00
trop[bot]
51a35f8b4d fix: ensure ready-to-show event is fired (#25471)
* fix: ensure ready-to-show event is fired

* test: acutally draw something when capturePage

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-16 09:15:34 +09:00
John Kleinschmidt
b88396cf00 chore: bump chromium to 87.0.4251.1 (11-x-y) (#25259) 2020-09-15 09:52:14 -07:00
Jeremy Rose
35d2727de0 feat: remove getMediaSourceIdForWebContents() (#25414) (#25455)
This reverts commit 204f001c5d.
2020-09-14 13:44:54 -07:00
trop[bot]
23c32766e5 fix: Ensure electron delay loads the same modules as chromium (#25436)
* Ensure electron delay loads the appropriate modules as chromium on windows

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

* fix: Ensure win modules are properly delayloaded

* chore: fix linting

Co-authored-by: Chris Davis <chrisdavis@outlook.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-09-14 10:20:31 -07:00
trop[bot]
db492c3178 fix: provide asynchronous cleanup hooks in n-api (#25281)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-14 10:24:40 -06:00
Electron Bot
86cc6a7b44 Bump v11.0.0-beta.7 2020-09-14 08:02:47 -07:00
trop[bot]
2ed7f0f4fc fix: crash on nativeImage on Windows on ARM (#25410)
* fix: nativeImage on WOA

* Remove old ldflag

* maybe this will work ¯\_(ツ)_/¯

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-09-14 10:25:11 +09:00
Electron Bot
9e9cc8f606 Bump v11.0.0-beta.6 2020-09-10 08:02:15 -07:00
trop[bot]
1e1d35fb87 fix(extensions): devtools now open for background pages (#25366)
refactor(extensions): remove unused InitWithBrowserContext method

fix(extensions): release background page WebContents to avoid crash

The background page WebContents instance is managed by the ExtensionHost.

fix(extensions): open background page devtools detached by default

test(extensions): add background page devtools test

chore: test fix for null web_contents()

fix: close background page devtools in test after opening

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2020-09-10 11:38:52 +09:00
trop[bot]
119cd24a7f fix: bind fake mojo service for badging (#25370)
* fix: bind fake mojo service for badging

* Add a test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-10 09:14:53 +09:00
Eryk Rakowski
138fa6cdf3 feat(extensions): add support for some chrome.management APIs (#25098) (#25342)
* fix: initialize management policy

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

* test: add tests

* docs: add a note about chrome.management

* fix: lint errors

* fix: lint errors

* fix: remove favicon_service include

* fix: add missing management permission

* docs: more supported apis

* fix: extensions.md line endings
2020-09-08 20:11:50 +09:00
trop[bot]
7745e48498 chore: graceful handling of notes with sub-lists (#25312)
* chore: graceful handling of notes with sub-lists

Handle multine release notes that contain their own bullet points.

Also, if a release note begins with a bullet point, remove it because it
will confuse the markdown parser to have two bullet points.

* chore: make lint happy

* test: add tests for release note changes

* chore: only target current octokit

* chore: add commits to release-notes test cache

No behavior change; just includes files that ought to be cached to prevent
hitting octokit for them.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-09-08 17:12:09 +09:00
trop[bot]
b62e00f0ae fix: handle electron script errors better (#25331)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-09-08 16:26:41 +09:00
Electron Bot
ad876ac1b1 Bump v11.0.0-beta.5 2020-09-07 08:01:02 -07:00
trop[bot]
c35ec6bc34 fix: only focus a webContents if the window was not initially hidden (#25323)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-09-04 14:47:08 -07:00
trop[bot]
a08b3682c3 fix: avoid creating client_id file for empty DIR_CRASH_DUMPS (#25310)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-09-03 19:09:20 -07:00
trop[bot]
c3ad33c28b fix: multiple dock icons when calling dock.show/hide (#25300)
* fix: mulitple dock icons when calling dock.show/hide

* test: run dock.show tests after dock.hide tests

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-03 13:57:06 -07:00
Electron Bot
59f9e417d4 Bump v11.0.0-beta.4 2020-09-03 08:01:35 -07:00
trop[bot]
7931c8abfd ci: cleanup up test app directories (#25257)
* ci: cleanup up test app directories

* ci: use electron prefix for a testing apps so that the can be cleaned up

* Revert "ci: cleanup up test app directories"

This reverts commit a47daba812.

* fixup test due to app name change

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-09-02 10:05:09 +09:00
trop[bot]
622f5f84cf chore: wrap add/remove view in extra check (#25258)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-09-02 10:04:10 +09:00
trop[bot]
c8944df576 chore: force source code and markdown files to use LF line ending (#25176)
* chore: force source code and markdown files to use LF line ending

* chore: replace CRLF with LF

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-09-01 12:48:18 +09:00
Robo
3efbee2061 fix: client area inset calculation when maximized for framless windows (#25217)
* adopt per monitor scale factor

* fix: client area inset calculation when maximized

* address review feedback

* pass correct glass insets to GetDwmFrameInsetsInPixels

* remove unused code

* Windows 8 and 10 use the same DWM frame calculation

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

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-31 13:20:28 -07:00
trop[bot]
aafada554f docs: fix supported platforms of powerMonitor (#25211)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-31 10:16:26 -07:00
Electron Bot
56e81665fb Bump v11.0.0-beta.3 2020-08-31 08:01:05 -07:00
trop[bot]
e68f086d95 fix: do not reset process_id in URLLoaderFactoryParams (#25180)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-31 10:08:52 +09:00
trop[bot]
74edd99570 fix: save dialog extensions should be deterministic (#25193)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-08-28 11:38:07 -07:00
trop[bot]
63720fd603 fix: resolve RegisterSuspendResumeNotification dynamically (#25168)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-08-28 10:15:40 +09:00
Markus Olsson
d6bea2a681 fix: make shell.moveItemToTrash return false on Windows when move unsuccessful (#25171) 2020-08-27 17:43:52 -07:00
Electron Bot
5b53a08132 Bump v11.0.0-beta.2 2020-08-27 08:01:11 -07:00
Electron Bot
09e33b3420 Bump v11.0.0-beta.1 2020-08-26 10:51:08 -07:00
Jeremy Rose
2c9e79c8d5 test: add tests for shell.moveItemToTrash (#25113) 2020-08-26 09:34:29 -07:00
Electron Bot
fdb36eb5b5 Bump v11.0.0-nightly.20200826 2020-08-26 07:32:46 -07:00
Shelley Vohr
be8db589eb fix: mitigate use of private macOS font API (#25117) 2020-08-25 21:13:42 -07:00
Shelley Vohr
c8a0b2b71d fix: prevent crash if BrowserView webContents was destroyed (#25112) 2020-08-25 20:04:13 -07:00
leonllrmc
c97f8109c2 chore: update import for use new ECMA features (#24987) 2020-08-25 09:23:44 -07:00
Electron Bot
d5ab63b1ea Bump v11.0.0-nightly.20200825 2020-08-25 07:31:28 -07:00
Keeley Hammond
7704954505 docs: add restricted header info to ClientRequest docs (#25075)
* docs: add restricted header info to docs

* docs: clarify header language

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-08-25 20:29:58 +09:00
Jeremy Rose
35237d3c30 fix: [linux] open directories with dbus FileManager (#25087) 2020-08-24 13:54:50 -07:00
Cheng Zhao
cd3fadc2fb fix: save normal window bounds when maximizing (#25051)
* fix: save normal window bounds when maximizing

* fix: prevent maximize being emitted twice
2020-08-24 13:32:08 -07:00
Cheng Zhao
5ed3460751 fix: register for connected standby changes (#25076) 2020-08-24 13:09:36 -07:00
Samuel Attard
8baa9deccd build: update to typescript 4 (#25091) 2020-08-24 11:23:25 -07:00
Shelley Vohr
0efcaec4d6 fix: global shortcut media keys working with accessibility (#24145)
* fix: global shortcut media keys

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-08-24 10:41:06 -07:00
John Kleinschmidt
d8fe7af703 ci: fix WOA failing tests (#25018)
* tests: fix failing WOA tests

tests: fix startDrag for WOA

tests: fix early-in-memory-session-create crash test on WOA

ci: cleanup user app data directories on WOA

* tests: disable nativeImage.createFromBuffer tests on WOA

* disable failing nativeImage.createFromPath on WOA

* disable another nativeImage test for WOA
2020-08-24 12:58:55 -04:00
George Xu
beaf60de0a feat: add nativeImage.createThumbnailFromPath API (#24802)
* initial commit, mac implementation

* add documentation

* convert createThumbnailFromPath to async function

* windows impl protoype

* add tests

* added test

* fix

* fix test

* clean up

* update docs

* cleaning up code

* fix test

* retrigger CI

* retrigger CI

* refactor from app to native_image

* windows build

* lint

* lint

* add smart pointers, fix test

* change tests and update docs

* fix test, remove nolint

* add renderer-main process routing to fix tests

* lint

* thanks sam

* thanks sam
2020-08-24 09:36:13 -07:00
Sofia Nguy
b403e64ef2 docs: update currently supported versions for 10.0.0 release (#25027) 2020-08-24 11:21:41 -05:00
Sofia Nguy
59670e8d8c docs: update 11.0 stable release date (#25073) 2020-08-24 11:21:17 -05:00
Shelley Vohr
024ea32313 feat: make window visual effect state customizable (#25083) 2020-08-24 11:44:48 -04:00
Electron Bot
c0440a35f2 Bump v11.0.0-nightly.20200824 2020-08-24 07:32:16 -07:00
Shelley Vohr
bea6c9e4e1 fix: reply notifs sometimes destroyed too early (#25086)
* fix: reply notifs sometimes destroyed too early

* Fix windows build
2020-08-23 21:27:46 -07:00
Alfred Xing
a23c66e4e1 feat: allow monospaced font styles to be specified for macOS tray titles (#25059)
* feat: add optional font type to macOS tray title

* test: add tests for tray font type

* docs: update API reference for Tray setTitle

* review: change API to use an options object

* review: fix string enum in docs

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

* review: return after throwing errors

* review: don't need thrower anymore now that we have args

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-08-23 14:39:29 -07:00
Electron Bot
13751c815e Bump v11.0.0-nightly.20200822 2020-08-22 16:45:58 -07:00
Samuel Attard
1646f938f3 Revert "refactor: use aws-sdk-js instead of boto (#24863)"
This reverts commit a3581aa992.
2020-08-22 16:42:45 -07:00
Samuel Attard
cd4c4e9f04 Revert "Bump v11.0.0-nightly.20200822"
This reverts commit bda5ec519b.
2020-08-22 16:42:41 -07:00
Electron Bot
bda5ec519b Bump v11.0.0-nightly.20200822 2020-08-22 11:29:05 -07:00
Samuel Attard
3f4c867599 build: remove mksnapshot token file 2020-08-22 02:23:14 -07:00
Samuel Attard
3e2d959817 build: fix electron_mksnapshot_zip_done check 2020-08-22 01:17:43 -07:00
Electron Bot
02f5ffbaac Bump v11.0.0-nightly.20200821 2020-08-21 20:34:09 -07:00
Samuel Attard
e2a5908665 Revert "Bump v11.0.0-nightly.20200821"
This reverts commit 1709fed85e
2020-08-21 20:32:22 -07:00
Samuel Attard
5df6c5ecce build: more space on arm64 builds, running out of ideas here (#25043)
* build: more space on arm64 builds, running out of ideas here

* build: well this is kinda nuts but off we go

* chore: rollback thingy

* chore: build snapshot for realz

* chore: do not delete hunspell

* build: use the new magic extra-disk-space circle image

* build: remove existing file, it is not a tree
2020-08-21 20:30:04 -07:00
Samuel Attard
b1e2185c5e refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL

* spec: add test for x-site _top navigation
2020-08-21 12:34:09 -07:00
shur
a17e97c3b2 feat: expose currencyCode on Product struct in IAP module (#25058)
Co-authored-by: Shur Singh <ssingh@evernote.com>
2020-08-21 10:41:40 -07:00
Jeremy Rose
5d3301769b feat: record v8 cpu samples in the main process (#24819) 2020-08-21 09:25:30 -07:00
Electron Bot
1709fed85e Bump v11.0.0-nightly.20200821 2020-08-21 07:31:43 -07:00
Samuel Attard
26f28b6ae4 fix: add handling for non-absolute extension paths (#25068) 2020-08-20 20:47:10 -07:00
Charlie Hess
42409d860b fix: Resolve bookmarks without mounting network drives (#24708) 2020-08-20 15:01:08 -07:00
Charles Kerr
d9a1c453ab fix: revert 6ecf729 to fix Linux titlebar dark mode (#25055)
Fixes #24741
2020-08-20 16:53:06 -04:00
Electron Bot
2d502b8ac6 Bump v11.0.0-nightly.20200820 2020-08-20 07:31:57 -07:00
Shelley Vohr
9631eafa1f fix: DCHECK on print job cancellation (#25031) 2020-08-20 15:28:24 +09:00
Shelley Vohr
53668445ba feat: reinvigorate visibleOnFullscreen option (#24956) 2020-08-19 13:31:25 -07:00
Cheng Zhao
52d7afa4ef fix: calculate frame when setting window placement (#25014) 2020-08-19 12:34:15 -07:00
Jeremy Rose
9021843850 fix: enable TLS renegotiation in node (#25022) 2020-08-19 11:18:16 -07:00
Electron Bot
3313e00578 Bump v11.0.0-nightly.20200819 2020-08-19 07:32:52 -07:00
Eryk Rakowski
9e53112ee1 fix(extensions): enable WebSQL in background pages (#24798)
* fix(extensions): enable WebSQL in background pages

* fix: apply suggestions

* fix: remove duplicate include

* fix: remove trailing spaces
2020-08-19 09:41:47 +09:00
Shelley Vohr
ff24caf798 test: use custom partition for sw tests (#24999) 2020-08-18 09:31:24 -07:00
Electron Bot
a1eceee48f Bump v11.0.0-nightly.20200818 2020-08-18 07:32:07 -07:00
GitHubPang
5c5e006e46 docs: fix typos (#24982)
* docs: sync table of content from pull-requests.md to CONTRIBUTING.md

This also fixes some incorrect / dead links.

* docs: fix a bunch of typos
2020-08-18 16:55:16 +09:00
Vlad Hashimoto
b55e8dc578 docs: update default value for enableRemoteModule in BrowserWindow (#24955) 2020-08-18 16:54:47 +09:00
Samuel Attard
29d9c02ab9 build: increase available space on mac arm64 vm (#25008) 2020-08-17 22:06:59 -07:00
Tierney Cyren
303fcc69be fix(docs): update outdated ref to NSP (#24925)
removes an outdated reference to Node Security Project, which was acquired by npm some time ago. The new workflow for the same process (now the npm advisories page) has been added.
2020-08-17 19:29:45 -07:00
Samuel Attard
ab6769d7f8 build: upload windows breakpad symbols (#25000) 2020-08-17 14:52:08 -07:00
Jeremy Rose
bac2f46ba9 fix: browser contexts live forever (#24964) 2020-08-17 13:21:53 -07:00
Shelley Vohr
befbbc27d8 fix: pdf download not working (#24946) 2020-08-17 08:25:20 -07:00
Electron Bot
db13dcb8d2 Bump v11.0.0-nightly.20200817 2020-08-17 07:31:30 -07:00
Electron Bot
53033a66b1 chore: bump chromium to 7d4ac110045b7647fa8a81f5f0709 (master) (#24970)
* chore: bump chromium in DEPS to 760c905ccca34d8ed83c54f6a42c42a375792a6b

* chore: update patches

- Introduce WebContentsObserverList to encapsulate common behaviour
  https://chromium-review.googlesource.com/c/chromium/src/+/2343269
- DumpAccTree mac testing: refactor tree formatter logic to make it
suitable for nested attribute calls
  https://chromium-review.googlesource.com/c/chromium/src/+/2274545
- Fix FontPlatformDataMacTest.VariableOpticalSizingThreshold for Big Sur
  https://chromium-review.googlesource.com/c/chromium/src/+/2351299

* chore: bump chromium in DEPS to b04584161e07d4ac110045b7647fa8a81f5f0709

* chore: update patches

* [printing] Move printing::MarginType to //printing/mojom/print.mojom

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-08-14 18:51:28 -07:00
Electron Bot
4ef827c13c Bump v11.0.0-nightly.20200814 2020-08-14 07:31:18 -07:00
Jeremy Rose
a3581aa992 refactor: use aws-sdk-js instead of boto (#24863)
* refactor: use js instead of boto for s3put

* replace merge-electron-checksums.py with js, remove boto

* fix auth

* actually pass the env to execute()
2020-08-13 13:25:40 -04:00
Electron Bot
627467d08a Bump v11.0.0-nightly.20200813 2020-08-13 07:31:18 -07:00
Tierney Cyren
8f30333322 docs: add Notification section to SECURITY.md (#24926)
adds a new section pointing to a relevant doc in Governance that defines how we notify end-users of security issues.
2020-08-12 17:31:29 -07:00
Electron Bot
8798571a77 chore: bump chromium to 0e4ca9c0a63d7a39bd910997ad4c6 (master) (#24687)
* chore: bump chromium in DEPS to 1f1c4d91f6eaa4a033ec8f499d63a0717f79a42a

* viz: Do not apply white level scaling for RGBA fp16 HDR video

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

* Move WebPreferences to WebContents

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

* Fix missing WeakPtr check in PreconnectManager

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

* Fixup swiftshader roll revision

* Update patch indices

* Move WebDeviceEmulationParams into common.

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

* Move EnableDisableDeviceEmulation to blink mojom messages

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

* PDF Viewer: Remove flag for two-up view

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

* Add mojom definition for DeviceEmulationParams.

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

* Remove ServiceWorkerContextWatcher from PaymentAppInstaller

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

* Loader: Move transferrable_url_loader.mojom into blink's mojom directory

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

* chore: bump chromium in DEPS to 4974f436479739025a90ebc2cc2e36d67ee1ac46

* mac: Work around Xcode 12b3 SDK bug

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

* Reland Update core items for macOS Big Sur.

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

* Update Swiftshader revision

* mac/arm64: When cross-building the snapshot, use page size of the target ISA instead of the host.

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

* Update patch indices

* Rename {,Non}ClientView::CanClose() to OnWindowCloseRequested()

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

* chore: bump chromium in DEPS to e9465d70d1dea539400f0fddad43358ea3c31d71

* chore: bump chromium in DEPS to bd5b71c5f20288eb26068a39ae6e0579566a51c5

* chore: bump chromium in DEPS to 786ee543048bd07d07c5ac50b7dbbdd6bdd8dcce

* chore: bump chromium in DEPS to 34eb6ecbf2c5894b648900bf771a2a29de204798

* chore: bump chromium in DEPS to 567ff038d68e3adb8116a01eec863cdf34d775f5

* chore: bump chromium in DEPS to 340b45c8d4ceb2dd61969fc34e1928d3c46db48c

* chore: update patches

* chore: base::DeleteFile with two params is removed

Should use base::DeleteFile and base::DeletePathRecursively when
appropriate

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

* chore: add patch for NodePlatform::PostJob impl

* chore: update patches

* chore: extension file access is now instrumented

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

* chore: implement SetWindowFrameInScreen in OSR RWHV

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

* chore: NotifyUserActivation requires a type now

This is just for a histogram thing and therefore it does not matter what
we pass in

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

* chore: update patches

* chore: bump chromium in DEPS to cd570e6dd3dcb84463ac252b04e92ceb02d8400c

* chore: update patches

* chore: bump chromium in DEPS to 0187908a31866992b90c59719ac1d016328f6ee0

* chore: bump chromium in DEPS to 3c9df38c508f3dba26a75248beed4882ddfb98e9

* chore: bump chromium in DEPS to 1a47d3b9cee710bd3c958c4f2d8b205710df9d50

* chore: bump chromium in DEPS to baac93040d96abdab72d46dd034c60f86e108702

* chore: bump chromium in DEPS to 13836145f97299e636491de38064b78861c4fb2e

* update patches

* change OS_MACOSX -> OS_MAC

Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=1105907

* patch: add header for ToExecutionContext in WebMessagePortConverter

* chore: bump chromium in DEPS to 91ab9b6ac5d04dc034a03ad847fbfa8261328c2b

* update patches

* NeedToFireBeforeUnloadOrUnload -> NeedToFireBeforeUnloadOrUnloadEvents

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

* chore: bump chromium in DEPS to 290deb11f0e30cb1382fd8f8793d340560283c23

* update patches

* add dragdrop header for autofill popup

* int -> x11::Time

* patch out accessibility private API use

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

* remove usage of XEvent

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

* trigger recalculation of WebPreferences before renderer initialization

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

* chore: bump chromium in DEPS to 6bdb484583b99c96ef3388d0c2184326581b2d5a

* chore: bump chromium in DEPS to 1eb2a79cde04fd5c8ae51b4d813e6521635269e5

* chore: bump chromium in DEPS to 3dc8e3c0f400e4ca9c0a63d7a39bd910997ad4c6

* chore: update patches

* fixup! trigger recalculation of WebPreferences before renderer initialization

* views: Make MenuButton and RadioButton default constructible

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

* chore: fix code style

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-08-12 11:33:58 -07:00
Electron Bot
3d2afa45c3 Bump v11.0.0-nightly.20200812 2020-08-12 07:32:30 -07:00
Electron Bot
4080b04911 Bump v11.0.0-nightly.20200811 2020-08-11 07:37:50 -07:00
Electron Bot
b09c828dd3 Revert "Bump v11.0.0-nightly.20200811"
This reverts commit f3363bde26.
2020-08-11 07:36:50 -07:00
Electron Bot
f3363bde26 Bump v11.0.0-nightly.20200811 2020-08-11 07:36:24 -07:00
Electron Bot
f136bf406f Revert "Bump v11.0.0-nightly.20200811"
This reverts commit 77ee3da77c.
2020-08-11 07:35:30 -07:00
Electron Bot
77ee3da77c Bump v11.0.0-nightly.20200811 2020-08-11 07:34:51 -07:00
GitHubPang
47f88b65b7 docs: fix typo in api/ipc-renderer (#24901) 2020-08-11 07:31:38 -07:00
Olawanle Joel
d7909b507f docs: fixed minor typos (#24912)
I was going through the entire documentation and decided to fix this to the best of my knowledge.
2020-08-11 07:30:45 -07:00
Teo Koon Peng
14aba3f0de fix: export libuv symbols (#24659)
* fix: export libuv symbols

* add test for linux and windows

* mac linker flags

* assuming same foo.so path for macos

* use --whole-archive flag for mac as well

* use force_load for mac

* refactor: use napi c api directly

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-08-11 19:17:18 +09:00
Shelley Vohr
7ded768743 fix: pdf viewer template strings (#24913) 2020-08-10 22:46:58 -07:00
Samuel Attard
47d451ae52 fix: ts-node node is not a thing 2020-08-10 20:25:29 -07:00
Charles Kerr
7e84d3a2c1 build: in release notes script, do not assume electron dirname (#24927) 2020-08-10 16:56:54 -07:00
Samuel Attard
29a7b8f805 fix: add deps on the new devtools highlighter (#24921) 2020-08-10 16:54:05 -07:00
Shelley Vohr
16c32d2eb2 build: handle unhandled promise rejection in notes (#24923)
Handle any potential Git processes without throwing unhandled rejection errors.
2020-08-10 10:18:08 -07:00
Samuel Attard
047650b564 chore: update patches (#24919) 2020-08-10 08:23:21 -07:00
Shelley Vohr
8311078a96 fix: don't try to init mmap on missing asar (#24890) 2020-08-10 08:22:49 -07:00
Electron Bot
a9eaebb7f4 Bump v11.0.0-nightly.20200810 2020-08-10 07:32:34 -07:00
Samuel Attard
01c9113e2b build: fix path to git attributes for for patch export (#24896) 2020-08-10 07:10:15 -07:00
Jeremy Rose
481b19bee6 fix: send guid with linux crashes (#24881) 2020-08-07 15:30:49 -07:00
Samuel Attard
433956ce4f build: remove the tools folder (#24880) 2020-08-07 14:13:09 -07:00
Samuel Attard
b0ea1e14e1 build: type check the script folder during lint (#24892) 2020-08-07 13:49:07 -07:00
Samuel Attard
4d50f3f62c build: convert some scripts to TS (#24891) 2020-08-07 13:48:46 -07:00
Electron Bot
2028492356 Bump v11.0.0-nightly.20200807 2020-08-07 12:02:05 -07:00
Samuel Attard
3fa250d6da Revert "Bump v11.0.0-nightly.20200807"
This reverts commit cbdfeb1979.
2020-08-07 12:00:29 -07:00
Samuel Attard
854b74809a build: upload the file stream not a JSON blob for the read stream (#24889) 2020-08-07 12:00:12 -07:00
Electron Bot
cbdfeb1979 Bump v11.0.0-nightly.20200807 2020-08-07 07:32:05 -07:00
Cheng Zhao
2224d94c75 fix: add handle scope in SelectClientCertificate (#24868) 2020-08-06 20:50:41 -07:00
Electron Bot
b6f8cd39e5 Bump v11.0.0-nightly.20200806 2020-08-06 14:58:30 -07:00
Electron Bot
075a7adcc0 Revert "Bump v11.0.0-nightly.20200806"
This reverts commit 14256ee697.
2020-08-06 14:57:37 -07:00
Electron Bot
14256ee697 Bump v11.0.0-nightly.20200806 2020-08-06 13:20:37 -07:00
Samuel Attard
aaa971ff19 Revert "Bump v11.0.0-nightly.20200806"
This reverts commit 5bf423b646.
2020-08-06 13:15:48 -07:00
Electron Bot
5bf423b646 Bump v11.0.0-nightly.20200806 2020-08-06 10:40:35 -07:00
Samuel Attard
4f4c383ec5 build: only do the lower case symbol copy on case sensitive file systems (#24876) 2020-08-06 10:39:24 -07:00
Samuel Attard
5ed8afbdb6 Revert "Bump v11.0.0-nightly.20200806"
This reverts commit 4523c90dcd.
2020-08-06 10:36:41 -07:00
Cheng Zhao
5f447e4b4f fix: do not render inactive titlebar as active on Windows (#24847) 2020-08-06 09:05:23 -07:00
Electron Bot
4523c90dcd Bump v11.0.0-nightly.20200806 2020-08-06 07:31:55 -07:00
Shelley Vohr
6cb23e1d36 fix: use non-symbols in isURLInstance check (#24831) 2020-08-05 15:05:36 -07:00
Samuel Attard
a2c82f2342 build: ensure symbol files are named lowercase on disk so that boto can find them (#24856) 2020-08-05 14:03:50 -07:00
Shelley Vohr
9274117e12 build: quash octokit deprecation warning (#24790) 2020-08-05 11:59:52 -04:00
Electron Bot
99874fd71f Bump v11.0.0-nightly.20200805 2020-08-05 07:31:04 -07:00
Shelley Vohr
06c47c650a fix: duplicate suspend/resume events (#24818) 2020-08-04 20:08:45 -07:00
Jeremy Rose
30cd9cdf2a docs: remove reference to remote from faq (#24816) 2020-08-04 12:08:44 -07:00
Jeremy Rose
9c234f3f3f docs: remove references to 'remote' from app-arch tutorial (#24815) 2020-08-04 12:08:35 -07:00
Jeremy Rose
01a2e23194 refactor: mmap asar files (#24470) 2020-08-04 11:48:04 -07:00
Electron Bot
15ee34a1f2 Bump v11.0.0-nightly.20200804 2020-08-04 07:32:55 -07:00
Eryk Rakowski
f53aac97f5 fix(extensions): bypass cors in requests made from background pages (#24483) 2020-08-03 16:56:18 -07:00
Jeremy Rose
1350dc46ed refactor: ginify Archive (#24799) 2020-08-03 14:26:27 -07:00
Shelley Vohr
6fd302f745 chore: remove overwritten Node.js patch (#24775)
* chore: remove overwritten Node.js patch

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-08-03 08:49:31 -07:00
Electron Bot
e5c721eafc Bump v11.0.0-nightly.20200803 2020-08-03 07:32:11 -07:00
Electron Bot
a342ab7ce7 Bump v11.0.0-nightly.20200731 2020-07-31 07:31:51 -07:00
Samuel Attard
c3258d6c4e fix: provide AXTextChangeValueStartMarker for macOS a11y value change notifications (#24801) 2020-07-30 21:01:26 -07:00
Jeremy Rose
b5cd9ce0b3 refactor: ginify WebContents (#24651) 2020-07-30 09:17:57 -07:00
Electron Bot
e7fc19c98e Bump v11.0.0-nightly.20200730 2020-07-30 07:33:03 -07:00
Shelley Vohr
948cc08265 chore: add V8 crash information to crashReporter (#24771)
* feat: add V8 crash information to crashReporter

* Address review feedback
2020-07-29 19:04:24 -07:00
Jeremy Rose
d93bb34ac4 fix: increase max crash key value length (#24782)
* fix: increase max crash key value length

* chore: fix linting

* chore: fix linux

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

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-07-29 19:04:04 -07:00
Robo
01023435c0 fix: save crash reports locally when uploadToServer: false on linux (#24778)
* fix: generate dumps under crashDumps folder in linux

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

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

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-07-29 17:45:02 -07:00
Samuel Attard
06cb550c75 build: upload sentry src bundles on windows as well (#24773) 2020-07-29 12:41:53 -07:00
George Xu
1b175a0609 feat: add capabilities to app.getLoginItemSettings() and app.setLoginItemSettings() (#24494)
* fixed

* semantic commit

* add comments to browser.h

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-07-29 10:08:37 -07:00
Electron Bot
75372e933f Bump v11.0.0-nightly.20200729 2020-07-29 07:31:20 -07:00
Samuel Attard
f859d4ce44 test: fail tests if the spec runner promise rejects (#24762) 2020-07-28 20:36:35 -07:00
Jeremy Rose
9c37e12e2d refactor: ginify app (#24679) 2020-07-28 16:43:43 -07:00
Jeremy Rose
834408a50f fix: wrap OnWindowMessage w/ handlescope (#24716) 2020-07-28 15:09:56 -07:00
Robo
b6321cc22d fix: crash when navigating from a page with webview that has inherited zoom level (#24757)
* fix: cleanup webview zoom level observers on navigation

* add spec

* webview should be on same partition

* wait for webview to finish loading
2020-07-28 13:00:44 -07:00
Jeremy Rose
38fafe4986 refactor: ginify autoUpdater (#24678) 2020-07-28 11:04:34 -07:00
Jeremy Rose
e6cf5906f6 refactor: ginify Screen (#24677) 2020-07-28 11:04:01 -07:00
Jeremy Rose
362da77c0a refactor: ginify SystemPreferences (#24675) 2020-07-28 11:03:30 -07:00
Electron Bot
3f45fc24bb Bump v11.0.0-nightly.20200728 2020-07-28 10:45:24 -07:00
Samuel Attard
75c3a426ea Revert "Bump v11.0.0-nightly.20200728"
This reverts commit c6c986648f.
2020-07-28 10:43:32 -07:00
Shelley Vohr
4e15273b9f build: fix failing arm64 builds on macOS (#24748) 2020-07-28 08:42:15 -07:00
Electron Bot
c6c986648f Bump v11.0.0-nightly.20200728 2020-07-28 07:31:27 -07:00
Samuel Attard
bac232689d build: only move folder if it exists when freeing space (#24740) 2020-07-27 23:09:29 -07:00
Robo
76e3ee6fe6 fix: loading dedicated/shared worker scripts over custom protocol (#20625)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-27 18:48:37 -07:00
Samuel Attard
4829b0f816 fix: disable rosetta as Electron does not run under rosetta (#24670) 2020-07-27 13:26:04 -07:00
Samuel Attard
a612fb00c8 chore: update symbol server URL (#24709) 2020-07-27 13:25:39 -07:00
Electron Bot
2f02a469f4 chore: bump node to v12.18.3 (master) (#24707)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-07-27 09:12:29 -07:00
Charles Kerr
b39a5b71fe chore: add trop annotations to release notes. (#24672)
Trop annotations are in the form of "(Also in 7.3, 8, 9)" with links to
the sibling branches.

Previously seen in b43e601b83 but is now
free of optional chaining and nullish coalescing, to run on Node < 14 :)
2020-07-27 10:01:41 -05:00
Electron Bot
91f5837344 Bump v11.0.0-nightly.20200727 2020-07-27 07:31:39 -07:00
Electron Bot
5fc354df73 Bump v11.0.0-nightly.20200724 2020-07-24 07:32:19 -07:00
Shelley Vohr
ee31611e84 fix: missing base::CommandLine include (#24718) 2020-07-24 00:08:04 -07:00
Jeremy Rose
071c5930b9 refactor: ginify InAppPurchase (#24674) 2020-07-23 14:55:41 -07:00
Samuel Attard
5cfe956fe1 fix: ensure that errors thrown in the context bridge are created in the correct context (#24534) 2020-07-23 14:32:38 -07:00
Samuel Attard
b500294c1d feat: add worldSafe flag for executeJS results (#24114)
* feat: add worldSafe flag for executeJS results

* chore: do not log warning for webContents.executeJS

* Apply suggestions from code review

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

* chore: apply PR feedback

* chore: split logic a bit

* chore: allow primitives through the world safe checl

* chore: clean up per PR feedback

* chore: flip boolean logic

* chore: update per PR feedback

* chore: fix typo

* chore: fix spec

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-07-23 14:32:20 -07:00
szTheory
3b250b649b docs: fix role typos in startSpeaking/stopSpeaking (#24550) 2020-07-23 13:59:24 -07:00
Samuel Attard
2162eeb609 build: fix linting issue in docs (#24710) 2020-07-23 12:27:00 -07:00
Charles Kerr
00fc8066de docs: clarify use of pageRanges when printing. (#24694)
Fixes #24684 -- the docs are slightly unclear about how pageRanges
should be used, e.g. whether the page indices are zero-based or
one-based.
2020-07-23 12:03:52 -07:00
Electron Bot
6b1de271a7 Bump v11.0.0-nightly.20200723 2020-07-23 07:33:04 -07:00
Raghav Bhutra
ec838cfc11 docs: add Documentation for Open Recent Menu-item (#24374) 2020-07-22 19:22:01 -07:00
Gellert Hegyi
6fa3406912 fix: remove corner mask override to increase window resize performance (#24642)
* fix: remove corner mask override to increase window resize performance

* uses corner mask only for vibrant view
2020-07-23 09:54:32 +09:00
Felix Rieseberg
b57f5086ef fix: Allow VoiceOver to navigate "back into" web contents (#24655)
* fix: Use ElectronAdaptedContentView

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

* chore: Remove things instead of manually keeping them
2020-07-22 15:29:01 -07:00
Jeremy Rose
734753dd7a refactor: ginify NativeTheme (#24673) 2020-07-22 11:01:30 -07:00
Electron Bot
10bf50e1fd Bump v11.0.0-nightly.20200722 2020-07-22 07:32:34 -07:00
Samuel Attard
5795e59352 build: upload x-compiled arm mksnapshot only on linux (#24680)
* build: upload x-compiled arm mksnapshot only on linux

* Update upload.py
2020-07-22 01:45:18 -07:00
Electron Bot
2fb14f53fe chore: bump chromium to 1a093e6a0cb5e72ba78990fe39824 (master) (#24575) 2020-07-21 22:34:34 -07:00
Samuel Attard
d4a4269989 perf: do not convert object keys in ctx bridge as they are always primitives (#24671)
* perf: do not convert object keys in ctx bridge as they are always primitives

* Update shell/renderer/api/electron_api_context_bridge.cc

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

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-07-21 15:26:16 -07:00
Charles Kerr
cd805544d1 docs: update the URL for catapult's trace viewer. (#24654)
The old URL points to an archived repo. The updated URL points to the
catapult's landing page for trace-viewer.
2020-07-21 15:00:31 -07:00
Electron Bot
95dd81bd68 Bump v11.0.0-nightly.20200721 2020-07-21 09:40:26 -07:00
Samuel Attard
a76e74ac3f Revert "chore: add Trop annotations to release notes. (#24644)"
This reverts commit b43e601b83.
2020-07-21 09:38:28 -07:00
szTheory
74e7f2773f doc: fix typos in role values (#24552) 2020-07-21 08:59:20 -07:00
Charles Kerr
b43e601b83 chore: add Trop annotations to release notes. (#24644)
* chore: add Trop annotations to release notes.

Trop annotations are in the form of "(Also in 7.3, 8, 9)"
with links to the sibling branches.
2020-07-21 10:32:36 -05:00
Samuel Attard
589968f9fc build: add arm64 macOS publish jobs (#24652)
* build: add arm64 macOS publish jobs

* update ci-release-build to run new arm64 macOS publish jobs

* fixup circleci config validate issues

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-07-21 07:55:00 -04:00
Cheng Zhao
a12602dbc3 docs: document missing permission types (#24660) 2020-07-21 07:49:37 -04:00
Erick Zhao
77eea08a54 docs: update webContents.send link in ipcMain docs (#24245) 2020-07-21 14:47:10 +09:00
Kriti Singh
86b441d599 docs: add descriptions for types of permissions (#23781) 2020-07-21 14:29:32 +09:00
Paul Frazee
509740c357 fix: Close protocol response streams when aborted (#24014) 2020-07-21 09:51:38 +09:00
Shelley Vohr
bcba4baa85 fix: use Node.js isolate setup logic in bindings (#24579)
* fix: use Node.js isolate setup logic in bindings

* Flags should be more process-specific

* Remove redundant isolate function setting

* Remove old SetFatalErrorHandler call
2020-07-20 12:41:52 -07:00
Jeremy Rose
f0953902db refactor: clean up Session with CleanedUpAtExit (#24603) 2020-07-20 12:13:33 -07:00
Jeremy Rose
e5cb22b7f9 refactor: use gin::Arguments in WebContents (#24604) 2020-07-20 11:07:02 -07:00
Samuel Attard
682f78b9a8 test: add more auto updater tests for squirrel.mac (#24611) 2020-07-20 09:51:33 -07:00
Electron Bot
8f5280a821 Bump v11.0.0-nightly.20200720 2020-07-20 08:32:04 -07:00
Milan Burda
fa1323d6cd feat: add child-process-gone event to app (#24367) 2020-07-20 10:34:16 -04:00
Samuel Attard
f146a164af build: add apple silicon support (#24545)
* chore: add patches to prevent installation of non-arm pip packages

* chore: add patches for apple-silicon

* build: add apple silicon build

* ci: add testing of new arm binary

* chore: remove / update for upstreamed patches

* Skip content tracing on macos on arm

* build: ensure that spec native modules are rebuilt for arm64 on apple-silicon

* chore: fix patches

* chore: fix broken patch

* chore: fix arm64 DCHECK

* build: add MAS arm64 build

* build: disable arm2 tests

* chore: update patches

* build: actually build MAS version of apple silicon app

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-07-17 09:08:44 -07:00
Electron Bot
6f53457a17 Bump v11.0.0-nightly.20200717 2020-07-17 08:33:03 -07:00
Jeremy Rose
45551f6bf2 refactor: WebContents::From returns pointer (#24605) 2020-07-16 16:16:05 -07:00
Samuel Attard
14bbc07f1e build: free up space on macOS VM in background (#24607) 2020-07-16 14:20:42 -07:00
Samuel Attard
3806f4cb64 build: stop the macOS checkout step early if the src cache already exists (#24606) 2020-07-16 14:16:02 -07:00
Jeremy Rose
eb7c04c7c4 refactor: stop using isolate() in WebContents (#24602) 2020-07-16 14:11:44 -07:00
Samuel Attard
f649e604be build: tsify asar and move to webpack js2c pipeline (#24495)
* build: tsify asar and move to webpack js2c pipeline

* build: use the webpack provider for fs-wrapper
2020-07-16 11:38:31 -07:00
Samuel Attard
4c3da359fc build: convert touch-bar to typescript (#24511) 2020-07-16 11:37:38 -07:00
Shelley Vohr
3f37ff87d2 fix: chrome://accessibility not loading (#24437) 2020-07-16 10:14:54 -07:00
Electron Bot
24fb498fd3 Bump v11.0.0-nightly.20200716 2020-07-16 08:32:31 -07:00
Samuel Attard
d8be385d4b fix: do not register the node ESM loader in renderer processes (#24301) 2020-07-16 08:09:07 -07:00
Jeremy Rose
e4180b3a3a refactor: rename InspectableWebContents{Impl =>} (#24543) 2020-07-15 11:27:42 -07:00
Yoshietru Nagata
eb550c57d3 docs: fix wrong description in breaking-changes.md (#24477) 2020-07-15 09:31:54 -07:00
Electron Bot
cdd5bb1eba Bump v11.0.0-nightly.20200715 2020-07-15 08:31:25 -07:00
Electron Bot
9c8cdd63fd chore: bump chromium to ab0f6deadb33bb3a0201cd2d21602 (master) (#24539)
* chore: bump chromium in DEPS to 0ee01724797ab0f6deadb33bb3a0201cd2d21602

* Update patches

* Separate pdf/pdf_ppapi.h into its own target.

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

* [ozone/x11] Removed DesktopWindowTreeHostX11 and its DnD client.

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

* Move front_end html_entrypoints to data_deps

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

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-07-14 20:07:42 -07:00
Samuel Attard
3f54f240bd perf: pass primitives directly through the context bridge, avoids copying (#24531) 2020-07-14 18:38:54 -07:00
Samuel Attard
36900df7d9 build: free up more space on the mac VM (#24549) 2020-07-14 18:34:38 -07:00
Shelley Vohr
ce87a7e69f fix: broken --trace-sync-io flag in Node.js (#24529) 2020-07-14 10:47:20 -07:00
Shelley Vohr
990a6f8b6c fix: Node.js cpu and heap profiling (#24528)
* fix: Node.js cpu and heap profiling

* chore: emable more now-working Node.js specs
2020-07-14 11:56:57 -04:00
Electron Bot
e002f7315d Bump v11.0.0-nightly.20200714 2020-07-14 08:31:14 -07:00
Electron Bot
8bbdc224ac chore: bump chromium to 6d130075d378a64187360ba4e7820 (master) (#24256)
* chore: bump chromium in DEPS to 7fb9778894d73378bff51087ce869ea5aa6e5d5d

* chore: bump chromium in DEPS to 83da426e53d423f0530fc23433b6d2c4d0548442

* update patches

* remove chromeos-only TtsControllerDelegate

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

* SharedUserScriptMaster -> SharedUserScriptManager

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

* avoid deprecated DISALLOW_COPY_AND_ASSIGN

https://groups.google.com/a/chromium.org/forum/#!msg/cxx/qwH2hxaEjac/TUKq6eqfCwAJ

* chore: bump chromium in DEPS to b2eaf9ff4e6b03267bf279583ea20ceb2b25e9d0

* update patches

* rename GetHighContrastColorScheme -> GetPlatformHighContrastColorScheme

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

* remove vulkan info collection

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

* add max_xcode_version build var

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

* add missing headers

* chore: bump chromium in DEPS to cded18ca1138f7e8efc904f077ddcca34f0135cf

* update patches

* add empty floc blocklist to BrowserProcessImpl

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

* chore: bump chromium in DEPS to f06602226cd80bf677b2ce013a94a2fb7f6ac58d

* chore: bump chromium in DEPS to 747aa4bfc74fc6cf7f08ee72624cd69ae41ae28d

* chore: bump chromium in DEPS to 31c0105e50fcc4e94de33e5c8602c755ace4a32b

* chore: update patches

* Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

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

* X11 and Ozone: make sure gfx::AcceleratedWidget to be uint32_t

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

* Move zygote from //services/service_manager back to //content

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

* chore: update v8 patches

* [XProto] Remove usage of Shape extension

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

* fixup! add empty floc blocklist to BrowserProcessImpl

* Require macOS 10.15.1 sdk

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

* Use newer Xcode version 11.5.0

* update src cache

* chore: bump chromium in DEPS to 60a9883e35db3f6f91916f0878e88e1849c17b11

* chore: update patches

* Reland "Reland "New toolchain for Windows 10 19041 SDK""

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

* update patches

* Convert raw NonClientFrameViews to unique_ptrs

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

* [printing] Move PrintHostMsg_DidPreviewDocument_Params to print.mojom

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

* chore: bump chromium in DEPS to 12c233c2a85bfa28fb279f390121ba681e52a71b

* chore: update patches

* Removing oppressive language for the directory chrome/browser/apps

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

* Inclusion: rename SpellcheckLanguageBlacklistPolicyHandler

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

* Clean up duplicate WebContents "is fullscreen" functions

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

* Adds icon loading service with sandbox for Windows.

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

* No more Vulkan info collection for UMA on Windows

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

* fix lint

* chore: update buildflag conditions

* chore: bump chromium in DEPS to a837d4c4230ace4f10b2768728f4044b7995dfa5

* update hunspell files

* chore: update patches

* Make content::FileSelectListener a RefCounted

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

* fix build failures on MAS

* update patches

* fixup! Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

* fix build on windows

* Check for GDI exhaustion if window creation fails

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

* chore: bump chromium in DEPS to 2c9b2a73be4ef9ec22d8b6da8e174cb80753f125

* chore: update patches

* Network Service: Move DeleteCookiePredicate into public folder

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

* chore: bump chromium in DEPS to fa2606299bcc02c362528d26b5dcf8c8a0db0735

* chore: bump chromium in DEPS to d9c235d1227204dbae3708daae851573a3566b94

* chore: bump chromium in DEPS to 2f82c284243c035f49a747fd1ead6c44b4b31093

* chore: update patches

* Move creating the LayerTreeSettings into blink.

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

* chore: bump chromium in DEPS to 914112f1d9af9e4974059dc403da62699a55550f

* update patches

* chore: bump chromium in DEPS to e0bc1ffae6393fc543a2da94c88167df75859b36

* refactor: match upstream print preview handling (#24452)

* update patches

* chore: bump chromium in DEPS to 0881423156abe084164b51ab58ce93a8bd380524

* update patches

* update patches

* give a type to pendingPromise

* chore: bump chromium in DEPS to 11a8c1534b16d130075d378a64187360ba4e7820

* update patches

* 2272609: Move //services/service_manager/sandbox to //sandbox/policy.

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

* update patches

* fixup! 2272609: Move //services/service_manager/sandbox to //sandbox/policy.

* fixup! 2272609: Move //services/service_manager/sandbox to //sandbox/policy.

* 2264511: Cookies: Update SetCanonicalCookie to return CookieAccessResult

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

* chore: fix setAlwaysOnTop test

The window must be visible for state to be updated properly.

* Revert "Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex."

https://webrtc-review.googlesource.com/c/src/+/179080

* update patches

Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2020-07-13 21:13:34 -04:00
Jeremy Rose
36bd940bc3 refactor: ginify NativeImage (#24486) 2020-07-13 14:44:12 -07:00
Shelley Vohr
f0a0e10bd1 fix: use default NSVisualEffectState (#24471) 2020-07-13 12:40:37 -07:00
Samuel Attard
b02748e607 build: ensure that electron/lib/browser can only use browser or common imports (#24512)
* build: ensure that electron/lib/browser can only use browser or common imports

* chore: fix linting
2020-07-13 09:58:49 -07:00
Jeremy Rose
1719f073c1 chore: remove some unused code in the net module (#24488) 2020-07-13 09:36:20 -07:00
Shelley Vohr
91cdedfea9 fix: default to simplex for printing DuplexMode (#24489) 2020-07-13 11:31:39 -04:00
Samuel Attard
cbb47570bd build: run the JS linter on the build folder (#24513) 2020-07-10 14:48:50 -07:00
Sam Saccone
e18f508e66 docs: fix incorrect formatting in browser docs. (#24473)
Address incorrect typing for isEnabled. The root cause of this was due
to missing backticks which caused the docs parser to think that the
return type of the `isEnabled` function was null, where it was supposed
to be a boolean type.

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

Fixes #24409
2020-07-10 13:57:29 -07:00
Shelley Vohr
6c4017ff45 fix: always callback error with invalid print settings (#24476) 2020-07-10 09:42:22 -07:00
Samuel Attard
5737fda154 build: tsify worker/init (#24497) 2020-07-09 20:32:37 -07:00
Samuel Attard
8847517798 build: tsify isolated_renderer/init (#24496) 2020-07-09 20:32:26 -07:00
Samuel Attard
c9aa68e32c build: update octicons (#24492) 2020-07-09 18:12:18 -07:00
Samuel Attard
42f716bbc6 build: update in-range dependencies (#24480) 2020-07-09 16:32:21 -07:00
Samuel Attard
ef9addcb92 build: fix linting issue in spec-main 2020-07-09 11:25:43 -07:00
Samuel Attard
dcb56923cb build: update @types packages and fs-extra (#24475) 2020-07-09 10:57:50 -07:00
Samuel Attard
eb6616e4e9 build: update to standard 14 (#24479) 2020-07-09 10:18:49 -07:00
Jeremy Rose
9bd0fc5348 refactor: ginify BrowserView (#23578) 2020-07-09 08:48:39 -07:00
Electron Bot
66d65a6d35 Bump v11.0.0-nightly.20200709 2020-07-09 08:32:15 -07:00
Samuel Attard
4305707ca8 build: update typescript parser deps (#24474) 2020-07-09 01:12:23 -07:00
Samuel Attard
8d25847318 build: update webpack / TS build deps (#24460)
* build: update webpack / TS build deps

* chore: fix JS inferred types
2020-07-09 01:05:16 -07:00
Samuel Attard
ad16e6c647 build: update linting deps (#24461) 2020-07-08 21:19:49 -07:00
Jeremy Rose
80a6adb597 fix: coerce executeJavaScript arguments (#24396) 2020-07-08 16:13:50 -07:00
Robo
7dd365784d fix: clipboard.readBuffer returning empty value (#24454) 2020-07-08 15:02:42 -07:00
Samuel Attard
e59370f541 build: update ts defs generator (#24459) 2020-07-08 13:08:31 -07:00
Shelley Vohr
6cfbee9f34 fix: uv_walk crash on web worker close (#24436)
* fix: uv_walk crash on web worker close

* Use DCHECK_EQ
2020-07-08 11:00:43 -07:00
Electron Bot
2aeaca6f7b Bump v11.0.0-nightly.20200708 2020-07-08 08:32:47 -07:00
Shelley Vohr
cadc142d05 fix: use try/catch for base class converter error (#24246) 2020-07-07 14:18:43 -07:00
Shelley Vohr
446100cdfe chore: don't duplicate devtools constants (#24440) 2020-07-07 17:04:23 -04:00
Milan Burda
7fd96cd188 feat: add name to app.getAppMetrics() output (#24359) 2020-07-07 14:00:45 -04:00
Electron Bot
25a36a43c1 Bump v11.0.0-nightly.20200707 2020-07-07 08:31:26 -07:00
jieniu$
b0be3fbb7f docs: fix typos in doc/tutorial/electron-versioning.md (#24362) 2020-07-06 16:31:24 -04:00
Jeremy Rose
71a7e1b2e3 chore: tsify menu (#24358) 2020-07-06 13:24:54 -07:00
Samuel Attard
2a3437e5b5 build: use python3 for electron hooks (#24435) 2020-07-06 13:12:23 -07:00
Andy Dill
cf74ee3d83 fix: use RenderViewReady to call InstallTransparency (#24390)
this fixes a crash with transparent OSR when GPU acceleration is
disabled
2020-07-06 11:57:14 -07:00
Samuel Attard
99079c3bc7 build: fix build with context snapshot disabled (#24433) 2020-07-06 11:11:48 -07:00
Jeremy Rose
1f23807271 chore: tsify web-contents (#24325) 2020-07-06 10:50:03 -07:00
Milan Burda
82af855579 chore: add missing _Deprecated_ to 'renderer-process-crashed' on app (#24410) 2020-07-06 10:09:42 -07:00
Electron Bot
f6e21d59e7 Bump v11.0.0-nightly.20200706 2020-07-06 08:32:59 -07:00
Shelley Vohr
4398ecb6c8 chore: use node_bindings loop for clarity (#24391) 2020-07-03 09:19:27 -07:00
Shelley Vohr
9106d0c6d5 fix: intermittent 100% CPU usage on macOS (#24394) 2020-07-03 09:18:51 -07:00
Electron Bot
92d9de93a4 Bump v11.0.0-nightly.20200703 2020-07-03 08:32:36 -07:00
Shelley Vohr
fd0eaf4507 fix: remove same-tag notifications before showing new ones (#24302) 2020-07-02 23:04:32 -07:00
Samuel Attard
2a6d6d6ea7 build: build squirrel and its dependencies from source (#24318)
* build: build squirrel and its dependencies from source

* chore: do not use fork for squirrel.mac

* build: do not ship headers with dependency frameworks

* Update BUILD.gn

* chore: s/striped/stripped

* chore: update as per feedback

* chore: use ARC and fix build errors

* chore: fix ARC Squirrel self retainer
2020-07-02 19:42:40 -07:00
Robo
d330c6f9fe feat: expose sessionId in debugger module (#24170) 2020-07-02 13:04:20 -07:00
Electron Bot
82ae18dd1c Bump v11.0.0-nightly.20200702 2020-07-02 08:36:33 -07:00
Electron Bot
c157311373 chore: bump node to v12.18.2 (master) (#24381)
* chore: bump node in DEPS to v12.18.2

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-07-01 15:39:35 -04:00
Jeremy Rose
354ea00f17 chore: tsify auto-updater (#24328) 2020-07-01 12:27:12 -07:00
Milan Burda
4c449fbc75 test: convert more tests to async / await (#24373) 2020-07-01 15:14:38 -04:00
Shelley Vohr
3cb833821a docs: add hardened runtime entitlement info (#24369) 2020-07-01 12:11:09 -07:00
Shelley Vohr
a69a655386 chore: remove upstreamed BoringSSL patch (#24363) 2020-07-01 09:27:14 -07:00
Electron Bot
dc3905cef4 Bump v11.0.0-nightly.20200701 2020-07-01 08:31:42 -07:00
John Kleinschmidt
22e64dc328 ci: update timeout on breakpad generation to 30 minutes (#24382) 2020-07-01 11:06:45 -04:00
Jeremy Rose
6bd30bf09e chore: tsify dialog (#24324) 2020-06-30 15:51:44 -07:00
Milan Burda
c6db47182a test: make sure tests fail properly instead of timing out (#24316) 2020-07-01 00:10:36 +02:00
Jeremy Rose
451086d7f2 chore: tsify extensions shim (#24355) 2020-06-30 12:49:08 -07:00
George Xu
ee61eb9aa4 feat: add app.getApplicationInfoForProtocol API (#24112)
* pre merge

* windows changes

* added tests

* clean up

* more cleanup

* lint error

* windows 7 support

* added windows 7 implementation

* code review

* lint and code review

* code review

* app.md merge conflict

* merge conflict app.md

accidently deleted code block

* 'lint'

* mis-moved getapplicationinfoforprotocol() into anonymous namespace

* fix test

* lint

* code review
2020-06-30 12:22:30 -07:00
Electron Bot
2cbd091e89 Bump v11.0.0-nightly.20200630 2020-06-30 08:33:54 -07:00
Shelley Vohr
af4876296c fix: macOS modal focus (#24286) 2020-06-29 13:15:28 -07:00
Jeremy Rose
d9d07c65b2 chore: tsify net-log (#24322)
* chore: tsify net-log

* comment

* gn
2020-06-29 09:21:32 -07:00
Electron Bot
6e069a7df8 Bump v11.0.0-nightly.20200629 2020-06-29 08:31:45 -07:00
Cheng Zhao
ef3579eae3 refactor: rename TopLevelWindow to BaseWindow (#24305) 2020-06-29 16:06:20 +09:00
Jeremy Rose
80e5007c47 chore: tsify browser-window (#24326)
* chore: tsify browser-window

* fix focus

* also tsify top-level-window
2020-06-29 10:22:55 +09:00
Milan Burda
1c49e4e376 test: use delay() helper (#24321) 2020-06-26 22:59:54 +02:00
Electron Bot
8eb198bab4 Bump v11.0.0-nightly.20200626 2020-06-26 08:32:52 -07:00
Samuel Attard
16a3f41fd3 chore: add deprecation warning for the default of contextIsolation (#23507)
* chore: add deprecation warning for the default of contextIsolation

* chore: add to breaking changes

* Update docs/breaking-changes.md

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

* chore: fix specs on windows

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-06-25 10:55:17 -07:00
Jeremy Rose
605e50269e chore: convert rpc-server to ts (#24271) 2020-06-25 10:19:08 -07:00
Milan Burda
9b4572de44 feat: implement systemPreferences.getMediaAccessStatus() on Windows (#24275) 2020-06-25 09:47:50 -07:00
Electron Bot
5b80556da2 Bump v11.0.0-nightly.20200625 2020-06-25 08:31:34 -07:00
Shelley Vohr
4290555a0d feat: support suspend/resume on macOS (#24254) 2020-06-24 10:17:07 -07:00
Electron Bot
1429a8961c Bump v11.0.0-nightly.20200624 2020-06-24 08:32:42 -07:00
Shelley Vohr
46f58b28c3 fix: frameless vibrant modals shouldn't bezel (#24250) 2020-06-24 07:30:49 -07:00
Shelley Vohr
6369748a2a feat: support suspend/resume on Windows (#24251) 2020-06-24 07:28:29 -07:00
Samuel Attard
abf2e9c93d chore: expose electrons built in modules in the REPL along with nodes (#24249) 2020-06-24 00:53:46 -07:00
Samuel Attard
b2b5a6a3de chore: minify internal JS code (#24252) 2020-06-23 14:57:08 -07:00
Shelley Vohr
acb64a2d3c fix: only notify mouse-up on mouse-up (#24240) 2020-06-23 08:37:13 -07:00
Electron Bot
3853fd3e99 Bump v11.0.0-nightly.20200623 2020-06-23 08:32:44 -07:00
Shelley Vohr
659e79fc08 refactor: prevent consistent early exception (#24191)
* refactor: prevent consistent early exception

* Use _linkedBinding where possible

* Remove dead electronBinding
2020-06-22 20:32:45 -07:00
Shelley Vohr
4c77fe318d refactor: improve the REPL (#24204)
This PR improves the Electron REPL experience. It adds a welcome message to the REPL to let users know what versions of Node.js and Electron they're running, as well as overriding the completer function in the REPL to preload and add tab autocompletion for Electron's own modules.
2020-06-22 19:03:19 -07:00
Electron Bot
72a089262e chore: bump chromium to a84d34e372b8fb5e9a94b1b4b447e (master) (#23908)
* chore: bump chromium in DEPS to a7249f73ae05d456c04487ef1693325f719556dd

* chore: bump chromium in DEPS to 202466fa40b58f0bb9c9a76a037d1c50154c099e

* chore: bump chromium in DEPS to 2dd1b25c8d794b50fb0dd911e0c4e909ff39f145

* Update patches

* update patches

* Revert "[printing] Mojofy PrintHostMsg_CheckForCancel"

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

* chore: bump chromium in DEPS to 8c1542e7dd36854fdf4abd1a8021eeb65a6a2e2b

* chore: bump chromium in DEPS to 078bc6d796334fb403acd8975b99d1c8ecd028e8

* chore: bump chromium in DEPS to d96e9f16ae852ec9dbd15bf17df3d440402413bb

* update patches

* chore: update patches

* Use ExtensionSystem::is_ready() instead of ExtensionService::is_ready()

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

* Remove WebImeTextSpan

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

* Remove PDFAnnotations flag altogether.

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

* Rework find-from-selection so it's synchronous -- fixes flaky tests

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

* fixup! Revert "[printing] Mojofy PrintHostMsg_CheckForCancel"

* chore: bump chromium in DEPS to a8a280835830c65145ed8573a9a09f36d3920418

* update sysroots

* update patches

* update patches

* Take RFH as a parameter for DidUpdateFavicon/ManifestURL

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

* chore: bump chromium in DEPS to b6149cb5a5e32caf8eab67b97ef3072b72521ca8

* Update patches

* Rename net::cookie_util::StripStatuses to StripAccessResults

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

* use net::CookieAccessResultList instead of net::CookieAccessResultList

* fix mas_no_private_api patch

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

* chore: bump chromium in DEPS to a27feee1643d952e48f77c92d8c03aedea14b720

* update patches

* fix: add new navigation state REUSE_SITE_INSTANCE

To fix the new set of state checks added in
https://chromium-review.googlesource.com/c/chromium/src/+/2215141

* chore: bump chromium in DEPS to ff4559a4c13d20888202474e4ab9917dbdad8a9a

* update patches

* Cleanup usages of old mojo types and remove unused code

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

* chore: bump chromium in DEPS to 05279845f76eb22900a8b0d1a11d4fd339a8e53b

* chore: bump chromium in DEPS to 821558279767cffec90e3b5b947865f90089fed3

* chore: bump chromium in DEPS to 1aef04e6486be337d3dd820b2d64d6320a1b9c13

* chore: bump chromium in DEPS to dc86386e8fdd796a0f7577e91e42a7f8b7e9bc78

* chore: bump chromium in DEPS to 64f2360794f14643764092ba3e58e2ed8f9fee12

* chore: update patches

* refactor: MessageLoop, you are terminated \o/

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

* refactor: plumb DownloadSchedule to DownloadItem

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

* chore: fix variable typo in IPC

* chore: s/BindPipeAndPassReceiver/BindNewPipeAndPassReceiver

* chore: update patches

* chore: XEvent becomes x11::Event

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

* fixup! refactor: MessageLoop, you are terminated \o/

* fixup! chore: XEvent becomes x11::Event

* build: update v8 headers

* chore: fix windows build

* chore: disable SameSite-by-default changes

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

* update printing.patch

* chore: bump chromium DEPS to 9ae03ef8f7d4f6ac663f725bcfe70311987652f3

* Convert WidgetHostMsg_SelectionBoundsChanged/TextInputStateChanged

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

* chore: update v8 patches

* [XProto] Replace usages of XID and ::Window with x11::Window

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

* Update VideoFrameMetadata to use base::Optionals

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

* --disable-dev-shm-usage for gpu process crash

* [v8] Allow for 4GB TypedArrays

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

* update lib_src_switch_buffer_kmaxlength_to_size_t.patch

* disable app.getGPUInfo spec on linux

* update patches

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-22 10:35:10 -07:00
Shelley Vohr
61a05caa78 refactor: remove uses of v8::Isolate::GetCurrent (#24179) 2020-06-22 09:35:24 -07:00
Electron Bot
563a8c83ea Bump v11.0.0-nightly.20200622 2020-06-22 08:33:12 -07:00
Shelley Vohr
046a05944a fix: emit click events with tray context menu (#24200) 2020-06-22 08:24:47 -07:00
Milan Burda
0629c6c2ea fix: isTrustedSender() in test-app (#24214) 2020-06-22 14:14:20 +02:00
Electron Bot
48d1a70b52 Bump v11.0.0-nightly.20200619 2020-06-19 08:31:56 -07:00
Electron Bot
5c6d8c2b7d chore: bump node to v12.18.1 (master) (#24199)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-18 17:37:23 -07:00
Electron Bot
0f44682be0 Bump v11.0.0-nightly.20200618 2020-06-18 08:32:15 -07:00
Cheng Zhao
2376c45443 fix: do not use CONTEXT_MENU flag for tray menu (reland) (#24097)
* fix: do not use CONTEXT_MENU flag for tray menu

* fix: menu window should not appear in taskbar
2020-06-17 21:21:43 -07:00
Electron Bot
b665eb6d43 chore: bump node to v12.18.0 (master) (#23789)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-17 15:57:12 -07:00
Elena Topaka
4e66f1b2c6 fix: use correct 'pasteandmatchstyle' shortcut on macOS (#24153) 2020-06-17 23:13:46 +02:00
Shelley Vohr
a54fcde3f4 docs: fix MenuItem click handler type (#24147) 2020-06-17 10:34:25 -07:00
Robo
7cc780d077 fix: let Node.js perform microtask checkpoint in the main process (#24131)
* fix: let Node.js perform microtask checkpoint in the main process

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

* fix: remove checkpoint from some call-sites

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

* fix: remove checkpoint from some call-sites

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

* fix incorrect specs

* default constructor arguments are considered for explicit mark

* add regression spec
2020-06-17 10:08:10 -07:00
Electron Bot
59f9d75324 Bump v11.0.0-nightly.20200617 2020-06-17 08:31:29 -07:00
Milan Burda
cb6476fd12 chore: cleanup unused WebContents::DereferenceRemoteJSObject() (#24167) 2020-06-17 16:50:21 +02:00
Jeremy Rose
e1e73fa5f5 refactor: use WeakRef on main process side of remote (#24115) 2020-06-16 14:34:08 -07:00
Samuel Attard
09c0ee8f87 build: remove dead symlink from MAS build (#24158)
* build: remove dead symlink from MAS build

* chore: new out cache

* build: fixup gn check

* Update node_main.cc

* chore: fix lint
2020-06-16 14:19:57 -07:00
Lukas Weber
cf284991d8 feat: Add did-become-active event on mac (#23872)
Co-authored-by: Lukas Weber <luweber@microsoft.com>
2020-06-16 10:03:41 -07:00
Electron Bot
f9fe8a67b9 Bump v11.0.0-nightly.20200616 2020-06-16 08:33:19 -07:00
Samuel Attard
7bf0af7d96 Revert "build: remove dead symlink from MAS build (#23831)" (#24146)
This reverts commit 7a216a8fab.
2020-06-15 23:42:18 -07:00
Samuel Attard
7a216a8fab build: remove dead symlink from MAS build (#23831)
* build: remove dead symlink from MAS build

* chore: new out cache

* fix gn check errors

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-16 14:25:21 +09:00
Milan Burda
673169a7ba chore: remove unused deprecate.fnToProperty() (#24069) 2020-06-15 18:59:04 -07:00
Shelley Vohr
9c7d73c6d6 fix: emit 'shutdown' outside -[NSApplication terminate:] (#24111) 2020-06-15 18:58:28 -07:00
Samuel Attard
0b830ba9e5 build: retry external binary downloads a few times (#24110) 2020-06-15 14:31:29 -07:00
Jeremy Rose
c0182bca15 chore: remove test usages of createIDWeakMap (#24116) 2020-06-15 13:56:51 -07:00
Electron Bot
8412aae231 Bump v11.0.0-nightly.20200615 2020-06-15 08:31:53 -07:00
Shelley Vohr
b9ac334efc fix: showing certificate dialog with no window (#24091) 2020-06-12 22:18:09 -07:00
Jeremy Rose
379bb174e9 refactor: use WeakRef on renderer side of remote (#24037) 2020-06-12 15:50:03 -07:00
Jeremy Rose
178e46cd23 test: add test for gc race in remote (#24087) 2020-06-12 14:19:20 -07:00
Shelley Vohr
66744ecb4d fix: fs.readdir should support withFileTypes (#24062) 2020-06-12 08:32:59 -07:00
Electron Bot
a7599a0838 Bump v11.0.0-nightly.20200612 2020-06-12 08:32:36 -07:00
Cheng Zhao
d5f642938d fix: handle non client pointer events from pen on Win10 (#24042) 2020-06-12 09:26:16 -05:00
Jeremy Rose
7274467f73 refactor: tsify remote (#24034) 2020-06-11 11:36:03 -07:00
Jeremy Rose
7c7ea141f0 test: extract defer helper (#24019) 2020-06-11 11:35:50 -07:00
Samuel Attard
c66282a460 Revert "fix: do not use CONTEXT_MENU flag for tray menu (#23843)" (#24076)
This reverts commit b809d104d0.
2020-06-11 11:27:57 -07:00
Jeremy Rose
78fe545d18 refactor: remove renderer-side refcount in remote (#24054) 2020-06-11 10:22:28 -07:00
Paul Frazee
81d09bea44 fix: correctly handle nexttick scheduling in stream reads (#24022) 2020-06-11 09:55:59 -07:00
Electron Bot
130b176796 Bump v11.0.0-nightly.20200611 2020-06-11 08:31:16 -07:00
Andrea Brancaleoni
2e2e9a3702 ci: use call instead of cmd /C (#23985)
Since we want to import the environment change from RefreshEnv.cmd
we also want to share the same execution context of the
caller.
2020-06-11 10:05:03 -04:00
Eryk Rakowski
04be1ac4a1 fix: assign session to remote webContents (#23989)
* fix: assign session to remote webContents

* fix: test name
2020-06-11 12:57:51 +09:00
Benjamin Sova
a33c10c3ed docs: fix explanation of darwin auto-quit prevention (#24003) 2020-06-11 11:08:27 +09:00
Gellert Hegyi
ce042184de fix: Add .paks for media-internals and webrtc-internals pages (#24010)
* fix: adds paks for media-internals and webrtc-internals pages

* adds tests
2020-06-11 11:07:49 +09:00
Electron Bot
b1574f9e59 Bump v11.0.0-nightly.20200610 2020-06-10 08:32:15 -07:00
Felix Rieseberg
9554d063a5 chore: backport advapi32 libuv fix (#24030)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-09 14:26:33 -07:00
Felix Rieseberg
3eade2c228 fix: Allow windows behind macOS elements if frame = false (#23976) 2020-06-09 11:52:14 -07:00
Jeremy Rose
71e2b7151c test: extract RemoteControlApp to spec-helpers (#24020) 2020-06-09 11:42:53 -07:00
Jeremy Rose
d08cfce6cb chore: use more inclusive language in a few places (#24023)
* chore: use more inclusive language in lint script

* whitelist -> allowed_extension_ids in plugin_utils

* some other places
2020-06-09 11:29:29 -07:00
dependabot[bot]
b2ef299efc build(deps): bump minimist from 1.2.0 to 1.2.5 in /spec-main (#24026)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.5.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-09 11:29:15 -07:00
Electron Bot
fc8b49485a Bump v11.0.0-nightly.20200609 2020-06-09 08:32:03 -07:00
Evgeny
aa32fbf1d6 docs: update setAboutPanelOptions iconPath description (#23998)
* Updated doc setAboutPanelOptions iconPath #23833

* Simplify docs
2020-06-08 17:46:25 -07:00
Charles Kerr
980e592271 chore: ensure release notes always come from Clerk (#23777)
* chore: ensure release notes always come from Clerk

Now with tests!

* chore: move sinon devDependency into `spec-main`

* refactor: tweak note-spec variable for readability
2020-06-08 11:39:44 -07:00
Paul Frazee
c6c022dc46 feat: add {stream} opt to custom protocol registry to configure media player (#22955) 2020-06-08 09:49:36 -07:00
Islam ElHakmi
261f385b5e docs: mention build-tools in the build instructions (#23909) 2020-06-08 08:59:19 -07:00
Electron Bot
6e710a20a6 Bump v11.0.0-nightly.20200608 2020-06-08 08:31:59 -07:00
Alexey Kuzmin
46c9e15182 fix: volume key globalShortcut deregistration (#23984) 2020-06-08 14:46:00 +02:00
Jeremy Rose
5185501b85 test: reduce flakiness of post-context-release ipc test (#23992) 2020-06-05 16:51:42 -07:00
Shelley Vohr
27d629abb9 fix: add missing isComposing KeyboardEvent property (#23971) 2020-06-05 15:18:20 -07:00
Shelley Vohr
9d960e29eb build: check patches on update (#23103) 2020-06-04 17:43:28 -07:00
Jeremy Apthorp
a1c55a13e1 fix: throw instead of crash when using ipcRenderer after context released (#23917) 2020-06-04 16:25:25 -07:00
Robo
491caf59c1 chore: update tracking bug (#23959) 2020-06-04 10:56:54 -07:00
Shelley Vohr
2d47daa8c4 fix: missing HandleScopes in touch bar (#23936) 2020-06-04 10:11:28 -07:00
Electron Bot
25e4a9431c Bump v11.0.0-nightly.20200604 2020-06-04 08:32:18 -07:00
Milan Burda
3fa4299939 fix: use acceptLanguages argument in session.setUserAgent() (#23944) 2020-06-04 13:05:37 +02:00
Cheng Zhao
90caa5eac9 docs: remove confusing notes on Node (#23929)
* docs: remove confusing notes on Node

* Update docs/tutorial/first-app.md

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

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-06-03 20:00:52 -07:00
Samuel Attard
b1adbf7fd7 build: fix filenames autogen with new BUILDFLAG syntax (#23952) 2020-06-03 15:46:59 -07:00
Cheng Zhao
2fadb73032 fix: destroy GetSize callback at last (#23930) 2020-06-03 11:04:30 -07:00
Shelley Vohr
ac81a39e09 fix: compensate for lazy-loaded circular deps (#23890) 2020-06-03 10:29:08 -07:00
Electron Bot
83247c48c3 Bump v11.0.0-nightly.20200603 2020-06-03 08:31:46 -07:00
Cheng Zhao
5de6adfb84 test: load page with some content when testing extension (#23901)
* test: load page with some content when testing extension

* test: use dom-ready to wait for page loaded with extension
2020-06-03 16:56:28 +09:00
Samuel Attard
d8594f7a78 fix: restore original GTK/appindicator implementation of tray icons (#23674) 2020-06-02 17:00:20 -07:00
Samuel Attard
087567655a fix: correctly support the --inspect-brk-node flag (#23903) 2020-06-02 15:02:54 -07:00
Robo
512e1541c6 fix: default to NTLM v2 in the network service for POSIX platforms (#23846)
* fix: default to NTLM v2 in the network service

* chore: update patch details
2020-06-02 12:58:00 -07:00
Samuel Attard
c36981da8b docs: default of allowRendererProcessReuse is true (#23888) 2020-06-02 11:09:20 -07:00
Samuel Attard
d3fa5ed1e8 docs: move protocol-ns to protocol.md (#23883)
* docs: move protocol-ns to protocol.md

* chore: fix up tests and implement missing pieces required for tests
2020-06-02 09:46:18 -07:00
Electron Bot
edc5050a2e Bump v11.0.0-nightly.20200602 2020-06-02 08:32:11 -07:00
Jeremy Apthorp
a5efc387c7 chore: note quiet period in PR template. (#23889) 2020-06-02 09:36:09 -04:00
Samuel Attard
0062b126b4 chore: update patches (#23902) 2020-06-02 03:34:52 -07:00
Samuel Attard
969f46a48f chore: remove IPC hiddens (#23720) 2020-06-02 02:33:06 -07:00
Samuel Attard
c6f4573a13 perf: lazily load some modules in sandbox mode (#23856) 2020-06-02 02:32:32 -07:00
Biru Mohanathas
95037a7d2a fix: Make the --disable-color-correct-rendering switch work again (#23787)
This regressed once again in Electron 8 due to Chromium changes.

Test Plan:

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

Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
2020-06-02 16:31:33 +09:00
Wojciech Krol
5218a6e6ab fix: notify URLLoaderClient about redirect inside intercepted protocol's handler (#23742)
* fix: notify URLLoaderClient about redirect inside intercepted protocol's handler

* fix: update new_request's site_for_coookies

* fix: Unound client, so it an be passed to sub-methods
2020-06-02 14:20:34 +09:00
Cheng Zhao
5918dd6e65 test: wait for beforeunload handler to be installed (#23874) 2020-06-02 11:32:39 +09:00
Samuel Attard
fbf397e15d fix: add patch to prevent crash during frame swap with ctx isolation enabled (#23684) 2020-06-01 18:02:30 -07:00
Samuel Attard
066b8c5ab3 fix: expose electron/common and electron/renderer modules in sandboxed preloads (#23857) 2020-06-01 17:37:02 -07:00
Samuel Attard
634ab45095 build: make electron renderer init scripts profilable (#23855)
The devtools profiler is not attached at the point we run out init scripts (or our apps preload scripts), we do not really want to change when we run these init scripts but for when a dev is doing performance work it makes sense to give them an option to make the devtools profiler actually work on both our init scripts and their preload script.  This PR adds that logic behind an environment variable ELECTRON_PROFILE_INIT_SCRIPTS.
2020-06-01 16:08:34 -07:00
Electron Bot
a4de915b74 chore: bump chromium to d66c2e32380bf5d1eb5e1fe37faef (master) (#23791)
* chore: bump chromium in DEPS to db7d7b3e7cb2bc925f2abfde526280cfdfc21a41

* Update patches

* chore: bump chromium in DEPS to 5613e1b99a44fcbe22f3910f803ca76903a77ec1

* Update patches

* Network service: Remove primary_network_context bool.

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

* WebContentsObserver now implements OnRendererResponsive

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

* update patches

* Fixup printing patch

* chore: bump chromium in DEPS to e387b972cdd7160c416fa6c64a724e2258aa0218

* update patches

* [printing] Move PrintHostMsg_DidPrintContent_Params to print.mojom

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

* [XProto] Move items from ::x11::XProto to ::x11

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

* revert Add IChromeAccessible

This was added in https://chromium-review.googlesource.com/c/chromium/src/+/2206224 but it breaks WOA builds because third_party/win_build_output/midl/ui/accessibility/platform/arm64 does not exist. The link above says that the new interface is behind a feature flag which is disabled by default so it is safe to remove for now.

* rebaseline ichromeaccessible for Windows arm64

This patch will not be needed once we get the next roll.

* Update to 1b9e01844e8bf1aaafc4a52c0c62af7f56d9637b to get arm64 fix

* update patches

* chore: bump chromium in DEPS to 096aefa04092ea00f7b68d8d19345883f20db3c3

* chore: bump chromium in DEPS to a524a45ffd1d6fd46a7a86138fe2b22df5b6651a

* chore: update patches

* Window Placement: Gate cross-screen fullscreen behavior on permission

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

* chore: add spec for https://crbug.com/1085836

* chore: bump chromium in DEPS to ff6c4f4b826d66c2e32380bf5d1eb5e1fe37faef

* update patches

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-06-01 16:34:34 -04:00
Electron Bot
4a551bde16 Bump v11.0.0-nightly.20200601 2020-06-01 08:32:05 -07:00
Cheng Zhao
b809d104d0 fix: do not use CONTEXT_MENU flag for tray menu (#23843) 2020-06-01 09:57:25 -05:00
Alexey Kuzmin
4133c71105 build: fix for "enable_desktop_capturer = false" (#23864) 2020-06-01 10:13:47 -04:00
Robo
f67aff2704 feat: add V8CacheOptions webpreference (#23842)
* feat: add V8CacheOptions webpreference

* address review comments
2020-05-31 20:09:23 -07:00
Cheng Zhao
aa8d81511f fix: MakeAbsoluteFilePath is a blocking call (#23840) 2020-05-30 10:01:55 -07:00
Samuel Attard
236c1334e3 chore: tsify sandboxed init (#23719) 2020-05-30 02:56:54 -07:00
DeeDeeG
9f21d09dfd docs: remove upgrading-node.md (#23802) 2020-05-29 12:12:35 -07:00
Electron Bot
9dec16d81e Bump v11.0.0-nightly.20200529 2020-05-29 08:31:10 -07:00
John Kleinschmidt
b086197968 fix: use system installed objcopy to copy debug symbols (#23835) 2020-05-29 08:37:02 -04:00
Shelley Vohr
e8ea007104 fix: ensure nativeImage serialization main->renderer (#23759) 2020-05-28 09:43:15 -07:00
Electron Bot
e5da2caa34 Bump v11.0.0-nightly.20200528 2020-05-28 08:32:13 -07:00
Cheng Zhao
a1edf5cf94 Revert "fix: trigger activate event when app is activated via app switcher (#23727)" (#23818)
This reverts commit 2bc85b2579.
2020-05-28 09:53:33 -04:00
Shelley Vohr
6516110c70 fix: volume key globalShortcut registration (#23782) 2020-05-28 08:56:48 -04:00
Alexey Kuzmin
3a7775fa73 test: refactor how spec files are collected (#23774) 2020-05-28 00:21:02 +02:00
Shelley Vohr
5d88d0ee74 fix: only bezel frameless windows (#23779) 2020-05-27 14:07:24 -07:00
Shelley Vohr
7b0a84477a fix: weakly reference MenuModel from MenuController (#23778) 2020-05-27 13:54:52 -07:00
Shelley Vohr
f78504515b fix: handle asynchronous URL loading in bw proxy (#23776) 2020-05-27 13:50:54 -07:00
Cheng Zhao
ca6a415626 fix: pass correct buffer length (#23785) 2020-05-27 10:50:01 -07:00
Electron Bot
f445e0a797 Bump v11.0.0-nightly.20200527 2020-05-27 08:32:31 -07:00
Jeremy Judeaux
204f001c5d feat: add desktopCapturer.getMediaSourceIdForWebContents() to get stream source id from web contents (#22701)
* feat: add desktopCapturer.getMediaSourceIdForWebContents() to get stream source id from web contents

* Cleanup from #22701 PR comments
2020-05-26 16:34:24 -04:00
Electron Bot
dc72f74020 chore: bump chromium to 580fe983e138952553cd6af11ee8b (master) (#23379)
* chore: bump chromium in DEPS to 5ce64b91b4d6a78c97480059f15ff6469fc0918e

* chore: bump chromium in DEPS to e74c73d0000f81b3f40a513176c8d024bba57d28

* chore: bump chromium in DEPS to 501640e650d4657ba63db65fa257e4a899168de7

* chore: bump chromium in DEPS to 00db20e1bc3d77706723a87ada3c1c647a1c37b7

* chore: update patches

* refactor: AddNewContents now takes a target_url

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

* chore: SetHostCleanupFinalizationGroupCallback has been removed from V8

* refactor: use WebInputEvent::Namespace types directly

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

* refactor: FollowRedirect takes in cors exempt headers now

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

* refactor: printing::DuplexMode moved to mojo

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

* refactor: use MessagePortDescriptor instead of raw mojo::MessagePipeHandles

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

* chore: update patches

* chore: bump chromium in DEPS to f1537676d613f3567cfb43adf577b3847fba4bc3

* chore: update patches

* refactor: service_manager::BinderMapWithContext merged into mojo::BinderMap

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

* chore: unused argument removed from ReadAvailableTypes in ui::Clipboard

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

* chore: bump chromium in DEPS to 949888433ab935dd6125c107226a4c9d6da9bf48

* chore: update patches

* update patches

* chore: update sysroots

* chore: bump chromium in DEPS to eaac5b5035fe189b6706e1637122e37134206059

* chore: bump chromium in DEPS to 258b54b903d33dab963adf59016691e6537f8b70

* build: update patches

* refactor: cursor.mojom and cursor_types.mojom moved to //ui/base/cursor/mojom

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

* chore: DesktopWindowTreeHostLinux becomes DesktopWindowTreeHostPlatform

Refs:

* refactor: LogErrorEventDescription moved from ui to x11

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

* chore: update patches

* chore: bump chromium in DEPS to bd06abcfe807d4461683479237cdd920dafa52ca

* chore: bump chromium in DEPS to 1afb0891e56f1e79d204db43ca053a46d0974511

* chore: bump chromium in DEPS to 5cb0f794bf7f155bf8c0a241b94e01c9d90c2744

* chore: bump chromium in DEPS to 37327ba3303234e1a3cd3310ca11a68e81b95123

* update patches

* remove ClientSideDetectionService from browser_process

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

* refactor: shuttle cursor changed event to WebContentsObserver

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

* chore: bump chromium in DEPS to 1d97904bb6936e106df13705208b73e47367c2b9

* avoid IPC crash introduced earlier in the roll

Refs: b67334e781 (diff-607f4e8f7c5686aa09af98c783925babR128)

* remove WebContentsView::SizeContents

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

* chore: bump chromium in DEPS to 87066d1db0546a9de33952ba964e1e42f76f1dae

* update patches

* adapt to //content creating NetworkContexts

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

* WIP temporarily ignore mojo-ified PrintHostMsg_PrintPreviewFailed

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

* add checkout_pgo_profiles to DEPS

* chore: bump chromium in DEPS to a095318bec1dedf580d676f408eaeefdbd9956b1

* add blink's execution_context to electron_lib deps

Refs:
b67334e781#, https://chromium-review.googlesource.com/c/chromium/src/+/1952124

* update patches

* update patches

* refactor: use newly mojo-ified PrintPreviewFailed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2195343
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: update patches

* chore: remove NOTIFICATION_EXTENSIONS_READY_DEPRECATED

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

* avoid a call to Profile::FromBrowserContext in printing

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

* chore: bump chromium in DEPS to 8f5c6a46861a991e12ffd80554b6bd41a11b0b65

* chore: bump chromium in DEPS to ab66134739ff3b6bdb8de53bbc58a97d1b7b5d8a

* chore: bump chromium in DEPS to dd08df9f6c8d6198f0a7b931ca9e845e27dae033

* chore: update patches

* [printing] Mojofy PrintHostMsg_PrintPreviewCancelled

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

* [printing] Mojofy PrintHostMsg_PrintPreviewInvalidPrinterSettings

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

* [printing] Mojofy PrintHostMsg_DidPrepareDocumentForPreview

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

* fix: inherit base network context params

* fix: use message handle api specific to embedders

* update patches

* chore: update v8 headers

* fixup! avoid a call to Profile::FromBrowserContext in printing

* chore: bump chromium in DEPS to f198bc3276828d992b6202d75a9da6a8363164ea

* chore: update patches

* Remove cors_exempt_headers.h

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

* Supply speech recognition sandbox from service_sandbox_type.h

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

* [content] Remove unused methods from WebContents

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

* [XProto] Replace XAtom with x11::Atom

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

* chore: bump chromium in DEPS to 5df37fabaaed09f3ea511f4ef49203d8ebee7b68

* [UI] Support secondary labels in dropdown menus

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

* chore: update patches

* refactor: GetSublabelAt => GetSecondaryLabelAt

* Revert "[printing] Mojofy PrintHostMsg_DidPrepareDocumentForPreview"

This reverts commit 44ed0892a0c81716229638f17253bbb2cf8f037d.

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

* Unnest CanonicalCookie::CookieInclusionStatus

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

* update print-to-pdf.html with latest html data

https://bugs.chromium.org/p/chromium/issues/detail?id=1085667

* chore: bump chromium in DEPS to 5dfa8d5f706580fe983e138952553cd6af11ee8b

* fix crash in x server when setting window icon

* chore: update patches

* Use a normal return value for WebContentsView::GetContainerBounds.

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

* fix build on windows

* chore: bump chromium in DEPS to 9d15054f4cba060901e43deecf74002f11f47be3

* chore: update patches

* [printing] Mojofy PrintHostMsg_CheckForCancel

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-26 13:06:26 -07:00
Electron Bot
2b39111e30 Bump v11.0.0-nightly.20200526 2020-05-26 08:31:30 -07:00
Lukas Weber
2bc85b2579 fix: trigger activate event when app is activated via app switcher (#23727)
When application is activated thru macOS app switcher (cmd+tab) the
App's activate event is note emitted. The reason is that
`applicationShouldHandleReopen:hasVisibleWindows:` is sent only when app
is activated via Dock. Using `applicationDidBecomeActive:` is handling
all cases properly.

Co-authored-by: Lukas Weber <luweber@microsoft.com>
2020-05-26 10:58:51 -04:00
Cheng Zhao
0a026cde0c test: return after inspector connection is closed (#23763) 2020-05-26 10:47:49 -04:00
John Kleinschmidt
db5cf816b4 ci: deflake WOA tests (#23707) 2020-05-26 10:25:57 -04:00
Cheng Zhao
08f288faf1 test: use WebContents event to test beforeunload (#23699) 2020-05-26 09:21:38 -04:00
Cheng Zhao
0dabd5e8c7 test: more logging in node inspector test (#23746) 2020-05-26 10:20:16 +09:00
Electron Bot
2029ff1903 Bump v11.0.0-nightly.20200525 2020-05-25 08:32:17 -07:00
Samuel Attard
9bc5e98238 chore: tsify more of lib (#23721)
* chore: tsify more of lib

* Update lib/browser/api/session.ts

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

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-05-22 12:46:22 -07:00
Shelley Vohr
762f7bcca2 refactor: use typeutils for nativeImage serialization (#23693) 2020-05-22 08:56:57 -07:00
Electron Bot
75847a0c5b Bump v11.0.0-nightly.20200522 2020-05-22 08:32:12 -07:00
Samuel Attard
e3c2ec9f7c chore: remove unused isolated-world-args (#23716) 2020-05-21 20:11:58 -07:00
Cheng Zhao
fdf40ce07a fix: read GTK dark theme setting on Linux (#23678) 2020-05-21 15:41:25 -07:00
Florian Keller
82924679fe docs: Explain console-message parameters (#23661) 2020-05-21 15:39:51 -07:00
Erick Zhao
f373cc770f docs: remove app feedback program doc (#23673) 2020-05-21 15:39:13 -07:00
Shelley Vohr
78d74bf8b4 fix: trigger about panel for about role on on win (#23687) 2020-05-21 15:38:26 -07:00
Samuel Attard
5ed2512881 fix: support 10-x-y in the release notes generator (#23709) 2020-05-21 13:55:27 -07:00
Cheng Zhao
ce77e3327c docs: errors in isolated world are not dispatched (#23653) 2020-05-21 11:56:22 -04:00
mtgto
7b55a70a36 feat: Add Secure Keyboard Entry APIs in macOS (#20678)
* feat: Add Secure Keyboard Entry APIs in macOS

Add methods:
- app.isSecureInputEnabled()
- app.setSecureInputEnabled(enabled)

These enable to prevent other process listens keyboard input events.

* fix: lint error in app.md for #20678

* fix: crash app.setSecureInputEnabled() in password textfield

* fix: export Secure keyboard Entry API to only macOS

* fix: lint error in browser_mac.mm for #20678

* test: add test for app.setSecureKeyboardEntryEnabled in macOS
2020-05-21 11:53:44 -04:00
Jeremy Apthorp
5bdf97e7ae test: hide child windows in webview spec (#23682) 2020-05-21 11:46:17 -04:00
Cheng Zhao
3137d5f011 test: multiple processes may crash in crashReporter test (#23695) 2020-05-21 11:43:47 -04:00
Electron Bot
4114281b62 Bump v10.0.0-nightly.20200521 2020-05-21 08:31:34 -07:00
Shelley Vohr
21a6062a31 docs: document optional scaleFactor param to nativeImage fns (#23671) 2020-05-20 18:52:48 -07:00
Milan Burda
df53816eea feat: expose the desktopCapturer module in the main process (#23548) 2020-05-20 20:25:49 -04:00
Shelley Vohr
4b23a85475 refactor: correctly serialize nativeImage/buffer with typeUtils (#23666)
* refactor: correctly serialize nativeImage/buffer with typeUtils

* test: add serialization specs

* fix: construct from dataURL

* test: test for dataURL specificity
2020-05-20 13:42:42 -07:00
Alexey Kuzmin
33d6a99d40 test: call "expect()" on a correct call stack (#23675) 2020-05-20 22:18:48 +02:00
LuoJinghua
9d851b8791 net: Don't ignore the referer header in net.request (#23386) 2020-05-20 13:28:38 -04:00
Jeremy Apthorp
0a481242f0 fix: wrap EmitWarning with HandleScope (#23667) 2020-05-20 09:44:27 -07:00
Electron Bot
84888bb1f1 Bump v10.0.0-nightly.20200520 2020-05-20 08:31:37 -07:00
Jeremy Apthorp
8de06f0c57 feat: deprecate uncompressed crash uploads (#23598) 2020-05-19 13:47:21 -07:00
Jeremy Apthorp
bca071f428 docs: note no planned breaking changes for v11 (#23638) 2020-05-19 15:39:51 -04:00
Jeremy Apthorp
de44d28c8e refactor: ginify Session (#23569) 2020-05-19 10:18:12 -07:00
Jeremy Apthorp
3f3a760a01 test: bind to 127.0.0.1 in contextBridge spec (#23639) 2020-05-19 10:17:40 -07:00
Jeremy Apthorp
27d7eb3880 docs: remove note about experimental nature of sandbox (#23651) 2020-05-19 10:17:31 -07:00
Jeremy Apthorp
393b637e9e test: attempt to track down "illegal access" error (#23645)
* test: attempt to track down "illegal access" error

* how does electron formed
2020-05-19 12:29:36 -04:00
Electron Bot
33bd218df9 Bump v10.0.0-nightly.20200519 2020-05-19 08:32:19 -07:00
Cheng Zhao
82da234650 test: disable parallel/test-worker-sharedarraybuffer-from-worker-thread (#23652) 2020-05-19 07:57:28 -07:00
Sofia Nguy
ce53c35e1d docs: update currently supported versions for 9.0.0 release (#23510)
* docs: update currently supported versions for 9.0.0 release

* update supported version numbers back to xy format
2020-05-19 09:22:38 -05:00
Sofia Nguy
82f89c8206 docs: update 10.0 stable release date (#23511)
* docs: update 10.0 stable release date

* add bullet for reference to chrome's schedule

* update node version
2020-05-19 09:22:22 -05:00
Cheng Zhao
38a04214e0 fix: make sure hunspell file is not destroyed in UI thread (#23631) 2020-05-19 09:55:23 -04:00
Jeremy Apthorp
01579cc8ed test: add retries to another beforeunload test (#23644) 2020-05-19 11:06:19 +09:00
Jeremy Apthorp
c00103d274 test: fix multiple connections in inspector test (#23648)
* test: fix multiple connections in inspector test

* debug log
2020-05-19 11:05:49 +09:00
John Kleinschmidt
89441caad4 build: save mksnapshot args on Windows (#23634) 2020-05-18 15:42:23 -04:00
Jeremy Apthorp
7e841ceb5c refactor: tsify net module (#23618) 2020-05-18 10:22:48 -07:00
John Kleinschmidt
8879a3db58 ci: use longer mocha timeout on WOA testing (#23633) 2020-05-18 12:33:54 -04:00
Shelley Vohr
ee0f67d541 fix: nativeImage remote serialization (#23543)
We weren't serializing nativeImages properly in the remote module, leading to gin conversion errors when trying to, for example, create a new context menu in the renderer with icons using nativeImage. This fixes that by adding a new special case to handle them.
2020-05-18 09:29:24 -07:00
Electron Bot
eb341b383d Bump v10.0.0-nightly.20200518 2020-05-18 08:31:53 -07:00
Jeremy Apthorp
87a670f74d feat: allow compressing crash uploads on linux (#23597)
* chore: align crash patch with upstream

* feat: allow compressing crash uploads on linux

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-18 11:09:50 -04:00
Jeremy Apthorp
8bbb68be79 test: retry beforeunload test (#23576) 2020-05-18 11:04:41 -04:00
Shelley Vohr
75fd9a3496 refactor: improve MoveItemToTrash error description (#23589) 2020-05-17 19:18:34 -07:00
Milan Burda
52b50e6b33 feat: add app render-process-gone event (#23560) 2020-05-17 17:05:05 +02:00
Samuel Attard
9d7ba98209 refactor: remove the RenderFrameFunctionStore and use privates to memory manage (#23592) 2020-05-15 11:57:40 -07:00
Electron Bot
3cf97d5717 Bump v10.0.0-nightly.20200515 2020-05-15 08:32:47 -07:00
Jeremy Apthorp
8b160d57a6 chore: align crash patch with upstream (#23595) 2020-05-14 20:09:02 -07:00
Charles Kerr
2342aaffbd feat: look harder for a commit's pull request. (#23593)
PR numbers are almost always listed parenthetically in the commit message;
but when something is committed manually, it could be missing. This change
uses octokit's listPullRequestsAssociatedWithCommit() as a second approach
to finding a commit's PR.

Last night's Releases WG meeting noted that "re-enable pdf viewer" was
missing from the notes. This PR fixes that omission.
2020-05-14 18:50:39 -05:00
Alexey Kuzmin
092eec8459 build: remove unused header from a patch (#23585) 2020-05-14 09:41:21 -07:00
Electron Bot
db94712227 Bump v10.0.0-nightly.20200514 2020-05-14 08:32:33 -07:00
Milan Burda
4afc756094 feat: add contents.getBackgroundThrottling() + backgroundThrottling property (#21036) 2020-05-14 15:11:45 +02:00
Milan Burda
7656480247 test: remove usage of the remote module from tests (#23571) 2020-05-14 00:33:37 +02:00
Jeremy Apthorp
6282487245 fix: exclude crashpad_handler binary on linux (#23538) 2020-05-13 15:28:12 -07:00
Jeremy Apthorp
e82bb06336 fix: generate symbols for the correct crashpad handler binary (#23537) 2020-05-13 13:54:40 -07:00
Milan Burda
fc468cce3b test: skip remote module related tests when enable_remote_module = false (#23557) 2020-05-13 20:05:44 +02:00
Milan Burda
85fae67966 perf: use type-utils for desktopCapturer.getSources() result serialization (#23549) 2020-05-13 19:05:53 +02:00
Electron Bot
508c7ac4f9 Bump v10.0.0-nightly.20200513 2020-05-13 08:31:51 -07:00
Milan Burda
54b6c06062 fix: expose v8util.createIDWeakMap() regardless of enable_remote_module (#23546) 2020-05-13 12:10:03 +02:00
Samuel Attard
54ff423dac fix: leave behind the unmodified XDG_CURRENT_DESKTOP variable (#23512) 2020-05-12 20:13:53 -07:00
Felix Rieseberg
dcbed18f44 feat: app.getPath('recent') (#23381)
* feat: getPath("recent")

* test: Add a spec and docs

* fix: Integrate feedback

* fix: Handle path change

* chore: Cut SetRecentPath
2020-05-13 11:27:56 +09:00
Samuel Attard
c7b2eb68cf docs: add documentation on how to use the built-in spellchecker (#23508) 2020-05-13 10:25:21 +09:00
Shelley Vohr
3daeec5e3e fix: run Node.js at-exit callbacks in renderer proc (#23419) 2020-05-12 13:09:56 -07:00
John Kleinschmidt
b11836e195 build: use correct v8_context_snapshot_generator in mksnapshot zip (#23536) 2020-05-12 14:52:56 -04:00
Cheng Zhao
16b41dc9ff fix: do not destroy thread in UI thread (#23495) 2020-05-12 10:37:51 -07:00
Milan Burda
ef176ce368 build: fix building with enable_remote_module = false (#23499) 2020-05-12 18:32:04 +02:00
Electron Bot
633f3c2413 Bump v10.0.0-nightly.20200512 2020-05-12 08:31:37 -07:00
Samuel Attard
7bba36a095 chore: add TRACE calls for heavy ctx bridge methods (#23501) 2020-05-11 14:24:43 -07:00
Samuel Attard
34da3bc500 feat: add new render-process-gone event (#23096) 2020-05-11 13:42:24 -07:00
Samuel Attard
7f9b7b2e95 chore: clean up context bridge scopes and add specs for internal bridge (#23334)
* chore: clean up context bridge context scopes

* spec: add specs for internalContextBridge
2020-05-11 13:41:42 -07:00
Samuel Attard
cf635c5fac docs: add document on contextIsolation (#23474)
* docs: add document on contextIsolation

* fix lint

* chore: link ctx isolation doc from security doc
2020-05-11 13:01:32 -07:00
Milan Burda
653c36b8c9 test: skip "handles Promise timeouts correctly" when ELECTRON_RUN_AS_NODE is disabled (#23415) 2020-05-11 14:19:39 -04:00
Samuel Attard
4af5c55c8d chore: add DCHECK to ensure extension_system() is not used for in-memory sessions (#23475) 2020-05-11 11:13:30 -07:00
Robin Dupret
ce4d95b16a docs: badgeCount needs notifications permission on macOS (#23488)
In order for `badgeCount` to properly update the dock icon on
macOS, the application needs to have the permissions to display
notifications.

Cross-refs #22715.
2020-05-11 11:13:17 -07:00
Electron Bot
5951b0ad4b Bump v10.0.0-nightly.20200511 2020-05-11 08:32:21 -07:00
Alexander Prinzhorn
ade8f285d0 Update mime-typed-buffer.md (#23384)
I think this should be aligned with `StringProtocolResponse`. At least the `charset` was missing from the docs.

https://www.electronjs.org/docs/api/protocol#protocolregisterbufferprotocolscheme-handler-completion

>  should be called with either a Buffer object or an object that has the data, mimeType, and charset properties.
2020-05-11 19:00:38 +09:00
Kevin Wang
3866c88aef Fix outdated Cerebral Debugger link (#23427) 2020-05-11 10:53:15 +09:00
Alexey Kuzmin
dc3de49a08 spec: fix conditions for some tests (#23489) 2020-05-11 10:46:45 +09:00
Shelley Vohr
6114518463 fix: NSImageName string conversion (#23467) 2020-05-11 10:24:45 +09:00
Milan Burda
392ea320cf build: allow use of BUILDFLAG directives from within JS code (#20328) 2020-05-11 01:06:07 +02:00
Milan Burda
f9c04449f4 refactor: SystemPreferences::SetUserDefault (#23412) 2020-05-10 00:38:15 +02:00
Pavel Feldman
3c132dc445 chore: handle Browser.close over CDP (#23436) 2020-05-08 16:13:32 -07:00
Samuel Attard
091f45b879 chore: fix linting (#23473) 2020-05-08 11:30:37 -07:00
Samuel Attard
21900fe4f4 fix: do not initialize any extension related logic in OffTheRecord contexts (#22772) 2020-05-08 11:17:28 -07:00
Electron Bot
a3ee61f963 Bump v10.0.0-nightly.20200508 2020-05-08 08:31:44 -07:00
Pavel Feldman
93f6129c80 chore: support --remote-debugging-pipe (#23433) 2020-05-07 21:27:55 -07:00
Jeremy Apthorp
06bf0d08dc fix: crashReporter incompatible with sandbox on Linux (#23265) 2020-05-07 13:31:26 -07:00
Shelley Vohr
fc434f136b fix: multiple extension filters on macOS (#23409) 2020-05-07 08:52:56 -07:00
Electron Bot
a4f701f9a5 Bump v10.0.0-nightly.20200507 2020-05-07 08:32:36 -07:00
Shelley Vohr
ba929b4195 chore: remove obsolete cjs assert patch (#23422) 2020-05-06 22:47:58 -07:00
Robo
a707a3eda3 feat: add enableWebSQL webpreference (#23311)
* feat: add enableWebSQL webpreference

* chore: update indexedDB test
2020-05-06 12:52:59 -07:00
Electron Bot
2a680e107b Bump v10.0.0-nightly.20200506 2020-05-06 08:32:27 -07:00
John Kleinschmidt
b7e4ed2052 build: update sccache for linux (#23418) 2020-05-05 14:38:14 -04:00
szTheory
1611c586ae docs: fix markdown list item formatting error (#23368) 2020-05-05 10:55:27 -07:00
Electron Bot
0d8e8a1113 Bump v10.0.0-nightly.20200505 2020-05-05 08:31:55 -07:00
Robo
bac9ac1163 fix: guard pdf behind correct buildflags (#23404) 2020-05-04 13:56:50 -07:00
1268 changed files with 71689 additions and 24118 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -27,7 +27,13 @@
"sourceType": "module"
},
"globals": {
"standardScheme": "readonly"
"standardScheme": "readonly",
"globalThis": "readonly",
"BUILDFLAG": "readonly",
"ENABLE_DESKTOP_CAPTURER": "readonly",
"ENABLE_REMOTE_MODULE": "readonly",
"ENABLE_VIEWS_API": "readonly",
"BigInt": "readonly"
},
"overrides": [
{

10
.gitattributes vendored
View File

@@ -2,3 +2,13 @@
# files to be checked out with LF endings even if core.autocrlf is true.
*.patch text eol=lf
patches/**/.patches merge=union
# Source code and markdown files should always use LF as line ending.
*.cc text eol=lf
*.mm text eol=lf
*.h text eol=lf
*.js text eol=lf
*.ts text eol=lf
*.py text eol=lf
*.ps1 text eol=lf
*.md text eol=lf

View File

@@ -15,6 +15,7 @@ Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTIN
- [ ] relevant documentation is changed or added
- [ ] PR title follows semantic [commit guidelines](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines)
- [ ] [PR release notes](https://github.com/electron/clerk/blob/master/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/master/README.md#examples).
- [ ] This is **NOT A BREAKING CHANGE**. Breaking changes may not be merged to master until 11-x-y is branched.
#### Release Notes

344
BUILD.gn
View File

@@ -49,6 +49,10 @@ if (is_linux) {
}
}
declare_args() {
use_prebuilt_v8_context_snapshot = false
}
branding = read_file("shell/app/BRANDING.json", "json")
electron_project_name = branding.project_name
electron_product_name = branding.product_name
@@ -94,6 +98,15 @@ npm_action("build_electron_definitions") {
outputs = [ "$target_gen_dir/tsc/typings/electron.d.ts" ]
}
webpack_build("electron_asar_bundle") {
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.asar_bundle_deps
config_file = "//electron/build/webpack/webpack.config.asar.js"
out_file = "$target_gen_dir/js2c/asar_bundle.js"
}
webpack_build("electron_browser_bundle") {
deps = [ ":build_electron_definitions" ]
@@ -139,25 +152,18 @@ webpack_build("electron_isolated_renderer_bundle") {
out_file = "$target_gen_dir/js2c/isolated_bundle.js"
}
copy("electron_js2c_copy") {
sources = [
"lib/common/asar.js",
"lib/common/asar_init.js",
]
outputs = [ "$target_gen_dir/js2c/{{source_file_part}}" ]
}
action("electron_js2c") {
deps = [
":electron_asar_bundle",
":electron_browser_bundle",
":electron_isolated_renderer_bundle",
":electron_js2c_copy",
":electron_renderer_bundle",
":electron_sandboxed_renderer_bundle",
":electron_worker_bundle",
]
webpack_sources = [
sources = [
"$target_gen_dir/js2c/asar_bundle.js",
"$target_gen_dir/js2c/browser_init.js",
"$target_gen_dir/js2c/isolated_bundle.js",
"$target_gen_dir/js2c/renderer_init.js",
@@ -165,15 +171,10 @@ action("electron_js2c") {
"$target_gen_dir/js2c/worker_init.js",
]
sources = webpack_sources + [
"$target_gen_dir/js2c/asar.js",
"$target_gen_dir/js2c/asar_init.js",
]
inputs = sources + [ "//third_party/electron_node/tools/js2c.py" ]
outputs = [ "$root_gen_dir/electron_natives.cc" ]
script = "tools/js2c.py"
script = "build/js2c.py"
args = [ rebase_path("//third_party/electron_node") ] +
rebase_path(outputs, root_build_dir) +
rebase_path(sources, root_build_dir)
@@ -322,8 +323,8 @@ source_set("electron_lib") {
"shell/common/api:mojo",
"//base:base_static",
"//base/allocator:buildflags",
"//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
"//components/language/core/browser",
"//components/net_log",
@@ -333,6 +334,7 @@ source_set("electron_lib") {
"//components/network_session_configurator/common",
"//components/pref_registry",
"//components/prefs",
"//components/upload_list",
"//components/user_prefs",
"//components/viz/host",
"//components/viz/service",
@@ -345,6 +347,7 @@ source_set("electron_lib") {
"//device/bluetooth",
"//device/bluetooth/public/cpp",
"//gin",
"//media/blink:blink",
"//media/capture/mojom:video_capture",
"//media/mojo/mojom",
"//net:extras",
@@ -360,12 +363,15 @@ source_set("electron_lib") {
"//services/viz/privileged/mojom/compositing",
"//skia",
"//third_party/blink/public:blink",
"//third_party/blink/public:blink_devtools_inspector_resources",
"//third_party/boringssl",
"//third_party/electron_node:node_lib",
"//third_party/inspector_protocol:crdtp",
"//third_party/leveldatabase",
"//third_party/libyuv",
"//third_party/webrtc_overrides:webrtc_component",
"//third_party/widevine/cdm:headers",
"//third_party/zlib/google:zip",
"//ui/base/idle",
"//ui/events:dom_keycode_converter",
"//ui/gl",
@@ -399,41 +405,26 @@ source_set("electron_lib") {
defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
}
extra_source_filters = []
if (!is_linux) {
extra_source_filters += [
"*\bx/*",
"*_x11.h",
"*_x11.cc",
"*_gtk.h",
"*_gtk.cc",
"*\blibrary_loaders/*",
]
}
if (!is_win) {
extra_source_filters += [
"*\bwin_*.h",
"*\bwin_*.cc",
]
}
if (!is_posix) {
extra_source_filters += [
"*_posix.cc",
"*_posix.h",
]
}
if (is_mac) {
extra_source_filters += [
"*_views.cc",
"*_views.h",
"*\bviews/*",
]
if (!is_mas_build) {
deps += [ "//components/crash/core/app" ]
}
set_sources_assignment_filter(
sources_assignment_filter + extra_source_filters)
sources = filenames.lib_sources
set_sources_assignment_filter(sources_assignment_filter)
if (is_win) {
sources += filenames.lib_sources_win
}
if (is_mac) {
sources += filenames.lib_sources_mac
}
if (is_posix) {
sources += filenames.lib_sources_posix
}
if (is_linux) {
sources += filenames.lib_sources_linux
}
if (!is_mac) {
sources += filenames.lib_sources_views
}
if (is_component_build) {
defines += [ "NODE_SHARED_MODE" ]
@@ -446,6 +437,10 @@ source_set("electron_lib") {
]
}
if (is_linux) {
deps += [ "//components/crash/content/browser" ]
}
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
@@ -453,7 +448,11 @@ source_set("electron_lib") {
"//ui/accelerated_widget_mac",
]
libs = [
if (!is_mas_build) {
deps += [ "//third_party/crashpad/crashpad/client" ]
}
frameworks = [
"AVFoundation.framework",
"Carbon.framework",
"LocalAuthentication.framework",
@@ -471,25 +470,28 @@ source_set("electron_lib") {
]
if (is_mas_build) {
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
sources -= [
"shell/browser/auto_updater_mac.mm",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
]
sources -= [ "shell/browser/auto_updater_mac.mm" ]
defines += [ "MAS_BUILD" ]
sources -= [
"shell/app/electron_crash_reporter_client.cc",
"shell/app/electron_crash_reporter_client.h",
"shell/common/crash_keys.cc",
"shell/common/crash_keys.h",
]
} else {
libs += [
frameworks += [
"Squirrel.framework",
"ReactiveCocoa.framework",
"ReactiveObjC.framework",
"Mantle.framework",
]
cflags_objcc = [
"-F",
rebase_path("external_binaries", root_build_dir),
deps += [
"//third_party/squirrel.mac:reactiveobjc_framework+link",
"//third_party/squirrel.mac:squirrel_framework+link",
]
# ReactiveCocoa which is used by Squirrel requires using __weak.
cflags_objcc += [ "-fobjc-weak" ]
# ReactiveObjC which is used by Squirrel requires using __weak.
cflags_objcc = [ "-fobjc-weak" ]
}
}
if (is_linux) {
@@ -498,7 +500,6 @@ source_set("electron_lib") {
"//build/config/linux/gtk",
"//dbus",
"//device/bluetooth",
"//third_party/breakpad:client",
"//ui/events/devices/x11",
"//ui/events/platform/x11",
"//ui/gtk",
@@ -512,8 +513,9 @@ source_set("electron_lib") {
]
}
configs += [ ":gio_unix" ]
include_dirs += [ "//third_party/breakpad" ]
configs += [ "//build/config/linux:x11" ]
if (use_x11) {
deps += [ "//ui/gfx/x" ]
}
defines += [
# Disable warnings for g_settings_list_schemas.
"GLIB_DISABLE_DEPRECATION_WARNINGS",
@@ -521,6 +523,16 @@ source_set("electron_lib") {
sources += filenames.lib_sources_nss
sources += [
"shell/browser/ui/gtk/app_indicator_icon.cc",
"shell/browser/ui/gtk/app_indicator_icon.h",
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
"shell/browser/ui/gtk/app_indicator_icon_menu.h",
"shell/browser/ui/gtk/gtk_status_icon.cc",
"shell/browser/ui/gtk/gtk_status_icon.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/gtk/status_icon.cc",
"shell/browser/ui/gtk/status_icon.h",
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
@@ -528,6 +540,7 @@ source_set("electron_lib") {
if (is_win) {
libs += [ "dwmapi.lib" ]
deps += [
"//components/crash/core/app:crash_export_thunks",
"//ui/native_theme:native_theme_browser",
"//ui/views/controls/webview",
"//ui/wm",
@@ -539,14 +552,6 @@ source_set("electron_lib") {
]
}
if ((is_mac && !is_mas_build) || is_win) {
sources += [
"shell/common/crash_reporter/crash_reporter_crashpad.cc",
"shell/common/crash_reporter/crash_reporter_crashpad.h",
]
deps += [ "//third_party/crashpad/crashpad/client" ]
}
if (enable_plugins) {
deps += [ "chromium_src:plugins" ]
sources += [
@@ -566,7 +571,6 @@ source_set("electron_lib") {
sources += [
"shell/browser/osr/osr_host_display_client.cc",
"shell/browser/osr/osr_host_display_client.h",
"shell/browser/osr/osr_host_display_client_mac.mm",
"shell/browser/osr/osr_render_widget_host_view.cc",
"shell/browser/osr/osr_render_widget_host_view.h",
"shell/browser/osr/osr_video_consumer.cc",
@@ -575,8 +579,13 @@ source_set("electron_lib") {
"shell/browser/osr/osr_view_proxy.h",
"shell/browser/osr/osr_web_contents_view.cc",
"shell/browser/osr/osr_web_contents_view.h",
"shell/browser/osr/osr_web_contents_view_mac.mm",
]
if (is_mac) {
sources += [
"shell/browser/osr/osr_host_display_client_mac.mm",
"shell/browser/osr/osr_web_contents_view_mac.mm",
]
}
deps += [
"//components/viz/service",
"//services/viz/public/mojom",
@@ -584,17 +593,6 @@ source_set("electron_lib") {
]
}
if (enable_remote_module) {
sources += [
"shell/common/api/remote/object_life_monitor.cc",
"shell/common/api/remote/object_life_monitor.h",
"shell/common/api/remote/remote_callback_freer.cc",
"shell/common/api/remote/remote_callback_freer.h",
"shell/common/api/remote/remote_object_freer.cc",
"shell/common/api/remote/remote_object_freer.h",
]
}
if (enable_desktop_capturer) {
if (is_component_build && !is_linux) {
# On windows the implementation relies on unexported
@@ -622,7 +620,10 @@ source_set("electron_lib") {
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
"shell/renderer/printing/print_render_frame_helper_delegate.h",
]
deps += [ "//components/printing/common:mojo_interfaces" ]
deps += [
"//chrome/services/printing/public/mojom",
"//components/printing/common:mojo_interfaces",
]
}
if (enable_electron_extensions) {
@@ -653,12 +654,21 @@ source_set("electron_lib") {
deps += [
"//components/pdf/browser",
"//components/pdf/renderer",
"//pdf:pdf_ppapi",
]
sources += [
"shell/browser/electron_pdf_web_contents_helper_client.cc",
"shell/browser/electron_pdf_web_contents_helper_client.h",
]
}
if (is_win && enable_win_dark_mode_window_ui) {
sources += [
"shell/browser/win/dark_mode.cc",
"shell/browser/win/dark_mode.h",
]
libs += [ "uxtheme.lib" ]
}
}
electron_paks("packed_resources") {
@@ -681,6 +691,15 @@ if (is_mac) {
sources = [ "shell/common/resources/mac/MainMenu.xib" ]
}
action("fake_v8_context_snapshot_generator") {
script = "build/fake_v8_context_snapshot_generator.py"
args = [
rebase_path("$root_out_dir/$v8_context_snapshot_filename"),
rebase_path("$root_out_dir/fake/$v8_context_snapshot_filename"),
]
outputs = [ "$root_out_dir/fake/$v8_context_snapshot_filename" ]
}
bundle_data("electron_framework_resources") {
public_deps = [ ":packed_resources" ]
sources = []
@@ -691,8 +710,13 @@ if (is_mac) {
if (v8_use_external_startup_data) {
public_deps += [ "//v8" ]
if (use_v8_context_snapshot) {
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
public_deps += [ "//tools/v8_context_snapshot" ]
if (use_prebuilt_v8_context_snapshot) {
sources += [ "$root_out_dir/fake/$v8_context_snapshot_filename" ]
public_deps += [ ":fake_v8_context_snapshot_generator" ]
} else {
sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
public_deps += [ "//tools/v8_context_snapshot" ]
}
} else {
sources += [ "$root_out_dir/snapshot_blob.bin" ]
}
@@ -751,11 +775,11 @@ if (is_mac) {
}
bundle_data("electron_crashpad_helper") {
sources = [ "$root_out_dir/crashpad_handler" ]
sources = [ "$root_out_dir/chrome_crashpad_handler" ]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
public_deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
public_deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
if (is_asan) {
# crashpad_handler requires the ASan runtime at its @executable_path.
@@ -771,6 +795,9 @@ if (is_mac) {
"Resources",
"Libraries",
]
if (!is_mas_build) {
framework_contents += [ "Helpers" ]
}
public_deps = [
":electron_framework_libraries",
":electron_lib",
@@ -794,18 +821,19 @@ if (is_mac) {
include_dirs = [ "." ]
sources = filenames.framework_sources
libs = []
frameworks = []
if (enable_osr) {
libs += [ "IOSurface.framework" ]
frameworks += [ "IOSurface.framework" ]
}
ldflags = [
"-F",
rebase_path("external_binaries", root_build_dir),
"-Wl,-install_name,@rpath/$output_name.framework/$output_name",
"-rpath",
"@loader_path/Libraries",
# Required for exporting all symbols of libuv.
"-Wl,-force_load,obj/third_party/electron_node/deps/uv/libuv.a",
]
if (is_component_build) {
ldflags += [
@@ -853,17 +881,49 @@ if (is_mac) {
}
}
template("stripped_framework") {
action(target_name) {
assert(defined(invoker.framework))
script = "//electron/build/strip_framework.py"
forward_variables_from(invoker, [ "deps" ])
inputs = [ "$root_out_dir/" + invoker.framework ]
outputs = [ "$target_out_dir/stripped_frameworks/" + invoker.framework ]
args = rebase_path(inputs) + rebase_path(outputs)
}
}
stripped_framework("stripped_mantle_framework") {
framework = "Mantle.framework"
deps = [ "//third_party/squirrel.mac:mantle_framework" ]
}
stripped_framework("stripped_reactiveobjc_framework") {
framework = "ReactiveObjC.framework"
deps = [ "//third_party/squirrel.mac:reactiveobjc_framework" ]
}
stripped_framework("stripped_squirrel_framework") {
framework = "Squirrel.framework"
deps = [ "//third_party/squirrel.mac:squirrel_framework" ]
}
bundle_data("electron_app_framework_bundle_data") {
sources = [ "$root_out_dir/$electron_framework_name.framework" ]
if (!is_mas_build) {
sources += [
"external_binaries/Mantle.framework",
"external_binaries/ReactiveCocoa.framework",
"external_binaries/Squirrel.framework",
]
sources += get_target_outputs(":stripped_mantle_framework") +
get_target_outputs(":stripped_reactiveobjc_framework") +
get_target_outputs(":stripped_squirrel_framework")
}
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
public_deps = [ ":electron_framework+link" ]
public_deps = [
":electron_framework+link",
":stripped_mantle_framework",
":stripped_reactiveobjc_framework",
":stripped_squirrel_framework",
]
foreach(helper_params, content_mac_helpers) {
sources +=
@@ -876,7 +936,7 @@ if (is_mac) {
output_name = electron_login_helper_name
sources = filenames.login_helper_sources
include_dirs = [ "." ]
libs = [ "AppKit.framework" ]
frameworks = [ "AppKit.framework" ]
info_plist = "shell/app/resources/mac/loginhelper-Info.plist"
extra_substitutions =
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
@@ -993,21 +1053,24 @@ if (is_mac) {
}
extract_symbols("crashpad_handler_syms") {
binary = "$root_out_dir/crashpad_handler"
binary = "$root_out_dir/chrome_crashpad_handler"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/crashpad_handler.dSYM/Contents/Resources/DWARF/crashpad_handler"
deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
dsym_file = "$root_out_dir/chrome_crashpad_handler.dSYM/Contents/Resources/DWARF/chrome_crashpad_handler"
deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
}
group("electron_symbols") {
deps = [
":crashpad_handler_syms",
":electron_app_syms",
":electron_framework_syms",
":swiftshader_egl_syms",
":swiftshader_gles_syms",
]
if (!is_mas_build) {
deps += [ ":crashpad_handler_syms" ]
}
foreach(helper_params, content_mac_helpers) {
_helper_target = helper_params[0]
deps += [ ":electron_helper_syms_${_helper_target}" ]
@@ -1037,6 +1100,7 @@ if (is_mac) {
":electron_app_manifest",
":electron_lib",
":packed_resources",
"//components/crash/core/app",
"//content:sandbox_helper_win",
"//electron/buildflags",
"//ui/strings",
@@ -1057,7 +1121,9 @@ if (is_mac) {
data += [ "$root_out_dir/resources/default_app.asar" ]
}
public_deps = [ "//tools/v8_context_snapshot:v8_context_snapshot" ]
if (use_v8_context_snapshot) {
public_deps = [ "//tools/v8_context_snapshot:v8_context_snapshot" ]
}
if (is_win) {
sources += [
@@ -1066,22 +1132,42 @@ if (is_mac) {
"shell/browser/resources/win/resource.h",
]
deps += [
"//components/browser_watcher:browser_watcher_client",
"//components/crash/core/app:run_as_crashpad_handler",
]
ldflags = []
libs = [
"comctl32.lib",
"uiautomationcore.lib",
"wtsapi32.lib",
]
configs += [ "//build/config/win:windowed" ]
ldflags = [
# Windows 7 doesn't have these DLLs.
# TODO: are there other DLLs we need to list here to be win7
# compatible?
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
configs += [
"//build/config/win:windowed",
"//build/config/win:delayloads",
]
if (target_cpu == "arm64") {
configs -= [ "//build/config/win:cfi_linker" ]
ldflags += [ "/guard:cf,nolongjmp" ]
}
if (current_cpu == "x86") {
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB needed by
# Chrome's main thread. This saves significant memory on threads (like
# those in the Windows thread pool, and others) whose stack size we can
# only control through this setting. Because Chrome's main thread needs
# a minimum 1.5 MiB stack, the main thread (in 32-bit builds only) uses
# fibers to switch to a 1.5 MiB stack before running any other code.
ldflags += [ "/STACK:0x80000" ]
} else {
# Increase the initial stack size. The default is 1MB, this is 8MB.
ldflags += [ "/STACK:0x800000" ]
}
# This is to support renaming of electron.exe. node-gyp has hard-coded
# executable names which it will recognise as node. This module definition
# file claims that the electron executable is in fact named "node.exe",
@@ -1094,7 +1180,14 @@ if (is_mac) {
]
}
if (is_linux) {
ldflags = [ "-pie" ]
ldflags = [
"-pie",
# Required for exporting all symbols of libuv.
"-Wl,--whole-archive",
"obj/third_party/electron_node/deps/uv/libuv.a",
"-Wl,--no-whole-archive",
]
if (!is_component_build && is_component_ffmpeg) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
@@ -1160,18 +1253,6 @@ test("shell_browser_ui_unittests") {
"//ui/base",
"//ui/strings",
]
if (is_mac) {
# Resolve paths owing to different test executable locations
ldflags = [
"-F",
rebase_path("external_binaries", root_build_dir),
"-rpath",
"@loader_path",
"-rpath",
"@executable_path/" + rebase_path("external_binaries", root_build_dir),
]
}
}
template("dist_zip") {
@@ -1269,10 +1350,13 @@ dist_zip("electron_chromedriver_zip") {
mksnapshot_deps = [
":licenses",
"//tools/v8_context_snapshot:v8_context_snapshot_generator",
"//v8:mksnapshot($v8_snapshot_toolchain)",
]
if (use_v8_context_snapshot) {
mksnapshot_deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_generator($v8_snapshot_toolchain)" ]
}
group("electron_mksnapshot") {
public_deps = mksnapshot_deps
}

View File

@@ -47,17 +47,17 @@ dependencies, and tools contained in the `electron/electron` repository.
* [Step 1: Fork](https://electronjs.org/docs/development/pull-requests#step-1-fork)
* [Step 2: Build](https://electronjs.org/docs/development/pull-requests#step-2-build)
* [Step 3: Branch](https://electronjs.org/docs/development/pull-requests#step-3-branch)
* [The Process of Making Changes](https://electronjs.org/docs/development/pull-requests#the-process-of-making-changes)
* [Making Changes](https://electronjs.org/docs/development/pull-requests#making-changes)
* [Step 4: Code](https://electronjs.org/docs/development/pull-requests#step-4-code)
* [Step 5: Commit](https://electronjs.org/docs/development/pull-requests#step-5-commit)
* [Commit message guidelines](https://electronjs.org/docs/development/pull-requests#commit-message-guidelines)
* [Step 6: Rebase](https://electronjs.org/docs/development/pull-requests#step-6-rebase)
* [Step 7: Test](https://electronjs.org/docs/development/pull-requests#step-7-test)
* [Step 8: Push](https://electronjs.org/docs/development/pull-requests#step-8-push)
* [Step 8: Opening the Pull Request](https://electronjs.org/docs/development/pull-requests#step-8-opening-the-pull-request)
* [Step 9: Discuss and Update](#step-9-discuss-and-update)
* [Step 9: Opening the Pull Request](https://electronjs.org/docs/development/pull-requests#step-9-opening-the-pull-request)
* [Step 10: Discuss and Update](https://electronjs.org/docs/development/pull-requests#step-10-discuss-and-update)
* [Approval and Request Changes Workflow](https://electronjs.org/docs/development/pull-requests#approval-and-request-changes-workflow)
* [Step 10: Landing](https://electronjs.org/docs/development/pull-requests#step-10-landing)
* [Step 11: Landing](https://electronjs.org/docs/development/pull-requests#step-11-landing)
* [Continuous Integration Testing](https://electronjs.org/docs/development/pull-requests#continuous-integration-testing)
## Style Guides

35
DEPS
View File

@@ -5,18 +5,22 @@ gclient_gn_args = [
'checkout_android_native_support',
'checkout_libaom',
'checkout_nacl',
'checkout_pgo_profiles',
'checkout_oculus_sdk',
'checkout_openxr',
'checkout_google_benchmark'
'checkout_google_benchmark',
'mac_xcode_version',
]
vars = {
'chromium_version':
'17da1064b910f4170320ff37e971064916aed1dc',
'87.0.4280.141',
'node_version':
'v12.16.3',
'v12.18.3',
'nan_version':
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
'squirrel.mac_version':
'a3a5b3f03b824441c014893b18f99a103b2603e9',
'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'pyyaml_version': '3.12',
@@ -28,6 +32,7 @@ vars = {
'nodejs_git': 'https://github.com/nodejs',
'requests_git': 'https://github.com/kennethreitz',
'yaml_git': 'https://github.com/yaml',
'squirrel_git': 'https://github.com/Squirrel',
# KEEP IN SYNC WITH utils.js FILE
'yarn_version': '1.15.2',
@@ -42,6 +47,7 @@ vars = {
'checkout_chromium': True,
'checkout_node': True,
'checkout_nan': True,
'checkout_pgo_profiles': True,
# It's only needed to parse the native tests configurations.
'checkout_pyyaml': False,
@@ -49,6 +55,8 @@ vars = {
# Python "requests" module is used for releases only.
'checkout_requests': False,
'mac_xcode_version': 'default',
# To allow running hooks without parsing the DEPS tree
'process_deps': True,
@@ -99,6 +107,18 @@ deps = {
'url': Var('requests_git') + '/requests.git' + '@' + Var('requests_version'),
'condition': 'checkout_requests and process_deps',
},
'src/third_party/squirrel.mac': {
'url': Var("squirrel_git") + '/Squirrel.Mac.git@' + Var("squirrel.mac_version"),
'condition': 'process_deps',
},
'src/third_party/squirrel.mac/vendor/ReactiveObjC': {
'url': 'https://github.com/ReactiveCocoa/ReactiveObjC.git@74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
'condition': 'process_deps'
},
'src/third_party/squirrel.mac/vendor/Mantle': {
'url': 'https://github.com/Mantle/Mantle.git@78d3966b3c331292ea29ec38661b25df0a245948',
'condition': 'process_deps',
}
}
hooks = [
@@ -107,7 +127,7 @@ hooks = [
'condition': '(checkout_chromium and apply_patches) and process_deps',
'pattern': 'src/electron',
'action': [
'python',
'python3',
'src/electron/script/apply_all_patches.py',
'src/electron/patches/config.json',
],
@@ -125,7 +145,7 @@ hooks = [
'name': 'electron_npm_deps',
'pattern': 'src/electron/package.json',
'action': [
'python',
'python3',
'-c',
'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python", "script/lib/npx.py", "yarn@' + (Var("yarn_version")) + '", "install", "--frozen-lockfile"]);',
],
@@ -135,7 +155,7 @@ hooks = [
'pattern': 'src/electron',
'condition': 'checkout_boto and process_deps',
'action': [
'python',
'python3',
'-c',
'import os, subprocess; os.chdir(os.path.join("src", "electron", "vendor", "boto")); subprocess.check_call(["python", "setup.py", "build"]);',
],
@@ -145,7 +165,7 @@ hooks = [
'pattern': 'src/electron',
'condition': 'checkout_requests and process_deps',
'action': [
'python',
'python3',
'-c',
'import os, subprocess; os.chdir(os.path.join("src", "electron", "vendor", "requests")); subprocess.check_call(["python", "setup.py", "build"]);',
],
@@ -154,4 +174,5 @@ hooks = [
recursedeps = [
'src',
'src/third_party/squirrel.mac',
]

View File

@@ -1 +1 @@
10.0.0-nightly.20200504
11.4.9

View File

@@ -5,7 +5,7 @@
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/master)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
: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
@@ -28,15 +28,12 @@ The preferred method is to install Electron as a development dependency in your
app:
```sh
npm install electron --save-dev [--save-exact]
npm install electron --save-dev
```
The `--save-exact` flag is recommended for Electron prior to version 2, as it does not follow semantic
versioning. As of version 2.0.0, Electron follows semver, so you don't need `--save-exact` flag. For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).
For more installation options and troubleshooting tips, see
[installation](docs/tutorial/installation.md).
[installation](docs/tutorial/installation.md). For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).
## Quick start & Electron Fiddle

View File

@@ -6,7 +6,11 @@ To report a security issue, email [security@electronjs.org](mailto:security@elec
The Electron team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [Node Security Project](https://nodesecurity.io/report).
Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [npm contact form](https://www.npmjs.com/support) by selecting "I'm reporting a security vulnerability".
## The Electron Security Notification Process
For context on Electron's security notification process, please see the [Notifications](https://github.com/electron/governance/blob/master/wg-security/membership-and-notifications.md#notifications) section of the Security WG's [Membership and Notifications](https://github.com/electron/governance/blob/master/wg-security/membership-and-notifications.md) Governance document.
## Learning More About Security
To learn more about securing an Electron application, please see the [security tutorial](docs/tutorial/security.md).

View File

@@ -29,13 +29,14 @@
version: 1.0.{build}
build_cloud: electron-16-core
image: vs2019bt-16.4.0
image: vs2019bt-16.6.2
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
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
@@ -53,7 +54,9 @@ build_script:
} else {
node script/yarn.js install --frozen-lockfile
if ($(node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH;$LASTEXITCODE -eq 0)) {
$result = node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
Write-Output $result
if ($result.ExitCode -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
}
@@ -61,6 +64,7 @@ build_script:
- git config --global core.longpaths true
- cd ..
- mkdir src
- update_depot_tools.bat
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: $env:SCCACHE_PATH="$pwd\src\electron\external_binaries\sccache.exe"
@@ -98,6 +102,11 @@ build_script:
} else {
# update external binaries
python src/electron/script/update-external-binaries.py
# update angle
cd src\third_party\angle
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
git fetch
cd ..\..\..
}
} else {
# file does not exist, gclient sync, then zip
@@ -113,14 +122,16 @@ build_script:
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
# archive current source for future use
# only run on x64/woa to avoid contention saving
if ($(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30;$LASTEXITCODE -ne 0)) {
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
if ($LASTEXITCODE -ne 0) {
Write-warning "Could not save source to shared drive; continuing anyway"
}
# build time generation of file gen/angle/commit.h depends on
# third_party/angle/.git/HEAD.
# build time generation of file gen/angle/angle_commit.h depends on
# third_party/angle/.git
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
if ($(7z a $zipfile src\third_party\angle\.git\HEAD;$LASTEXITCODE -ne 0)) {
Write-warning "Failed to add third_party\angle\.git\HEAD; continuing anyway"
$(7z a $zipfile src\third_party\angle\.git)
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
}
}
- ps: >-
@@ -133,7 +144,7 @@ build_script:
cd build-tools
npm install
mkdir third_party
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
cd ..
@@ -152,7 +163,11 @@ build_script:
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
@@ -200,11 +215,11 @@ test_script:
echo "Skipping tests for $env:GN_CONFIG build"
}
- cd electron
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --enable-logging)
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --trace-uncaught --enable-logging --disable-features=CalculateNativeWinOcclusion )
- cd ..
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( gn desc out\Default v8:run_mksnapshot_default args > out\Default\mksnapshot_args )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )
@@ -215,10 +230,10 @@ deploy_script:
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_S3) {
Write-Output "Uploading Electron release distribution to s3"
& python script\release\uploaders\upload.py --upload_to_s3
& python script\release\uploaders\upload.py --verbose --upload_to_s3
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py
& python script\release\uploaders\upload.py --verbose
}
} elseif (Test-Path Env:\TEST_WOA) {
node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH

104
azure-pipelines-arm.yml Normal file
View File

@@ -0,0 +1,104 @@
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: src/electron'
inputs:
TargetFolder: src/electron
- bash: |
cd src/electron
node script/yarn.js install --frozen-lockfile
displayName: 'Yarn install'
- bash: |
export ZIP_DEST=$PWD/src/out/Default
echo "##vso[task.setvariable variable=ZIP_DEST]$ZIP_DEST"
mkdir -p $ZIP_DEST
cd src/electron
node script/download-circleci-artifacts.js --buildNum=$CIRCLE_BUILD_NUM --name=dist.zip --dest=$ZIP_DEST
cd $ZIP_DEST
unzip -o dist.zip
displayName: 'Download and unzip dist files for test'
env:
CIRCLE_TOKEN: $(CIRCLECI_TOKEN)
- bash: |
export FFMPEG_ZIP_DEST=$PWD/src/out/ffmpeg
mkdir -p $FFMPEG_ZIP_DEST
cd src/electron
node script/download-circleci-artifacts.js --buildNum=$CIRCLE_BUILD_NUM --name=ffmpeg.zip --dest=$FFMPEG_ZIP_DEST
cd $FFMPEG_ZIP_DEST
unzip -o ffmpeg.zip
displayName: 'Download and unzip ffmpeg for test'
env:
CIRCLE_TOKEN: $(CIRCLECI_TOKEN)
- bash: |
export NODE_HEADERS_DEST=$PWD/src/out/Default/gen
mkdir -p $NODE_HEADERS_DEST
cd src/electron
node script/download-circleci-artifacts.js --buildNum=$CIRCLE_BUILD_NUM --name=node_headers.tar.gz --dest=$NODE_HEADERS_DEST
cd $NODE_HEADERS_DEST
tar xzf node_headers.tar.gz
displayName: 'Download and untar node header files for test'
env:
CIRCLE_TOKEN: $(CIRCLECI_TOKEN)
- bash: |
export CROSS_ARCH_SNAPSHOTS=$PWD/src/out/Default/cross-arch-snapshots
mkdir -p $CROSS_ARCH_SNAPSHOTS
cd src/electron
node script/download-circleci-artifacts.js --buildNum=$CIRCLE_BUILD_NUM --name=cross-arch-snapshots/snapshot_blob.bin --dest=$CROSS_ARCH_SNAPSHOTS
node script/download-circleci-artifacts.js --buildNum=$CIRCLE_BUILD_NUM --name=cross-arch-snapshots/v8_context_snapshot.bin --dest=$CROSS_ARCH_SNAPSHOTS
displayName: 'Download cross arch snapshot files'
env:
CIRCLE_TOKEN: $(CIRCLECI_TOKEN)
- bash: |
export NATIVE_UNITTESTS_DEST=$PWD/src/out/Default
cd src/electron
node script/download-circleci-artifacts.js --buildNum=$CIRCLE_BUILD_NUM --name=shell_browser_ui_unittests --dest=$NATIVE_UNITTESTS_DEST
chmod +x $NATIVE_UNITTESTS_DEST/shell_browser_ui_unittests
displayName: 'Download native unittest executables'
env:
CIRCLE_TOKEN: $(CIRCLECI_TOKEN)
- bash: |
cd src
export ELECTRON_OUT_DIR=Default
set npm_config_arch=arm64
(cd electron && node script/yarn test -- --enable-logging)
displayName: 'Run Electron tests'
timeoutInMinutes: 20
env:
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
- bash: |
cd src
python electron/script/verify-ffmpeg.py --source-root "$PWD" --build-dir out/Default --ffmpeg-path out/ffmpeg
displayName: Verify non proprietary ffmpeg
timeoutInMinutes: 5
condition: succeededOrFailed()
- bash: |
cd src
echo Verify cross arch snapshot
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --snapshot-files-dir $PWD/out/Default/cross-arch-snapshots
displayName: Verify cross arch snapshot
timeoutInMinutes: 5
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
condition: succeededOrFailed()
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()

View File

@@ -63,7 +63,8 @@ steps:
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
set npm_config_arch=arm64
cd electron
node script/yarn test -- --enable-logging --verbose
# 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
displayName: 'Run Electron tests'
env:
ELECTRON_OUT_DIR: Default
@@ -87,7 +88,11 @@ steps:
- powershell: |
Get-Process | Where Name Like "electron*" | Stop-Process
Get-Process | Where Name Like "MicrosoftEdge*" | Stop-Process
Get-Process | Where Name Like "msedge*" | Stop-Process
displayName: 'Kill processes left running from last test run'
condition: always()
- powershell: |
Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
displayName: 'Delete user app data directories'
condition: always()

View File

@@ -2,7 +2,7 @@ is_electron_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
node_module_version = 82
node_module_version = 85
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0

View File

@@ -0,0 +1,8 @@
import os
import shutil
import sys
if os.path.exists(sys.argv[2]):
os.remove(sys.argv[2])
shutil.copy(sys.argv[1], sys.argv[2])

16
build/strip_framework.py Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python
import os
import subprocess
import sys
source = sys.argv[1]
dest = sys.argv[2]
# Ensure any existing framework is removed
subprocess.check_output(["rm", "-rf", dest])
subprocess.check_output(["cp", "-a", source, dest])
# Strip headers, we do not need to ship them
subprocess.check_output(["rm", "-r", os.path.join(dest, 'Headers')])
subprocess.check_output(["rm", "-r", os.path.join(dest, 'Versions', 'Current', 'Headers')])

View File

@@ -1,2 +1,2 @@
process.env.PRINT_WEBPACK_GRAPH = true
require('./run-compiler')
process.env.PRINT_WEBPACK_GRAPH = true;
require('./run-compiler');

View File

@@ -1,22 +1,45 @@
const path = require('path')
const webpack = require('webpack')
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const configPath = process.argv[2]
const outPath = path.resolve(process.argv[3])
const config = require(configPath)
const configPath = process.argv[2];
const outPath = path.resolve(process.argv[3]);
const config = require(configPath);
config.output = {
path: path.dirname(outPath),
filename: path.basename(outPath)
}
};
webpack(config, (err, stats) => {
const { wrapInitWithProfilingTimeout, wrapInitWithTryCatch, ...webpackConfig } = config;
webpack(webpackConfig, (err, stats) => {
if (err) {
console.error(err)
process.exit(1)
console.error(err);
process.exit(1);
} else if (stats.hasErrors()) {
console.error(stats.toString('normal'))
process.exit(1)
console.error(stats.toString('normal'));
process.exit(1);
} else {
process.exit(0)
let contents = fs.readFileSync(outPath, 'utf8');
if (wrapInitWithTryCatch) {
contents = `try {
${contents}
} catch (err) {
console.error('Electron ${webpackConfig.output.filename} script failed to run');
console.error(err);
}`;
}
if (wrapInitWithProfilingTimeout) {
contents = `function ___electron_webpack_init__() {
${contents}
};
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
setTimeout(___electron_webpack_init__, 0);
} else {
___electron_webpack_init__();
}`;
}
fs.writeFileSync(outPath, contents);
process.exit(0);
}
})
});

View File

@@ -0,0 +1,5 @@
module.exports = require('./webpack.config.base')({
target: 'asar',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
});

View File

@@ -1,61 +1,120 @@
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const electronRoot = path.resolve(__dirname, '../..')
const electronRoot = path.resolve(__dirname, '../..');
const onlyPrintingGraph = !!process.env.PRINT_WEBPACK_GRAPH
const onlyPrintingGraph = !!process.env.PRINT_WEBPACK_GRAPH;
class AccessDependenciesPlugin {
apply(compiler) {
apply (compiler) {
// Only hook into webpack when we are printing the dependency graph
if (!onlyPrintingGraph) return
if (!onlyPrintingGraph) return;
compiler.hooks.compilation.tap('AccessDependenciesPlugin', compilation => {
compilation.hooks.finishModules.tap('AccessDependenciesPlugin', modules => {
const filePaths = modules.map(m => m.resource).filter(p => p).map(p => path.relative(electronRoot, p))
console.info(JSON.stringify(filePaths))
})
})
const filePaths = modules.map(m => m.resource).filter(p => p).map(p => path.relative(electronRoot, p));
console.info(JSON.stringify(filePaths));
});
});
}
}
const defines = {
BUILDFLAG: onlyPrintingGraph ? '(a => a)' : ''
};
const buildFlagsPrefix = '--buildflags=';
const buildFlagArg = process.argv.find(arg => arg.startsWith(buildFlagsPrefix));
if (buildFlagArg) {
const buildFlagPath = buildFlagArg.substr(buildFlagsPrefix.length);
const flagFile = fs.readFileSync(buildFlagPath, 'utf8');
for (const line of flagFile.split(/(\r\n|\r|\n)/g)) {
const flagMatch = line.match(/#define BUILDFLAG_INTERNAL_(.+?)\(\) \(([01])\)/);
if (flagMatch) {
const [, flagName, flagValue] = flagMatch;
defines[flagName] = JSON.stringify(Boolean(parseInt(flagValue, 10)));
}
}
}
const ignoredModules = [];
if (defines.ENABLE_DESKTOP_CAPTURER === 'false') {
ignoredModules.push(
'@electron/internal/browser/desktop-capturer',
'@electron/internal/browser/api/desktop-capturer',
'@electron/internal/renderer/api/desktop-capturer'
);
}
if (defines.ENABLE_REMOTE_MODULE === 'false') {
ignoredModules.push(
'@electron/internal/browser/remote/server',
'@electron/internal/renderer/api/remote'
);
}
if (defines.ENABLE_VIEWS_API === 'false') {
ignoredModules.push(
'@electron/internal/browser/api/views/image-view.js'
);
}
module.exports = ({
alwaysHasNode,
loadElectronFromAlternateTarget,
targetDeletesNodeGlobals,
target
target,
wrapInitWithProfilingTimeout,
wrapInitWithTryCatch
}) => {
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts');
if (!fs.existsSync(entry)) {
entry = path.resolve(electronRoot, 'lib', target, 'init.js')
entry = path.resolve(electronRoot, 'lib', target, 'init.js');
}
const electronAPIFile = path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts');
return ({
mode: 'development',
devtool: 'inline-source-map',
devtool: false,
entry,
target: alwaysHasNode ? 'node' : 'web',
output: {
filename: `${target}.bundle.js`
},
wrapInitWithProfilingTimeout,
wrapInitWithTryCatch,
resolve: {
alias: {
'@electron/internal': path.resolve(electronRoot, 'lib'),
'electron': path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts'),
// Force timers to resolve to our dependency that doens't use window.postMessage
'timers': path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
electron$: electronAPIFile,
'electron/main$': electronAPIFile,
'electron/renderer$': electronAPIFile,
'electron/common$': electronAPIFile,
// Force timers to resolve to our dependency that doesn't use window.postMessage
timers: path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
},
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: (moduleName) => !onlyPrintingGraph && ignoredModules.includes(moduleName),
loader: 'null-loader'
}, {
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
transpileOnly: onlyPrintingGraph,
ignoreDiagnostics: [6059]
ignoreDiagnostics: [
// File '{0}' is not under 'rootDir' '{1}'.
6059
]
}
}]
},
@@ -64,20 +123,32 @@ module.exports = ({
__filename: false,
// We provide our own "timers" import above, any usage of setImmediate inside
// one of our renderer bundles should import it from the 'timers' package
setImmediate: false,
setImmediate: false
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true
}
})
]
},
plugins: [
new AccessDependenciesPlugin(),
...(targetDeletesNodeGlobals ? [
new webpack.ProvidePlugin({
process: ['@electron/internal/renderer/webpack-provider', 'process'],
global: ['@electron/internal/renderer/webpack-provider', '_global'],
Buffer: ['@electron/internal/renderer/webpack-provider', 'Buffer'],
process: ['@electron/internal/common/webpack-provider', 'process'],
global: ['@electron/internal/common/webpack-provider', '_global'],
Buffer: ['@electron/internal/common/webpack-provider', 'Buffer']
})
] : []),
new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise'],
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise']
}),
new webpack.DefinePlugin(defines)
]
})
}
});
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,18 +13,30 @@ EXTENSIONS_TO_SKIP = [
]
PATHS_TO_SKIP = [
'angledata', #Skipping because it is an output of //ui/gl that we don't need
'./libVkICD_mock_', #Skipping because these are outputs that we don't need
'./VkICD_mock_', #Skipping because these are outputs that we don't need
# Skipping because its an output of create_bundle from //build/config/mac/rules.gni
# Skip because it is an output of //ui/gl that we don't need.
'angledata',
# Skip because these are outputs that we don't need.
'./libVkICD_mock_',
# Skip because these are outputs that we don't need.
'./VkICD_mock_',
# Skip because its an output of create_bundle from //build/config/mac/rules.gni
# that we don't need
'Electron.dSYM',
# Refs https://chromium-review.googlesource.com/c/angle/angle/+/2425197.
# Remove this when Angle themselves remove the file: https://issuetracker.google.com/issues/168736059
'gen/angle/angle_commit.h',
# //chrome/browser:resources depends on this via
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
# ship it.
'pyproto',
# On Windows, this binary doesn't exist (the crashpad handler is built-in).
# On MacOS, the binary is called 'chrome_crashpad_handler' and is inside the
# app bundle.
# On Linux, we don't use crashpad, but this binary is still built for some
# reason. Exclude it from the zip.
'./crashpad_handler',
# Skip because these are outputs that we don't need.
'resources/inspector',
]
def skip_path(dep, dist_zip, target_cpu):

View File

@@ -21,6 +21,7 @@ buildflag_header("buildflags") {
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
"ENABLE_PICTURE_IN_PICTURE=$enable_picture_in_picture",
"ENABLE_WIN_DARK_MODE_WINDOW_UI=$enable_win_dark_mode_window_ui",
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
]
}

View File

@@ -36,4 +36,7 @@ declare_args() {
# Enable Spellchecker support
enable_builtin_spellchecker = true
# Undocumented Windows dark mode API
enable_win_dark_mode_window_ui = false
}

View File

@@ -12,8 +12,12 @@ import("//third_party/widevine/cdm/widevine.gni")
static_library("chrome") {
visibility = [ "//electron:electron_lib" ]
sources = [
"//chrome/browser/accessibility/accessibility_ui.cc",
"//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",
@@ -22,18 +26,10 @@ static_library("chrome") {
"//chrome/browser/devtools/devtools_file_system_indexer.h",
"//chrome/browser/extensions/global_shortcut_listener.cc",
"//chrome/browser/extensions/global_shortcut_listener.h",
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
"//chrome/browser/extensions/global_shortcut_listener_win.cc",
"//chrome/browser/extensions/global_shortcut_listener_win.h",
"//chrome/browser/icon_loader.cc",
"//chrome/browser/icon_loader.h",
"//chrome/browser/icon_loader_mac.mm",
"//chrome/browser/icon_loader_win.cc",
"//chrome/browser/icon_manager.cc",
"//chrome/browser/icon_manager.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
"//chrome/browser/net/proxy_config_monitor.cc",
@@ -53,22 +49,45 @@ static_library("chrome") {
"//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",
"//chrome/browser/win/chrome_process_finder.cc",
"//chrome/browser/win/chrome_process_finder.h",
"//extensions/browser/app_window/size_constraints.cc",
"//extensions/browser/app_window/size_constraints.h",
]
if (is_mac) {
sources += [
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
"//chrome/browser/icon_loader_mac.mm",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
]
}
if (is_win) {
sources += [
"//chrome/browser/extensions/global_shortcut_listener_win.cc",
"//chrome/browser/extensions/global_shortcut_listener_win.h",
"//chrome/browser/icon_loader_win.cc",
"//chrome/browser/win/chrome_process_finder.cc",
"//chrome/browser/win/chrome_process_finder.h",
"//chrome/child/v8_crashpad_support_win.cc",
"//chrome/child/v8_crashpad_support_win.h",
]
}
public_deps = [
"//chrome/common",
"//chrome/common:version_header",
"//components/keyed_service/content",
"//components/paint_preview/buildflags",
"//components/proxy_config",
"//components/security_state/content",
"//content/public/browser",
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//components/feature_engagement:buildflags",
"//chrome/services/speech:buildflags",
"//components/optimization_guide/proto:optimization_guide_proto",
]
@@ -88,6 +107,14 @@ static_library("chrome") {
]
}
if (is_win) {
sources += [
"//chrome/browser/win/icon_reader_service.cc",
"//chrome/browser/win/icon_reader_service.h",
]
public_deps += [ "//chrome/services/util_win:lib" ]
}
if (enable_desktop_capturer) {
sources += [
"//chrome/browser/media/webrtc/desktop_media_list.h",
@@ -107,10 +134,17 @@ static_library("chrome") {
"//chrome/browser/platform_util.h",
"//chrome/browser/ui/browser_dialogs.h",
"//chrome/browser/ui/color_chooser.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.h",
]
if (use_aura) {
sources += [ "//chrome/browser/platform_util_aura.cc" ]
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
]
if (!is_win) {
sources += [
@@ -127,6 +161,8 @@ static_library("chrome") {
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
"//chrome/browser/ui/cocoa/color_chooser_mac.h",
"//chrome/browser/ui/cocoa/color_chooser_mac.mm",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm",
]
deps += [
"//components/remote_cocoa/app_shim",
@@ -148,13 +184,6 @@ static_library("chrome") {
}
}
if (enable_tts) {
sources += [
"//chrome/browser/speech/tts_controller_delegate_impl.cc",
"//chrome/browser/speech/tts_controller_delegate_impl.h",
]
}
if (enable_widevine) {
sources += [
"//chrome/renderer/media/chrome_key_systems.cc",
@@ -256,12 +285,23 @@ static_library("chrome") {
]
}
}
if (!is_mas_build) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ]
if (is_mac) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ]
} else if (is_win) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_win.cc" ]
} else {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ]
}
}
}
source_set("plugins") {
sources = []
deps = []
libs = []
frameworks = []
# browser side
sources += [
@@ -295,7 +335,7 @@ source_set("plugins") {
"//chrome/browser/renderer_host/pepper/monitor_finder_mac.h",
"//chrome/browser/renderer_host/pepper/monitor_finder_mac.mm",
]
libs += [ "CoreGraphics.framework" ]
frameworks += [ "CoreGraphics.framework" ]
}
if (is_linux) {
deps += [ "//components/services/font/public/cpp" ]
@@ -359,8 +399,8 @@ source_set("chrome_spellchecker") {
"//chrome/browser/spellchecker/spellcheck_factory.h",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_service.cc",

View File

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

View File

@@ -68,7 +68,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/posix/eintr_wrapper.h"
@@ -361,7 +360,7 @@ bool CheckCookie(const base::FilePath& path, const base::FilePath& cookie) {
}
bool IsAppSandboxed() {
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// NB: There is no sane API for this, we have to just guess by
// reading tea leaves
base::FilePath home_dir;
@@ -372,7 +371,7 @@ bool IsAppSandboxed() {
return home_dir.value().find("Library/Containers") != std::string::npos;
#else
return false;
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
}
bool ConnectSocket(ScopedSocket* socket,
@@ -422,7 +421,7 @@ bool ConnectSocket(ScopedSocket* socket,
}
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
bool ReplaceOldSingletonLock(const base::FilePath& symlink_content,
const base::FilePath& lock_path) {
// Try taking an flock(2) on the file. Failure means the lock is taken so we
@@ -448,14 +447,14 @@ bool ReplaceOldSingletonLock(const base::FilePath& symlink_content,
// lock. We never flock() the lock file from now on. I.e. we assume that an
// old version of Chrome will not run with the same user data dir after this
// version has run.
if (!base::DeleteFile(lock_path, false)) {
if (!base::DeleteFile(lock_path)) {
PLOG(ERROR) << "Could not delete old singleton lock.";
return false;
}
return SymlinkPath(symlink_content, lock_path);
}
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
} // namespace
@@ -827,10 +826,9 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
to_send.append(current_dir.value());
const std::vector<std::string>& argv = electron::ElectronCommandLine::argv();
for (std::vector<std::string>::const_iterator it = argv.begin();
it != argv.end(); ++it) {
for (const auto& arg : argv) {
to_send.push_back(kTokenDelimiter);
to_send.append(*it);
to_send.append(arg);
}
// Send the message
@@ -971,7 +969,7 @@ bool ProcessSingleton::Create() {
if (!SymlinkPath(symlink_content, lock_path_)) {
// TODO(jackhou): Remove this case once this code is stable on Mac.
// http://crbug.com/367612
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// On Mac, an existing non-symlink lock file means the lock could be held by
// the old process singleton code. If we can successfully replace the lock,
// continue as normal.

View File

@@ -24,18 +24,18 @@ GlobalMenuBarRegistrarX11* GlobalMenuBarRegistrarX11::GetInstance() {
return base::Singleton<GlobalMenuBarRegistrarX11>::get();
}
void GlobalMenuBarRegistrarX11::OnWindowMapped(unsigned long xid) {
live_xids_.insert(xid);
void GlobalMenuBarRegistrarX11::OnWindowMapped(x11::Window window) {
live_windows_.insert(window);
if (registrar_proxy_)
RegisterXID(xid);
RegisterXWindow(window);
}
void GlobalMenuBarRegistrarX11::OnWindowUnmapped(unsigned long xid) {
void GlobalMenuBarRegistrarX11::OnWindowUnmapped(x11::Window window) {
if (registrar_proxy_)
UnregisterXID(xid);
UnregisterXWindow(window);
live_xids_.erase(xid);
live_windows_.erase(window);
}
GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11()
@@ -63,9 +63,9 @@ GlobalMenuBarRegistrarX11::~GlobalMenuBarRegistrarX11() {
}
}
void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
void GlobalMenuBarRegistrarX11::RegisterXWindow(x11::Window window) {
DCHECK(registrar_proxy_);
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(xid);
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window);
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
// TODO(erg): The mozilla implementation goes to a lot of callback trouble
@@ -76,13 +76,13 @@ void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
// I don't see any reason why we should care if "RegisterWindow" completes or
// not.
g_dbus_proxy_call(registrar_proxy_, "RegisterWindow",
g_variant_new("(uo)", xid, path.c_str()),
g_variant_new("(uo)", window, path.c_str()),
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, nullptr, nullptr);
}
void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
void GlobalMenuBarRegistrarX11::UnregisterXWindow(x11::Window window) {
DCHECK(registrar_proxy_);
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(xid);
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window);
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
// TODO(erg): The mozilla implementation goes to a lot of callback trouble
@@ -93,7 +93,7 @@ void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
// I don't see any reason why we should care if "UnregisterWindow" completes
// or not.
g_dbus_proxy_call(registrar_proxy_, "UnregisterWindow",
g_variant_new("(u)", xid), G_DBUS_CALL_FLAGS_NONE, -1,
g_variant_new("(u)", window), G_DBUS_CALL_FLAGS_NONE, -1,
nullptr, nullptr, nullptr);
}
@@ -120,10 +120,9 @@ void GlobalMenuBarRegistrarX11::OnProxyCreated(GObject* source,
void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */,
GParamSpec* /* ignored */) {
// If the name owner changed, we need to reregister all the live xids with
// the system.
for (std::set<unsigned long>::const_iterator it = live_xids_.begin();
it != live_xids_.end(); ++it) {
RegisterXID(*it);
// If the name owner changed, we need to reregister all the live x11::Window
// with the system.
for (const auto& window : live_windows_) {
RegisterXWindow(window);
}
}

View File

@@ -12,19 +12,20 @@
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
#include "ui/base/glib/glib_signal.h"
#include "ui/gfx/x/xproto.h"
// Advertises our menu bars to Unity.
//
// GlobalMenuBarX11 is responsible for managing the DbusmenuServer for each
// XID. We need a separate object to own the dbus channel to
// x11::Window. We need a separate object to own the dbus channel to
// com.canonical.AppMenu.Registrar and to register/unregister the mapping
// between a XID and the DbusmenuServer instance we are offering.
// between a x11::Window and the DbusmenuServer instance we are offering.
class GlobalMenuBarRegistrarX11 {
public:
static GlobalMenuBarRegistrarX11* GetInstance();
void OnWindowMapped(unsigned long xid);
void OnWindowUnmapped(unsigned long xid);
void OnWindowMapped(x11::Window window);
void OnWindowUnmapped(x11::Window window);
private:
friend struct base::DefaultSingletonTraits<GlobalMenuBarRegistrarX11>;
@@ -33,8 +34,8 @@ class GlobalMenuBarRegistrarX11 {
~GlobalMenuBarRegistrarX11();
// Sends the actual message.
void RegisterXID(unsigned long xid);
void UnregisterXID(unsigned long xid);
void RegisterXWindow(x11::Window window);
void UnregisterXWindow(x11::Window window);
CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11,
void,
@@ -49,9 +50,9 @@ class GlobalMenuBarRegistrarX11 {
GDBusProxy* registrar_proxy_;
// Window XIDs which want to be registered, but haven't yet been because
// x11::Window which want to be registered, but haven't yet been because
// we're waiting for the proxy to become available.
std::set<unsigned long> live_xids_;
std::set<x11::Window> live_windows_;
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarRegistrarX11);
};

View File

@@ -1,5 +1,6 @@
import { app, dialog, BrowserWindow, shell, ipcMain } from 'electron';
import * as path from 'path';
import * as url from 'url';
let mainWindow: BrowserWindow | null = null;
@@ -29,26 +30,25 @@ function isTrustedSender (webContents: Electron.WebContents) {
return false;
}
const parsedUrl = new URL(webContents.getURL());
const urlPath = process.platform === 'win32'
// Strip the prefixed "/" that occurs on windows
? path.resolve(parsedUrl.pathname.substr(1))
: parsedUrl.pathname;
return parsedUrl.protocol === 'file:' && urlPath === indexPath;
try {
return url.fileURLToPath(webContents.getURL()) === indexPath;
} catch {
return false;
}
}
ipcMain.handle('bootstrap', (event) => {
return isTrustedSender(event.sender) ? electronPath : null;
});
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

@@ -53,31 +53,31 @@
<nav>
<div class="linkcol">
<a class="hero-link" target="_blank" href="https://electronjs.org/blog">
<span class="octicon hero-octicon octicon-gist" aria-hidden="true"></span>
<span class="octicon hero-octicon octicon-code-square-24" aria-hidden="true"></span>
<h4>Blog</h4>
</a>
</div>
<div class="linkcol">
<a class="hero-link" target="_blank" href="https://github.com/electron/electron">
<span class="octicon hero-octicon octicon-mark-github" aria-hidden="true"></span>
<span class="octicon hero-octicon octicon-mark-github-16" aria-hidden="true"></span>
<h4>Repository</h4>
</a>
</div>
<div class="linkcol">
<a class="hero-link" target="_blank" href="https://electronjs.org/docs">
<span class="octicon hero-octicon octicon-gear" aria-hidden="true"></span>
<span class="octicon hero-octicon octicon-book-24" aria-hidden="true"></span>
<h4>Docs</h4>
</a>
</div>
<div class="linkcol">
<a class="hero-link" target="_blank" href="https://github.com/electron/electron-api-demos">
<span class="octicon hero-octicon octicon-star" aria-hidden="true"></span>
<span class="octicon hero-octicon octicon-star-fill-24" aria-hidden="true"></span>
<h4>API Demos</h4>
</a>
</div>
<div class="linkcol">
<a class="hero-link" target="_blank" href="https://electronforge.io">
<span class="octicon hero-octicon octicon-gift" aria-hidden="true"></span>
<span class="octicon hero-octicon octicon-gift-24" aria-hidden="true"></span>
<h4>Forge</h4>
</a>
</div>

View File

@@ -1,8 +1,9 @@
import { app, dialog } from 'electron';
import * as electron from 'electron';
import * as fs from 'fs';
import * as path from 'path';
import * as url from 'url';
const { app, dialog } = electron;
type DefaultAppOptions = {
file: null | string;
@@ -145,13 +146,90 @@ function startRepl () {
process.exit(1);
}
// prevent quitting
// Prevent quitting.
app.on('window-all-closed', () => {});
const repl = require('repl');
repl.start('> ').on('exit', () => {
const GREEN = '32';
const colorize = (color: string, s: string) => `\x1b[${color}m${s}\x1b[0m`;
const electronVersion = colorize(GREEN, `v${process.versions.electron}`);
const nodeVersion = colorize(GREEN, `v${process.versions.node}`);
console.info(`
Welcome to the Electron.js REPL \\[._.]/
You can access all Electron.js modules here as well as Node.js modules.
Using: Node.js ${nodeVersion} and Electron.js ${electronVersion}
`);
const { REPLServer } = require('repl');
const repl = new REPLServer({
prompt: '> '
}).on('exit', () => {
process.exit(0);
});
function defineBuiltin (context: any, name: string, getter: Function) {
const setReal = (val: any) => {
// Deleting the property before re-assigning it disables the
// getter/setter mechanism.
delete context[name];
context[name] = val;
};
Object.defineProperty(context, name, {
get: () => {
const lib = getter();
delete context[name];
Object.defineProperty(context, name, {
get: () => lib,
set: setReal,
configurable: true,
enumerable: false
});
return lib;
},
set: setReal,
configurable: true,
enumerable: false
});
}
defineBuiltin(repl.context, 'electron', () => electron);
for (const api of Object.keys(electron) as (keyof typeof electron)[]) {
defineBuiltin(repl.context, api, () => electron[api]);
}
// Copied from node/lib/repl.js. For better DX, we don't want to
// show e.g 'contentTracing' at a higher priority than 'const', so
// we only trigger custom tab-completion when no common words are
// potentially matches.
const commonWords = [
'async', 'await', 'break', 'case', 'catch', 'const', 'continue',
'debugger', 'default', 'delete', 'do', 'else', 'export', 'false',
'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'let',
'new', 'null', 'return', 'switch', 'this', 'throw', 'true', 'try',
'typeof', 'var', 'void', 'while', 'with', 'yield'
];
const electronBuiltins = [...Object.keys(electron), 'original-fs', 'electron'];
const defaultComplete = repl.completer;
repl.completer = (line: string, callback: Function) => {
const lastSpace = line.lastIndexOf(' ');
const currentSymbol = line.substring(lastSpace + 1, repl.cursor);
const filterFn = (c: string) => c.startsWith(currentSymbol);
const ignores = commonWords.filter(filterFn);
const hits = electronBuiltins.filter(filterFn);
if (!ignores.length && hits.length) {
callback(null, [hits, currentSymbol]);
} else {
defaultComplete.apply(repl, [line, callback]);
}
};
}
// Start the specified app if there is one specified in command line, otherwise

View File

@@ -92,7 +92,6 @@ These individual tutorials expand on topics discussed in the guide above.
* Electron Releases & Developer Feedback
* [Versioning Policy](tutorial/electron-versioning.md)
* [Release Timelines](tutorial/electron-timelines.md)
* [App Feedback Program](tutorial/app-feedback-program.md)
* [Packaging App Source Code with asar](tutorial/application-packaging.md)
* [Generating asar Archives](tutorial/application-packaging.md#generating-asar-archives)
* [Using asar Archives](tutorial/application-packaging.md#using-asar-archives)
@@ -149,7 +148,7 @@ These individual tutorials expand on topics discussed in the guide above.
### Modules for the Renderer Process (Web Page):
* [desktopCapturer](api/desktop-capturer.md)
* [contextBridge](api/context-bridge.md)
* [ipcRenderer](api/ipc-renderer.md)
* [remote](api/remote.md)
* [webFrame](api/web-frame.md)
@@ -158,6 +157,7 @@ These individual tutorials expand on topics discussed in the guide above.
* [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

@@ -32,7 +32,8 @@ In most cases, you should do everything in the `ready` event handler.
Returns:
* `launchInfo` unknown _macOS_
* `event` Event
* `launchInfo` Record<string, any> _macOS_
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
holds the `userInfo` of the `NSUserNotification` that was used to open the
@@ -140,6 +141,16 @@ this event, such as launching the application for the first time, attempting
to re-launch the application when it's already running, or clicking on the
application's dock or taskbar icon.
### Event: 'did-become-active' _macOS_
Returns:
* `event` Event
Emitted when mac application become active. Difference from `activate` event is
that `did-become-active` is emitted every time the app becomes active, not only
when Dock icon is clicked or application is re-launched.
### Event: 'continue-activity' _macOS_
Returns:
@@ -350,7 +361,7 @@ page.
Emitted whenever there is a GPU info update.
### Event: 'gpu-process-crashed'
### Event: 'gpu-process-crashed' _Deprecated_
Returns:
@@ -359,7 +370,12 @@ Returns:
Emitted when the GPU process crashes or is killed.
### Event: 'renderer-process-crashed'
**Deprecated:** This event is superceded by the `child-process-gone` event
which contains more information about why the child process disappeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
### Event: 'renderer-process-crashed' _Deprecated_
Returns:
@@ -369,6 +385,60 @@ Returns:
Emitted when the renderer process of `webContents` crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process disappeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
### Event: 'render-process-gone'
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `details` Object
* `reason` String - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
Emitted when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
### Event: 'child-process-gone'
Returns:
* `event` Event
* `details` Object
* `type` String - Process type. One of the following values:
* `Utility`
* `Zygote`
* `Sandbox helper`
* `GPU`
* `Pepper Plugin`
* `Pepper Plugin Broker`
* `Unknown`
* `reason` String - The reason the child process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` Number - The exit code for the process
(e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows).
* `name` String (optional) - The name of the process. i.e. for plugins it might be Flash.
Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc.
Emitted when the child process unexpectedly disappears. This is normally
because it was crashed or killed. It does not include renderer processes.
### Event: 'accessibility-support-changed' _macOS_ _Windows_
Returns:
@@ -432,7 +502,7 @@ Returns:
Emitted when `desktopCapturer.getSources()` is called in the renderer process of `webContents`.
Calling `event.preventDefault()` will make it return empty sources.
### Event: 'remote-require'
### Event: 'remote-require' _Deprecated_
Returns:
@@ -444,7 +514,7 @@ Emitted when `remote.require()` is called in the renderer process of `webContent
Calling `event.preventDefault()` will prevent the module from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-global'
### Event: 'remote-get-global' _Deprecated_
Returns:
@@ -456,7 +526,7 @@ Emitted when `remote.getGlobal()` is called in the renderer process of `webConte
Calling `event.preventDefault()` will prevent the global from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-builtin'
### Event: 'remote-get-builtin' _Deprecated_
Returns:
@@ -468,7 +538,7 @@ Emitted when `remote.getBuiltin()` is called in the renderer process of `webCont
Calling `event.preventDefault()` will prevent the module from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-current-window'
### Event: 'remote-get-current-window' _Deprecated_
Returns:
@@ -479,7 +549,7 @@ Emitted when `remote.getCurrentWindow()` is called in the renderer process of `w
Calling `event.preventDefault()` will prevent the object from being returned.
Custom value can be returned by setting `event.returnValue`.
### Event: 'remote-get-current-web-contents'
### Event: 'remote-get-current-web-contents' _Deprecated_
Returns:
@@ -608,8 +678,10 @@ Returns `String` - The current application directory.
* `music` Directory for a user's music.
* `pictures` Directory for a user's pictures.
* `videos` Directory for a user's videos.
* `recent` Directory for the user's recent files (Windows only).
* `logs` Directory for your app's log folder.
* `pepperFlashSystemPlugin` Full path to the system version of the Pepper Flash plugin.
* `crashDumps` Directory where crash dumps are stored.
Returns `String` - A path to a special directory or file associated with `name`. On
failure, an `Error` is thrown.
@@ -677,7 +749,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).
@@ -779,6 +852,20 @@ Returns `String` - Name of the application handling the protocol, or an empty
This method returns the application name of the default handler for the protocol
(aka URI scheme) of a URL.
### `app.getApplicationInfoForProtocol(url)` _macOS_ _Windows_
* `url` String - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a
minimum (e.g. `https://`).
Returns `Promise<Object>` - Resolve with an object containing the following:
* `icon` NativeImage - the display icon of the app handling the protocol.
* `path` String - installation path of the app handling the protocol.
* `name` String - display name of the app handling the protocol.
This method returns a promise that contains the application name, icon and path of the default handler for the protocol
(aka URI scheme) of a URL.
### `app.setUserTasks(tasks)` _Windows_
* `tasks` [Task[]](structures/task.md) - Array of `Task` objects
@@ -838,6 +925,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
@@ -940,6 +1031,7 @@ if (!gotTheLock) {
// Create myWindow, load the rest of the app, etc...
app.whenReady().then(() => {
myWindow = createWindow()
})
}
```
@@ -1055,8 +1147,10 @@ For `infoType` equal to `complete`:
For `infoType` equal to `basic`:
Promise is fulfilled with `Object` containing fewer attributes than when requested with `complete`. Here's an example of basic response:
```js
{ auxAttributes:
{ amdSwitchable: true,
{
auxAttributes:
{
amdSwitchable: true,
canSupportThreadedTextureMailbox: false,
directComposition: false,
directRendering: true,
@@ -1069,12 +1163,14 @@ For `infoType` equal to `basic`:
sandboxed: false,
softwareRendering: false,
supportsOverlays: false,
videoDecodeAcceleratorFlags: 0 },
gpuDevice:
[ { active: true, deviceId: 26657, vendorId: 4098 },
{ active: false, deviceId: 3366, vendorId: 32902 } ],
machineModelName: 'MacBookPro',
machineModelVersion: '11.5' }
videoDecodeAcceleratorFlags: 0
},
gpuDevice:
[{ active: true, deviceId: 26657, vendorId: 4098 },
{ active: false, deviceId: 3366, vendorId: 32902 }],
machineModelName: 'MacBookPro',
machineModelVersion: '11.5'
}
```
Using `basic` should be preferred if only basic information like `vendorId` or `driverId` is needed.
@@ -1126,6 +1222,13 @@ Returns `Object`:
should restore the state from the previous session. This indicates that the
app should restore the windows that were open the last time the app was
closed. This setting is not available on [MAS builds][mas-builds].
* `executableWillLaunchAtLogin` Boolean _Windows_ - `true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.
* `launchItems` Object[] _Windows_
* `name` String _Windows_ - name value of a registry entry.
* `path` String _Windows_ - The executable to an app that corresponds to a registry entry.
* `args` String[] _Windows_ - the command-line arguments to pass to the executable.
* `scope` String _Windows_ - one of `user` or `machine`. Indicates whether the registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
* `enabled` Boolean _Windows_ - `true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.
### `app.setLoginItemSettings(settings)` _macOS_ _Windows_
@@ -1141,7 +1244,9 @@ Returns `Object`:
* `args` String[] (optional) _Windows_ - The command-line arguments to pass to
the executable. Defaults to an empty array. Take care to wrap paths in
quotes.
* `enabled` Boolean (optional) _Windows_ - `true` will change the startup approved registry key and `enable / disable` the App in Task Manager and Windows Settings.
Defaults to `true`.
* `name` String (optional) _Windows_ - value name to write into registry. Defaults to the app's AppUserModelId().
Set the app's login item settings.
To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel-Windows],
@@ -1196,7 +1301,7 @@ Show the app's about panel options. These options can be overridden with `app.se
* `credits` String (optional) _macOS_ _Windows_ - Credit information.
* `authors` String[] (optional) _Linux_ - List of app authors.
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
@@ -1241,7 +1346,7 @@ systems Application folder. Use in combination with `app.moveToApplicationsFolde
### `app.moveToApplicationsFolder([options])` _macOS_
* `options` Object (optional)
* `conflictHandler` Function<Boolean> (optional) - A handler for potential conflict in move failure.
* `conflictHandler` Function\<Boolean> (optional) - A handler for potential conflict in move failure.
* `conflictType` String - The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.
Returns `Boolean` - Whether the move was successful. Please note that if
@@ -1257,7 +1362,7 @@ method returns false. If we fail to perform the copy, then this method will
throw an error. The message in the error should be informative and tell
you exactly what went wrong.
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
For example:
@@ -1278,6 +1383,25 @@ app.moveToApplicationsFolder({
Would mean that if an app already exists in the user directory, if the user chooses to 'Continue Move' then the function would continue with its default behavior and the existing app will be trashed and the active app moved into its place.
### `app.isSecureKeyboardEntryEnabled()` _macOS_
Returns `Boolean` - whether `Secure Keyboard Entry` is enabled.
By default this API will return `false`.
### `app.setSecureKeyboardEntryEnabled(enabled)` _macOS_
* `enabled` Boolean - Enable or disable `Secure Keyboard Entry`
Set the `Secure Keyboard Entry` is enabled in your application.
By using this API, important information such as password and other sensitive information can be prevented from being intercepted by other processes.
See [Apple's documentation](https://developer.apple.com/library/archive/technotes/tn2150/_index.html) for more
details.
**Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it when it is no longer needed.
## Properties
### `app.accessibilitySupportEnabled` _macOS_ _Windows_
@@ -1304,6 +1428,9 @@ On macOS, setting this with any nonzero integer shows on the dock icon. On Linux
**Note:** Unity launcher requires the existence of a `.desktop` file to work,
for more information please read [Desktop Environment Integration][unity-requirement].
**Note:** On macOS, you need to ensure that your application has the permission
to display notifications for this property to take effect.
### `app.commandLine` _Readonly_
A [`CommandLine`](./command-line.md) object that allows you to read and manipulate the
@@ -1355,7 +1482,7 @@ in your app's initialization to ensure that your overridden value is used.
A `Boolean` which when `true` disables the overrides that Electron has in place
to ensure renderer processes are restarted on every navigation. The current
default value for this property is `false`.
default value for this property is `true`.
The intention is for these overrides to become disabled by default and then at
some point in the future this property will be removed. This property impacts
@@ -1363,3 +1490,12 @@ which native modules you can use in the renderer process. For more information
on the direction Electron is going with renderer process restarts and usage of
native modules in the renderer process please check out this
[Tracking Issue](https://github.com/electron/electron/issues/18397).
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_
A `Boolean` which when `true` indicates that the app is currently running
under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)).
You can use this property to prompt users to download the arm64 version of
your application when they are running the x64 version under Rosetta
incorrectly.

View File

@@ -104,7 +104,7 @@ The `autoUpdater` object has the following methods:
* `options` Object
* `url` String
* `headers` Record<String, String> (optional) _macOS_ - HTTP request headers.
* `serverType` String (optional) _macOS_ - Either `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
* `serverType` String (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.
Sets the `url` and initialize the auto updater.

View File

@@ -28,25 +28,6 @@ view.webContents.loadURL('https://electronjs.org')
* `options` Object (optional)
* `webPreferences` Object (optional) - See [BrowserWindow](browser-window.md).
### Static Methods
#### `BrowserView.getAllViews()`
Returns `BrowserView[]` - An array of all opened BrowserViews.
#### `BrowserView.fromWebContents(webContents)`
* `webContents` [WebContents](web-contents.md)
Returns `BrowserView | null` - The BrowserView that owns the given `webContents`
or `null` if the contents are not owned by a BrowserView.
#### `BrowserView.fromId(id)`
* `id` Integer
Returns `BrowserView` - The view with the given `id`.
### Instance Properties
Objects created with `new BrowserView` have the following properties:
@@ -55,24 +36,10 @@ Objects created with `new BrowserView` have the following properties:
A [`WebContents`](web-contents.md) object owned by this view.
#### `view.id` _Experimental_
A `Integer` representing the unique ID of the view.
### Instance Methods
Objects created with `new BrowserView` have the following instance methods:
#### `view.destroy()`
Force closing the view, the `unload` and `beforeunload` events won't be emitted
for the web page. After you're done with a view, call this function in order to
free memory and other resources as soon as possible.
#### `view.isDestroyed()`
Returns `Boolean` - Whether the view is destroyed.
#### `view.setAutoResize(options)` _Experimental_
* `options` Object

View File

@@ -8,9 +8,6 @@ Process: [Main](../glossary.md#main-process)
// In the main process.
const { BrowserWindow } = require('electron')
// Or use `remote` from the renderer process.
// const { BrowserWindow } = require('electron').remote
const win = new BrowserWindow({ width: 800, height: 600 })
// Load a remote URL
@@ -38,7 +35,7 @@ the window after this event will have no visual flash:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ show: false })
const win = new BrowserWindow({ show: false })
win.once('ready-to-show', () => {
win.show()
})
@@ -60,7 +57,7 @@ immediately, and use a `backgroundColor` close to your app's background:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ backgroundColor: '#2e2c29' })
const win = new BrowserWindow({ backgroundColor: '#2e2c29' })
win.loadURL('https://github.com')
```
@@ -74,8 +71,8 @@ By using `parent` option, you can create child windows:
```javascript
const { BrowserWindow } = require('electron')
let top = new BrowserWindow()
let child = new BrowserWindow({ parent: top })
const top = new BrowserWindow()
const child = new BrowserWindow({ parent: top })
child.show()
top.show()
```
@@ -90,7 +87,7 @@ window, you have to set both `parent` and `modal` options:
```javascript
const { BrowserWindow } = require('electron')
let child = new BrowserWindow({ parent: top, modal: true, show: false })
const child = new BrowserWindow({ parent: top, modal: true, show: false })
child.loadURL('https://github.com')
child.once('ready-to-show', () => {
child.show()
@@ -207,11 +204,15 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `opacity` Number (optional) - Set the initial opacity of the window, between 0.0 (fully
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
some GTK desktop environments. Default is [`nativeTheme.shouldUseDarkColors`](native-theme.md).
some GTK+3 desktop environments. Default is `false`.
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
Default is `false`. On Windows, does not work unless the window is frameless.
* `type` String (optional) - The type of window, default is normal window. See more about
this below.
* `visualEffectState` String (optional) - Specify how the material appearance should reflect window activity state on macOS. Must be used with the `vibrancy` property. Possible values are:
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
* `active` - The backdrop should always appear active.
* `inactive` - The backdrop should always appear inactive.
* `titleBarStyle` String (optional) - The style of window title bar.
Default is `default`. Possible values are:
* `default` - Results in the standard gray opaque Mac title
@@ -271,7 +272,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
the `nodeIntegration` option and the APIs available to the preload script
are more limited. Read more about the option [here](sandbox-option.md).
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
Default is `true`.
Default is `false`.
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
page. Instead of passing the Session object directly, you can also choose to
use the `partition` option instead, which accepts a partition string. When
@@ -348,6 +349,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
You can access this context in the dev tools by selecting the
'Electron Isolated Context' entry in the combo box at the top of the
Console tab.
* `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values
can't unsafely cross between worlds when using `contextIsolation`. The default
is `false`. In Electron 12, the default will be changed to `true`. _Deprecated_
* `nativeWindowOpen` Boolean (optional) - Whether to use native
`window.open()`. Defaults to `false`. Child windows will always have node
integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently
@@ -385,6 +389,15 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
visible to users.
* `spellcheck` Boolean (optional) - Whether to enable the builtin spellchecker.
Default is `true`.
* `enableWebSQL` Boolean (optional) - Whether to enable the [WebSQL api](https://www.w3.org/TR/webdatabase/).
Default is `true`.
* `v8CacheOptions` String (optional) - Enforces the v8 code caching policy
used by blink. Accepted values are
* `none` - Disables code caching
* `code` - Heuristic based code caching
* `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation
* `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager.
Default policy is `code`.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
@@ -525,6 +538,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
Emitted after the window has been resized.
#### Event: 'resized' _macOS_ _Windows_
Emitted once when the window has finished being resized.
This is usually emitted when the window has been resized manually. On macOS, resizing the window with `setBounds`/`setSize` and setting the `animate` parameter to `true` will also emit this event once resizing has finished.
#### Event: 'will-move' _macOS_ _Windows_
Returns:
@@ -540,12 +559,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
Emitted when the window is being moved to a new position.
__Note__: On macOS this event is an alias of `moved`.
#### Event: 'moved' _macOS_
#### Event: 'moved' _macOS_ _Windows_
Emitted once when the window is moved to a new position.
__Note__: On macOS this event is an alias of `move`.
#### Event: 'enter-full-screen'
Emitted when the window enters a full-screen state.
@@ -588,7 +607,7 @@ e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.on('app-command', (e, cmd) => {
// Navigate the window back when the user hits their mouse back button
if (cmd === 'browser-backward' && win.webContents.canGoBack()) {
@@ -654,6 +673,20 @@ Emitted when the window has closed a sheet.
Emitted when the native new tab button is clicked.
#### Event: 'system-context-menu' _Windows_
Returns:
* `event` Event
* `point` [Point](structures/point.md) - The screen coordinates the context menu was triggered at
Emitted when the system context menu is triggered on the window, this is
normally only triggered when the user right clicks on the non-client area
of your window. This is the window titlebar or any area you have declared
as `-webkit-app-region: drag` in a frameless window.
Calling `event.preventDefault()` will prevent the menu from being displayed.
### Static Methods
The `BrowserWindow` class has the following static methods:
@@ -683,7 +716,7 @@ Returns `BrowserWindow | null` - The window that owns the given `browserView`. I
* `id` Integer
Returns `BrowserWindow` - The window with the given `id`.
Returns `BrowserWindow | null` - The window with the given `id`.
#### `BrowserWindow.addExtension(path)` _Deprecated_
@@ -697,7 +730,7 @@ The method will also not return if the extension's manifest is missing or incomp
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.loadExtension(path)`](session.md#sesloadextensionpath).
[`ses.loadExtension(path)`](session.md#sesloadextensionpath-options).
#### `BrowserWindow.removeExtension(name)` _Deprecated_
@@ -739,7 +772,7 @@ The method will also not return if the extension's manifest is missing or incomp
is emitted.
**Note:** This method is deprecated. Instead, use
[`ses.loadExtension(path)`](session.md#sesloadextensionpath).
[`ses.loadExtension(path)`](session.md#sesloadextensionpath-options).
#### `BrowserWindow.removeDevToolsExtension(name)` _Deprecated_
@@ -763,7 +796,7 @@ To check if a DevTools extension is installed you can run the following:
```javascript
const { BrowserWindow } = require('electron')
let installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron')
const installed = 'devtron' in BrowserWindow.getDevToolsExtensions()
console.log(installed)
```
@@ -780,7 +813,7 @@ Objects created with `new BrowserWindow` have the following properties:
```javascript
const { BrowserWindow } = require('electron')
// In this example `win` is our instance
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('https://github.com')
```
@@ -1013,7 +1046,7 @@ Returns `Boolean` - Whether the window is in simple (pre-Lion) fullscreen mode.
Returns `Boolean` - Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).
#### `win.setAspectRatio(aspectRatio[, extraSize])` _macOS_ _Linux_
#### `win.setAspectRatio(aspectRatio[, extraSize])`
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
content view.
@@ -1034,6 +1067,9 @@ the player itself we would call this function with arguments of 16/9 and
are within the content view--only that they exist. Sum any extra width and
height areas you have within the overall content view.
The aspect ratio is not respected when window is resized programmingly with
APIs like `win.setSize`.
#### `win.setBackgroundColor(backgroundColor)`
* `backgroundColor` String - Window's background color as a hexadecimal value,
@@ -1114,7 +1150,7 @@ Disable or enable the window.
#### `win.isEnabled()`
Returns Boolean - whether the window is enabled.
Returns `Boolean` - whether the window is enabled.
#### `win.setSize(width, height[, animate])`
@@ -1305,9 +1341,9 @@ a HTML-rendered toolbar. For example:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
let toolbarRect = document.getElementById('toolbar').getBoundingClientRect()
const toolbarRect = document.getElementById('toolbar').getBoundingClientRect()
win.setSheetOffset(toolbarRect.height)
```
@@ -1353,6 +1389,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.
@@ -1405,7 +1443,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])`
@@ -1431,7 +1469,7 @@ Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject)
method:
```javascript
let url = require('url').format({
const url = require('url').format({
protocol: 'file',
slashes: true,
pathname: require('path').join(__dirname, 'index.html')
@@ -1657,9 +1695,12 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
Returns `Boolean` - Whether the menu bar is visible.
#### `win.setVisibleOnAllWorkspaces(visible)`
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
* `visible` Boolean
* `options` Object (optional)
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
the window should be visible above fullscreen windows
Sets whether the window should be visible on all workspaces.
@@ -1810,6 +1851,13 @@ Replacement API for setBrowserView supporting work with multi browser views.
* `browserView` [BrowserView](browser-view.md)
#### `win.setTopBrowserView(browserView)` _Experimental_
* `browserView` [BrowserView](browser-view.md)
Raises `browserView` above other `BrowserView`s attached to `win`.
Throws an error if `browserView` is not attached to `win`.
#### `win.getBrowserViews()` _Experimental_
Returns `BrowserView[]` - an array of all BrowserViews that have been attached

View File

@@ -171,6 +171,20 @@ lowercasing. It can be called only before first write. Calling this method after
the first write will throw an error. If the passed value is not a `String`, its
`toString()` method will be called to obtain the final value.
Certain headers are restricted from being set by apps. These headers are
listed below. More information on restricted headers can be found in
[Chromium's header utils](https://source.chromium.org/chromium/chromium/src/+/master:services/network/public/cpp/header_util.cc;drc=1562cab3f1eda927938f8f4a5a91991fefde66d3;bpv=1;bpt=1;l=22).
* `Content-Length`
* `Host`
* `Trailer` or `Te`
* `Upgrade`
* `Cookie2`
* `Keep-Alive`
* `Transfer-Encoding`
Additionally, setting the `Connection` header to the value `upgrade` is also disallowed.
#### `request.getHeader(name)`
* `name` String - Specify an extra header name.

View File

@@ -36,6 +36,10 @@ for integrated authentication. Without `*` prefix the URL has to match exactly.
A comma-separated list of servers for which delegation of user credentials is required.
Without `*` prefix the URL has to match exactly.
### --disable-ntlm-v2
Disables NTLM v2 for posix platforms, no effect elsewhere.
### --disable-http-cache
Disables the disk cache for HTTP requests.
@@ -75,6 +79,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.
@@ -194,6 +204,14 @@ logging level for all code in the source files under a `foo/bar` directory.
This switch only works when `--enable-logging` is also passed.
### --force_high_performance_gpu
Force using discrete GPU when there are multiple GPUs available.
### --force_low_power_gpu
Force using integrated GPU when there are multiple GPUs available.
## Node.js Flags
Electron supports some of the [CLI flags][node-cli] supported by Node.js.

View File

@@ -16,7 +16,7 @@ const { app, contentTracing } = require('electron')
app.whenReady().then(() => {
(async () => {
await contentTracing.startRecording({
include_categories: ['*']
included_categories: ['*']
})
console.log('Tracing started')
await new Promise(resolve => setTimeout(resolve, 5000))
@@ -83,4 +83,4 @@ Returns `Promise<Object>` - Resolves with an object containing the `value` and `
Get the maximum usage across processes of trace buffer as a percentage of the
full state.
[trace viewer]: https://github.com/catapult-project/catapult/blob/master/tracing
[trace viewer]: https://chromium.googlesource.com/catapult/+/HEAD/tracing/README.md

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

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

View File

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

View File

@@ -3,7 +3,7 @@
> Access information about media sources that can be used to capture audio and
> video from the desktop using the [`navigator.mediaDevices.getUserMedia`] API.
Process: [Renderer](../glossary.md#renderer-process)
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
The following example shows how to capture video from a desktop window whose
title is `Electron`:

View File

@@ -11,14 +11,6 @@ const { dialog } = require('electron')
console.log(dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] }))
```
The Dialog is opened from Electron's main thread. If you want to use the dialog
object from a renderer process, remember to access it using the remote:
```javascript
const { dialog } = require('electron').remote
console.log(dialog)
```
## Methods
The `dialog` module has the following methods:
@@ -162,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
@@ -193,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
@@ -269,7 +261,7 @@ Shows a message box, it will block the process until the message box is closed.
It returns the index of the clicked button.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
If `browserWindow` is not shown dialog will not be attached to it. In such case It will be displayed as independed window.
If `browserWindow` is not shown dialog will not be attached to it. In such case it will be displayed as an independent window.
### `dialog.showMessageBox([browserWindow, ]options)`

View File

@@ -11,7 +11,7 @@ control the download item.
```javascript
// In the main process.
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.webContents.session.on('will-download', (event, item, webContents) => {
// Set the save path, making Electron not to prompt a save dialog.
item.setSavePath('/tmp/save.pdf')

View File

@@ -147,3 +147,14 @@ the one downloaded by `npm install`. Usage:
```sh
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
```
## Set By Electron
Electron sets some variables in your environment at runtime.
### `ORIGINAL_XDG_CURRENT_DESKTOP`
This variable is set to the value of `XDG_CURRENT_DESKTOP` that your application
originally launched with. Electron sometimes modifies the value of `XDG_CURRENT_DESKTOP`
to affect other logic within Chromium so if you want access to the _original_ value
you should look up this environment variable instead.

View File

@@ -15,7 +15,7 @@ extension capabilities.
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
work). Extensions are installed per-`session`. To load an extension, call
[`ses.loadExtension`](session.md#sesloadextensionpath):
[`ses.loadExtension`](session.md#sesloadextensionpath-options):
```js
const { session } = require('electron')
@@ -102,3 +102,21 @@ The following methods of `chrome.tabs` are supported:
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
> supported and will raise an error.
### `chrome.management`
The following methods of `chrome.management` are supported:
- `chrome.management.getAll`
- `chrome.management.get`
- `chrome.management.getSelf`
- `chrome.management.getPermissionWarningsById`
- `chrome.management.getPermissionWarningsByManifest`
- `chrome.management.onEnabled`
- `chrome.management.onDisabled`
### `chrome.webRequest`
All features of this API are supported.
> **NOTE:** Electron's [`webRequest`](web-request.md) module takes precedence over `chrome.webRequest` if there are conflicting handlers.

View File

@@ -15,7 +15,7 @@ To create a frameless window, you need to set `frame` to `false` in
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600, frame: false })
const win = new BrowserWindow({ width: 800, height: 600, frame: false })
win.show()
```
@@ -33,7 +33,7 @@ Results in a hidden title bar and a full size content window, yet the title bar
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ titleBarStyle: 'hidden' })
const win = new BrowserWindow({ titleBarStyle: 'hidden' })
win.show()
```
@@ -43,7 +43,7 @@ Results in a hidden title bar with an alternative look where the traffic light b
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
win.show()
```
@@ -58,7 +58,7 @@ This option is only applicable for frameless windows.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: false })
const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: false })
win.show()
```
@@ -69,7 +69,7 @@ window transparent:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ transparent: true, frame: false })
const win = new BrowserWindow({ transparent: true, frame: false })
win.show()
```
@@ -83,8 +83,11 @@ win.show()
* The `blur` filter only applies to the web page, so there is no way to apply
blur effect to the content below the window (i.e. other applications open on
the user's system).
* On Windows operating systems, transparent windows will not work when DWM is
* The window will not be transparent when DevTools is opened.
* On Windows operating systems,
* transparent windows will not work when DWM is
disabled.
* transparent windows can not be maximized using the Windows system menu or by double clicking the title bar. The reasoning behind this can be seen on [this pull request](https://github.com/electron/electron/pull/28207).
* On Linux, users have to put `--enable-transparent-visuals --disable-gpu` in
the command line to disable GPU and allow ARGB to make transparent window,
this is caused by an upstream bug that [alpha channel doesn't work on some
@@ -100,7 +103,7 @@ API:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.setIgnoreMouseEvents(true)
```
@@ -112,13 +115,19 @@ optional parameter can be used to forward mouse move messages to the web page,
allowing events such as `mouseleave` to be emitted:
```javascript
let win = require('electron').remote.getCurrentWindow()
let el = document.getElementById('clickThroughElement')
const { ipcRenderer } = require('electron')
const el = document.getElementById('clickThroughElement')
el.addEventListener('mouseenter', () => {
win.setIgnoreMouseEvents(true, { forward: true })
ipcRenderer.send('set-ignore-mouse-events', true, { forward: true })
})
el.addEventListener('mouseleave', () => {
win.setIgnoreMouseEvents(false)
ipcRenderer.send('set-ignore-mouse-events', false)
})
// Main process
const { ipcMain } = require('electron')
ipcMain.on('set-ignore-mouse-events', (event, ...args) => {
BrowserWindow.fromWebContents(event.sender).setIgnoreMouseEvents(...args)
})
```

View File

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

View File

@@ -91,7 +91,7 @@ Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`
* `channel` String
* `listener` Function<Promise<void> | any>
* `listener` Function<Promise\<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@@ -123,7 +123,7 @@ WebContents is the source of the invoke request.
### `ipcMain.handleOnce(channel, listener)`
* `channel` String
* `listener` Function<Promise<void> | any>
* `listener` Function<Promise\<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@@ -148,4 +148,4 @@ found in the [`ipc-main-invoke-event`](structures/ipc-main-invoke-event.md)
structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[web-contents-send]: web-contents.md#contentssendchannel-arg1-arg2-
[web-contents-send]: web-contents.md#contentssendchannel-args

View File

@@ -61,9 +61,13 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process handles it by listening for `channel` with the
[`ipcMain`](ipc-main.md) module.
@@ -85,9 +89,13 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process should listen for `channel` with
[`ipcMain.handle()`](ipc-main.md#ipcmainhandlechannel-listener).
@@ -108,7 +116,7 @@ ipcMain.handle('some-name', async (event, someArgument) => {
If you need to transfer a [`MessagePort`][] to the main process, use [`ipcRenderer.postMessage`](#ipcrendererpostmessagechannel-message-transfer).
If you do not need a respons to the message, consider using [`ipcRenderer.send`](#ipcrenderersendchannel-args).
If you do not need a response to the message, consider using [`ipcRenderer.send`](#ipcrenderersendchannel-args).
### `ipcRenderer.sendSync(channel, ...args)`
@@ -123,9 +131,13 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process handles it by listening for `channel` with [`ipcMain`](ipc-main.md) module,
and replies by setting `event.returnValue`.

View File

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

View File

@@ -12,7 +12,7 @@ See [`Menu`](menu.md) for examples.
* `click` Function (optional) - Will be called with
`click(menuItem, browserWindow, event)` when the menu item is clicked.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md)
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
@@ -69,6 +69,7 @@ a `type`.
The `role` property can have following values:
* `undo`
* `about` - Trigger a native about panel (custom message box on Window, which does not provide its own).
* `redo`
* `cut`
* `copy`
@@ -94,7 +95,6 @@ The `role` property can have following values:
The following additional roles are available on _macOS_:
* `appMenu` - Whole default "App" menu (About, Services, etc.)
* `about` - Map to the `orderFrontStandardAboutPanel` action.
* `hide` - Map to the `hide` action.
* `hideOthers` - Map to the `hideOtherApplications` action.
* `unhide` - Map to the `unhideAllApplications` action.

View File

@@ -22,8 +22,10 @@ Sets `menu` as the application menu on macOS. On Windows and Linux, the
Also on Windows and Linux, you can use a `&` in the top-level item name to
indicate which letter should get a generated accelerator. For example, using
`&File` for the file menu would result in a generated `Alt-F` accelerator that
opens the associated menu. The indicated character in the button label gets an
underline. The `&` character is not displayed on the button label.
opens the associated menu. The indicated character in the button label then gets an
underline, and the `&` character is not displayed on the button label.
In order to escape the `&` character in an item name, add a proceeding `&`. For example, `&&File` would result in `&File` displayed on the button label.
Passing `null` will suppress the default menu. On Windows and Linux,
this has the additional effect of removing the menu bar from the window.
@@ -96,7 +98,7 @@ Appends the `menuItem` to the menu.
* `id` String
Returns `MenuItem` the item with the specified `id`
Returns `MenuItem | null` the item with the specified `id`
#### `menu.insert(pos, menuItem)`
@@ -141,13 +143,7 @@ can have a submenu.
## Examples
The `Menu` class is only available in the main process, but you can also use it
in the render process via the [`remote`](remote.md) module.
### Main process
An example of creating the application menu in the main process with the
simple template API:
An example of creating the application menu with the simple template API:
```javascript
const { app, Menu } = require('electron')
@@ -195,8 +191,8 @@ const template = [
{
label: 'Speech',
submenu: [
{ role: 'startspeaking' },
{ role: 'stopspeaking' }
{ role: 'startSpeaking' },
{ role: 'stopSpeaking' }
]
}
] : [
@@ -211,12 +207,12 @@ const template = [
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forcereload' },
{ role: 'toggledevtools' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
{ role: 'resetzoom' },
{ role: 'zoomin' },
{ role: 'zoomout' },
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
@@ -257,26 +253,36 @@ Menu.setApplicationMenu(menu)
### Render process
Below is an example of creating a menu dynamically in a web page
(render process) by using the [`remote`](remote.md) module, and showing it when
the user right clicks the page:
To create menus initiated by the renderer process, send the required
information to the main process using IPC and have the main process display the
menu on behalf of the renderer.
```html
<!-- index.html -->
<script>
const { remote } = require('electron')
const { Menu, MenuItem } = remote
const menu = new Menu()
menu.append(new MenuItem({ label: 'MenuItem1', click() { console.log('item 1 clicked') } }))
menu.append(new MenuItem({ type: 'separator' }))
menu.append(new MenuItem({ label: 'MenuItem2', type: 'checkbox', checked: true }))
Below is an example of showing a menu when the user right clicks the page:
```js
// renderer
window.addEventListener('contextmenu', (e) => {
e.preventDefault()
menu.popup({ window: remote.getCurrentWindow() })
}, false)
</script>
ipcRenderer.send('show-context-menu')
})
ipcRenderer.on('context-menu-command', (e, command) => {
// ...
})
// main
ipcMain.on('show-context-menu', (event) => {
const template = [
{
label: 'Menu Item 1',
click: () => { event.sender.send('context-menu-command', 'menu-item-1') }
},
{ type: 'separator' },
{ label: 'Menu Item 2', type: 'checkbox', checked: true }
]
const menu = Menu.buildFromTemplate(template)
menu.popup(BrowserWindow.fromWebContents(event.sender))
})
```
## Notes on macOS Application Menu

View File

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

View File

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

View File

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

View File

@@ -119,6 +119,13 @@ Returns `NativeImage`
Creates an empty `NativeImage` instance.
### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
* `path` String - path to a file that we intend to construct a thumbnail out of.
* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
### `nativeImage.createFromPath(path)`
* `path` String
@@ -266,9 +273,13 @@ image instead of a copy, so you _must_ ensure that the associated
Returns `Boolean` - Whether the image is empty.
#### `image.getSize()`
#### `image.getSize([scaleFactor])`
Returns [`Size`](structures/size.md)
* `scaleFactor` Double (optional) - Defaults to 1.0.
Returns [`Size`](structures/size.md).
If `scaleFactor` is passed, this will return the size corresponding to the image representation most closely matching the passed value.
#### `image.setTemplateImage(option)`
@@ -303,10 +314,18 @@ Returns `NativeImage` - The resized image.
If only the `height` or the `width` are specified then the current aspect ratio
will be preserved in the resized image.
#### `image.getAspectRatio()`
#### `image.getAspectRatio([scaleFactor])`
* `scaleFactor` Double (optional) - Defaults to 1.0.
Returns `Float` - The image's aspect ratio.
If `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.
#### `image.getScaleFactors()`
Returns `Float[]` - An array of all scale factors corresponding to representations for a given nativeImage.
#### `image.addRepresentation(options)`
* `options` Object

View File

@@ -58,7 +58,7 @@ Your application should then always use `shouldUseDarkColors` to determine what
### `nativeTheme.shouldUseHighContrastColors` _macOS_ _Windows_ _Readonly_
A `Boolean` for if the OS / Chromium currently has high-contrast mode enabled
or is being instructed to show a high-constrast UI.
or is being instructed to show a high-contrast UI.
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_

View File

@@ -8,19 +8,19 @@ Process: [Main](../glossary.md#main-process)
The `powerMonitor` module emits the following events:
### Event: 'suspend'
### Event: 'suspend' _macOS_ _Windows_
Emitted when the system is suspending.
### Event: 'resume'
### Event: 'resume' _macOS_ _Windows_
Emitted when system is resuming.
### Event: 'on-ac' _Windows_
### Event: 'on-ac' _macOS_ _Windows_
Emitted when the system changes to AC power.
### Event: 'on-battery' _Windows_
### Event: 'on-battery' _macOS_ _Windows_
Emitted when system changes to battery power.

View File

@@ -1,309 +0,0 @@
# protocol (NetworkService) (Draft)
This document describes the new protocol APIs based on the [NetworkService](https://www.chromium.org/servicification).
We don't currently have an estimate of when we will enable the `NetworkService` by
default in Electron, but as Chromium is already removing non-`NetworkService`
code, we will probably switch before Electron 10.
The content of this document should be moved to `protocol.md` after we have
enabled the `NetworkService` by default in Electron.
> Register a custom protocol and intercept existing protocol requests.
Process: [Main](../glossary.md#main-process)
An example of implementing a protocol that has the same effect as the
`file://` protocol:
```javascript
const { app, protocol } = require('electron')
const path = require('path')
app.whenReady().then(() => {
protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
})
})
```
**Note:** All methods unless specified can only be used after the `ready` event
of the `app` module gets emitted.
## Using `protocol` with a custom `partition` or `session`
A protocol is registered to a specific Electron [`session`](./session.md)
object. If you don't specify a session, then your `protocol` will be applied to
the default session that Electron uses. However, if you define a `partition` or
`session` on your `browserWindow`'s `webPreferences`, then that window will use
a different session and your custom protocol will not work if you just use
`electron.protocol.XXX`.
To have your custom protocol work in combination with a custom session, you need
to register it to that session explicitly.
```javascript
const { session, app, protocol } = require('electron')
const path = require('path')
app.whenReady().then(() => {
const partition = 'persist:example'
const ses = session.fromPartition(partition)
ses.protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
})
mainWindow = new BrowserWindow({ webPreferences: { partition } })
})
```
## Methods
The `protocol` module has the following methods:
### `protocol.registerSchemesAsPrivileged(customSchemes)`
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
**Note:** This method can only be used before the `ready` event of the `app`
module gets emitted and can be called only once.
Registers the `scheme` as standard, secure, bypasses content security policy for
resources, allows registering ServiceWorker and supports fetch API. Specify a
privilege with the value of `true` to enable the capability.
An example of registering a privileged scheme, that bypasses Content Security
Policy:
```javascript
const { protocol } = require('electron')
protocol.registerSchemesAsPrivileged([
{ scheme: 'foo', privileges: { bypassCSP: true } }
])
```
A standard scheme adheres to what RFC 3986 calls [generic URI
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
`https` are standard schemes, while `file` is not.
Registering a scheme as standard allows relative and absolute resources to
be resolved correctly when served. Otherwise the scheme will behave like the
`file` protocol, but without the ability to resolve relative URLs.
For example when you load following page with custom protocol without
registering it as standard scheme, the image will not be loaded because
non-standard schemes can not recognize relative URLs:
```html
<body>
<img src='test.png'>
</body>
```
Registering a scheme as standard will allow access to files through the
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
error for the scheme.
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
cookies) are disabled for non standard schemes. So in general if you want to
register a custom protocol to replace the `http` protocol, you have to register
it as a standard scheme.
### `protocol.registerFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a file as the response. The
`handler` will be called with `request` and `callback` where `request` is
an incoming request for the `scheme`.
To handle the `request`, the `callback` should be called with either the file's
path or an object that has a `path` property, e.g. `callback(filePath)` or
`callback({ path: filePath })`. The `filePath` must be an absolute path.
By default the `scheme` is treated like `http:`, which is parsed differently
from protocols that follow the "generic URI syntax" like `file:`.
### `protocol.registerBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a `Buffer` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `Buffer` object or an object that has the `data`
property.
Example:
```javascript
protocol.registerBufferProtocol('atom', (request, callback) => {
callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
})
```
### `protocol.registerStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a `String` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `String` or an object that has the `data`
property.
### `protocol.registerHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` ProtocolResponse
Registers a protocol of `scheme` that will send an HTTP request as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with an object that has the `url` property.
### `protocol.registerStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a stream as a response.
The usage is the same with `registerFileProtocol`, except that the
`callback` should be called with either a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable) object or an object that
has the `data` property.
Example:
```javascript
const { protocol } = require('electron')
const { PassThrough } = require('stream')
function createStream (text) {
const rv = new PassThrough() // PassThrough is also a Readable stream
rv.push(text)
rv.push(null)
return rv
}
protocol.registerStreamProtocol('atom', (request, callback) => {
callback({
statusCode: 200,
headers: {
'content-type': 'text/html'
},
data: createStream('<h5>Response</h5>')
})
})
```
It is possible to pass any object that implements the readable stream API (emits
`data`/`end`/`error` events). For example, here's how a file could be returned:
```javascript
protocol.registerStreamProtocol('atom', (request, callback) => {
callback(fs.createReadStream('index.html'))
})
```
### `protocol.unregisterProtocol(scheme)`
* `scheme` String
Unregisters the custom protocol of `scheme`.
### `protocol.isProtocolRegistered(scheme)`
* `scheme` String
Returns `Boolean` - Whether `scheme` is already registered.
### `protocol.interceptFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a file as a response.
### `protocol.interceptStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `String` as a response.
### `protocol.interceptBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `Buffer` as a response.
### `protocol.interceptHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` ProtocolResponse
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a new HTTP request as a response.
### `protocol.interceptStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
protocol handler.
### `protocol.uninterceptProtocol(scheme)`
* `scheme` String
Remove the interceptor installed for `scheme` and restore its original handler.
### `protocol.isProtocolIntercepted(scheme)`
* `scheme` String
Returns `Boolean` - Whether `scheme` is already intercepted.
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem

View File

@@ -15,8 +15,6 @@ app.whenReady().then(() => {
protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
}, (error) => {
if (error) console.error('Failed to register protocol')
})
})
```
@@ -26,9 +24,15 @@ of the `app` module gets emitted.
## Using `protocol` with a custom `partition` or `session`
A protocol is registered to a specific Electron [`session`](./session.md) object. If you don't specify a session, then your `protocol` will be applied to the default session that Electron uses. However, if you define a `partition` or `session` on your `browserWindow`'s `webPreferences`, then that window will use a different session and your custom protocol will not work if you just use `electron.protocol.XXX`.
A protocol is registered to a specific Electron [`session`](./session.md)
object. If you don't specify a session, then your `protocol` will be applied to
the default session that Electron uses. However, if you define a `partition` or
`session` on your `browserWindow`'s `webPreferences`, then that window will use
a different session and your custom protocol will not work if you just use
`electron.protocol.XXX`.
To have your custom protocol work in combination with a custom session, you need to register it to that session explicitly.
To have your custom protocol work in combination with a custom session, you need
to register it to that session explicitly.
```javascript
const { session, app, protocol } = require('electron')
@@ -41,17 +45,9 @@ app.whenReady().then(() => {
ses.protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
}, (error) => {
if (error) console.error('Failed to register protocol')
})
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
partition: partition
}
})
mainWindow = new BrowserWindow({ webPreferences: { partition } })
})
```
@@ -63,15 +59,15 @@ The `protocol` module has the following methods:
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
**Note:** This method can only be used before the `ready` event of the `app`
module gets emitted and can be called only once.
Registers the `scheme` as standard, secure, bypasses content security policy for resources,
allows registering ServiceWorker and supports fetch API.
Registers the `scheme` as standard, secure, bypasses content security policy for
resources, allows registering ServiceWorker, supports fetch API, and streaming
video/audio. Specify a privilege with the value of `true` to enable the capability.
Specify a privilege with the value of `true` to enable the capability.
An example of registering a privileged scheme, with bypassing Content Security Policy:
An example of registering a privileged scheme, that bypasses Content Security
Policy:
```javascript
const { protocol } = require('electron')
@@ -84,7 +80,7 @@ A standard scheme adheres to what RFC 3986 calls [generic URI
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
`https` are standard schemes, while `file` is not.
Registering a scheme as standard, will allow relative and absolute resources to
Registering a scheme as standard allows relative and absolute resources to
be resolved correctly when served. Otherwise the scheme will behave like the
`file` protocol, but without the ability to resolve relative URLs.
@@ -102,168 +98,107 @@ Registering a scheme as standard will allow access to files through the
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
error for the scheme.
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB, cookies)
are disabled for non standard schemes. So in general if you want to register a
custom protocol to replace the `http` protocol, you have to register it as a standard scheme.
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
cookies) are disabled for non standard schemes. So in general if you want to
register a custom protocol to replace the `http` protocol, you have to register
it as a standard scheme.
`protocol.registerSchemesAsPrivileged` can be used to replicate the functionality of the previous `protocol.registerStandardSchemes`, `webFrame.registerURLSchemeAs*` and `protocol.registerServiceWorkerSchemes` functions that existed prior to Electron 5.0.0, for example:
Protocols that use streams (http and stream protocols) should set `stream: true`.
The `<video>` and `<audio>` HTML elements expect protocols to buffer their
responses by default. The `stream` flag configures those elements to correctly
expect streaming responses.
**before (<= v4.x)**
```javascript
// Main
protocol.registerStandardSchemes(['scheme1', 'scheme2'], { secure: true })
// Renderer
webFrame.registerURLSchemeAsPrivileged('scheme1', { secure: true })
webFrame.registerURLSchemeAsPrivileged('scheme2', { secure: true })
```
**after (>= v5.x)**
```javascript
protocol.registerSchemesAsPrivileged([
{ scheme: 'scheme1', privileges: { standard: true, secure: true } },
{ scheme: 'scheme2', privileges: { standard: true, secure: true } }
])
```
### `protocol.registerFileProtocol(scheme, handler[, completion])`
### `protocol.registerFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `filePath` String | [FilePathWithHeaders](structures/file-path-with-headers.md) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send the file as a response. The
`handler` will be called with `handler(request, callback)` when a `request` is
going to be created with `scheme`. `completion` will be called with
`completion(null)` when `scheme` is successfully registered or
`completion(error)` when failed.
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a file as the response. The
`handler` will be called with `request` and `callback` where `request` is
an incoming request for the `scheme`.
To handle the `request`, the `callback` should be called with either the file's
path or an object that has a `path` property, e.g. `callback(filePath)` or
`callback({ path: filePath })`. The object may also have a `headers` property
which gives a map of headers to values for the response headers, e.g.
`callback({ path: filePath, headers: {"Content-Security-Policy": "default-src 'none'"]})`.
When `callback` is called with nothing, a number, or an object that has an
`error` property, the `request` will fail with the `error` number you
specified. For the available error numbers you can use, please see the
[net error list][net-error].
`callback({ path: filePath })`. The `filePath` must be an absolute path.
By default the `scheme` is treated like `http:`, which is parsed differently
than protocols that follow the "generic URI syntax" like `file:`.
from protocols that follow the "generic URI syntax" like `file:`.
### `protocol.registerBufferProtocol(scheme, handler[, completion])`
### `protocol.registerBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `buffer` (Buffer | [MimeTypedBuffer](structures/mime-typed-buffer.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `Buffer` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `Buffer` object or an object that has the `data`,
`mimeType`, and `charset` properties.
should be called with either a `Buffer` object or an object that has the `data`
property.
Example:
```javascript
const { protocol } = require('electron')
protocol.registerBufferProtocol('atom', (request, callback) => {
callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
}, (error) => {
if (error) console.error('Failed to register protocol')
})
```
### `protocol.registerStringProtocol(scheme, handler[, completion])`
### `protocol.registerStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `data` (String | [StringProtocolResponse](structures/string-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `String` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `String` or an object that has the `data`,
`mimeType`, and `charset` properties.
should be called with either a `String` or an object that has the `data`
property.
### `protocol.registerHttpProtocol(scheme, handler[, completion])`
### `protocol.registerHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Session | null (optional)
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error
* `response` ProtocolResponse
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send an HTTP request as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with a `redirectRequest` object that has the `url`, `method`,
`referrer`, `uploadData` and `session` properties.
should be called with an object that has the `url` property.
By default the HTTP request will reuse the current session. If you want the
request to have a different session you should set `session` to `null`.
For POST requests the `uploadData` object must be provided.
### `protocol.registerStreamProtocol(scheme, handler[, completion])`
### `protocol.registerStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `stream` (ReadableStream | [StreamProtocolResponse](structures/stream-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a `Readable` as a response.
Returns `Boolean` - Whether the protocol was successfully registered
The usage is similar to the other `register{Any}Protocol`, except that the
`callback` should be called with either a `Readable` object or an object that
has the `data`, `statusCode`, and `headers` properties.
Registers a protocol of `scheme` that will send a stream as a response.
The usage is the same with `registerFileProtocol`, except that the
`callback` should be called with either a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable) object or an object that
has the `data` property.
Example:
@@ -286,8 +221,6 @@ protocol.registerStreamProtocol('atom', (request, callback) => {
},
data: createStream('<h5>Response</h5>')
})
}, (error) => {
if (error) console.error('Failed to register protocol')
})
```
@@ -295,132 +228,102 @@ It is possible to pass any object that implements the readable stream API (emits
`data`/`end`/`error` events). For example, here's how a file could be returned:
```javascript
const { protocol } = require('electron')
const fs = require('fs')
protocol.registerStreamProtocol('atom', (request, callback) => {
callback(fs.createReadStream('index.html'))
}, (error) => {
if (error) console.error('Failed to register protocol')
})
```
### `protocol.unregisterProtocol(scheme[, completion])`
### `protocol.unregisterProtocol(scheme)`
* `scheme` String
* `completion` Function (optional)
* `error` Error
Returns `Boolean` - Whether the protocol was successfully unregistered
Unregisters the custom protocol of `scheme`.
### `protocol.isProtocolHandled(scheme)`
### `protocol.isProtocolRegistered(scheme)`
* `scheme` String
Returns `Promise<Boolean>` - fulfilled with a boolean that indicates whether there is
already a handler for `scheme`.
Returns `Boolean` - Whether `scheme` is already registered.
### `protocol.interceptFileProtocol(scheme, handler[, completion])`
### `protocol.interceptFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `filePath` String
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a file as a response.
### `protocol.interceptStringProtocol(scheme, handler[, completion])`
### `protocol.interceptStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `data` (String | [StringProtocolResponse](structures/string-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `String` as a response.
### `protocol.interceptBufferProtocol(scheme, handler[, completion])`
### `protocol.interceptBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `buffer` Buffer (optional)
* `completion` Function (optional)
* `error` Error
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `Buffer` as a response.
### `protocol.interceptHttpProtocol(scheme, handler[, completion])`
### `protocol.interceptHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Session | null (optional)
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error
* `response` [ProtocolResponse](structures/protocol-response.md)
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a new HTTP request as a response.
### `protocol.interceptStreamProtocol(scheme, handler[, completion])`
### `protocol.interceptStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `stream` (ReadableStream | [StreamProtocolResponse](structures/stream-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
protocol handler.
### `protocol.uninterceptProtocol(scheme[, completion])`
### `protocol.uninterceptProtocol(scheme)`
* `scheme` String
* `completion` Function (optional)
* `error` Error
Returns `Boolean` - Whether the protocol was successfully unintercepted
Remove the interceptor installed for `scheme` and restore its original handler.
[net-error]: https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h
### `protocol.isProtocolIntercepted(scheme)`
* `scheme` String
Returns `Boolean` - Whether `scheme` is already intercepted.
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem

View File

@@ -17,7 +17,7 @@ renderer process:
```javascript
const { BrowserWindow } = require('electron').remote
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('https://github.com')
```

View File

@@ -88,26 +88,17 @@ 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. We must be
// careful to not leak any objects into the global scope!
const { ipcRenderer, remote } = require('electron')
const fs = remote.require('fs')
// read a configuration file using the `fs` module
const buf = fs.readFileSync('allowed-popup-urls.json')
const allowedUrls = JSON.parse(buf.toString('utf8'))
// 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
function customWindowOpen (url, ...args) {
if (allowedUrls.indexOf(url) === -1) {
ipcRenderer.sendSync('blocked-popup-notification', location.origin, url)
return null
}
return defaultWindowOpen(url, ...args)
window.open = function customWindowOpen (url, ...args) {
ipcRenderer.send('report-window-open', location.origin, url, args)
return defaultWindowOpen(url + '?from_electron=1', ...args)
}
window.open = customWindowOpen
```
Important things to notice in the preload script:
@@ -115,8 +106,6 @@ 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 can indirectly access all APIs from the main process through the
`remote` and `ipcRenderer` modules.
- 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.
@@ -144,34 +133,50 @@ following modules:
- `desktopCapturer`
- `ipcRenderer`
- `nativeImage`
- `remote`
- `webFrame`
- `events`
- `timers`
- `url`
More may be added as needed to expose more Electron APIs in the sandbox, but any
module in the main process can already be used through
`electron.remote.require`.
More may be added as needed to expose more Electron APIs in the sandbox.
## Status
## Rendering untrusted content
Please use the `sandbox` option with care, as it is still an experimental
feature. We are still not aware of the security implications of exposing some
Electron renderer APIs to the preload script, but here are some things to
consider before 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 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).
Since rendering untrusted content in Electron is still uncharted territory,
the APIs exposed to the sandbox preload script should be considered more
unstable than the rest of Electron APIs, and may have breaking changes to fix
security issues.
- 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

@@ -33,8 +33,8 @@ const { app, BrowserWindow, screen } = require('electron')
let win
app.whenReady().then(() => {
let displays = screen.getAllDisplays()
let externalDisplay = displays.find((display) => {
const displays = screen.getAllDisplays()
const externalDisplay = displays.find((display) => {
return display.bounds.x !== 0 || display.bounds.y !== 0
})

View File

@@ -39,7 +39,7 @@ Returns:
* `message` String - The actual console message
* `versionId` Number - The version ID of the service worker that sent the log message
* `source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `sourceUrl` String - The URL the message came from
* `lineNumber` Number - The line number of the source that triggered this console message

View File

@@ -12,7 +12,7 @@ property of [`WebContents`](web-contents.md), or from the `session` module.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
const ses = win.webContents.session
@@ -332,7 +332,7 @@ verify proc.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.webContents.session.setCertificateVerifyProc((request, callback) => {
const { hostname } = request
@@ -348,8 +348,17 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `handler` Function | null
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
* `permission` String - Enum of 'media', 'geolocation', 'notifications', 'midiSysex',
'pointerLock', 'fullscreen', 'openExternal'.
* `permission` String - The type of requested permission.
* `clipboard-read` - Request access to read from the clipboard.
* `media` - Request access to media devices such as camera, microphone and speakers.
* `mediaKeySystem` - Request access to DRM protected content.
* `geolocation` - Request access to user's current location.
* `notifications` - Request notification creation and the ability to display them in the user's system tray.
* `midi` - Request MIDI access in the `webmidi` API.
* `midiSysex` - Request the use of system exclusive messages in the `webmidi` API.
* `pointerLock` - Request to directly interpret mouse movements as an input method. Click [here](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) to know more.
* `fullscreen` - Request for the app to enter fullscreen mode.
* `openExternal` - Request to open links in external applications.
* `callback` Function
* `permissionGranted` Boolean - Allow or deny the permission.
* `details` Object - Some properties are only available on certain permission types.
@@ -376,12 +385,12 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
#### `ses.setPermissionCheckHandler(handler)`
* `handler` Function<Boolean> | null
* `handler` Function\<Boolean> | null
* `webContents` [WebContents](web-contents.md) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
* `permission` String - Enum of 'media'.
* `requestingOrigin` String - The origin URL of the permission check
* `details` Object - Some properties are only available on certain permission types.
* `securityOrigin` String - The security orign of the `media` check.
* `securityOrigin` String - The security origin of the `media` check.
* `mediaType` String - The type of media access being requested, can be `video`,
`audio` or `unknown`
* `requestingUrl` String - The last URL the requesting frame loaded
@@ -518,7 +527,7 @@ Returns `String[]` - An array of language codes the spellchecker is enabled for.
will fallback to using `en-US`. By default on launch if this setting is an empty list Electron will try to populate this
setting with the current OS locale. This setting is persisted across restarts.
**Note:** On macOS the OS spellchecker is used and has it's own list of languages. This API is a no-op on macOS.
**Note:** On macOS the OS spellchecker is used and has its own list of languages. This API is a no-op on macOS.
#### `ses.setSpellCheckerDictionaryDownloadURL(url)`
@@ -559,9 +568,13 @@ will not work on non-persistent (in-memory) sessions.
**Note:** On macOS and Windows 10 this word will be removed from the OS custom dictionary as well
#### `ses.loadExtension(path)`
#### `ses.loadExtension(path[, options])`
* `path` String - Path to a directory containing an unpacked Chrome extension
* `options` Object (optional)
* `allowFileAccess` Boolean - Whether to allow the extension to read local files over `file://`
protocol and inject content scripts into `file://` pages. This is required e.g. for loading
devtools extensions on `file://` URLs. Defaults to false.
Returns `Promise<Extension>` - resolves when the extension is loaded.
@@ -584,7 +597,11 @@ const { app, session } = require('electron')
const path = require('path')
app.on('ready', async () => {
await session.defaultSession.loadExtension(path.join(__dirname, 'react-devtools'))
await session.defaultSession.loadExtension(
path.join(__dirname, 'react-devtools'),
// allowFileAccess is required to load the devtools extension on file:// URLs.
{ allowFileAccess: true }
)
// Note that in order to use the React DevTools extension, you'll need to
// download and unzip a copy of the extension.
})
@@ -655,7 +672,7 @@ const path = require('path')
app.whenReady().then(() => {
const protocol = session.fromPartition('some-partition').protocol
protocol.registerFileProtocol('atom', (request, callback) => {
let url = request.url.substr(7)
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
}, (error) => {
if (error) console.error('Failed to register protocol')

View File

@@ -30,7 +30,7 @@ Show the given file in a file manager. If possible, select the file.
* `path` String
Returns `Promise<String>` - Resolves with an string containing the error message corresponding to the failure if a failure occurred, otherwise "".
Returns `Promise<String>` - Resolves with a string containing the error message corresponding to the failure if a failure occurred, otherwise "".
Open the given file in the desktop's default manner.

View File

@@ -8,3 +8,4 @@
* `allowServiceWorkers` Boolean (optional) - Default false.
* `supportFetchAPI` Boolean (optional) - Default false.
* `corsEnabled` Boolean (optional) - Default false.
* `stream` Boolean (optional) - Default false.

View File

@@ -19,5 +19,5 @@
available.
* `appIcon` [NativeImage](../native-image.md) - An icon image of the
application that owns the window or null if the source has a type screen.
The size of the icon is not known in advance and depends on what the
The size of the icon is not known in advance and depends on what
the application provides.

View File

@@ -1,5 +1,6 @@
# IpcMainEvent Object extends `Event`
* `processId` Integer - The internal ID of the renderer process that sent this message
* `frameId` Integer - The ID of the renderer frame that sent this message
* `returnValue` any - Set this to the value to be returned in a synchronous message
* `sender` WebContents - Returns the `webContents` that sent the message

View File

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

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,4 +1,4 @@
# KeyboardEvent Object extends `Event`
# KeyboardEvent Object
* `ctrlKey` Boolean (optional) - whether the Control key was used in an accelerator to trigger the Event
* `metaKey` Boolean (optional) - whether a meta key was used in an accelerator to trigger the Event

View File

@@ -1,4 +1,5 @@
# MimeTypedBuffer Object
* `mimeType` String - The mimeType of the Buffer that you are sending.
* `mimeType` String (optional) - MIME type of the buffer.
* `charset` String (optional) - Charset of the buffer.
* `data` Buffer - The actual Buffer content.

View File

@@ -7,7 +7,7 @@
* `isDefault` Boolean - whether or not a given printer is set as the default printer on the OS.
* `options` Object - an object containing a variable number of platform-specific printer information.
The number represented by `status` means different things on different platforms: on Windows it's potential values can be found [here](https://docs.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).
The number represented by `status` means different things on different platforms: on Windows its potential values can be found [here](https://docs.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).
## Example

View File

@@ -11,6 +11,8 @@
* `Pepper Plugin`
* `Pepper Plugin Broker`
* `Unknown`
* `name` String (optional) - The name of the process. i.e. for plugins it might be Flash.
Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc.
* `cpu` [CPUUsage](cpu-usage.md) - CPU usage of the process.
* `creationTime` Number - Creation time for this process.
The time is represented as number of milliseconds since epoch.

View File

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

View File

@@ -4,3 +4,4 @@
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](upload-data.md) (optional)
* `headers` Record<String, String>

View File

@@ -1,5 +0,0 @@
# StreamProtocolResponse Object
* `statusCode` Number (optional) - The HTTP response code.
* `headers` Record<String, String | String[]> (optional) - An object containing the response headers.
* `data` ReadableStream | null - A Node.js readable stream representing the response body.

View File

@@ -1,5 +0,0 @@
# StringProtocolResponse Object
* `mimeType` String (optional) - MIME type of the response.
* `charset` String (optional) - Charset of the response.
* `data` String | null - A string representing the response body.

View File

@@ -6,7 +6,7 @@
* `trace_buffer_size_in_events` number (optional) - maximum size of the trace
recording buffer in events.
* `enable_argument_filter` boolean (optional) - if true, filter event data
according to a whitelist of events that have been manually vetted to not
according to a specific list of events that have been manually vetted to not
include any PII. See [the implementation in
Chromium][trace_event_args_whitelist.cc] for specifics.
* `included_categories` String[] (optional) - a list of tracing categories to
@@ -41,7 +41,7 @@ An example TraceConfig that roughly matches what Chrome DevTools records:
'disabled-by-default-v8.cpu_profiler',
'disabled-by-default-v8.cpu_profiler.hires'
],
excluded_categories: [ '*' ]
excluded_categories: ['*']
}
```

View File

@@ -9,7 +9,7 @@ the [native modules](../tutorial/using-native-node-modules.md)).
Electron also provides some extra built-in modules for developing native
desktop applications. Some modules are only available in the main process, some
are only available in the renderer process (web page), and some can be used in
both processes.
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
@@ -29,15 +29,15 @@ app.whenReady().then(() => {
```
The renderer process is no different than a normal web page, except for the
extra ability to use node modules:
extra ability to use node modules if `nodeIntegration` is enabled:
```html
<!DOCTYPE html>
<html>
<body>
<script>
const { app } = require('electron').remote
console.log(app.getVersion())
const fs = require('fs')
console.log(fs.readFileSync(__filename, 'utf8'))
</script>
</body>
</html>

View File

@@ -132,6 +132,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`.
@@ -209,7 +211,7 @@ not (transparent windows won't work correctly when DWM composition is disabled):
```javascript
const { BrowserWindow, systemPreferences } = require('electron')
let browserOptions = { width: 1000, height: 800 }
const browserOptions = { width: 1000, height: 800 }
// Make the window transparent only if the platform supports it.
if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) {
@@ -218,7 +220,7 @@ if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) {
}
// Create the window.
let win = new BrowserWindow(browserOptions)
const win = new BrowserWindow(browserOptions)
// Navigate.
if (browserOptions.transparent) {
@@ -406,7 +408,7 @@ systemPreferences.promptTouchID('To get consent for a Security-Gated Thing').the
})
```
This API itself will not protect your user data; rather, it is a mechanism to allow you to do so. Native apps will need to set [Access Control Constants](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags?language=objc) like [`kSecAccessControlUserPresence`](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags/ksecaccesscontroluserpresence?language=objc) on the their keychain entry so that reading it would auto-prompt for Touch ID biometric consent. This could be done with [`node-keytar`](https://github.com/atom/node-keytar), such that one would store an encryption key with `node-keytar` and only fetch it if `promptTouchID()` resolves.
This API itself will not protect your user data; rather, it is a mechanism to allow you to do so. Native apps will need to set [Access Control Constants](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags?language=objc) like [`kSecAccessControlUserPresence`](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags/ksecaccesscontroluserpresence?language=objc) on their keychain entry so that reading it would auto-prompt for Touch ID biometric consent. This could be done with [`node-keytar`](https://github.com/atom/node-keytar), such that one would store an encryption key with `node-keytar` and only fetch it if `promptTouchID()` resolves.
**NOTE:** This API will return a rejected Promise on macOS systems older than Sierra 10.12.2.
@@ -416,7 +418,7 @@ This API itself will not protect your user data; rather, it is a mechanism to al
Returns `Boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_
### `systemPreferences.getMediaAccessStatus(mediaType)` _Windows_ _macOS_
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
@@ -426,6 +428,9 @@ This user consent was not required on macOS 10.13 High Sierra or lower so this m
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
macOS 10.15 Catalina or higher requires consent for `screen` access.
Windows 10 has a global setting controlling `microphone` and `camera` access for all win32 applications.
It will always return `granted` for `screen` and for all media types on older versions of Windows.
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_
* `mediaType` String - the type of media being requested; can be `microphone`, `camera`.

View File

@@ -41,6 +41,10 @@ the button in the touch bar.
A `NativeImage` representing the button's current icon. Changing this value immediately updates the button
in the touch bar.
#### `touchBarButton.iconPosition`
A `String` - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
#### `touchBarButton.enabled`
A `Boolean` representing whether the button is in an enabled state.

View File

@@ -49,3 +49,7 @@ updates the control in the touch bar. Updating deep properties inside this array
An `Integer` representing the currently selected segment. Changing this value immediately updates the control
in the touch bar. User interaction with the touch bar will update this value automatically.
#### `touchBarSegmentedControl.mode`
A `String` representing the current selection mode of the control. Can be `single`, `multiple` or `buttons`.

View File

@@ -11,3 +11,11 @@ Process: [Main](../tutorial/application-architecture.md#main-and-renderer-proces
* `small` - Small space between items. Maps to `NSTouchBarItemIdentifierFixedSpaceSmall`. This is the default.
* `large` - Large space between items. Maps to `NSTouchBarItemIdentifierFixedSpaceLarge`.
* `flexible` - Take up all available space. Maps to `NSTouchBarItemIdentifierFlexibleSpace`.
### Instance Properties
The following properties are available on instances of `TouchBarSpacer`:
#### `touchBarSpacer.size`
A `String` representing the size of the spacer. Can be `small`, `large` or `flexible`.

View File

@@ -217,9 +217,11 @@ Sets the `image` associated with this tray icon when pressed on macOS.
Sets the hover text for this tray icon.
#### `tray.setTitle(title)` _macOS_
#### `tray.setTitle(title[, options])` _macOS_
* `title` String
* `options` Object (optional)
* `fontType` String (optional) - The font family variant to display, can be `monospaced` or `monospacedDigit`. `monospaced` is available in macOS 10.15+ and `monospacedDigit` is available in macOS 10.11+. When left blank, the title uses the default system font.
Sets the title displayed next to the tray icon in the status bar (Support ANSI colors).

View File

@@ -12,10 +12,10 @@ the [`BrowserWindow`](browser-window.md) object. An example of accessing the
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 1500 })
const win = new BrowserWindow({ width: 800, height: 1500 })
win.loadURL('http://github.com')
let contents = win.webContents
const contents = win.webContents
console.log(contents)
```
@@ -42,7 +42,8 @@ returns `null`.
* `id` Integer
Returns `WebContents` - A WebContents instance with the given ID.
Returns `WebContents` | undefined - A WebContents instance with the given ID, or
`undefined` if there is no WebContents associated with the given ID.
## Class: WebContents
@@ -256,7 +257,7 @@ Returns:
Emitted after a server side redirect occurs during navigation. For example a 302
redirect.
This event can not be prevented, if you want to prevent redirects you should
This event cannot be prevented, if you want to prevent redirects you should
checkout out the `will-redirect` event above.
#### Event: 'did-navigate'
@@ -338,7 +339,7 @@ win.webContents.on('will-prevent-unload', (event) => {
})
```
#### Event: 'crashed'
#### Event: 'crashed' _Deprecated_
Returns:
@@ -347,6 +348,29 @@ Returns:
Emitted when the renderer process crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process disappeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
#### Event: 'render-process-gone'
Returns:
* `event` Event
* `details` Object
* `reason` String - The reason the render process is gone. Possible values:
* `clean-exit` - Process exited with an exit code of zero
* `abnormal-exit` - Process exited with a non-zero exit code
* `killed` - Process was sent a SIGTERM or otherwise killed externally
* `crashed` - Process crashed
* `oom` - Process ran out of memory
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
Emitted when the renderer process unexpectedly disappears. This is normally
because it was crashed or killed.
#### Event: 'unresponsive'
Emitted when the web page becomes unresponsive.
@@ -379,6 +403,7 @@ Returns:
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
* `isComposing` Boolean - Equivalent to [KeyboardEvent.isComposing][keyboardevent].
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
@@ -394,7 +419,7 @@ To only prevent the menu shortcuts, use
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.webContents.on('before-input-event', (event, input) => {
// For example, only enable application menu keyboard shortcuts when
@@ -641,7 +666,7 @@ app.whenReady().then(() => {
win = new BrowserWindow({ width: 800, height: 600 })
win.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault()
let result = deviceList.find((device) => {
const result = deviceList.find((device) => {
return device.deviceName === 'test'
})
if (!result) {
@@ -667,7 +692,7 @@ buffer.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ webPreferences: { offscreen: true } })
const win = new BrowserWindow({ webPreferences: { offscreen: true } })
win.webContents.on('paint', (event, dirty, image) => {
// updateBitmap(dirty, image.getBitmap())
})
@@ -696,7 +721,7 @@ This event can be used to configure `webPreferences` for the `webContents`
of a `<webview>` before it's loaded, and provides the ability to set settings
that can't be set via `<webview>` attributes.
**Note:** The specified `preload` script option will be appear as `preloadURL`
**Note:** The specified `preload` script option will appear as `preloadURL`
(not `preload`) in the `webPreferences` object emitted with this event.
#### Event: 'did-attach-webview'
@@ -714,9 +739,9 @@ Emitted when a `<webview>` has been attached to this web contents.
Returns:
* `event` Event
* `level` Integer
* `message` String
* `line` Integer
* `level` Integer - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `message` String - The actual console message
* `line` Integer - The line number of the source that triggered this console message
* `sourceId` String
Emitted when the associated window logs a console message.
@@ -760,7 +785,7 @@ Returns:
Emitted when `desktopCapturer.getSources()` is called in the renderer process.
Calling `event.preventDefault()` will make it return empty sources.
#### Event: 'remote-require'
#### Event: 'remote-require' _Deprecated_
Returns:
@@ -771,7 +796,7 @@ Emitted when `remote.require()` is called in the renderer process.
Calling `event.preventDefault()` will prevent the module from being returned.
Custom value can be returned by setting `event.returnValue`.
#### Event: 'remote-get-global'
#### Event: 'remote-get-global' _Deprecated_
Returns:
@@ -782,7 +807,7 @@ Emitted when `remote.getGlobal()` is called in the renderer process.
Calling `event.preventDefault()` will prevent the global from being returned.
Custom value can be returned by setting `event.returnValue`.
#### Event: 'remote-get-builtin'
#### Event: 'remote-get-builtin' _Deprecated_
Returns:
@@ -793,7 +818,7 @@ Emitted when `remote.getBuiltin()` is called in the renderer process.
Calling `event.preventDefault()` will prevent the module from being returned.
Custom value can be returned by setting `event.returnValue`.
#### Event: 'remote-get-current-window'
#### Event: 'remote-get-current-window' _Deprecated_
Returns:
@@ -803,7 +828,7 @@ Emitted when `remote.getCurrentWindow()` is called in the renderer process.
Calling `event.preventDefault()` will prevent the object from being returned.
Custom value can be returned by setting `event.returnValue`.
#### Event: 'remote-get-current-web-contents'
#### Event: 'remote-get-current-web-contents' _Deprecated_
Returns:
@@ -883,11 +908,11 @@ Returns `String` - The URL of the current web page.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
let currentURL = win.webContents.getURL()
console.log(currentURL)
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com').then(() => {
const currentURL = win.webContents.getURL()
console.log(currentURL)
})
```
#### `contents.getTitle()`
@@ -974,6 +999,34 @@ Navigates to the specified offset from the "current entry".
Returns `Boolean` - Whether the renderer process has crashed.
#### `contents.forcefullyCrashRenderer()`
Forcefully terminates the renderer process that is currently hosting this
`webContents`. This will cause the `render-process-gone` event to be emitted
with the `reason=killed || reason=crashed`. Please note that some webContents share renderer
processes and therefore calling this method may also crash the host process
for other webContents as well.
Calling `reload()` immediately after calling this
method will force the reload to occur in a new process. This should be used
when this process is unstable or unusable, for instance in order to recover
from the `unresponsive` event.
```js
contents.on('unresponsive', async () => {
const { response } = await dialog.showMessageBox({
message: 'App X has become unresponsive',
title: 'Do you want to try forcefully reloading the app?',
buttons: ['OK', 'Cancel'],
cancelId: 1
})
if (response === 0) {
contents.forcefullyCrashRenderer()
contents.reload()
}
})
```
#### `contents.setUserAgent(userAgent)`
* `userAgent` String
@@ -1180,8 +1233,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`.
* `wordStart` Boolean (optional) - Whether to look only at the start of words.
@@ -1231,7 +1283,7 @@ is large then 0.
#### `contents.incrementCapturerCount([size, stayHidden])`
* `size` [Size](structures/size.md) (optional) - The perferred size for the capturer.
* `size` [Size](structures/size.md) (optional) - The preferred size for the capturer.
* `stayHidden` Boolean (optional) - Keep the page hidden instead of visible.
Increase the capturer count by one. The page is considered visible when its browser window is
@@ -1272,9 +1324,9 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
* `pagesPerSheet` Number (optional) - The number of pages to print per page sheet.
* `collate` Boolean (optional) - Whether the web page should be collated.
* `copies` Number (optional) - The number of copies of the web page to print.
* `pageRanges` Record<string, number> (optional) - The page range to print.
* `from` Number - the start page.
* `to` Number - the end page.
* `pageRanges` Object[] (optional) - The page range to print. On macOS, only one range is honored.
* `from` Number - Index of the first page to print (0-based).
* `to` Number - Index of the last page to print (inclusive) (0-based).
* `duplexMode` String (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
* `dpi` Record<string, number> (optional)
* `horizontal` Number (optional) - The horizontal dpi.
@@ -1287,6 +1339,8 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
* `success` Boolean - Indicates success of the print call.
* `failureReason` String - Error description called back if the print fails.
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minimum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings for printing.
@@ -1295,7 +1349,14 @@ Use `page-break-before: always;` CSS style to force to print to a new page.
Example usage:
```js
const options = { silent: true, deviceName: 'My-Printer' }
const options = {
silent: true,
deviceName: 'My-Printer',
pageRanges: [{
from: 0,
to: 1
}]
}
win.webContents.print(options, (success, errorType) => {
if (!success) console.log(errorType)
})
@@ -1310,13 +1371,12 @@ win.webContents.print(options, (success, errorType) => {
* `landscape` Boolean (optional) - `true` for landscape, `false` for portrait.
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin.
and `width` in microns.
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
* `pageRanges` Record<string, number> (optional) - The page range to print.
* `from` Number - the first page to print.
* `to` Number - the last page to print (inclusive).
* `from` Number - Index of the first page to print (0-based).
* `to` Number - Index of the last page to print (inclusive) (0-based).
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean (optional) - Whether to print selection only.
@@ -1347,19 +1407,22 @@ An example of `webContents.printToPDF`:
```javascript
const { BrowserWindow } = require('electron')
const fs = require('fs')
const path = require('path')
const os = require('os')
let win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
win.webContents.on('did-finish-load', () => {
// Use default printing options
win.webContents.printToPDF({}).then(data => {
fs.writeFile('/tmp/print.pdf', data, (error) => {
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
fs.writeFile(pdfPath, data, (error) => {
if (error) throw error
console.log('Write PDF successfully.')
console.log(`Wrote PDF successfully to ${pdfPath}`)
})
}).catch(error => {
console.log(error)
console.log(`Failed to write PDF to ${pdfPath}: `, error)
})
})
```
@@ -1373,7 +1436,7 @@ creation:
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.webContents.on('devtools-opened', () => {
win.webContents.addWorkSpace(__dirname)
})
@@ -1418,7 +1481,7 @@ An example of showing devtools in a `<webview>` tag:
<webview id="browser" src="https://github.com"></webview>
<webview id="devtools" src="about:blank"></webview>
<script>
const { webContents } = require('electron').remote
const { ipcRenderer } = require('electron')
const emittedOnce = (element, eventName) => new Promise(resolve => {
element.addEventListener(eventName, event => resolve(event), { once: true })
})
@@ -1427,16 +1490,26 @@ An example of showing devtools in a `<webview>` tag:
const browserReady = emittedOnce(browserView, 'dom-ready')
const devtoolsReady = emittedOnce(devtoolsView, 'dom-ready')
Promise.all([browserReady, devtoolsReady]).then(() => {
const browser = webContents.fromId(browserView.getWebContentsId())
const devtools = webContents.fromId(devtoolsView.getWebContentsId())
browser.setDevToolsWebContents(devtools)
browser.openDevTools()
const targetId = browserView.getWebContentsId()
const devtoolsId = devtoolsView.getWebContentsId()
ipcRenderer.send('open-devtools', targetId, devtoolsId)
})
</script>
</body>
</html>
```
```js
// Main process
const { ipcMain, webContents } = require('electron')
ipcMain.on('open-devtools', (event, targetContentsId, devtoolsContentsId) => {
const target = webContents.fromId(targetContentsId)
const devtools = webContents.fromId(devtoolsContentsId)
target.setDevToolsWebContents(devtools)
target.openDevTools()
})
```
An example of showing devtools in a `BrowserWindow`:
```js
@@ -1521,8 +1594,7 @@ included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> special Electron objects will throw an exception.
The renderer process can handle the message by listening to `channel` with the
[`ipcRenderer`](ipc-renderer.md) module.
@@ -1558,7 +1630,9 @@ app.whenReady().then(() => {
#### `contents.sendToFrame(frameId, channel, ...args)`
* `frameId` Integer
* `frameId` Integer | [number, number] - the ID of the frame to send to, or a
pair of `[processId, frameId]` if the frame is in a different process to the
main frame.
* `channel` String
* `...args` any[]
@@ -1568,9 +1642,8 @@ Send an asynchronous message to a specific frame in a renderer process via
chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or
WeakSets will throw an exception.
> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
> special Electron objects is deprecated, and will begin throwing an exception
> starting with Electron 9.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
The renderer process can handle the message by listening to `channel` with the
[`ipcRenderer`](ipc-renderer.md) module.
@@ -1694,7 +1767,7 @@ Returns `Promise<void>` - resolves if the page is saved.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow()
const win = new BrowserWindow()
win.loadURL('https://github.com')
@@ -1732,7 +1805,7 @@ Returns `Boolean` - If *offscreen rendering* is enabled returns whether it is cu
* `fps` Integer
If *offscreen rendering* is enabled sets the frame rate to the specified number.
Only values between 1 and 60 are accepted.
Only values between 1 and 240 are accepted.
#### `contents.getFrameRate()`
@@ -1789,6 +1862,11 @@ Returns `Promise<void>` - Indicates whether the snapshot has been created succes
Takes a V8 heap snapshot and saves it to `filePath`.
#### `contents.getBackgroundThrottling()`
Returns `Boolean` - whether or not this WebContents will throttle animations and timers
when the page becomes backgrounded. This also affects the Page Visibility API.
#### `contents.setBackgroundThrottling(allowed)`
* `allowed` Boolean
@@ -1825,7 +1903,7 @@ The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
#### `contents.frameRate`
An `Integer` property that sets the frame rate of the web contents to the specified number.
Only values between 1 and 60 are accepted.
Only values between 1 and 240 are accepted.
Only applicable if *offscreen rendering* is enabled.
@@ -1856,3 +1934,8 @@ A [`Debugger`](debugger.md) instance for this webContents.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
#### `contents.backgroundThrottling`
A `Boolean` property that determines whether or not this WebContents will throttle animations and timers
when the page becomes backgrounded. This also affects the Page Visibility API.

View File

@@ -162,10 +162,14 @@ this limitation.
* `error` Error
Returns `Promise<any>` - A promise that resolves with the result of the executed
code or is rejected if execution throws or results in a rejected promise.
code or is rejected if execution could not start.
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
Note that when the execution of script fails, the returned promise will not
reject and the `result` would be `undefined`. This is because Chromium does not
dispatch errors of isolated worlds to foreign worlds.
### `webFrame.setIsolatedWorldInfo(worldId, info)`
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
* `info` Object

View File

@@ -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
@@ -137,7 +137,7 @@ This option is disabled by default in the guest page.
```
A `Boolean`. When this attribute is `false` the guest page in `webview` will not have access
to the [`remote`](remote.md) module. The remote module is available by default.
to the [`remote`](remote.md) module. The remote module is unavailable by default.
### `plugins`
@@ -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`.
* `wordStart` Boolean (optional) - Whether to look only at the start of words.
@@ -560,9 +559,9 @@ Stops any `findInPage` request for the `webview` with the provided `action`.
* `pagesPerSheet` Number (optional) - The number of pages to print per page sheet.
* `collate` Boolean (optional) - Whether the web page should be collated.
* `copies` Number (optional) - The number of copies of the web page to print.
* `pageRanges` Record<string, number> (optional) - The page range to print.
* `from` Number - the start page.
* `to` Number - the end page.
* `pageRanges` Object[] (optional) - The page range to print.
* `from` Number - Index of the first page to print (0-based).
* `to` Number - Index of the last page to print (inclusive) (0-based).
* `duplexMode` String (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
* `dpi` Record<string, number> (optional)
* `horizontal` Number (optional) - The horizontal dpi.
@@ -588,8 +587,8 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
and `width` in microns.
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
* `pageRanges` Record<string, number> (optional) - The page range to print.
* `from` Number - the first page to print.
* `to` Number - the last page to print (inclusive).
* `from` Number - Index of the first page to print (0-based).
* `to` Number - Index of the last page to print (inclusive) (0-based).
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
@@ -755,9 +754,9 @@ Fired when page leaves fullscreen triggered by HTML API.
Returns:
* `level` Integer
* `message` String
* `line` Integer
* `level` Integer - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `message` String - The actual console message
* `line` Integer - The line number of the source that triggered this console message
* `sourceId` String
Fired when the guest window logs a console message.
@@ -816,7 +815,7 @@ const { shell } = require('electron')
const webview = document.querySelector('webview')
webview.addEventListener('new-window', async (e) => {
const protocol = require('url').parse(e.url).protocol
const protocol = (new URL(e.url)).protocol
if (protocol === 'http:' || protocol === 'https:') {
await shell.openExternal(e.url)
}
@@ -968,4 +967,4 @@ Emitted when DevTools is closed.
Emitted when DevTools is focused / opened.
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
[chrome-webview]: https://developer.chrome.com/apps/tags/webview
[chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/

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