Compare commits

...

443 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
30e8011b9f Bump v15.5.6 2022-05-23 08:04:01 -07:00
Keeley Hammond
54432ab8b2 build: fix index upload error on 15-x-y (#34314) 2022-05-23 14:04:05 +02:00
trop[bot]
37558a6215 revert: some frameless windows showing a frame on Windows (#33608)
Revert "fix: some frameless windows showing a frame on Windows (#32692)"

This reverts commit 7c701367c0.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-05-19 10:15:03 +02:00
Darshan Sen
d5ba5c8e0a fix: crash in safeStorage on Linux (#34263) 2022-05-19 10:04:19 +02:00
Sudowoodo Release Bot
b1b83f79b7 Revert "Bump v15.5.6"
This reverts commit ade9151181.
2022-05-18 11:38:29 -07:00
trop[bot]
a85b38847e fix: building with printing disabled (#34273)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-18 09:42:13 -07:00
Sudowoodo Release Bot
ade9151181 Bump v15.5.6 2022-05-18 08:32:28 -07:00
Pedro Pontes
9d2961868c chore: cherry-pick 99c3f3bfd507 from chromium (#34227)
* chore: cherry-pick 99c3f3bfd507 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-05-17 15:15:47 -04:00
Pedro Pontes
cdd6fc93b2 chore: cherry-pick d49484c21e3c from angle (#34014)
Co-authored-by: Electron Bot <electron@github.com>
2022-05-17 13:30:48 -04:00
Pedro Pontes
1e21b7c910 chore: cherry-pick 14e51893e5 from icu (#34224)
* chore: cherry-pick 14e51893e5 from icu

* chore: fixup patch for lint

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-17 11:26:59 -04:00
trop[bot]
c224431ae8 docs: add missing explanation for [angle|dawn]_enable_vulkan_validation_layers = false (#34255)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-17 11:24:32 -04:00
Pedro Pontes
9e0fda8393 chore: cherry-pick ec0cce63f47d from chromium (#34234)
* chore: cherry-pick ec0cce63f47d from chromium

* chore: update patches

* Trigger Build

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-16 18:12:09 -04:00
Pedro Pontes
36b72ba5ee chore: cherry-pick a4f71e40e5 from angle (#34231) 2022-05-16 14:58:12 -04:00
Darshan Sen
dd8c63e15a docs: note safeStorage.isEncryptionAvailable() needs ready event (#34220)
docs: note safeStorage.isEncryptionAvailable() needs ready event (#33724)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-16 12:12:14 -04:00
Pedro Pontes
6bfa54fcf2 chore: cherry-pick a602a068e022 from angle (#34201)
* chore: cherry-pick a602a068e022 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-12 20:19:44 -04:00
Samuel Attard
6d9f3a4945 fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#34191)
fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33367)

* Make ElectronBrowser mojo interface frame associated. (#32815)

Co-authored-by: Marek Haranczyk <marek@openfin.co>

* fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33323) (#33350)

* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames

Notes: no-notes

* refactor: extract electron API IPC to its own mojo interface

* fix: just check main frame not primary main frame

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Marek Haranczyk <marek@openfin.co>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Marek Haranczyk <marek@openfin.co>
2022-05-12 15:26:59 -07:00
Samuel Attard
a20396588a build: improve CI speeds and reduce CI costs (#34184)
build: improve CI speeds and reduce CI costs (#33904) (#33953)

* build: improve CI speeds and reduce CI costs (#33904)

* remove third_party/electron_node:overlapped-checker

target isn't present in older versions

* build: use original arch logic

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Samuel Attard <sattard@salesforce.com>

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-11 12:38:19 -07:00
Sudowoodo Release Bot
f988853128 Bump v15.5.5 2022-05-11 08:31:43 -07:00
trop[bot]
8bc25e8a9d build: change upload-to-s3 vars to upload-to-storage (#34142)
* build: change upload-to-s3 vars to upload-to-az

* build: change upload-to-az to upload-to-storage

* build: change linux-ia32-publish var

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-05-11 10:02:03 -04:00
trop[bot]
a8f8b507aa build: use azure function to hash assets instead of lambda (#34119)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-08 09:30:23 -07:00
trop[bot]
eb320cbbf9 build: stop uploading assets to S3 (#34112)
* build: remove S3 uploads

* build: remove ending slash upload-index-json (#34125)

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-05-07 14:48:27 -07:00
Pedro Pontes
37eab5c66e chore: cherry-pick 5be8e065f43e from chromium (#34040)
* chore: cherry-pick 5be8e065f43e from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-05-05 09:58:08 -04:00
Pedro Pontes
fc912026e2 chore: cherry-pick 5361d836ae from chromium (#34009) 2022-05-04 16:53:02 -07:00
Pedro Pontes
6aa0609a97 chore: cherry-pick 6b66a45021 from chromium (#34075) 2022-05-04 16:30:38 -07:00
trop[bot]
620d615fe0 test: fix nativeModulesEnabled in spec/webview-spec.js (#34063)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-04 11:57:24 -04:00
Sudowoodo Release Bot
ec7baba401 Bump v15.5.4 2022-05-04 08:34:57 -07:00
Pedro Pontes
f8ba4d6012 chore: cherry-pick d27d9d059b51 from angle (#34045)
* chore: cherry-pick d27d9d059b51 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-05-04 16:28:55 +02:00
Pedro Pontes
79af6f3493 chore: cherry-pick 5ff02e4d7368 from chromium (#34019)
* chore: cherry-pick 5ff02e4d7368 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-05-03 23:57:14 -07:00
Pedro Pontes
6a952c4ff1 chore: cherry-pick d24570fb65 from angle (#34037)
* chore: cherry-pick d24570fb65 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-03 16:16:03 -07:00
Pedro Pontes
ce7c83e8d6 chore: cherry-pick 12ba78f3fa7a from chromium (#34051)
* chore: cherry-pick 12ba78f3fa7a from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-03 16:15:53 -07:00
Pedro Pontes
a686f7e102 chore: cherry-pick 1665a1d16d46 from chromium (#33682)
* chore: cherry-pick 1665a1d16d46 from chromium

* chore: update patches

* Trigger Build

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-03 16:40:38 +09:00
trop[bot]
fa07b74836 build: allow script/spec-runner.js with empty list of runners (#33999)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 11:09:21 -04:00
trop[bot]
587353dbc9 spec: allow connections to port 2049 (#33989)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 14:47:39 +09:00
Samuel Attard
21b8b3064d build: use dev-cdn instead of sysroots s3 bucket (#33987)
* build: use dev-cdn instead of sysroots s3 bucket (#33922)

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-02 10:31:34 +09:00
Sudowoodo Release Bot
0f05991c3e Bump v15.5.3 2022-04-29 15:16:22 -07:00
Keeley Hammond
6bdab4a353 build: revert migrate urllib to python3 (#33980)
This reverts commit a29136950e.
2022-04-29 15:04:24 -07:00
Sudowoodo Release Bot
6e5f02426a Revert "Bump v15.5.3"
This reverts commit 30da5dee2a.
2022-04-29 12:33:33 -07:00
Sudowoodo Release Bot
30da5dee2a Bump v15.5.3 2022-04-29 09:14:26 -07:00
Pedro Pontes
bd9c7c41ba chore: cherry-pick 2004594a46c8 from v8 (#33884)
* chore: cherry-pick 2004594a46c8 from v8

* chore: update patches

* Trigger Build

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-29 01:51:41 -07:00
Pedro Pontes
76f4ced8d4 chore: cherry-pick 4d26949260aa from chromium (#33676)
* chore: cherry-pick 4d26949260aa from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-04-28 20:36:58 -04:00
Pedro Pontes
cac38cb6ea chore: cherry-pick 4deb522c22 and d88e959e01 from chromium (#33852)
* chore: cherry-pick d88e959e01 from chromium

* chore: update patches

* chore: update patches

* chore: update patches

* chore: update patches

* chore: update patches

* chore: update patches

* chore: update patches

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-04-28 20:27:49 -04:00
trop[bot]
e8f89da1c4 build: ensure sync-done file exists during git cache save (#33954)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-27 18:27:13 -07:00
Samuel Attard
a0f73938cd build: upload to AZ as well as S3 (#33927)
* build: upload to AZ as well as S3

* build: actually verify az urls too
2022-04-27 10:44:28 -07:00
Samuel Attard
1bf71fa81f build: improve circleci config (#33945)
* build: improve circleci config (#33881)

* build: fix conditional restore of git cache

* build: split lint out of setup.yml

* ci: update release script to handle new CircleCI configs (#33914)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-27 10:13:01 -07:00
Sudowoodo Release Bot
0de8079b33 Revert "Bump v15.5.3"
This reverts commit 52fd3da443.
2022-04-27 09:34:00 -07:00
Sudowoodo Release Bot
52fd3da443 Bump v15.5.3 2022-04-27 08:32:55 -07:00
Pedro Pontes
742aab764e chore: cherry-pick 1a31e2110440 from chromium (#33856)
* chore: cherry-pick 1a31e2110440 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-04-25 09:36:28 +09:00
trop[bot]
1f669c3cc5 chore: use semantic-commit-action (#33863)
* chore: use semantic-commit-action

* Update semantic.yml

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-04-21 14:55:29 -07:00
Pedro Pontes
d26d064082 chore: cherry-pick e42dbcdedb7a from v8 (#33831)
* chore: cherry-pick e42dbcdedb7a from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-04-21 17:24:26 +09:00
Pedro Pontes
a31e722d43 chore: cherry-pick 5cb934a23d from chromium (#33860) 2022-04-21 15:09:55 +09:00
Sudowoodo Release Bot
81b923c8f5 Revert "Bump v15.5.3"
This reverts commit 91cf2e2163.
2022-04-20 16:24:29 -07:00
Pedro Pontes
b745364907 chore: cherry-pick b2d3ef69ef99 from v8 (#33836) 2022-04-20 13:51:53 -07:00
Sudowoodo Release Bot
91cf2e2163 Bump v15.5.3 2022-04-20 08:32:27 -07:00
Pedro Pontes
53af38ad54 chore: cherry-pick 652dd12a85 from chromium (#33670)
Co-authored-by: Electron Bot <electron@github.com>
2022-04-18 12:37:00 +09:00
trop[bot]
2fef020e06 chore: interpret bytes to string (#33772)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-14 06:28:46 -07:00
Pedro Pontes
b60dfe4117 chore: cherry-pick a1dc371d66 from chromium (#33679) 2022-04-14 12:35:40 +02:00
Pedro Pontes
7e123ac6e5 chore: cherry-pick f546ac11eec7 from v8 (#33763)
* chore: cherry-pick f546ac11eec7 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-14 19:17:23 +09:00
trop[bot]
a29136950e build: migrate urllib to python3 (#33741)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-13 10:55:10 -07:00
Jeremy Rose
458a843174 chore: cherry-pick a48de319c521 from pdfium (#33715)
* chore: cherry-pick a48de319c521 from pdfium

* Update config.json

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 12:00:25 +02:00
Pedro Pontes
e11e12d5b3 chore: cherry-pick ac341df436 from webrtc (#33673) 2022-04-12 11:04:40 +02:00
trop[bot]
25ed65150d fix: report more detailed errors in shell.openExternal() on Windows (#33656)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-04-11 08:52:27 -07:00
Jeremy Rose
8737aa046d fix: prevent UAF crash in setCertificateVerifyProc (#33256) 2022-04-06 12:37:25 -07:00
Sudowoodo Release Bot
0d94bdda50 Bump v15.5.2 2022-04-06 08:31:42 -07:00
Jeremy Rose
2c3081afb8 chore: cherry-pick f599381978f2 from v8 (#33606) 2022-04-05 09:42:19 -07:00
John Kleinschmidt
f583acff46 test: disable newly added/failing test on Windows (#33615) 2022-04-05 12:23:31 -04:00
Milan Burda
271e98c059 fix: building with printing disabled (#33603) 2022-04-04 16:40:01 -07:00
trop[bot]
8279c02e9a fix: gn check when //printing component is disabled (#33601)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-04 16:39:40 -07:00
David Sanders
ef4cbe86af fix: on macOS show BrowserWindow on maximize if not currently shown (#33523) 2022-03-30 19:20:28 -04:00
Jeremy Rose
300a40f939 chore: cherry-pick a1427aad7cef from v8 (#33525)
* chore: cherry-pick a1427aad7cef from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-30 19:06:49 -04:00
Sudowoodo Release Bot
79b45ac5f6 Bump v15.5.1 2022-03-30 08:32:53 -07:00
trop[bot]
e5e8dd5156 fix: libuv patches to address child_process.spawn slowness (#33406)
* fix: libuv patches to address child_process.spawn slowness

* chore: backport additional patches

* Update .patches

* chore: update patches

* chore: update patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-29 19:45:46 -04:00
trop[bot]
4e75499270 fix: crash when WindowButtonsProxy references cleared NSWindow (#33487)
* resets WindowButtonsProxy on window delete on macOS

* fixes reset

* chore: empty commit

Co-authored-by: Gellert Hegyi <gellert.hegyi@around.co>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-03-29 19:43:28 -04:00
Sudowoodo Release Bot
1bc5b6177f Bump v15.5.0 2022-03-28 13:24:07 -07:00
Pedro Pontes
5647382a55 chore: cherry-pick 26b7ad6967b1 from v8 (#33473)
* chore: cherry-pick 26b7ad6967b1 from v8

* chore: update patches

* kick lint

* kick lint

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Electron Bot <electron@github.com>
2022-03-28 13:12:10 -07:00
Pedro Pontes
fd272d89bc chore: cherry-pick c46fb3a15ec2 from v8 (#33393)
* chore: cherry-pick c46fb3a15ec2 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-28 12:45:57 -04:00
Calvin
d745647c54 fix: non-client windows messages on legacy widget host (again) (#33449) 2022-03-28 16:34:53 +09:00
trop[bot]
9038bdd7bc fix: use stricter options in SecStaticCodeCheckValidity (#33376)
* fix: use stricter options in SecStaticCodeCheckValidity

* Update patches/squirrel.mac/fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch

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

* Trigger Build

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-25 10:53:56 +01:00
trop[bot]
bbc862c878 test: disable webview.capturePage test (#33433)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-03-24 12:19:24 -04:00
trop[bot]
ff57df1ecb ci: abort CI if goma authentication is invalid (#33417)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-24 09:01:35 -04:00
Milan Burda
37dfd8be4a feat: add nativeTheme.inForcedColorsMode (#32956) (#33360) 2022-03-23 16:55:09 -07:00
Sudowoodo Release Bot
f043e665dd Bump v15.4.2 2022-03-23 08:32:18 -07:00
Pedro Pontes
798f151e05 chore: cherry-pick 2b75a29bf2 from angle (#33390)
* chore: cherry-pick 2b75a29bf2 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-23 09:48:49 -04:00
Robin Ebert
a9a3910aa0 chore: backport dd4c3ddadbb9 from chromium (#33038)
* chore: backport dd4c3ddadbb9 from chromium

* Fix mapping of keymap fd

* Implement a proper wayland keymap fix that doesn't depend on fd permissions

* Close keymap fd at the end of Keymap-event handler
2022-03-23 18:42:26 +09:00
Pedro Pontes
2f28e10543 chore: cherry-pick ca32852e4f from angle (#33222)
Co-authored-by: Electron Bot <electron@github.com>
2022-03-22 20:11:21 -04:00
trop[bot]
f1021b93d0 fix: non-client mouse events on WCO-enabled windows (#33199)
* fix: non-client mouse events on WCO-enabled windows

* chore: cleanup .patches after merge

Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Calvin <clavin@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-22 11:29:04 -04:00
Pedro Pontes
6788561bb3 chore: cherry-pick 161f0866e8 from angle (#33342)
* chore: cherry-pick 161f0866e8 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-22 15:08:45 +09:00
Pedro Pontes
35d3f35a44 chore: cherry-pick 905302eb3a2b from chromium (#33237)
* chore: cherry-pick 905302eb3a2b from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-03-22 08:27:15 +09:00
trop[bot]
f949a1aafd chore: cherry-pick 2ed58f4 from chromium (#33109) (#33248)
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: https://github.com/electron/electron/issues/33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-03-21 11:09:31 +09:00
Pedro Pontes
b8e22532b0 chore: cherry-pick 246c10dede97 from chromium (#33245)
* chore: cherry-pick 246c10dede97 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-03-21 10:26:20 +09:00
trop[bot]
c2758554ed fix: crash when destroying node env with pending promises (#33300)
* fix: crash when destroying node env with pending promises

* chore: add spec

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-21 10:20:30 +09:00
trop[bot]
05cb4240bd build: drop pywin32 usage (#33296)
* build: drop pywin32 usage

* chore: ignore extra output on AppVeyor

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-21 10:16:28 +09:00
trop[bot]
c84b152164 docs: remove "marked" from process.getBlinkMemoryInfo() (#33289)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-17 14:08:45 +01:00
David Sanders
20f8c10977 fix: ensure external memory adjustments are balanced (#33311) 2022-03-16 22:17:18 -07:00
Pedro Pontes
38be2dfb25 chore: cherry-pick eb967bf211 from chromium (#33242) 2022-03-16 12:34:55 +01:00
Jeremy Rose
0c371e53a4 chore: cherry-pick 62142d222a80 from chromium (#33185)
* chore: cherry-pick 62142d222a80 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-03-09 16:27:32 -05:00
Sudowoodo Release Bot
8e517202ea Bump v15.4.1 2022-03-09 07:31:54 -08:00
Jeremy Rose
3410147699 chore: cherry-pick 1887414c016d from chromium (#33178)
* chore: cherry-pick 1887414c016d from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-03-08 14:36:13 -05:00
Jeremy Rose
ce5157236c chore: cherry-pick 49e8ff16f1fe from angle (#33181)
* chore: cherry-pick 49e8ff16f1fe from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-08 10:54:31 -05:00
Jeremy Rose
8ec2469379 chore: cherry-pick 6b2643846ae3 from chromium (#33168)
* chore: cherry-pick 6b2643846ae3 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-07 16:52:22 -08:00
trop[bot]
ddf348d609 fix: really strip crashpad handler binary (#33173)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-03-07 17:05:50 -05:00
trop[bot]
f757a17821 fix: macOS tray icon alternate images (#33104)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-02 12:01:13 -08:00
Sudowoodo Release Bot
8519ba881e Bump v15.4.0 2022-02-28 16:11:36 -08:00
Michaela Laurencin
bd31023314 feat: add WCO height option (#33064)
* feat: add WCO height option (#31222)

* feat: add WCO height option

* add docs and mac functionality

* add macOS functionality and height lowerbound

* Update docs/api/browser-window.md

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

* update macOS functionality

* add chromium related notes

* add test and fix pixel under button bug and fix typo

* revert changes to docs/api/frameless-window.md

* modify `useCustomHeight` calls

* update `useCustomHeight` and `getCurrentMargin`

* modify margin calculation

* fix minimum custom height on macOS

* Update window_buttons_proxy.mm

* fix specified traffic light positions

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

* Update win_caption_button.h

* Update win_caption_button_container.h

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-02-28 11:35:04 -08:00
trop[bot]
fb0eb6c0ca fix: tray garbage collection (#33077)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-24 16:34:27 -05:00
Sudowoodo Release Bot
390349e3db Revert "Bump v15.3.8"
This reverts commit f6e6873971.
2022-02-23 15:45:05 -08:00
Sudowoodo Release Bot
f6e6873971 Bump v15.3.8 2022-02-23 11:30:58 -08:00
Robo
ecd6918166 chore: cherry-pick a1c1ec1ea from chromium (#32800)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3244046

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-22 16:33:44 +09:00
Shelley Vohr
d54f1d58f7 fix: savePage throw on relative paths (#33018) 2022-02-22 16:30:46 +09:00
trop[bot]
5d5b2bf8e5 fix: command string for windows protocol handler (#33011)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-02-22 16:26:43 +09:00
Pedro Pontes
fa37e1533f chore: cherry-pick 11505c3867 from chromium (#32912) 2022-02-21 14:07:46 -08:00
Pedro Pontes
f9cf232597 chore: cherry-pick 05e714a87c from chromium (#32908)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-21 10:41:47 -08:00
trop[bot]
615c15c914 chore: add @electron/wg-security to patches/ CODEOWNERS (#33004)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-21 11:47:52 +01:00
Pedro Pontes
4550baa7a5 chore: cherry-pick be50c60b4225 from chromium (#32917)
* chore: cherry-pick be50c60b4225 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-21 16:46:12 +09:00
Robo
7469c72d80 chore: cherry-pick e8379497e from chromium (#32799)
* chore: cherry-pick e8379497e from chromium

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

* chore: update patches

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-21 16:43:59 +09:00
Robo
bedb5e1055 chore: cherry-pick ebddaedee from v8 (#32797)
* chore: cherry-pick ebddaedee from v8

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

* chore: update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-02-21 16:36:00 +09:00
trop[bot]
6815c823b3 fix: stale renderer process on quit (#32967)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-02-21 10:26:22 +09:00
Cheng Zhao
78c5a2cf4b chore: cherry-pick fix for 1277917 from chromium (#32786)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-18 11:11:54 +09:00
Pedro Pontes
3c3d279182 chore: cherry-pick ebc188ad769e from chromium (#32914)
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-02-17 13:19:27 -08:00
Pedro Pontes
1c7a612931 chore: cherry-pick e3805f29fed7 from chromium (#32901)
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-02-17 10:03:12 -08:00
Cheng Zhao
4615dcbbfd chore: cherry-pick fix for 1281979 from chromium (#32785)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-17 21:07:15 +09:00
Pedro Pontes
3bbe839403 chore: cherry-pick b790affce3 and 9c1efd3def from angle (#32904) 2022-02-17 21:06:21 +09:00
Pedro Pontes
0f5967fce2 chore: cherry-pick 0081bb347e67 from chromium (#32919)
* chore: cherry-pick 0081bb347e67 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-02-17 15:00:09 +09:00
Robo
da171befe7 chore: cherry-pick 1c93e2afc8 from v8 (#32796)
Backports https://chromium-review.googlesource.com/c/v8/v8/+/3338698

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-17 14:53:48 +09:00
Cheng Zhao
c850e2452c chore: cherry-pick fix for 1282354 from chromium (#32783)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-17 14:53:12 +09:00
Cheng Zhao
f3ca6ff998 chore: cherry-pick fix for 1283198 from chromium (#32781)
* chore: cherry-pick fix for 1283198 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-02-16 17:05:14 +09:00
Sudowoodo Release Bot
58e9dedd76 Bump v15.3.7 2022-02-14 11:23:11 -08:00
Cheng Zhao
51a673e7e0 chore: cherry-pick fix for 1283375 from chromium (#32777)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-14 20:04:39 +09:00
Milan Burda
fed01fb57d fix: will-attach-webview handler modifying params.instanceId does not break <webview> (#32386) (#32855) 2022-02-13 22:33:31 -08:00
Micha Hanselmann
65c9f47e15 chore: cherry-pick c1700c5 from v8 (#32770)
* chore: cherry-pick c1700c5 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-02-10 11:27:01 -05:00
Cheng Zhao
1b54c4bc44 chore: cherry-pick fix for 1283371 from chromium (#32779)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-10 10:03:37 -06:00
Robo
f903141394 chore: cherry-pick 06504ff3b1 from chromium (#32793)
* chore: cherry-pick 06504ff3b1 from chromium

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

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-10 22:16:55 +09:00
Robo
6c1f9f8270 chore: cherry-pick 5c41beab6 from chromium (#32798)
* chore: cherry-pick 5c41beab6 from chromium

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

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-10 19:36:18 +09:00
Robo
7432ea43b7 chore: cherry-pick 91fbf1798 and cff03c22c5 from chromium (#32792)
Backports
https://chromium-review.googlesource.com/c/chromium/src/+/3347570
https://chromium-review.googlesource.com/c/chromium/src/+/3348406

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-10 17:22:19 +09:00
Robo
0d1b7be451 chore: cherry-pick efdfe711dc5 from chromium (#32791)
Backports
https://chromium-review.googlesource.com/c/chromium/src/+/3242785
https://chromium-review.googlesource.com/c/angle/angle/+/3242963

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-10 15:13:26 +09:00
Robo
e0a7f869de chore: cherry-pick 349a35b19 from chromium (#32790)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3226142

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-10 09:37:43 +09:00
Jeremy Rose
d9dd6138e2 chore: cherry-pick 9db9911e1242 from chromium (#32741)
* chore: cherry-pick 9db9911e1242 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-02-09 16:49:44 -05:00
trop[bot]
c1651e333b test: disable the test that makes spec runner hang on exit (#32836)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-09 12:11:16 -05:00
trop[bot]
c0ea40e71d build: rebuild the dist_zips when the deps get modified (#32819)
* build: rebuild the dist_zips when the deps get modified

The dist.zip generated by the electron_dist_zip action was not getting
updated when changes were being made to the dependencies, like the
source files. It turns out, we were using data_deps for the dependencies
instead of deps. Here is the difference:

data_deps: things needed to ultimately run the thing built by a target
deps: things needed to build the target

So the difference in treatment of both sets of dependencies is actually
intentional.

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

* fixup! build: rebuild the dist_zips when the deps get modified

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

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-02-09 11:13:28 -05:00
Robo
501bb98a10 chore: cherry-pick 5f8ddef5a6 from chromium (#32789)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3193885

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-09 13:04:10 +09:00
Robo
9fe9a0ccc1 chore: cherry-pick ce8b70863 from angle (#32795)
Backports https://chromium-review.googlesource.com/c/angle/angle/+/3335173
2022-02-09 09:41:57 +09:00
Robo
f6d2b9dc63 chore: cherry-pick 55f6cb37 from chromium (#32794)
* chore: cherry-pick 55f6cb37 from chromium

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

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-02-09 09:41:24 +09:00
Jeremy Rose
b04be1dff6 chore: cherry-pick 27bc67f761e6 from v8 (#32739)
* chore: cherry-pick 27bc67f761e6 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-02-09 09:40:26 +09:00
Cheng Zhao
656463c2f4 chore: cherry-pick fix for 1284367 from chromium (#32775) 2022-02-08 11:32:00 -05:00
trop[bot]
a0e9cc6c02 fix: WCO window hover on window controls on Windows (#32717) 2022-02-03 10:06:48 +01:00
trop[bot]
27e2c79dd0 docs: fix missing tag end in clipboard example (#32693)
Co-authored-by: Paul Hollinsky <paulhollinsky@gmail.com>
2022-02-02 10:13:58 -05:00
trop[bot]
d74441f00e docs: fix typo in BrowserWindow description (#32697)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
2022-02-02 10:09:58 -05:00
trop[bot]
97e52764a8 fix: some frameless windows showing a frame on Windows (#32708)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-02 15:38:37 +01:00
trop[bot]
112392c414 fix: expose all serial devices to setDevicePermissionHandler (#32686)
* fix: expose all serial devices to setDevicePermissionHandler

* Trigger Build

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-02-01 19:28:20 -05:00
trop[bot]
42c2eecdef fix: transparent window max/unmax event firing (#32688)
* fix: transparent window max/unmax event firing

* chore: fixup tests

* Update spec-main/api-browser-window-spec.ts

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-02-01 20:21:42 +09:00
trop[bot]
98603c645e fix: missing comma in config.py (#32676)
* Fix missing comma

Co-authored-by: Marek Šuppa <mrshu@users.noreply.github.com>
2022-02-01 17:52:59 +09:00
trop[bot]
11391e7351 docs: update context bridge docs about Promises and Errors (#32533) (#32646)
* Update context bridge docs about Promises

From my testing it doesn't remove Promises in nested objects,
also according to the test suite it does not:
80577a4f08/spec-main/api-context-bridge-spec.ts (L693)

* docs: Update docs for errors too

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-01-28 19:59:28 +09:00
Sudowoodo Release Bot
a636ab7c61 Bump v15.3.6 2022-01-27 09:46:32 -08:00
trop[bot]
53e39eb9c0 ci: update ts-compile-doc-change to properly use src cache (#32625)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-26 10:30:22 -05:00
trop[bot]
cccd74e6a6 fix: webContents.setZoomFactor crash (#32619)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-26 20:05:49 +09:00
trop[bot]
1efa631b56 fix: crash when saving edited PDF files (#32537)
* fix: crash when saving edited PDF files

* chore: update patches after backport

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-26 20:03:37 +09:00
trop[bot]
221d2220e1 fix: make window without rounded corners closable (#32610)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-01-26 20:03:12 +09:00
trop[bot]
ae3ee8ad00 test: disable flaky test on WOA (#32562)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-25 13:31:02 -05:00
Jeremy Rose
b39a34650f chore: cherry-pick c5571653d932 from chromium (#32353)
* chore: cherry-pick c5571653d932 from chromium

* fix patch

* Update cherry-pick-c5571653d932.patch

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-01-24 13:16:38 -05:00
trop[bot]
8292b3dc0c fix: strip crashpad_handler binary (#32548)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-01-24 20:06:55 +09:00
David Sanders
8653dfc8b3 docs: fix anchors for broken relative links (#32568) 2022-01-24 19:59:27 +09:00
trop[bot]
1ef9a756e5 ci: call autoninja without ninjalog_uploader_wrapper.py (#32573)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-24 19:55:03 +09:00
Pedro Pontes
fdfa5d41d4 chore: cherry-pick cc44ae61f37b from angle (#32546)
* chore: cherry-pick cc44ae61f37b from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-01-20 11:08:23 -08:00
trop[bot]
86e10b06dd fix: check for maximized window before unmaximizings (#32494)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-01-19 10:39:04 -05:00
Shelley Vohr
d2497a14e0 fix: maximize/unmaximize firing on linux (#32498) 2022-01-19 10:30:47 -05:00
trop[bot]
5963024ac7 docs: fix broken images for symbol server setup (#32524)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-01-18 15:24:12 -05:00
trop[bot]
26690b12f2 fix: Corrupted title of alert dialog (#32468)
Co-authored-by: Takao Baba <babatakao@gmail.com>
2022-01-17 16:34:26 +09:00
trop[bot]
1a148a8232 fix: optional postMessage transfer arg (#32458)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-01-14 09:42:37 +09:00
Pedro Pontes
cff70f15aa chore: cherry-pick f0a63e1f361f from chromium (#32012)
* chore: cherry-pick f0a63e1f361f from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-13 18:39:01 +09:00
trop[bot]
a6f094c983 fix: use setAspectRatio for frameless window on mac (#32445)
* fix(window): setAspectRatio for frameless windows

* dummy

* undo dummy

Co-authored-by: Gellert Hegyi <gellert.hegyi@around.co>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-01-13 17:19:12 +09:00
Pedro Pontes
04dcbe4c74 chore: cherry-pick 27eb11a28555 from chromium (#32015)
* chore: cherry-pick 27eb11a28555 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-13 09:36:39 +09:00
Pedro Pontes
28def9ed7d chore: cherry-pick 855df1837e from chromium (#32032)
Co-authored-by: Electron Bot <electron@github.com>
2022-01-12 16:45:06 +09:00
trop[bot]
2089370bbb build: pin colors to v1.4.0 in package.json (#32424)
* pin colors to v1.4.0 in packae.json

Fixes #32416

* fixup! pin colors to v1.4.0 in packae.json

update yarn.lock too

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-01-12 16:44:27 +09:00
Pedro Pontes
837dc05204 chore: cherry-pick bdffa0ea5148 from angle (#32184)
* chore: cherry-pick bdffa0ea5148 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-12 16:42:40 +09:00
Sudowoodo Release Bot
9f08e46018 Bump v15.3.5 2022-01-11 11:18:16 -08:00
trop[bot]
6a70d8a6ca fix: incorrect skipTransformProcessType option parsing in win.setVisibleOnAllWorkspaces() (#32396)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-01-11 14:45:25 +09:00
Pedro Pontes
aab276c532 chore: cherry-pick da11d71a0227 from chromium (#32181)
* chore: cherry-pick da11d71a0227 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-11 14:43:57 +09:00
Pedro Pontes
053fea1b44 chore: cherry-pick 05e69c75905f from angle (#32190)
* chore: cherry-pick 05e69c75905f from angle

* chore: update patches

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-11 14:42:40 +09:00
Pedro Pontes
0b0e991a54 chore: cherry-pick 809830f1b3 from webrtc (#32226)
* chore: cherry-pick 809830f1b3 from webrtc

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-01-11 14:40:54 +09:00
Pedro Pontes
ec7408a2d4 chore: cherry-pick 891020ed64d4 from angle (#32223)
* chore: cherry-pick 891020ed64d4 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-01-10 17:01:35 -05:00
Milan Burda
250b7ed3db docs: left is a valid mode in contents.openDevTools() options (#32372) (#32404) 2022-01-10 16:54:07 -05:00
Pedro Pontes
d136430b35 chore: cherry-pick dbde8795233a from chromium (#32210)
* chore: cherry-pick dbde8795233a from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-10 11:10:32 +01:00
Pedro Pontes
79abfe7ac8 chore: cherry-pick 05ccacee14 from v8. (#32216)
Co-authored-by: Electron Bot <electron@github.com>
2022-01-10 11:07:14 +01:00
trop[bot]
a18a4609ad fix: Allow npm_config_arch override on mac (#32380)
If the npm_config_arch environment variable is set on Mac, then use the
specified architecture rather than overriding it to x64.

Co-authored-by: Tommy MacWilliam <tommy@serenade.ai>
2022-01-10 10:49:30 +01:00
Pedro Pontes
cdf661939d chore: cherry-pick 6bb320d134b1 from chromium (#32009)
* chore: cherry-pick 6bb320d134b1 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-06 09:47:14 -05:00
Pedro Pontes
98cf0e5dff chore: cherry-pick 2b98abd8cb6c from angle (#32187)
* chore: cherry-pick 2b98abd8cb6c from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-01-06 13:34:35 +01:00
trop[bot]
be9dccfcc6 fix: rename patch file to .patch to conform to naming standard which utilizes .gitattributes settings (#32346)
* Rename patch file to .patch to conform to naming standard which utilizes .gitattributes settings

* chore: remove backported patches

* chore: rename patch (don't re-add)

Co-authored-by: stsean <stsean@justin.tv>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-01-06 09:19:17 +09:00
Pedro Pontes
e4bb98195f chore: cherry-pick 109fde1088be from chromium (#32011)
* chore: cherry-pick 109fde1088be from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-01-05 13:50:59 -05:00
trop[bot]
099560c59c fix: crash caused by app.getLocaleCountryCode() (#32332)
CFLocaleGetValue() returned null and crashed the process when
app.getLocaleCountryCode() was run on a CircleCI metal resource class
macOS instance with Xcode 12.5.1. This change fixes that logic and adds
further checks to make the code future-proof.

Here too people are complaining that the returned country code migth be
null: https://stackoverflow.com/questions/15202454/nslocalecountrycode-returns-nil

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

Co-authored-by: Darshan Sen <darshan.sen@postman.com>
2022-01-05 18:35:00 +09:00
trop[bot]
efd276d31f fix: #32141 register wrong command for setAsDefaultProtocolClient for windows (#32330)
Co-authored-by: Shubham-Kumar-2000 <shukhu10@gmail.com>
2022-01-04 16:09:13 +09:00
Pedro Pontes
e2cb43768d chore: cherry-pick 2b978fb482 from chromium (#32232)
Co-authored-by: Electron Bot <electron@github.com>
2022-01-04 10:09:05 +09:00
Cheng Zhao
e654f5ecb3 fix: window.open not overriding parent's webPreferences (#32109) 2022-01-04 09:18:38 +09:00
Pedro Pontes
f74940b536 chore: cherry-pick f781748dcb3c from chromium (#32257)
* chore: cherry-pick f781748dcb3c from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-01-03 12:01:51 -05:00
Pedro Pontes
fe8508a287 chore: cherry-pick 04a58fedd5 from v8 (#32235) 2022-01-03 09:43:48 -05:00
trop[bot]
d5dd50f87e fix: check for single bluetooth listener (#32245)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2022-01-03 10:29:19 +01:00
trop[bot]
952994c591 fix: older systems crash when playing media files (#32213)
* fix: win7 crash when playing media

* reset

* chore: update patches

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-12-17 13:30:03 -08:00
Sudowoodo Release Bot
536b5c4e3b Bump v15.3.4 2021-12-16 09:06:05 -08:00
trop[bot]
210bae878f fix: ensure bluetooth devices are not returned by default (#32197)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-12-15 19:51:28 -08:00
trop[bot]
9b78227260 docs: Fix environment variable name (#32161)
The names of environment variables are case-sensitive on Linux and Mac.

Co-authored-by: stephen9357 <stephen9357@gmail.com>
2021-12-14 19:42:16 +09:00
Keeley Hammond
0a50571460 build: add CI path-filtering for docs-only changes (#32056)
* build: add CI path-filtering for docs-only changes (#31741)

build: (wip) initial dynamic config research

* build: (wip) test path filtering option

* build: (wip) remove doc-only script, use path filtering to check changes

* build: (wip) add docker image with Electron dependencies

* build: (wip) clean up config

* build (wip): readd parameters, executors and env*s

* build: re-add steps and commands

* build: change doc-only to ts-compile-doc-only

* build: re-add workflows and jobs

* build: split configs to setup & build

* build: move lint to "always run" config

* build: clean up, remove old reference config

* build: bump to path-filtering 0.1.0

* build: remove ts-compile step from build-linux

* build: remove nightly-linux-release-test, linux-checks-nightly

* build: don't run build on publish

* build: set base-revision to main (runs branch vs commit)

* build: update config from chromium roll

* build: don't use python3 on sync-step

reverts ea6087e343. This commit was added in
the Nov. 23, 2021 Chromium roll in main, and doesn't apply to 15-x-y

* build: account for path-filtering workflow in release-build script (#32063)

* build: account for path-filtering workflow in release-build script

* build: update syntax for workflow id

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

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

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-12-06 11:36:18 +09:00
trop[bot]
248a6012d5 fix: gtk_native_dialog_run() calls show() internally (#32081)
In the synchronous code path, gtk_native_dialog_run() will call
gtk_native_dialog_show(). Previously this was causing an assertion to be
hit at run time.

Co-authored-by: Tristan Partin <tristan@partin.io>
2021-12-06 11:29:54 +09:00
Sudowoodo Release Bot
ed52801e09 Bump v15.3.3 2021-11-30 12:57:10 -08:00
trop[bot]
6226507536 fix: aspect ratio when max width/height is set (#31956)
* fix: fix aspect ratio when max width/height is set

Add the native frame border size to the minimum and maximum size if
the view reports its size as the client size. It allows to enlarge
window to proper values when aspect ratio and max width/height are
set. It also fixes DCHECK which was triggered when user tried to
enlarge window above dimensions set during creation of the
BrowserWindow.

* chore: update patches

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-11-24 15:42:20 -05:00
Pedro Pontes
098a118dce chore: cherry-pick 56de3b2004, bbca3704f9 and f2b0985ac3 from chromium (#31919)
Co-authored-by: Electron Bot <electron@github.com>
2021-11-24 10:49:13 -05:00
Pedro Pontes
56e08fe5f1 chore: cherry-pick 1fcfb942bd from chromium (#31927) 2021-11-22 16:22:03 -05:00
trop[bot]
8dba1cf5fa fix: ninja build failed on some system (#31942)
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2021-11-22 16:16:21 -05:00
Pedro Pontes
1fc7634f69 chore: cherry-pick 1a8af2da50e4 from chromium (#31902)
* chore: cherry-pick 1a8af2da50e4 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-11-22 08:29:39 -08:00
Pedro Pontes
52e443ec52 chore: cherry-pick 5d2b5e7c006c from v8 (#31910)
* chore: cherry-pick 5d2b5e7c006c from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-11-22 01:44:38 -08:00
Pedro Pontes
16be926e0a chore: cherry-pick a5f54612590d from chromium (#31899) 2021-11-22 01:36:15 -08:00
trop[bot]
5c2d65c749 fix: BrowserView setBackgroundColor needs two calls (#31946)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-22 16:41:33 +09:00
trop[bot]
7bf1d3c110 fix: lint Objective-C header files (#31938)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-22 16:35:19 +09:00
trop[bot]
92969d6032 docs: fix typo in distribution docs (#31879)
Co-authored-by: Sergey Zolotarev <sryze@protonmail.com>
2021-11-18 20:32:17 +09:00
trop[bot]
b48d0f2cbe fix: setContentProtection affects BrowserWindow frame (#31830)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2021-11-17 19:36:25 +09:00
Shelley Vohr
ff8594b11b chore: fix malformed mojom::CreateNewWindowParams patch (#31843)
* chore: fix malformed mojom::CreateNewWindowParams patch

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-11-16 20:39:31 +01:00
trop[bot]
a41f04028e chore: use std::forward() in ConvertToV8() (#31856)
The variable `input` is accepted by a universal reference, so it doesn't
make sense to cast a potential lvalue reference into an rvalue
reference. In case `input` is an lvalue reference, we should rather
forward the value as is to `ToV8()`.

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

Co-authored-by: Darshan Sen <darshan.sen@postman.com>
2021-11-16 10:03:36 -05:00
Sudowoodo Release Bot
1f320e0688 Bump v15.3.2 2021-11-15 15:45:07 -08:00
Shelley Vohr
1f23e83ef9 fix: BrowserView setBackgroundColor() (#31844) 2021-11-15 10:32:56 -08:00
trop[bot]
11ea44925b fix: make BrowserView aware of owning window (#31841)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-15 10:32:30 -08:00
trop[bot]
21a6c6dc76 fix: in GTK open dialog, do not preview huge files (#31820)
* fix: in GTK open dialog, do not preview huge files

Previewing images whose files are larger than a GB can crash Electron.

* refactor: tweak CanPreview()

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-11-15 10:48:27 -06:00
trop[bot]
057c24feec fix: media shouldn't open permissions dialog (#31836)
* fix: media shouldn't open permissions dialog

Playing media shouldn't open Accessibility permissions dialog on macOS.
However, we still need to watch for media events, just not globally and
`media_keys_listener_` is an API over global capture of the media keys.

The fix is to let chromium call `UpdateWhichKeysAreListenedFor` which
will call `UpdateSystemMediaControlsEnabledControls` and watch for
events on `system_media_controls_` without triggering permissions popup.

* chore: update patches

* chore: update patches

Co-authored-by: Fedor Indutny <fedor@indutny.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-11-15 08:20:38 -08:00
trop[bot]
69014e7aad fix: correct default text for button labels in gtk dialogs (#31823) 2021-11-15 16:19:21 +01:00
trop[bot]
ec293f4de0 fix: crash on browserView.webContents.destroy() (#31826)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-15 16:18:54 +01:00
trop[bot]
15038974ad chore: cleanup obsolete lib/common/remote/ipc-messages.ts (#31766)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-09 11:37:06 -05:00
trop[bot]
d2287a1935 test: fix crash in electron::NativeWindowMac::Close() (#31760)
* test: fix crash in electron::NativeWindowMac::Close()

* remove extra close

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-09 11:25:15 -05:00
Sudowoodo Release Bot
e298bf46e4 Bump v15.3.1 2021-11-08 09:26:37 -08:00
trop[bot]
5426d2c920 fix: clipboard.writeBuffer raw format access (#31720)
* fix: clipboard.writeBuffer raw format access (#31116)

* fix: clipboard.writeBuffer raw format access

* test: clipboard.writeBuffer raw format access

* test: clipboard win32 test skip

* fixup spec

* cleanup patch

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

* fixup .patches file

Co-authored-by: henrit <henrit@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-08 11:36:14 -05:00
Milan Burda
3e0a2edec4 fix: <webview> background transparency (#31701)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-11-05 14:43:08 -07:00
trop[bot]
f74d89ba80 fix: crash dump location on Linux (#31712)
* fix: crash dump location on Linux

* fix: ignore client_id for Zygote process

* chore: update comment

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-11-04 17:18:50 -04:00
trop[bot]
4e14dca687 test: deflake <webview> tag loads devtools extensions on WOA (#31716)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-04 16:36:11 -04:00
Pedro Pontes
1aaf1e7241 chore: cherry-pick 91dd4f79ab5b from chromium (#31680)
* chore: cherry-pick 91dd4f79ab5b from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-11-04 14:28:26 -04:00
Keeley Hammond
1e7c8a3c63 docs: update test automation doc (#31506) (#31699)
* Update WebdriverIO documentation

* Update docs/tutorial/using-selenium-and-webdriver.md

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

* Update docs/tutorial/using-selenium-and-webdriver.md

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

* docs: update automated testing docs

* lint

* update

* Update docs/tutorial/automated-testing.md

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* fixes

Co-authored-by: Christian Bromann <github@christian-bromann.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

Co-authored-by: Christian Bromann <github@christian-bromann.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-11-04 09:52:23 -07:00
trop[bot]
8496a12321 fix: incorrect Content-Disposition serialization (#31693)
* fix: incorrect Content-Disposition serialization

* test: fixup test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-04 10:00:12 +09:00
trop[bot]
98bab0ca28 fix: do not run dialog callback inside transaction commit (#31658)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-11-02 13:22:23 +01:00
trop[bot]
a630db8c86 test: fix test-datetime-change-notify after daylight change (#31655)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-01 20:57:41 -04:00
trop[bot]
7e19dbad6f fix: use disable-hid-blocklist to allow FIDO devices (#31649)
* fix: use disable-hid-blocklist to allow FIDO

* Trigger Build

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-01 17:09:53 -04:00
Milan Burda
2b8fc8a139 chore: update chore_add_context_to_context_aware_module_prevention.patch (#31579) (#31628)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-11-01 15:39:42 -04:00
trop[bot]
30b9d15af0 fix: crash on close window when webContents destroyed (#31644)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-01 15:30:46 -04:00
trop[bot]
bcf04f5878 fix: clipboard.read() to recognize custom types (#31651)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-01 13:45:48 -04:00
Shelley Vohr
9fba8b35cb fix: silent print settings (#31616) 2021-11-01 10:03:27 -04:00
trop[bot]
ad3563687f docs: link to Apple developer docs for app.ready event (#31599)
Changes some links around. There was no link for `NSUserNotification`, and
`UNNotificationResponse` incorrectly linked to our own `NotificationResponse`
API structure doc.

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-10-28 11:17:10 +09:00
trop[bot]
4e2c19944f fix: clipboard.read() crash (#31591)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-26 11:29:58 -04:00
trop[bot]
95814288cf build: retry hasher function if it fails first time (#31582)
* build: retry hasher function if it fails first time

* Update script/release/get-url-hash.js

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

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-10-26 17:40:41 +09:00
trop[bot]
b711b8f98d docs: win.getParentWindow() returns BrowserWindow | null (#31576)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-26 17:38:12 +09:00
Pedro Pontes
a1744e5de0 chore: cherry-pick 36028012d897 from chromium (#31539)
Co-authored-by: Electron Bot <electron@github.com>
2021-10-25 13:27:14 -04:00
trop[bot]
e9446f0dc4 fix: MediaMetadata not working properly (#31534)
* fix: MediaMetadata not working properly

* chore: update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-10-25 16:55:16 +02:00
Pedro Pontes
1cda1d0e86 chore: cherry-pick 0894af410c4e from chromium (#31543)
* chore: cherry-pick 0894af410c4e from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-10-25 13:03:10 +02:00
Pedro Pontes
c2023dd9f5 chore: cherry-pick 8af66de55aad from chromium (#31523)
* chore: cherry-pick 8af66de55aad 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-10-25 09:47:11 +09:00
Pedro Pontes
c98059abd9 chore: cherry-pick c69dddfe1cde from chromium (#31519)
* chore: cherry-pick c69dddfe1cde 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-10-22 21:19:03 +09:00
Pedro Pontes
df726b619d chore: cherry-pick 6de4e210688e from v8 (#31501)
* chore: cherry-pick 6de4e210688e from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2021-10-22 21:14:15 +09:00
trop[bot]
c2b1db192d fix: event with invalid timestamp in trace log (#31422)
* fix: event with invalid timestamp in trace log

When node is started within Electron's environment it doesn't
initialize v8 and time of v8's start is never set. As a result
we log v8's start time as 0 and it breaks timestamps in the
trace log. With this change we log v8's start time only when
it was initialized by node.

* fixup patches for 15-x-y

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-10-22 21:13:02 +09:00
Pedro Pontes
235c32ee55 chore: cherry-pick 29be6884cb8a from v8 (#31516) 2021-10-21 16:08:48 -04:00
Pedro Pontes
7e66d6a952 chore: cherry-pick 2e7c9b33453b from chromium (#31497)
* chore: cherry-pick 2e7c9b33453b from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-10-21 15:15:43 -04:00
Erick Zhao
0db4d5add5 docs: add window customization guide (#31054) (#31507)
* docs: add window customization guide

* fixes

* Update docs/api/browser-window.md

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

* Update docs/api/browser-window.md

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

* Update docs/fiddles/windows/manage-windows/frameless-window/index.html

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* Update docs/tutorial/window-customization.md

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

* fix code fence

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

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-10-21 14:07:57 -04:00
trop[bot]
9380803004 feat: warn when ipcRenderer.sendSync() called with no listeners for channel (#31434)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-21 09:09:01 +09:00
trop[bot]
2a12d5fa7f fix: ensure TracingAgent in place for SWs (#31476)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-21 09:07:41 +09:00
trop[bot]
93e8de87a5 fix: remove 'NOTREACHED()' from 'GetWindowResizeEdge' (#31480)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-10-21 09:05:45 +09:00
Sudowoodo Release Bot
b6c9110923 Bump v15.3.0 2021-10-20 07:51:47 -07:00
Keeley Hammond
5e815df20f fix: don't use private enterprise APIs in MAS build (#31483) 2021-10-19 23:14:22 -07:00
trop[bot]
e676b3862c fix: link to image windows progress bar image was linked with square brackets [] insted of parenthesis () and to github asset storage instead of local image directory. (#31472)
Co-authored-by: Daniel Ramp <12480131+DanielRamp@users.noreply.github.com>
2021-10-19 20:40:12 +09:00
trop[bot]
cd8f678a8d Avoid Undefined Variable In printToPdf Example (#31465)
Co-authored-by: universalstrapping <90921972+universalstrapping@users.noreply.github.com>
2021-10-19 17:41:24 +09:00
trop[bot]
79554ba989 fix: add isDestroyed check (#31468)
* Added isDestroyed check

fix: https://github.com/electron/electron/issues/31196

* fix: unregister frame name

Unregister the frame name so that we do not accidentally unregister the wrong window later on in case there is a timing issue with the events

* fix; check if webContents is destroyed

* fix: check if window/webContents is destroyed

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

Co-authored-by: t57ser <seve@live.at>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-10-19 17:39:49 +09:00
Cheng Zhao
ad67a27dcf fix: generate valid config.gypi (#31442) 2021-10-19 09:39:47 +09:00
trop[bot]
c9476eb821 fix: also pass securityOrigin to media permissions request handler (#31417)
Co-authored-by: Maxime Serrano <mserrano@alumni.cmu.edu>
2021-10-15 13:31:48 +09:00
John Kleinschmidt
2c6321c9af chore: refactor persisting permission granted to serial ports (#31418)
(cherry picked from commit 515785aabe)
2021-10-15 09:07:24 +09:00
trop[bot]
715de396d4 fix: mac window crash native theme update (#31429)
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-10-15 09:06:05 +09:00
Sudowoodo Release Bot
98d6b9bf15 Bump v15.2.0 2021-10-14 12:54:57 -07:00
trop[bot]
a05ed73f43 fix: reset render_frame_disposed_ after render frame host change (#31426)
* fix: reset render_frame_disposed_ after hang

* fix: handle exception in webContents.send

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-10-14 12:52:46 -07:00
trop[bot]
f7fdd34c45 docs: update Versioning doc (#31388)
* fix information

* move historical section to bottom

* Update docs/tutorial/electron-versioning.md

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: fix small typo

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-10-13 11:24:56 +09:00
trop[bot]
55e6ce81e0 fix: black window on screen capture when content protection is enabled (#31385)
Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
2021-10-12 09:09:10 +09:00
trop[bot]
b5c81db591 feat: add commandLine.removeSwitch (#31326)
* feat: add commandLine.removeSwitch

In some cases apps may want to remove Chromium command line switches to avoid certain Chromium behaviors being used, E.g. remote-debugging-port or gpu-launcher

* fix: add missing removeSwitch to app.ts

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-12 09:05:52 +09:00
electron-roller[bot]
cffbeeaefa chore: bump chromium to 94.0.4606.81 (15-x-y) (#31351) 2021-10-11 13:28:17 +02:00
trop[bot]
c81380848f fix: correctly notify WebViewGuestDelegate when webview is detached (#31376)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-10-11 14:35:33 +09:00
Milan Burda
45a1d81315 docs: nativeWindowOpen default was changed in Electron 15 (#31345) (#31367)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2021-10-10 15:50:48 -07:00
Sudowoodo Release Bot
ded013e4a7 Bump v15.1.2 2021-10-08 09:10:28 -07:00
Samuel Attard
2cabee9128 chore: cherry-pick 39090918efac from chromium (#31297)
* chore: cherry-pick 39090918efac from chromium

* chore: cherry-pick ec42dfd3545f from chromium

* chore: reconcile FPS patch differences

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2021-10-08 09:07:58 -07:00
trop[bot]
0c9571c89f docs: add missing 'context-menu' event to webview-tag.md (#31309)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-08 08:57:45 -07:00
electron-roller[bot]
c93204ec0d chore: bump chromium to 94.0.4606.71 (15-x-y) (#31234)
* chore: bump chromium in DEPS to 94.0.4606.71

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-10-07 22:02:54 -04:00
trop[bot]
3c47d9e0d7 fix: crash on missing render frame (#31334)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-07 20:15:48 +02:00
Robo
9c54bf7973 refactor: only access memory coordinator interface from browser process (#31295) (#31303)
Refs https://chromium-review.googlesource.com/c/chromium/src/+/3174305
2021-10-06 15:44:14 -07:00
trop[bot]
d6f44a75d2 test: add missing context-menu event spec for <webview> (#31306)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-06 15:16:28 -05:00
trop[bot]
259f27070c chore: add logging for print_backend failures (#31286)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-06 16:55:17 +02:00
trop[bot]
6d1fa337c2 fix: return HTNOWHERE in resize hit test to allow draggable regions to kick in when required (#31299)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-10-06 09:22:21 +09:00
Sudowoodo Release Bot
b51f82c73f Bump v15.1.1 2021-10-04 12:42:12 -07:00
trop[bot]
e19f7fbaf7 fix: "Failed to serialize arguments" when emitting 'context-menu' for webview (#31259) (#31279)
* fix: sanitize params for 'context-menu' event sent over IPC for webview

* Revert "fix: sanitize params for 'context-menu' event sent over IPC for webview"

This reverts commit 7fee455138.

* fix: make frame property non-enumerable in params for 'context-menu' event

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-04 15:40:46 -04:00
trop[bot]
955d6c82ff fix: dialog is not defined (#31272)
Corrects the following error in Electron Fiddle:

```
Uncaught Exception:
ReferenceError: dialog is not defined
...
```

Co-authored-by: Ryan Johnson <CITguy@users.noreply.github.com>
2021-10-04 12:14:59 +09:00
trop[bot]
5fbb4fd8c9 fix: fix typo in description of secureDnsMode (#31267)
Co-authored-by: Tobias Nießen <tniessen@users.noreply.github.com>
2021-10-04 12:13:57 +09:00
Robo
9407a3ee09 fix: remove expired DST Root CA X3 (#31219)
* Revert "fix: Enable X509_V_FLAG_TRUSTED_FIRST flag in BoringSSL (#31218)"

This reverts commit d788d817ee.

* fix: remove expired DST Root CA X3
2021-10-01 07:56:31 -07:00
Sudowoodo Release Bot
86bb866ffb Bump v15.1.0 2021-10-01 07:32:00 -07:00
Keeley Hammond
2b22f02354 Revert "Bump v15.1.0" (#31238)
This reverts commit c3ee7b4bd1.
2021-10-01 10:29:43 -04:00
Sudowoodo Release Bot
c3ee7b4bd1 Bump v15.1.0 2021-09-30 14:38:16 -07:00
trop[bot]
d788d817ee fix: Enable X509_V_FLAG_TRUSTED_FIRST flag in BoringSSL (#31218)
* fix: Enable X509_V_FLAG_TRUSTED_FIRST flag in BoringSSL

Fixes: https://github.com/electron/electron/issues/31212
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

* Update .patches

Co-authored-by: Juan Cruz Viotti <jv@jviotti.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-09-30 17:00:29 -04:00
trop[bot]
6fbd50ab37 fix: draggable regions in BrowserViews are independent (#31198)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-30 12:04:29 -04:00
trop[bot]
097fd4c206 fix: first mouse not dragging BrowserView (#31100)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-30 11:06:04 -04:00
Alexey Kuzmin
844d104d06 chore: fix pylint (#31207)
* chore: fix pylint

* chore: fix linter errors
2021-09-30 09:48:59 -04:00
trop[bot]
b62cef5a01 fix: running tests with release build (#31140)
* fix: running tests with release build

* Update electron_api_v8_util.cc

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-29 17:18:06 -04:00
Keeley Hammond
4cdb2c4bd4 chore: remove gin::Wrappable crash keys (#31075) (#31189) 2021-09-29 17:06:46 -04:00
Darshan Sen
bc655b8eaf refactor: make InitWithWebContents and InspectableWebContents take a unique_ptr (#30920) (#31124)
* refactor: make InitWithWebContents take a unique_ptr

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

* refactor: make InspectableWebContents take a unique_ptr

Signed-off-by: Darshan Sen <darshan.sen@postman.com>
2021-09-29 17:05:53 -04:00
trop[bot]
4891e92f32 feat: add width option to dialog.showMessageBox() (#31088)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-29 14:28:16 -04:00
John Kleinschmidt
62b88b2a0b feat: add support for WebHID (#30213) (#31095)
* feat: add support for WebHID

* Apply suggestions from code review

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

* Address review feedback

* Address review feedback

* chore: clear granted_devices on navigation

Also added test to verify devices get cleared

* fixup testing for device clear

* make sure navigator.hid.getDevices is run on correct frame

* clear granted devices on RenderFrameHost deletion/change

* manage device permissions per RenderFrameHost

This change makes sure we don't clear device permission prematurely due to child frame navigation

* Update shell/browser/api/electron_api_web_contents.cc

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

* apply review feedback from @zcbenz

* Match upstream ObjectMap

This change matches what ObjectPermissionContextBase uses to cache object permissions: https://source.chromium.org/chromium/chromium/src/+/main:components/permissions/object_permission_context_base.h;l=52;drc=8f95b5eab2797a3e26bba299f3b0df85bfc98bf5;bpv=1;bpt=0

The main reason for this was to resolve this crash on Win x64:
ok 2 WebContentsView doesn't crash when GCed during allocation
Received fatal exception EXCEPTION_ACCESS_VIOLATION
Backtrace:
        gin::WrappableBase::SecondWeakCallback [0x00007FF6F2AFA005+133] (o:\gin\wrappable.cc:53)
        v8::internal::GlobalHandles::InvokeSecondPassPhantomCallbacks [0x00007FF6F028F9AB+171] (o:\v8\src\handles\global-handles.cc:1400)
        v8::internal::GlobalHandles::InvokeSecondPassPhantomCallbacksFromTask [0x00007FF6F028F867+391] (o:\v8\src\handles\global-handles.cc:1387)
        node::PerIsolatePlatformData::RunForegroundTask [0x00007FF6F3B4D065+317] (o:\third_party\electron_node\src\node_platform.cc:415)
        node::PerIsolatePlatformData::FlushForegroundTasksInternal [0x00007FF6F3B4C424+776] (o:\third_party\electron_node\src\node_platform.cc:479)
        uv_run [0x00007FF6F2DDD07C+492] (o:\third_party\electron_node\deps\uv\src\win\core.c:609)
        electron::NodeBindings::UvRunOnce [0x00007FF6EEE1E036+294] (o:\electron\shell\common\node_bindings.cc:631)
        base::TaskAnnotator::RunTask [0x00007FF6F2318A19+457] (o:\base\task\common\task_annotator.cc:178)
        base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl [0x00007FF6F2E6F553+963] (o:\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:361)
        base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork [0x00007FF6F2E6EC69+137] (o:\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:266)
        base::MessagePumpForUI::DoRunLoop [0x00007FF6F235AA58+216] (o:\base\message_loop\message_pump_win.cc:221)
        base::MessagePumpWin::Run [0x00007FF6F235A01A+106] (o:\base\message_loop\message_pump_win.cc:79)
        base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run [0x00007FF6F2E702DA+682] (o:\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:470)
        base::RunLoop::Run [0x00007FF6F22F95BA+842] (o:\base\run_loop.cc:136)
        content::BrowserMainLoop::RunMainMessageLoop [0x00007FF6F14423CC+208] (o:\content\browser\browser_main_loop.cc:990)
        content::BrowserMainRunnerImpl::Run [0x00007FF6F144402F+143] (o:\content\browser\browser_main_runner_impl.cc:153)
        content::BrowserMain [0x00007FF6F143F911+257] (o:\content\browser\browser_main.cc:49)
        content::RunBrowserProcessMain [0x00007FF6EFFA7D18+112] (o:\content\app\content_main_runner_impl.cc:608)
        content::ContentMainRunnerImpl::RunBrowser [0x00007FF6EFFA8CF4+1220] (o:\content\app\content_main_runner_impl.cc:1104)
        content::ContentMainRunnerImpl::Run [0x00007FF6EFFA87C9+393] (o:\content\app\content_main_runner_impl.cc:971)
        content::RunContentProcess [0x00007FF6EFFA73BD+733] (o:\content\app\content_main.cc:394)
        content::ContentMain [0x00007FF6EFFA79E1+54] (o:\content\app\content_main.cc:422)
        wWinMain [0x00007FF6EECA1535+889] (o:\electron\shell\app\electron_main.cc:291)
        __scrt_common_main_seh [0x00007FF6F6F88482+262] (d:\A01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
        BaseThreadInitThunk [0x00007FFEC0087034+20]
        RtlUserThreadStart [0x00007FFEC1F02651+33]
✗ Electron tests failed with code 0xc0000005.

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
(cherry picked from commit 6aece4a83d)
2021-09-29 13:05:26 -04:00
trop[bot]
2cbfd19d94 fix: crash creating private key with unsupported algorithm (#31137)
* fix: crash creating private key with unsupported algorithm

* test: add regression test

* chore: update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-29 11:56:45 -04:00
trop[bot]
da132e0289 fix: .lldbinit config stale (unavailable) (#31158)
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2021-09-29 12:33:07 +02:00
trop[bot]
622b79cd9d fix: BrowserView drag now delegates to the OS when possible (#31177)
Co-authored-by: @anulman <@anulman>
2021-09-29 12:28:38 +02:00
trop[bot]
2e91d6e10c docs: update branch name (#31149) 2021-09-28 09:51:57 +02:00
trop[bot]
4a495542cb refactor: use native WeakRef instead of v8util.weaklyTrackValue() (#31165)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-28 09:44:31 +02:00
trop[bot]
45813a0342 fix: crash in v8 due to regexp reentrancy (#31144)
* fix: crash in v8 due to regexp reentrancy

Check failed: !regexp_stack_->is_in_use()

Refs https://bugs.chromium.org/p/chromium/issues/detail?id=1250646
Refs https://bugs.chromium.org/p/v8/issues/detail?id=11382

* chore: update patches

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-27 16:54:46 -07:00
trop[bot]
b55362b588 fix: avoid double free when destroying WebContents (#31133)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-09-27 22:00:44 +02:00
electron-roller[bot]
b39b6cde8c chore: bump chromium to 94.0.4606.61 (15-x-y) (#31112)
* chore: bump chromium in DEPS to 94.0.4606.61

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-27 12:38:07 -04:00
trop[bot]
6919520c88 fix: startDrag params type incorrect (#31083)
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2021-09-23 19:50:10 +09:00
trop[bot]
71fcb8d8f8 fix: update Windows' cache after changing window's style (#31081)
To enable/disable window resizing we set/unset WS_THICKFRAME style
flag on the window. Window's frame styles are cached so we need to
call SetWindowPos with the SWP_FRAMECHANGED flag set to update
cache properly.

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
2021-09-23 19:48:12 +09:00
trop[bot]
ee23788acf fix: proper localization when using GtkFileChooserNative (#31066)
* fix: proper localization when using GtkFileChooserNative

* fix: iwyu

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-23 16:35:46 +09:00
trop[bot]
52196791b9 feat: add isMainFrame argument to 'certificate-error' event (#31038)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-23 16:32:56 +09:00
trop[bot]
6dbf0c52ec docs: update glossary (#31056)
* docs: update glossary

* remove nsis entry

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-09-23 16:30:13 +09:00
trop[bot]
5d95688753 chore: clarify new-window fix comment (#31073)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-09-22 17:26:41 -07:00
electron-roller[bot]
6e60fa6d59 chore: bump chromium to 94.0.4606.54 (15-x-y) (#31046)
* chore: bump chromium in DEPS to 94.0.4606.54

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-22 14:12:04 -04:00
trop[bot]
d072d408c0 feat: add frame to context-menu event params (#31057)
* feat: add frame to context-menu event params

* doc: rephrase frame description

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-09-22 14:11:48 -04:00
trop[bot]
cde7f04409 fix: prevent navigator.fonts.query() from crashing (#30985) 2021-09-22 08:25:18 +02:00
trop[bot]
e143f654ca fix: maximized state calculation for non-resizable windows (#31041)
* fix: maximized state calculation for non-resizable windows

* refactor: clean up NSRect comparison

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-22 09:28:44 +09:00
trop[bot]
cc62c4a33a docs: update public timeline for E16 (#31051)
Co-authored-by: Sofia Nguy <sofianguy@gmail.com>
2021-09-21 14:37:02 -07:00
Sudowoodo Release Bot
c3e6746fa9 Bump v15.0.0 2021-09-21 11:50:28 -07:00
Samuel Attard
436c3ba644 Revert "Bump v15.0.0"
This reverts commit dc6f951f43.
2021-09-21 11:48:38 -07:00
Samuel Attard
599babae00 Revert "Bump v15.0.1"
This reverts commit 5f7da14447.
2021-09-21 11:48:31 -07:00
Sudowoodo Release Bot
5f7da14447 Bump v15.0.1 2021-09-21 11:43:53 -07:00
Sudowoodo Release Bot
dc6f951f43 Bump v15.0.0 2021-09-21 11:40:26 -07:00
trop[bot]
f4fa6c0cf4 fix: propagate window.open settings to child window (#31049)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-09-21 10:34:32 -07:00
trop[bot]
98de50451a fix: suppress insecure resource warning for more local hostnames (#31036) 2021-09-21 10:48:26 +02:00
Sudowoodo Release Bot
c78ab7a1f2 Revert "Bump v15.0.0"
This reverts commit 0928f322fa.
2021-09-20 17:16:32 -07:00
Sudowoodo Release Bot
0928f322fa Bump v15.0.0 2021-09-20 11:31:33 -07:00
trop[bot]
c6c59bf0b3 build: fix release CI jobs start script (#31026)
* build: fix release CI jobs start script

This broke in #30492, we weren't handled 20X status codes and weren't authing to appveyor correctly.

* build: do not pass undefined to Auth header in CI scripts

(cherry picked from commit a48968c1ce)

* build: use basic auth to trigger CI if either a username OR password is provided

(cherry picked from commit d1bd9afbbf)

* build: manually pull 64bit dugite for 32bit tests (#30531)

(cherry picked from commit 8b9d0092cb)

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-09-20 11:02:51 -07:00
Keeley Hammond
9d3bcfc559 fix: ensure web_contents() is alive before grabbing view (#31027) 2021-09-20 10:14:12 -07:00
Sudowoodo Release Bot
fb2473bb5e Revert "Bump v15.0.0-beta.8"
This reverts commit 18c5401d08.
2021-09-20 07:43:58 -07:00
electron-roller[bot]
4664b5da57 chore: bump chromium to 94.0.4606.51 (15-x-y) (#30895)
* chore: bump chromium in DEPS to 94.0.4606.41

* chore: bump chromium in DEPS to 94.0.4606.50

* chore: bump chromium in DEPS to 94.0.4606.51

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2021-09-20 10:42:16 -04:00
Sudowoodo Release Bot
18c5401d08 Bump v15.0.0-beta.8 2021-09-20 06:31:53 -07:00
trop[bot]
3f81697e48 fix: disabling and enabling resizability on macOS (#31014)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-20 09:34:55 +09:00
trop[bot]
a00a43ba25 chore: update links of documentation of chromes (#31008)
chrome now use developer.chrome.com/docs/extensions/* instead of developer.chrome.com/extensions/*

Co-authored-by: 祈緒ちゃん - Kiochan <sunxingchen@live.com>
2021-09-17 22:10:48 +09:00
trop[bot]
ce1435be30 fix: links to images (#31005)
Images that used the inline link format do not show up on Docusaurus or
the old website infrastructure. There are only 2 guides using it so it
is faster to change the format rather than figuring out why the parsin
logic does not work.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref: https://github.com/electron/electronjs.org-new/issues/84

Co-authored-by: Antón Molleda <amolleda@gmail.com>
2021-09-17 16:49:03 +09:00
trop[bot]
c625b77bde fix: add casing for WCO edge (#30995)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-09-16 18:49:03 -04:00
Samuel Attard
4969c4ab19 build: ensure we await correctly in npm publish script 2021-09-16 13:48:53 -07:00
Sudowoodo Release Bot
9e1736f5bc Bump v15.0.0-beta.7 2021-09-16 07:36:07 -07:00
Sudowoodo Release Bot
200e26c602 Revert "Bump v15.0.0-beta.7"
This reverts commit bbc4545742.
2021-09-16 07:32:57 -07:00
Sudowoodo Release Bot
bbc4545742 Bump v15.0.0-beta.7 2021-09-16 06:33:26 -07:00
trop[bot]
9874e940ab build: embed binary checksums in the npm package (#30647)
* build: embed binary checksums in the npm package

* Update docs/tutorial/installation.md

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

* refactor: replace reduce with loop

* refactor: remove all usages of the legacy request module (#30492)

* Replaces request with got
* Replaces nugget with got streams
* Replaces request in docs with got
* Upgrades dugite to drop requests dependency

* build: do not excessively log response bodies

* build: fix publish-to-npm script post requests migration

* chore: revert accidental package bumps

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-09-16 09:36:54 +09:00
trop[bot]
304453fa5c fix: always include pepper flash font file (#30970)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2021-09-16 09:29:34 +09:00
Keeley Hammond
16a32a30d9 chore: update E15 node module version (#30773)
Ref: https://github.com/nodejs/node/pull/39950/files
2021-09-15 16:33:08 -07:00
trop[bot]
a227474809 chore: correct hierarchy of BrowserWindow headings (#30974)
* chore: correct hierarchy of BrowserWindow headings

* Update docs/api/browser-window.md

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

* Update docs/api/browser-window.md

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

* Update docs/api/browser-window.md

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

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-09-15 15:41:29 +09:00
trop[bot]
3a2055ebba docs: update context isolation doc (#30977)
* docs: update context isolation doc

* Apply suggestions from code review

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

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-09-15 15:40:35 +09:00
Sudowoodo Release Bot
87042e1493 Bump v15.0.0-beta.6 2021-09-14 06:03:11 -07:00
Sudowoodo Release Bot
86f3aa0376 Revert "Bump v15.0.0-beta.6"
This reverts commit 33eb6263c0.
2021-09-13 20:35:36 -07:00
Sudowoodo Release Bot
33eb6263c0 Bump v15.0.0-beta.6 2021-09-13 15:31:50 -07:00
trop[bot]
05d5ee4486 fix: remove conflicting RunFileChooserEnd for Mac (#30936)
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2021-09-13 15:26:00 -07:00
trop[bot]
98845392d8 feat: add support for validating asar archives on macOS (#30900)
* feat: add support for validating asar archives on macOS

* chore: fix lint

* chore: update as per feedback

* feat: switch implementation to asar integrity hash checks

* feat: make ranged requests work with the asar file validator DataSourceFilter

* chore: fix lint

* chore: fix missing log include on non-darwin

* fix: do not pull block size out of missing optional

* fix: match ValidateOrDie symbol on non-darwin

* chore: fix up asar specs by repacking archives

* fix: maintain integrity chain, do not load file integrity if header integrity was not loaded

* debug test

* Update node-spec.ts

* fix: initialize header_validated_

* chore: update PR per feedback

* chore: update per feedback

* build: use final asar module

* Update fuses.json5

* chore: fix compile errors

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-09-13 09:58:59 -07:00
Sudowoodo Release Bot
946baab086 Bump v15.0.0-beta.5 2021-09-13 08:46:53 -07:00
trop[bot]
e3aeba3581 fix: delete rfh after open/save dialog done (#30927)
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2021-09-13 08:37:33 -07:00
Sudowoodo Release Bot
e03c11598e Bump v15.0.0-beta.4 2021-09-09 06:32:23 -07:00
trop[bot]
3b1c9dfc54 refactor: remove dead code in NeedsCompleteGpuInfoCollection (#30877)
Refs https://chromium-review.googlesource.com/c/chromium/src/+/1208362

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-08 15:19:25 +09:00
Mark Lee
2724456dc7 docs(protocols): simplify packaging section & cleanup (#30881)
Backport of #30194
Backport of #30566
Backport of #30832
2021-09-08 15:18:33 +09:00
trop[bot]
9333b091f5 docs: Update windows info for auto-updater (#30871)
Squirrel.Mac can be served from a static host as well.

Co-authored-by: Finn Behrens <me@kloenk.dev>
2021-09-08 08:43:50 +09:00
trop[bot]
cb12c4e392 refactor: use getter for frame in webrequest details (#30861)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-09-08 08:42:18 +09:00
trop[bot]
1d38e14e92 fix: show maximized frameless window (#30865)
* fix: show maximized frameless window

* test: show maximized transparent window

* fix: test using wrong bounds

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

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-09-07 17:02:14 +02:00
Robo
9f39865999 chore: enable v8 oilpan (#30853)
* chore: enable v8 oilpan

* chore: update patches
2021-09-07 09:41:50 +02:00
Sudowoodo Release Bot
2d5b45659a Bump v15.0.0-beta.3 2021-09-06 19:03:15 -07:00
Sudowoodo Release Bot
dab8ec7711 Revert "Bump v15.0.0-beta.3"
This reverts commit 8f81c73908.
2021-09-06 18:47:42 -07:00
Sudowoodo Release Bot
8f81c73908 Bump v15.0.0-beta.3 2021-09-06 18:11:46 -07:00
Sudowoodo Release Bot
79580b1809 Revert "Bump v15.0.0-beta.3"
This reverts commit 835c4a1bb4.
2021-09-06 18:10:45 -07:00
Sudowoodo Release Bot
835c4a1bb4 Bump v15.0.0-beta.3 2021-09-06 06:32:28 -07:00
trop[bot]
81f773eb6f docs: updated webview tag documentation to accurately reflect preload behavior with asar archives (#30851)
Co-authored-by: ike <isaactaylor124@gmail.com>
2021-09-06 19:17:42 +09:00
trop[bot]
2708f66627 fix: devtools not resizable on Windows (#30848)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-06 19:16:57 +09:00
trop[bot]
190085141c feat: add webContents.fromDevToolsTargetId() (#30733)
* feat: add webContents.fromDevToolsTargetId()

* refactor: avoid using FromOrCreate

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2021-09-03 10:24:32 +02:00
electron-roller[bot]
4111f2b3a7 chore: bump chromium to 94.0.4606.31 (15-x-y) (#30813)
* chore: bump chromium in DEPS to 94.0.4606.31

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-02 14:19:04 -04:00
trop[bot]
f894f8a92d feat: add <webview> 'did-redirect-navigation' event (#30664)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-02 13:25:40 -04:00
Samuel Maddock
439a295776 fix: BrowserWindow backgroundColor (#30777) 2021-09-02 10:53:11 -04:00
Sudowoodo Release Bot
99868688f1 Bump v15.0.0-beta.2 2021-09-02 06:33:03 -07:00
Milan Burda
3dc92be74c feat: add <webview>.sendToFrame() / frameId to 'ipc-message' event (#30451) (#30704) 2021-09-02 11:13:06 +02:00
trop[bot]
a9e141305b feat: add 'dom-ready' event to WebFrameMain (#30801) 2021-09-02 10:13:13 +02:00
trop[bot]
4fb3b585f9 feat: add app.configureHostResolver (#30775)
* feat: add app.configureHostResolver (#30576)

* fix tests

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-09-01 20:22:53 -04:00
Erick Zhao
ceb65338a5 docs: fix code example in process-model.md (#30690) (#30802)
* Update process-model.md

the demo have two error:
- at macos, close all window, the app will not quite, unless press cmd + q
- attach preload.js, use preload prop that is member of `webPreferences` property of `BrowserWindow` controller argument

* Update docs/tutorial/process-model.md

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

Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>

Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-09-01 16:52:57 -07:00
trop[bot]
30a2a0bf8d repl: fix crash when SharedArrayBuffer disabled (#30483)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-01 14:23:40 -04:00
trop[bot]
1401789817 ci: ignore pdb download failure (#30796)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-09-01 13:24:30 -04:00
trop[bot]
a20f19bc8f fix(linux): OpenURI portal support for shell.showItemInFolder() (#30784)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-01 20:48:13 +09:00
trop[bot]
87f07534b1 docs: improve documentation about macOS entitlement usage security (#30781)
Co-authored-by: ComplexSpaces <complexspacescode@gmail.com>
2021-09-01 20:47:45 +09:00
Sudowoodo Release Bot
326de41302 Bump v15.0.0-beta.1 2021-08-31 13:02:28 -07:00
trop[bot]
53fee846d4 docs: add remote removal to E14 breaking changes (#30770)
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2021-08-31 11:51:29 -07:00
trop[bot]
2c406ff566 fix: remove ipc wrapper for nativeImage.createThumbnailFromPath (#30734)
* fix: remove ipc wrapper for nativeImage.createThumbnailFromPath

* ScopedCOMInitializer

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-08-30 19:31:40 +09:00
electron-roller[bot]
a2ae0e16b5 chore: bump chromium to 94.0.4606.20 (15-x-y) (#30715)
* chore: bump chromium in DEPS to 94.0.4606.20

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-26 12:16:54 -04:00
Sudowoodo Release Bot
b69d7af656 Bump v15.0.0-alpha.10 2021-08-26 09:03:25 -07:00
trop[bot]
4b4bd037e1 docs: explain the null webContents case in permission checks (#30688)
* docs: explain the null webContents case in permission checks

* Update docs/api/session.md

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-08-26 15:48:18 +09:00
trop[bot]
ebc21d751a fix: titlebar and buttons state under simple fullscreen (#30708)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-08-26 15:46:34 +09:00
trop[bot]
ea17543800 fix: crash when using TouchBarScrubber arrow button (#30681)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-25 10:06:41 +09:00
electron-roller[bot]
2bc618e7ac chore: bump chromium to 94.0.4606.12 (15-x-y) (#30370)
* chore: bump chromium in DEPS to 94.0.4595.0

* chore: bump chromium in DEPS to 94.0.4596.0

* chore: bump chromium in DEPS to 94.0.4597.0

* chore: bump chromium in DEPS to 94.0.4598.2

* chore: bump chromium in DEPS to 94.0.4599.2

* chore: bump chromium in DEPS to 94.0.4600.0

* chore: bump chromium in DEPS to 94.0.4601.0

* chore: bump chromium in DEPS to 94.0.4602.0

* chore: bump chromium in DEPS to 94.0.4603.0

* chore: bump chromium in DEPS to 94.0.4604.0

* chore: bump chromium in DEPS to 94.0.4603.0

* chore: bump chromium in DEPS to 94.0.4605.0

* chore: bump chromium in DEPS to 94.0.4606.0

* chore: bump chromium in DEPS to 94.0.4606.3

* chore: bump chromium in DEPS to 94.0.4606.5

* build: 3-way merge of chromium patches

(cherry picked from commit d77d456a369c07dbc06e4c2eade23e4029a4c169)

* build: 3-way merge of chromium patches

(cherry picked from commit e495584d5c8a36a469946ada24fa75b30776e1b9)

* 3076040: Reland Remove delete_children RemoveAllChildViews arg

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3076040
(cherry picked from commit 22e131c7b5e146ac57b813a6906d87f98a51c3c3)

* 3069287: Remove the remaining uses and delete the deprecated API

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3069287
(cherry picked from commit a6c546107298ab197893e1bdef906b15bb4f1c70)

* 2297212: Replace RemoveWithoutPathExpansion(.*, nullptr) with Value::RemoveKey()

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

Also: https://chromium-review.googlesource.com/c/chromium/src/+/3060296
(cherry picked from commit 10854b7cb26b1cd259b067e3f5aa2b266bf8eb9a)

* 3082756: Change transport_security_persister_path param to be a path to a file.

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

> this CL intentionally changes the name of the parameter
> in the network context parameters and the order of the constructor
> parameters to ensure all callers update their code to pass a full
> file path rather than a path to a directory.

The 'path' in this diff is already an absolute path, coming from
`CHECK(base::PathService::Get(chrome::DIR_USER_DATA, &path_));` at
08ff1c2cbf/shell/browser/electron_browser_context.cc (L126)

(cherry picked from commit 3e310964ffc592b0a0af4eeededeab3cadbec5a5)

* iwyu: network::mojom::HttpRawHeaderPair

(cherry picked from commit 51c73ea7fd65711eaf26f545b39b8e4a52435182)

* fixup! 3076040: Reland Remove delete_children RemoveAllChildViews arg

Missed one.

(cherry picked from commit f6f9de30780e6b1c677dc55f081af34e4f44fd9c)

* 2999884: CodeHealth: Remove DictionaryValue::GetStringWithoutPathExpansion

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2999884
(example of replacing GetStringWithoutPathExpansion() w/FindStringKey())

Also: https://chromium-review.googlesource.com/c/chromium/src/+/3060296
(removal of DictionaryValue::GetStringWithoutPathExpansion)

(cherry picked from commit 5f7fd94d71480e05ad8badf4be1cfc5d2bd685ce)

* 3059260: Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

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

We had both of these in a 'disable_features' list. Since these feature have
been removed upstream, remove them from our disable list, too.

IMPORTANT: this commit should not be backported to older branches that
still have these features, because doing so would un-disable them.

(cherry picked from commit a09154d0b20af4680d7c7be6cafd40f84408df2e)

* 2920890: Load reroute_info from download in-progress and history db back into DownloadItem.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2920890
(cherry picked from commit 66a3797a3f798a368c7630d6c6a1ebc3d8606880)

* 3039323: [Clipboard API] Clipboard Custom Formats implementation Part 5.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3039323
(cherry picked from commit 136b2ed9aa601bd59b3416d11c1109d249850faa)

* 3084502: Add a new PrintRasterizePdfDpi policy.

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

* chore: update patches

(cherry picked from commit 4b03542e425f73ef7742ee272f30feac350d9bd0)

* chore: update patches

* Disable kDesktopCaptureMacV2

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

* [DevTools] Remove report_raw_headers from network::ResourceRequest (Attempt #2)

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

* Add a new PrintRasterizePdfDpi policy.

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

* chore: update patches

* chore: fix lint

(cherry picked from commit ed0d9adef6b9c5fb8c2b4bcf6783a3bd58605d51)

* Linux: use chrome_crashpad_handler instead of crashpad_handler

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

* DCHECK that predictor always has a non-empty NetworkIsolationKey.

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

* fixup! Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

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

* chore: bump chromium in DEPS to 94.0.4606.12

* chore: update patches

* Disable kDesktopCaptureMacV2

https://chromium-review.googlesource.com/c/chromium/src/+/3069272
(cherry picked from commit 205e477037)

* Convert PrintManager to RenderFrameHostReceiverSet.

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

* [Clipboard API] Clipboard Custom Formats implementation Part 5.

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

* Convert ExtensionFrameHost to RenderFrameHostReceiverSet.

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

* cleanup after merge

* chore: fix lint

(cherry picked from commit b4ea757281)

* chore: disable v8 oilpan

(cherry picked from commit 19a5afd264)

* fixup! Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

(cherry picked from commit d0a1a8b51a)

* fixup! Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

(cherry picked from commit c49b5a9277)

* fixup! Disable kDesktopCaptureMacV2

(cherry picked from commit bc6b974647)

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-24 17:07:19 -04:00
trop[bot]
ba8f4660fd feat: enable windows control overlay on Windows (#29600) (#30497)
* rebase "feat: enable windows control overlay on Windows"

* correct compilation error

* fix linting errors

* modify includes and build file

* change `hidden` option to `overlay`

* add patch to fix visual layout

* add button background color parameter

* add button text color parameter

* modify `overlay` in docs and modify button hover/press transition color

* change `text` to `symbol`

* remove todo and fix `text` replacement

* add new titleBarOverlay property and remove titleBarStyle `overlay`

* update browser and frameless window docs

* remove chromium patches

* chore: update patches

* change button hover color, update trailing `_`, update test file

* add dchecks, update title bar drawing checks, update test file

* modify for mac and linux builds

* update docs with overlayColor and overlaySymbolColor

* add corner and side hit test info

* modify docs and copyright info

* modify `titlebar_overlay_` as boolean or object

* move `title_bar_style_ to `NativeWindow`

* update docs with boolean and object titlebar_overlay_

* add `IsEmpty` checks

* move get options for boolean and object checks

* fix linting error

* disable `use_lld` for macos

* Update docs/api/frameless-window.md

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

* Update docs/api/frameless-window.md

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

* Update docs/api/frameless-window.md

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

* Apply docs suggestions from code review

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

* modify `true` option description `titleBarOverlay`

* ci: cleanup keychain after tests on arm64 mac (#30472)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-08-23 20:52:45 -04:00
trop[bot]
b19ccb708e fix: change gin::Wrappable crash key type to ScopedCrashKey (#30610)
* fix: change gin_wrappable to scoped crash key

* fix: build dependency

Dependency was missed in cbeae20438

Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-08-23 17:19:28 -07:00
trop[bot]
24b3ee8444 feat: add electron.safeStorage encryption API (#30020) (#30430)
* feat: add SafeStorage api; first commit

* chore: rename files to fit semantically

* chore: add linkedBindings

* chore: fix function signatures

* chore: refactor eisCookieEncryptionEnabled() fuse

* chore: create test file

* chore: add tests and documentation

* chore: add copyright and lint

* chore: add additional tests

* chore: fix constructor

* chore: commit for pair programming

* wip: commit for keeley pairing

* chore: docs change and code cleanup

* chore: add linux import

* chore: add description to documentation

* chore: fixing tests

* chore: modify behaviour to not allow unencrypted strings as decyption input

* fix add patch for enabling default v11 encryption on Linux

* chore: remove file after each test

* chore: fix patch

* chore: remove chromium patch

* chore: add linux specific tests

* chore: fix path

* chore: add checker for linuux file deletion

* chore: add dcheck back

* chore: remove reference to headless mode

* chore: remove tests for linux

* chore: edit commit message

* chore: refactor safeStorage to not be a class

* chore: remove static variable from header

* chore:  spec file remove settimeout

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

Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-08-23 15:21:40 -07:00
Sudowoodo Release Bot
941ab704e1 Bump v15.0.0-alpha.9 2021-08-23 08:08:12 -07:00
trop[bot]
9d9c7a2f70 fix: media key globalShortcuts on macOS (#30570)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-19 19:54:59 -04:00
Sudowoodo Release Bot
e406ebd472 Bump v15.0.0-alpha.8 2021-08-19 09:11:24 -07:00
trop[bot]
e44b02b9ad fix: WebFrameMain mojo pipe not reset (#30632)
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-08-19 16:55:21 +09:00
trop[bot]
b26760bed5 docs: typo in launch-app-from-url-in-another-app.md (#30628)
* Typo in launch-app-from-url-in-another-app.md

Code snippet for the info.plist example had html formatting. Removed.

* Fix paddings

Co-authored-by: Larry Kluger <larry.kluger@docusign.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-08-19 15:11:22 +09:00
trop[bot]
33fd679843 fix: cross-origin navigation disposing WebFrameMain instances (#30600)
* refactor: call methods directly from electron:WebContents

Writing static method boilerplate isn't fun

* fix: cross-origin navigation disposing WebFrameMain instances

* fix: move call to WFM::Connect

* refactor: use base::NoDestructor<T>

* Update shell/browser/api/electron_api_web_frame_main.cc

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

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-08-19 15:08:08 +09:00
trop[bot]
87399cc4f4 fix: handle nullish WebContentsView in UpdateDraggableRegions (#30558)
* fix: handle nullish WebContentsView in UpdateDraggableRegions

* build: nogncheck on webcontentsimpl include

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-08-19 10:38:51 +09:00
trop[bot]
33631b44f8 docs: remove unused Desktop Environment Integration doc (#30619)
* docs: remove unused Desktop Environment Integration doc

* Update docs/api/app.md

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

* Update docs/api/app.md

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

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-08-19 09:54:07 +09:00
trop[bot]
10a8752e70 docs: update Hazel information (#30623)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-08-19 09:53:35 +09:00
trop[bot]
12c54ab670 fix: persist BrowserView background color when bounds offscreen (#30542)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-19 08:39:53 +09:00
trop[bot]
1ca52e9b93 fix: {exit|enter}-html-fullscreen emitted after esc in webview (#30562)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-19 08:38:34 +09:00
trop[bot]
b444944a6d fix: documentEdited with non-default titlebarStyle (#30604)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-18 14:13:41 -07:00
trop[bot]
766a58e465 fix: disable kWindowCaptureMacV2 for desktopCapturer (#30525)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-08-16 11:17:59 -07:00
trop[bot]
8130613364 docs: uniformize tutorial titles (#30547)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-08-16 14:07:59 -04:00
trop[bot]
e1859a3657 docs: clarify usage of option (#30550)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-08-16 14:04:43 -04:00
Sudowoodo Release Bot
daf533dabb Bump v15.0.0-alpha.7 2021-08-16 08:37:31 -07:00
John Kleinschmidt
6cf9e12dd4 chore: bump chromium to 94.0.4590.2 (15-x-y) (#30512)
* chore: bump chromium to 94.0.4590.2 (main) (#30274)

* chore: bump chromium in DEPS to 94.0.4587.0

* chore: update patches

* 2823155: fix GPU video decoding capabilities enumeration

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

* 3041383: Reduce includes in url_request_mojom_traits.h

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

* chore: bump chromium in DEPS to 94.0.4588.0

* chore: update patches

* chore: bump chromium in DEPS to 94.0.4589.0

* chore: update patches

* 3050633: Rename ScaleFactor to ResourceScaleFactor

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

* 3048296: Create new mojo target to prevent traits header spreading

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

* 3046186: Rename base::ClampToRange

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

* chore: update picture-in-picture patch

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

* chore: bump chromium in DEPS to 94.0.4590.0

* chore: update patches

* 3057495: Fix base::NoDestructor usage in Mac KeychainPassword

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

* 3056134: Remove NetworkIsolationKey unused methods

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

* 3035091: [rab/gsab] Fix gsab maxByteLength after transferring to worker

Adds a patch to v8 to disable a DCHECK that is also firing on node streams
in child processes.

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

* chore: bump chromium in DEPS to 94.0.4590.2

* chore: fix mas_no_private_api.patch

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

* 3049555: [views] Add CHECK to prevent fallthrough to global NativeTheme

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

* chore: empty commit

* chore: fix whitespace for lint

* chore: cherry-pick chromium woa fix

* Revert "chore: cherry-pick chromium woa fix"

This reverts commit 64f3082e2d.

* chore: fix the build on Windows on ARM

* chore: remove commented code in printing.patch

* fixup! chore: remove commented code in printing.patch

do not remove the new weak_ptr check

* build: sync disable_use_lld_for_macos.patch

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
(cherry picked from commit 81c143318b)

* test fix for (unrelated) bug showing up on linux-asan

(cherry picked from commit a65d2dacd3)

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-08-16 10:12:39 -04:00
trop[bot]
0b5c95abdf ci: update git on CI machines (#30532)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-08-16 10:48:26 +02:00
Sudowoodo Release Bot
84df964d2f Bump v15.0.0-alpha.6 2021-08-12 08:18:31 -07:00
trop[bot]
6781a2c6e0 ci: make arm64 macos test cleanup more resilient (#30502)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-08-11 17:46:48 -04:00
Keeley Hammond
5dce02a3bb fix: explicitly define REFGUID from ::GUID&, not base::GUID (#30442) (#30498)
* fix: explicitly define REFGUID from ::GUID&

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

* fix: duplicate GUID_NULL symbol, add comment
2021-08-11 14:13:01 -07:00
trop[bot]
9aafee9cf0 docs: add missing <webview> event documentation (#30467)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-08-11 09:43:50 +09:00
trop[bot]
5df3e7e8fb ci: cleanup keychain after tests on arm64 mac (#30477)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-08-11 09:43:22 +09:00
trop[bot]
889be2327f docs: fix camelcase in menu example (#30463)
* docs: fix camelcase in menu example and add hint to deal with TS error

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

* docs: Fix spelling, added hint to TypeScript

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

* remove ts hints

Co-authored-by: a@b <a@b>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-08-11 09:38:39 +09:00
trop[bot]
68e87ea4f5 fix: mouse doesn't work on frameless browserwindows (#30460)
Fixes #30402. This bug is from the "CanResize has been de-virtualized"
refactor in https://github.com/electron/electron/pull/29256

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-08-11 09:38:06 +09:00
trop[bot]
d3462596fa feat: add fuses for NODE_OPTIONS and --inspect (#30420)
* feat: add fuses for NODE_OPTIONS and --inspect

* chore: add node patch to ensure NODE_OPTIONS are never parsed when fuse is disabledd

* chore: fix lint

* chore: flip boolean logic

* chore: update patches

* chore: add trailing _ to static member

* Update add_should_read_node_options_from_env_option_to_disable_node_options.patch

* chore: update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-08-09 22:07:18 -04:00
trop[bot]
f3fd8492cf chore: more crash-keys for gin::Wrappable debugging (#30423)
* chore: more crash-keys for gin::Wrappable debugging

* fix namespace for Event

* Update crash_keys.cc

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-08-10 09:50:10 +09:00
trop[bot]
a3ca79f883 build: rebase release branch before reverting bump (#30419)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-08-09 17:17:33 -04:00
trop[bot]
e2aaf5d18a build: set the export goma auth fallback flag for the control process (#30315)
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-08-09 11:54:09 -04:00
Electron Bot
e49b33cad8 Bump v15.0.0-alpha.5 2021-08-09 08:25:06 -07:00
trop[bot]
5ac3192dd0 fix: move window buttons in-place on macOS (#30392)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-08-09 16:00:29 +09:00
Electron Bot
ea63f2ea98 Bump v15.0.0-alpha.4 2021-08-05 08:41:46 -07:00
trop[bot]
73b280d6b4 fix: console window popping up when --enable-logging passed on windows (#30386)
* fix: console window popping up when --enable-logging passed on windows

* chore: update patches

* clang format

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-08-05 08:58:14 +09:00
trop[bot]
2de6939db0 build: fix building with enable_desktop_capturer = false (#30389)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-08-04 09:56:10 +09:00
Electron Bot
022620f4cd Bump v15.0.0-alpha.3 2021-08-02 08:16:27 -07:00
trop[bot]
d1894977de build: update build images to update npm and node (#30364)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-08-02 13:00:45 +09:00
trop[bot]
6765eec7a9 fix: respect LogJsConsoleMessages feature in InspectableWebContents::DidAddMessageToConsole (#30356)
* fix: respect LogJsConsoleMessages feature in InspectableWebContents::DidAddMessageToConsole

* just delete the method

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-08-02 10:00:30 +09:00
trop[bot]
d462204dce fix: guard against missing native view (#30328)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-08-02 09:57:58 +09:00
trop[bot]
52d9bf41e6 chore: update deps (#30346)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-07-30 14:56:10 -07:00
trop[bot]
0cd714a3bb fix: use contentAspectRatio not aspectRatio (#30332)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-30 02:24:30 -07:00
trop[bot]
1228c69e1d fix: BrowserViews not painting their WebContents (#30336)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-30 02:23:08 -07:00
trop[bot]
c09b22bf85 chore: remove experimental from navigator.serial implementation (#30334)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-07-29 21:55:48 -04:00
trop[bot]
65d83f2054 chore: update publish to npm to use GitHub token (#30292)
ensures that we don't get hit with a rate limit while trying to publish a release.

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-07-28 12:24:29 -07:00
trop[bot]
6fa95afd71 test: deflake crashReporter.getLastCrashReport test (#30309)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-07-28 12:21:04 -07:00
trop[bot]
d58211304b fix: update traffic lights position for macOS 11 (#30270)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-07-28 12:02:09 +02:00
trop[bot]
760cb4ab50 fix: Add missing items to menuItem.role documentation (#30302) 2021-07-28 11:54:41 +02:00
trop[bot]
4acdb97543 chore: bump chromium to 94.0.4584.0 (main) (#30030) (#30268)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@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>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@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>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-07-26 16:11:58 -07:00
Electron Bot
011a874021 Bump v15.0.0-alpha.2 2021-07-26 10:07:59 -07:00
trop[bot]
bac728a134 fix: process.exit crash in nativeWindowOpen (#30238)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-07-26 18:28:37 +02:00
trop[bot]
9d6c37ac88 docs: update title of guide (#30260)
Co-authored-by: Antón Molleda <amolleda@gmail.com>
2021-07-26 20:18:20 +09:00
trop[bot]
25fc9acec6 fix: increase stack size on windows x86 (#30243)
* fix: increace main thread stack size on windows x86

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

* chore: add debug logs

* Revert "chore: add debug logs"

This reverts commit 0be81ae07c.

* chore: use a reliable crash endpoint

Co-authored-by: Stephen Wang <wangwenqiang.wwq@bytedance.com>
Co-authored-by: Deepak Mohan <hop2deep@gmail.com>
2021-07-26 17:45:36 +09:00
Electron Bot
edb65a07f1 Bump v15.0.0-alpha.1 2021-07-21 15:05:18 -07:00
Samuel Attard
82b5fbc396 build: handle alpha tag existing before beta line has finished 2021-07-21 14:50:06 -07:00
654 changed files with 38572 additions and 6916 deletions

1
.circleci/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
config-staging

File diff suppressed because it is too large Load Diff

2469
.circleci/config/base.yml Normal file

File diff suppressed because it is too large Load Diff

34
.circleci/config/build.js Normal file
View File

@@ -0,0 +1,34 @@
const cp = require('child_process');
const fs = require('fs-extra');
const path = require('path');
const yaml = require('js-yaml');
const STAGING_DIR = path.resolve(__dirname, '..', 'config-staging');
function copyAndExpand(dir = './') {
const absDir = path.resolve(__dirname, dir);
const targetDir = path.resolve(STAGING_DIR, dir);
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir);
}
for (const file of fs.readdirSync(absDir)) {
if (!file.endsWith('.yml')) {
if (fs.statSync(path.resolve(absDir, file)).isDirectory()) {
copyAndExpand(path.join(dir, file));
}
continue;
}
fs.writeFileSync(path.resolve(targetDir, file), yaml.dump(yaml.load(fs.readFileSync(path.resolve(absDir, file), 'utf8')), {
noRefs: true,
}));
}
}
if (fs.pathExists(STAGING_DIR)) fs.removeSync(STAGING_DIR);
copyAndExpand();
const output = cp.spawnSync(process.env.CIRCLECI_BINARY || 'circleci', ['config', 'pack', STAGING_DIR]);
fs.writeFileSync(path.resolve(STAGING_DIR, 'built.yml'), output.stdout.toString());

View File

@@ -0,0 +1,51 @@
executor:
name: linux-docker
size: medium
steps:
- checkout:
path: src/electron
- run:
name: Setup third_party Depot Tools
command: |
# "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
- run:
name: Download GN Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
cipd ensure -ensure-file - -root . \<<-CIPD
\$ServiceURL https://chrome-infra-packages.appspot.com/
@Subdir src/buildtools/linux64
gn/gn/linux-amd64 $gn_version
CIPD
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
- run:
name: Download clang-format Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
sha1_path='buildtools/linux64/clang-format.sha1'
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
- run:
name: Run Lint
command: |
# gn.py tries to find a gclient root folder starting from the current dir.
# When it fails and returns "None" path, the whole script fails. Let's "fix" it.
touch .gclient
# Another option would be to checkout "buildtools" inside the Electron checkout,
# but then we would lint its contents (at least gn format), and it doesn't pass it.
cd src/electron
node script/yarn install --frozen-lockfile
node script/yarn lint
- run:
name: Run Script Typechecker
command: |
cd src/electron
node script/yarn tsc -p tsconfig.script.json

View File

@@ -0,0 +1,10 @@
{
"name": "@electron/circleci-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
"dependencies": {
"fs-extra": "^10.1.0",
"js-yaml": "^4.1.0"
}
}

View File

@@ -0,0 +1,43 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"
jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
dependencies:
universalify "^2.0.0"
optionalDependencies:
graceful-fs "^4.1.6"
universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==

2
.github/CODEOWNERS vendored
View File

@@ -4,7 +4,7 @@
# https://git-scm.com/docs/gitignore
# Upgrades WG
/patches/ @electron/wg-upgrades
/patches/ @electron/wg-upgrades @electron/wg-security
DEPS @electron/wg-upgrades
# Releases WG

View File

@@ -8,9 +8,9 @@ body:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
required: true

View File

@@ -8,9 +8,9 @@ body:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
required: true

View File

@@ -7,9 +7,9 @@ body:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- type: input
attributes:

View File

@@ -3,7 +3,7 @@
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->
#### Checklist
@@ -11,7 +11,7 @@ Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTIN
- [ ] PR description included and stakeholders cc'd
- [ ] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/master/docs/development/testing.md)
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant documentation is changed or added
- [ ] [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).

6
.github/config.yml vendored
View File

@@ -2,7 +2,7 @@
newPRWelcomeComment: |
💖 Thanks for opening this pull request! 💖
We use [semantic commit messages](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
We use [semantic commit messages](https://github.com/electron/electron/blob/main/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
Examples of commit messages with semantic prefixes:
@@ -12,9 +12,9 @@ newPRWelcomeComment: |
Things that will help get your PR across the finish line:
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/master/docs/development/coding-style.md).
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/main/docs/development/coding-style.md).
- Run `npm run lint` locally to catch formatting errors earlier.
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/master/docs/styleguide.md).
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/main/docs/styleguide.md).
- Include tests when adding/changing behavior.
- Include screenshots and animated GIFs whenever possible.

20
.github/workflows/semantic.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: "Check Semantic Commit"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: semantic-pull-request
uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: false

1
.gitignore vendored
View File

@@ -26,6 +26,7 @@ compile_commands.json
# npm package
/npm/dist
/npm/path.txt
/npm/checksums.json
.npmrc

View File

@@ -187,6 +187,12 @@ action("electron_js2c") {
rebase_path(sources, root_build_dir)
}
action("generate_config_gypi") {
outputs = [ "$root_gen_dir/config.gypi" ]
script = "script/generate-config-gypi.py"
args = rebase_path(outputs) + [ target_cpu ]
}
target_gen_default_app_js = "$target_gen_dir/js/default_app"
typescript_build("default_app_js") {
@@ -361,6 +367,7 @@ source_set("electron_lib") {
"//ppapi/shared_impl",
"//printing/buildflags",
"//services/device/public/cpp/geolocation",
"//services/device/public/cpp/hid",
"//services/device/public/mojom",
"//services/proxy_resolver:lib",
"//services/video_capture/public/mojom:constants",
@@ -1006,6 +1013,12 @@ if (is_mac) {
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
asar_hashed_info_plist("electron_app_plist") {
keys = [ "DEFAULT_APP_ASAR_HEADER_SHA" ]
hash_targets = [ ":default_app_asar_header_hash" ]
plist_file = "shell/browser/resources/mac/Info.plist"
}
mac_app_bundle("electron_app") {
output_name = electron_product_name
sources = filenames.app_sources
@@ -1013,6 +1026,7 @@ if (is_mac) {
include_dirs = [ "." ]
deps = [
":electron_app_framework_bundle_data",
":electron_app_plist",
":electron_app_resources",
":electron_fuses",
"//base",
@@ -1021,7 +1035,7 @@ if (is_mac) {
if (is_mas_build) {
deps += [ ":electron_login_helper_app" ]
}
info_plist = "shell/browser/resources/mac/Info.plist"
info_plist_target = ":electron_app_plist"
extra_substitutions = [
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id",
"ELECTRON_VERSION=$electron_version",
@@ -1131,6 +1145,7 @@ if (is_mac) {
]
data = []
data_deps = []
data += [ "$root_out_dir/resources.pak" ]
data += [ "$root_out_dir/chrome_100_percent.pak" ]
@@ -1149,6 +1164,10 @@ if (is_mac) {
public_deps = [ "//tools/v8_context_snapshot:v8_context_snapshot" ]
}
if (is_linux) {
data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
}
if (is_win) {
sources += [
# TODO: we should be generating our .rc files more like how chrome does
@@ -1212,6 +1231,10 @@ if (is_mac) {
if (!is_component_build && is_component_ffmpeg) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_linux) {
deps += [ "//sandbox/linux:chrome_sandbox" ]
}
}
}
@@ -1348,11 +1371,13 @@ dist_zip("electron_dist_zip") {
if (is_linux) {
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
}
deps = data_deps
outputs = [ "$root_build_dir/dist.zip" ]
}
dist_zip("electron_ffmpeg_zip") {
data_deps = [ "//third_party/ffmpeg" ]
deps = data_deps
outputs = [ "$root_build_dir/ffmpeg.zip" ]
}
@@ -1370,6 +1395,7 @@ group("electron_chromedriver") {
dist_zip("electron_chromedriver_zip") {
testonly = true
data_deps = electron_chromedriver_deps
deps = data_deps
outputs = [ "$root_build_dir/chromedriver.zip" ]
}
@@ -1388,6 +1414,7 @@ group("electron_mksnapshot") {
dist_zip("electron_mksnapshot_zip") {
data_deps = mksnapshot_deps
deps = data_deps
outputs = [ "$root_build_dir/mksnapshot.zip" ]
}
@@ -1398,18 +1425,21 @@ copy("hunspell_dictionaries") {
dist_zip("hunspell_dictionaries_zip") {
data_deps = [ ":hunspell_dictionaries" ]
deps = data_deps
flatten = true
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
}
copy("libcxx_headers") {
sources = libcxx_headers + libcxx_licenses
sources = libcxx_headers + libcxx_licenses +
[ "//buildtools/third_party/libc++/__config_site" ]
outputs = [ "$target_gen_dir/electron_libcxx_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
}
dist_zip("libcxx_headers_zip") {
data_deps = [ ":libcxx_headers" ]
deps = data_deps
flatten = true
flatten_relative_to = rebase_path(
"$target_gen_dir/electron_libcxx_include/buildtools/third_party/libc++/trunk",
@@ -1425,6 +1455,7 @@ copy("libcxxabi_headers") {
dist_zip("libcxxabi_headers_zip") {
data_deps = [ ":libcxxabi_headers" ]
deps = data_deps
flatten = true
flatten_relative_to = rebase_path(
"$target_gen_dir/electron_libcxxabi_include/buildtools/third_party/libc++abi/trunk",

View File

@@ -36,7 +36,7 @@ Having the original text _as well as_ the translation can help mitigate translat
Responses to posted issues may or may not be in the original language.
**Please note** that using non-English as an attempt to circumvent our [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) will be an immediate, and possibly indefinite, ban from the project.
**Please note** that using non-English as an attempt to circumvent our [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) will be an immediate, and possibly indefinite, ban from the project.
## [Pull Requests](https://electronjs.org/docs/development/pull-requests)

2
DEPS
View File

@@ -15,7 +15,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'93.0.4566.0',
'94.0.4606.81',
'node_version':
'v16.5.0',
'nan_version':

View File

@@ -1 +1 @@
15.0.0-nightly.20210721
15.5.6

View File

@@ -1,7 +1,7 @@
[![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/master.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/master)
[![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)
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/main.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/main)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/main?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.com/invite/electron)
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
@@ -16,7 +16,7 @@ Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
announcements.
This project adheres to the Contributor Covenant
[code of conduct](https://github.com/electron/electron/tree/master/CODE_OF_CONDUCT.md).
[code of conduct](https://github.com/electron/electron/tree/main/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to [coc@electronjs.org](mailto:coc@electronjs.org).
@@ -98,6 +98,6 @@ and more can be found in the [support document](docs/tutorial/support.md#finding
## License
[MIT](https://github.com/electron/electron/blob/master/LICENSE)
[MIT](https://github.com/electron/electron/blob/main/LICENSE)
When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).

View File

@@ -10,7 +10,7 @@ Report security bugs in third-party modules to the person or team maintaining th
## 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.
For context on Electron's security notification process, please see the [Notifications](https://github.com/electron/governance/blob/main/wg-security/membership-and-notifications.md#notifications) section of the Security WG's [Membership and Notifications](https://github.com/electron/governance/blob/main/wg-security/membership-and-notifications.md) Governance document.
## Learning More About Security

View File

@@ -11,7 +11,7 @@
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
# Is used in some publishing scripts, but does NOT affect the Electron binary.
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
# - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket.
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
# Otherwise the release will be uploaded to the Github Releases.
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
#
@@ -66,6 +66,31 @@ build_script:
- mkdir src
- update_depot_tools.bat
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
@@ -129,21 +154,6 @@ build_script:
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
}
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
@@ -221,9 +231,9 @@ deploy_script:
- cd electron
- ps: >-
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 --verbose --upload_to_s3
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py --verbose

View File

@@ -54,11 +54,17 @@ steps:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: |
$localArtifactPath = "$pwd\src\pdb.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
cd src
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
try {
$localArtifactPath = "$pwd\src\pdb.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
cd src
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
} catch {
Write-Host "There was an exception encountered while downloading pdb files:" $_.Exception.Message
} finally {
$global:LASTEXITCODE = 0
}
displayName: 'Download pdb files for detailed stacktraces'
env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)

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 = 89
node_module_version = 98
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
@@ -16,6 +16,9 @@ proprietary_codecs = true
ffmpeg_branding = "Chrome"
enable_basic_printing = true
# Removes DLLs from the build, which are only meant to be used for Chromium development.
# See https://github.com/electron/electron/pull/17985
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false

View File

@@ -57,4 +57,42 @@ template("asar") {
rebase_path(outputs[0]),
]
}
node_action(target_name + "_header_hash") {
invoker_out = invoker.outputs
deps = [ ":" + invoker.target_name ]
sources = invoker.outputs
script = "//electron/script/gn-asar-hash.js"
outputs = [ "$target_gen_dir/asar_hashes/$target_name.hash" ]
args = [
rebase_path(invoker_out[0]),
rebase_path(outputs[0]),
]
}
}
template("asar_hashed_info_plist") {
node_action(target_name) {
assert(defined(invoker.plist_file),
"Need plist_file to add hashed assets to")
assert(defined(invoker.keys), "Need keys to replace with asset hash")
assert(defined(invoker.hash_targets), "Need hash_targets to read hash from")
deps = invoker.hash_targets
script = "//electron/script/gn-plist-but-with-hashes.js"
inputs = [ invoker.plist_file ]
outputs = [ "$target_gen_dir/hashed_plists/$target_name.plist" ]
hash_files = []
foreach(hash_target, invoker.hash_targets) {
hash_files += get_target_outputs(hash_target)
}
args = [
rebase_path(invoker.plist_file),
rebase_path(outputs[0]),
] + invoker.keys + rebase_path(hash_files)
}
}

View File

@@ -3,5 +3,9 @@
"_schema": "0 == off, 1 == on, r == removed fuse",
"_version": 1,
"run_as_node": "1",
"cookie_encryption": "0"
"cookie_encryption": "0",
"node_options": "1",
"node_cli_inspect": "1",
"embedded_asar_integrity_validation": "0",
"only_load_app_from_asar": "0"
}

View File

@@ -1,9 +1,12 @@
from __future__ import with_statement
from __future__ import unicode_literals
import contextlib
import sys
import os
import optparse
import json
import re
import subprocess
sys.path.append("%s/../../build" % os.path.dirname(os.path.realpath(__file__)))
@@ -33,36 +36,56 @@ def calculate_hash(root):
return CalculateHash('.', None)
def windows_installed_software():
import win32com.client
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer, "root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_Product")
items = []
powershell_command = [
"Get-CimInstance",
"-Namespace",
"root\cimv2",
"-Class",
"Win32_product",
"|",
"Select",
"vendor,",
"description,",
"@{l='install_location';e='InstallLocation'},",
"@{l='install_date';e='InstallDate'},",
"@{l='install_date_2';e='InstallDate2'},",
"caption,",
"version,",
"name,",
"@{l='sku_number';e='SKUNumber'}",
"|",
"ConvertTo-Json",
]
for objItem in colItems:
item = {}
if objItem.Caption:
item['caption'] = objItem.Caption
if objItem.Caption:
item['description'] = objItem.Description
if objItem.InstallDate:
item['install_date'] = objItem.InstallDate
if objItem.InstallDate2:
item['install_date_2'] = objItem.InstallDate2
if objItem.InstallLocation:
item['install_location'] = objItem.InstallLocation
if objItem.Name:
item['name'] = objItem.Name
if objItem.SKUNumber:
item['sku_number'] = objItem.SKUNumber
if objItem.Vendor:
item['vendor'] = objItem.Vendor
if objItem.Version:
item['version'] = objItem.Version
items.append(item)
proc = subprocess.Popen(
["powershell.exe", "-Command", "-"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
return items
stdout, _ = proc.communicate(" ".join(powershell_command).encode("utf-8"))
if proc.returncode != 0:
raise RuntimeError("Failed to get list of installed software")
# On AppVeyor there's other output related to PSReadline,
# so grab only the JSON output and ignore everything else
json_match = re.match(
r".*(\[.*{.*}.*\]).*", stdout.decode("utf-8"), re.DOTALL
)
if not json_match:
raise RuntimeError(
"Couldn't find JSON output for list of installed software"
)
# Filter out missing keys
return list(
map(
lambda info: {k: info[k] for k in info if info[k]},
json.loads(json_match.group(1)),
)
)
def windows_profile():
@@ -89,7 +112,7 @@ def windows_profile():
def main(options):
if sys.platform == 'win32':
with open(options.output_json, 'wb') as f:
with open(options.output_json, 'w') as f:
json.dump(windows_profile(), f)
else:
raise OSError("Unsupported OS")

View File

@@ -21,6 +21,8 @@ static_library("chrome") {
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.h",
"//chrome/browser/devtools/devtools_eye_dropper.cc",
"//chrome/browser/devtools/devtools_eye_dropper.h",
"//chrome/browser/devtools/devtools_file_system_indexer.cc",
"//chrome/browser/devtools/devtools_file_system_indexer.h",
"//chrome/browser/extensions/global_shortcut_listener.cc",
@@ -35,6 +37,8 @@ static_library("chrome") {
"//chrome/browser/net/proxy_config_monitor.h",
"//chrome/browser/net/proxy_service_factory.cc",
"//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/platform_util.cc",
"//chrome/browser/platform_util.h",
"//chrome/browser/predictors/preconnect_manager.cc",
"//chrome/browser/predictors/preconnect_manager.h",
"//chrome/browser/predictors/predictors_features.cc",
@@ -45,6 +49,10 @@ static_library("chrome") {
"//chrome/browser/predictors/resolve_host_client_impl.h",
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.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",
"//extensions/browser/app_window/size_constraints.cc",
"//extensions/browser/app_window/size_constraints.h",
]
@@ -56,6 +64,9 @@ static_library("chrome") {
"//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",
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm",
]
}
@@ -64,13 +75,28 @@ static_library("chrome") {
"//chrome/browser/extensions/global_shortcut_listener_win.cc",
"//chrome/browser/extensions/global_shortcut_listener_win.h",
"//chrome/browser/icon_loader_win.cc",
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
"//chrome/browser/ui/frame/window_frame_util.h",
"//chrome/browser/ui/view_ids.h",
"//chrome/browser/win/chrome_process_finder.cc",
"//chrome/browser/win/chrome_process_finder.h",
"//chrome/browser/win/titlebar_config.h",
"//chrome/child/v8_crashpad_support_win.cc",
"//chrome/child/v8_crashpad_support_win.h",
]
}
if (is_linux) {
sources += [ "//chrome/browser/media/webrtc/window_icon_util_linux.cc" ]
}
if (use_aura) {
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
]
}
public_deps = [
"//chrome/browser:dev_ui_browser_resources",
"//chrome/common",
@@ -144,64 +170,6 @@ static_library("chrome") {
deps += [ "//ui/snapshot" ]
}
if (enable_color_chooser) {
sources += [
"//chrome/browser/devtools/devtools_eye_dropper.cc",
"//chrome/browser/devtools/devtools_eye_dropper.h",
"//chrome/browser/platform_util.cc",
"//chrome/browser/platform_util.h",
"//chrome/browser/ui/browser_dialogs.h",
"//chrome/browser/ui/color_chooser.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.h",
]
if (use_aura) {
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
]
if (!is_win) {
sources += [
"//chrome/browser/ui/views/color_chooser_aura.cc",
"//chrome/browser/ui/views/color_chooser_aura.h",
]
}
deps += [ "//components/feature_engagement" ]
}
if (is_mac) {
sources += [
"//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",
"//components/remote_cocoa/browser",
]
}
if (is_win) {
sources += [
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
"//chrome/browser/ui/views/color_chooser_dialog.cc",
"//chrome/browser/ui/views/color_chooser_dialog.h",
"//chrome/browser/ui/views/color_chooser_win.cc",
]
}
if (is_linux) {
sources += [ "//chrome/browser/media/webrtc/window_icon_util_linux.cc" ]
}
}
if (enable_widevine) {
sources += [
"//chrome/renderer/media/chrome_key_systems.cc",
@@ -346,17 +314,13 @@ source_set("plugins") {
sources += [
"//chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc",
"//chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h",
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
"//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
"//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
]
if (enable_pdf_viewer) {
sources += [
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/renderer" ]
}
deps += [ "//components/pdf/renderer" ]
}
deps += [
"//components/strings",

View File

@@ -4,6 +4,7 @@
#include "chrome/browser/process_singleton.h"
#include <windows.h>
#include <shellapi.h>
#include "base/base_paths.h"

View File

@@ -59,10 +59,9 @@ an issue:
* [Testing and Debugging](tutorial/application-debugging.md)
* [Debugging the Main Process](tutorial/debugging-main-process.md)
* [Debugging with Visual Studio Code](tutorial/debugging-vscode.md)
* [Using Selenium and WebDriver](tutorial/using-selenium-and-webdriver.md)
* [Testing on Headless CI Systems (Travis, Jenkins)](tutorial/testing-on-headless-ci.md)
* [DevTools Extension](tutorial/devtools-extension.md)
* [Automated Testing with a Custom Driver](tutorial/automated-testing-with-a-custom-driver.md)
* [Automated Testing](tutorial/automated-testing.md)
* [REPL](tutorial/repl.md)
* [Distribution](tutorial/application-distribution.md)
* [Supported Platforms](tutorial/support.md#supported-platforms)

View File

@@ -36,10 +36,10 @@ Returns:
* `launchInfo` Record<string, any> | [NotificationResponse](structures/notification-response.md) _macOS_
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
holds the `userInfo` of the `NSUserNotification` or information from
[`UNNotificationResponse`](structures/notification-response.md) that was used to open the
application, if it was launched from Notification Center. You can also call
`app.isReady()` to check if this event has already fired and `app.whenReady()`
holds the `userInfo` of the [`NSUserNotification`](https://developer.apple.com/documentation/foundation/nsusernotification)
or information from [`UNNotificationResponse`](https://developer.apple.com/documentation/usernotifications/unnotificationresponse)
that was used to open the application, if it was launched from Notification Center.
You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()`
to get a Promise that is fulfilled when Electron is initialized.
### Event: 'window-all-closed'
@@ -277,6 +277,7 @@ Returns:
* `certificate` [Certificate](structures/certificate.md)
* `callback` Function
* `isTrusted` Boolean - Whether to consider the certificate as trusted
* `isMainFrame` Boolean
Emitted when failed to verify the `certificate` for `url`, to trust the
certificate you should prevent the default behavior with
@@ -1061,6 +1062,61 @@ Imports the certificate in pkcs12 format into the platform certificate store.
`callback` is called with the `result` of import operation, a value of `0`
indicates success while any other value indicates failure according to Chromium [net_error_list](https://source.chromium.org/chromium/chromium/src/+/master:net/base/net_error_list.h).
### `app.configureHostResolver(options)`
* `options` Object
* `enableBuiltInResolver` Boolean (optional) - Whether the built-in host
resolver is used in preference to getaddrinfo. When enabled, the built-in
resolver will attempt to use the system's DNS settings to do DNS lookups
itself. Enabled by default on macOS, disabled by default on Windows and
Linux.
* `secureDnsMode` String (optional) - Can be "off", "automatic" or "secure".
Configures the DNS-over-HTTP mode. When "off", no DoH lookups will be
performed. When "automatic", DoH lookups will be performed first if DoH is
available, and insecure DNS lookups will be performed as a fallback. When
"secure", only DoH lookups will be performed. Defaults to "automatic".
* `secureDnsServers` String[]&#32;(optional) - A list of DNS-over-HTTP
server templates. See [RFC8484 § 3][] for details on the template format.
Most servers support the POST method; the template for such servers is
simply a URI. Note that for [some DNS providers][doh-providers], the
resolver will automatically upgrade to DoH unless DoH is explicitly
disabled, even if there are no DoH servers provided in this list.
* `enableAdditionalDnsQueryTypes` Boolean (optional) - Controls whether additional DNS
query types, e.g. HTTPS (DNS type 65) will be allowed besides the
traditional A and AAAA queries when a request is being made via insecure
DNS. Has no effect on Secure DNS which always allows additional types.
Defaults to true.
Configures host resolution (DNS and DNS-over-HTTPS). By default, the following
resolvers will be used, in order:
1. DNS-over-HTTPS, if the [DNS provider supports it][doh-providers], then
2. the built-in resolver (enabled on macOS only by default), then
3. the system's resolver (e.g. `getaddrinfo`).
This can be configured to either restrict usage of non-encrypted DNS
(`secureDnsMode: "secure"`), or disable DNS-over-HTTPS (`secureDnsMode:
"off"`). It is also possible to enable or disable the built-in resolver.
To disable insecure DNS, you can specify a `secureDnsMode` of `"secure"`. If you do
so, you should make sure to provide a list of DNS-over-HTTPS servers to use, in
case the user's DNS configuration does not include a provider that supports
DoH.
```js
app.configureHostResolver({
secureDnsMode: 'secure',
secureDnsServers: [
'https://cloudflare-dns.com/dns-query'
]
})
```
This API must be called after the `ready` event is emitted.
[doh-providers]: https://source.chromium.org/chromium/chromium/src/+/main:net/dns/public/doh_provider_entry.cc;l=31?q=%22DohProviderEntry::GetList()%22&ss=chromium%2Fchromium%2Fsrc
[RFC8484 § 3]: https://datatracker.ietf.org/doc/html/rfc8484#section-3
### `app.disableHardwareAcceleration()`
Disables hardware acceleration for current app.
@@ -1137,8 +1193,8 @@ badge.
On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
**Note:** Unity launcher requires the existence of a `.desktop` file to work,
for more information please read [Desktop Environment Integration][unity-requirement].
**Note:** Unity launcher requires a `.desktop` file to work. For more information,
please read the [Unity integration documentation][unity-requirement].
### `app.getBadgeCount()` _Linux_ _macOS_
@@ -1376,8 +1432,8 @@ An `Integer` property that returns the badge count for current app. Setting the
On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher.
**Note:** Unity launcher requires the existence of a `.desktop` file to work,
for more information please read [Desktop Environment Integration][unity-requirement].
**Note:** Unity launcher requires a `.desktop` file to work. For more information,
please read the [Unity integration documentation][unity-requirement].
**Note:** On macOS, you need to ensure that your application has the permission
to display notifications for this property to take effect.
@@ -1405,7 +1461,7 @@ A `Boolean` property that returns `true` if the app is packaged, `false` otherw
[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme
[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html
[activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType
[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher
[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher
[mas-builds]: ../tutorial/mac-app-store-submission-guide.md
[Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
[JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx

View File

@@ -43,7 +43,7 @@ The installer generated with Squirrel will create a shortcut icon with an
same ID for your app with `app.setAppUserModelId` API, otherwise Windows will
not be able to pin your app properly in task bar.
Unlike Squirrel.Mac, Windows can host updates on S3 or any other static file host.
Like Squirrel.Mac, Windows can host updates on S3 or any other static file host.
You can read the documents of [Squirrel.Windows][squirrel-windows] to get more details
about how Squirrel.Windows works.

View File

@@ -17,17 +17,19 @@ win.loadURL('https://github.com')
win.loadFile('index.html')
```
## Frameless window
## Window customization
To create a window without chrome, or a transparent window in arbitrary shape,
you can use the [Frameless Window](frameless-window.md) API.
The `BrowserWindow` class exposes various ways to modify the look and behavior of
your app's windows. For more details, see the [Window Customization](../tutorial/window-customization.md)
tutorial.
## Showing window gracefully
## Showing the window gracefully
When loading a page in the window directly, users may see the page load incrementally, which is not a good experience for a native app. To make the window display
without visual flash, there are two solutions for different situations.
When loading a page in the window directly, users may see the page load incrementally,
which is not a good experience for a native app. To make the window display
without a visual flash, there are two solutions for different situations.
## Using `ready-to-show` event
### Using the `ready-to-show` event
While loading the page, the `ready-to-show` event will be emitted when the renderer
process has rendered the page for the first time if the window has not been shown yet. Showing
@@ -48,7 +50,7 @@ event.
Please note that using this event implies that the renderer will be considered "visible" and
paint even though `show` is false. This event will never fire if you use `paintWhenInitiallyHidden: false`
## Setting `backgroundColor`
### Setting the `backgroundColor` property
For a complex app, the `ready-to-show` event could be emitted too late, making
the app feel slow. In this case, it is recommended to show the window
@@ -183,13 +185,13 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
`true`.
* `paintWhenInitiallyHidden` Boolean (optional) - Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.
* `frame` Boolean (optional) - Specify `false` to create a
[Frameless Window](frameless-window.md). Default is `true`.
[frameless window](../tutorial/window-customization.md#create-frameless-windows). Default is `true`.
* `parent` BrowserWindow (optional) - Specify parent window. Default is `null`.
* `modal` Boolean (optional) - Whether this is a modal window. This only works when the
window is a child window. Default is `false`.
* `acceptFirstMouse` Boolean (optional) - Whether the web view accepts a single
mouse-down event that simultaneously activates the window. Default is
`false`.
* `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also
click through to the web contents. Default is `false` on macOS. This option is not
configurable on other platforms.
* `disableAutoHideCursor` Boolean (optional) - Whether to hide cursor when typing.
Default is `false`.
* `autoHideMenuBar` Boolean (optional) - Auto hide the menu bar unless the `Alt`
@@ -205,7 +207,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
* `transparent` Boolean (optional) - Makes the window [transparent](../tutorial/window-customization.md#create-transparent-windows).
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.
@@ -213,16 +215,13 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `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.
* `titleBarStyle` String (optional) _macOS_ _Windows_ - The style of window title bar.
Default is `default`. Possible values are:
* `default` - Results in the standard gray opaque Mac title
bar.
* `hidden` - Results in a hidden title bar and a full size content window, yet
the title bar still has the standard window controls ("traffic lights") in
the top left.
* `hiddenInset` - Results in a hidden title bar with an alternative look
* `default` - Results in the standard title bar for macOS or Windows respectively.
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
* `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look
where the traffic light buttons are slightly more inset from the window edge.
* `customButtonsOnHover` - Results in a hidden title bar and a full size
* `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size
content window, the traffic light buttons will display when being hovered
over in the top left of the window. **Note:** This option is currently
experimental.
@@ -392,10 +391,10 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
contain the layout of the document—without requiring scrolling. Enabling
this will cause the `preferred-size-changed` event to be emitted on the
`WebContents` when the preferred size changes. Default is `false`.
* `titleBarOverlay` Boolean (optional) - On macOS, when using a frameless window in conjunction with
`win.setWindowButtonVisibility(true)` or using a `titleBarStyle` so that the traffic lights are visible,
this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and
[CSS Environment Variables][overlay-css-env-vars]. Default is `false`.
* `titleBarOverlay` Object | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Default is `false`.
* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color.
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
* `height` Integer (optional) _macOS_ _Windows_ - The height of the title bar and Window Controls Overlay in pixels. Default is system height.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
@@ -991,7 +990,7 @@ 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
The aspect ratio is not respected when window is resized programmatically with
APIs like `win.setSize`.
#### `win.setBackgroundColor(backgroundColor)`
@@ -1001,7 +1000,7 @@ APIs like `win.setSize`.
is `true`). Default is `#FFF` (white).
Sets the background color of the window. See [Setting
`backgroundColor`](#setting-backgroundcolor).
`backgroundColor`](#setting-the-backgroundcolor-property).
#### `win.previewFile(path[, displayName])` _macOS_
@@ -1046,7 +1045,7 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `
#### `win.getBackgroundColor()`
Returns `String` - Gets the background color of the window. See [Setting
`backgroundColor`](#setting-backgroundcolor).
`backgroundColor`](#setting-the-backgroundcolor-property).
#### `win.setContentBounds(bounds[, animate])`
@@ -1699,7 +1698,7 @@ current window into a top-level window.
#### `win.getParentWindow()`
Returns `BrowserWindow` - The parent window.
Returns `BrowserWindow | null` - The parent window or `null` if there is no parent.
#### `win.getChildWindows()`

View File

@@ -76,7 +76,7 @@ Writes `markup` to the clipboard.
```js
const { clipboard } = require('electron')
clipboard.writeHTML('<b>Hi</b')
clipboard.writeHTML('<b>Hi</b>')
```
### `clipboard.readImage([type])`
@@ -197,7 +197,7 @@ Returns `Boolean` - Whether the clipboard supports the specified `format`.
```js
const { clipboard } = require('electron')
const hasFormat = clipboard.has('<p>selection</p>')
const hasFormat = clipboard.has('public/utf8-plain-text')
console.log(hasFormat)
// 'true' or 'false'
```

View File

@@ -53,3 +53,12 @@ Returns `Boolean` - Whether the command-line switch is present.
Returns `String` - The command-line switch value.
**Note:** When the switch is not present or has no value, it returns empty string.
#### `commandLine.removeSwitch(switch)`
* `switch` String - A command-line switch
Removes the specified switch from Chromium's command line.
**Note:** This will not affect `process.argv`. The intended usage of this function is to
control Chromium's behavior.

View File

@@ -102,8 +102,8 @@ has been included below for completeness:
| `Boolean` | Simple | ✅ | ✅ | N/A |
| `Object` | Complex | ✅ | ✅ | Keys must be supported using only "Simple" types in this table. Values must be supported in this table. Prototype modifications are dropped. Sending custom classes will copy values but not the prototype. |
| `Array` | Complex | ✅ | ✅ | Same limitations as the `Object` type |
| `Error` | Complex | ✅ | ✅ | Errors that are thrown are also copied, this can result in the message and stack trace of the error changing slightly due to being thrown in a different context |
| `Promise` | Complex | ✅ | ✅ | Promises are only proxied if they are the return value or exact parameter. Promises nested in arrays or objects will be dropped. |
| `Error` | Complex | ✅ | ✅ | Errors that are thrown are also copied, this can result in the message and stack trace of the error changing slightly due to being thrown in a different context, and any custom properties on the Error object [will be lost](https://github.com/electron/electron/issues/25596) |
| `Promise` | Complex | ✅ | ✅ | N/A
| `Function` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending classes or constructors will not work. |
| [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple | ✅ | ✅ | See the linked document on cloneable types |
| `Element` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending custom elements will not work. |

View File

@@ -93,7 +93,7 @@ the response.
* `domain` String (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.
* `path` String (optional) - The path of the cookie. Empty by default if omitted.
* `secure` Boolean (optional) - Whether the cookie should be marked as Secure. Defaults to
false.
false unless [Same Site=None](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite#samesitenone_requires_secure) attribute is used.
* `httpOnly` Boolean (optional) - Whether the cookie should be marked as HTTP only.
Defaults to false.
* `expirationDate` Double (optional) - The expiration date of the cookie as the number of

View File

@@ -234,6 +234,7 @@ expanding and collapsing the dialog.
* `title` String (optional) - Title of the message box, some platforms will not show it.
* `detail` String (optional) - Extra information of the message.
* `icon` ([NativeImage](native-image.md) | String) (optional)
* `textWidth` Integer (optional) _macOS_ - Custom width of the text in the message box.
* `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via
the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the
label. If no such labeled buttons exist and this option is not set, `0` will be used as the
@@ -285,6 +286,7 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
* `checkboxChecked` Boolean (optional) - Initial checked state of the
checkbox. `false` by default.
* `icon` [NativeImage](native-image.md) (optional)
* `textWidth` Integer (optional) _macOS_ - Custom width of the text in the message box.
* `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via
the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the
label. If no such labeled buttons exist and this option is not set, `0` will be used as the

View File

@@ -122,7 +122,7 @@ Prints Chromium's internal logging to the console.
Setting this variable is the same as passing `--enable-logging`
on the command line. For more info, see `--enable-logging` in [command-line
switches](./command-line-switches.md#enable-loggingfile).
switches](./command-line-switches.md#--enable-loggingfile).
### `ELECTRON_LOG_FILE`
@@ -130,7 +130,7 @@ Sets the file destination for Chromium's internal logging.
Setting this variable is the same as passing `--log-file`
on the command line. For more info, see `--log-file` in [command-line
switches](./command-line-switches.md#log-filepath).
switches](./command-line-switches.md#--log-filepath).
### `ELECTRON_DEBUG_DRAG_REGIONS`

View File

@@ -1,205 +0,0 @@
# Frameless Window
> Open a window without toolbars, borders, or other graphical "chrome".
A frameless window is a window that has no
[chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome), the parts of
the window, like toolbars, that are not a part of the web page. These are
options on the [`BrowserWindow`](browser-window.md) class.
## Create a frameless window
To create a frameless window, you need to set `frame` to `false` in
[BrowserWindow](browser-window.md)'s `options`:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ width: 800, height: 600, frame: false })
win.show()
```
### Alternatives on macOS
There's an alternative way to specify a chromeless window.
Instead of setting `frame` to `false` which disables both the titlebar and window controls,
you may want to have the title bar hidden and your content extend to the full window size,
yet still preserve the window controls ("traffic lights") for standard window actions.
You can do so by specifying the `titleBarStyle` option:
#### `hidden`
Results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls (“traffic lights”) in the top left.
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ titleBarStyle: 'hidden' })
win.show()
```
#### `hiddenInset`
Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
win.show()
```
#### `customButtonsOnHover`
Uses custom drawn close, and miniaturize buttons that display
when hovering in the top left of the window. The fullscreen button
is not available due to restrictions of frameless windows as they
interface with Apple's macOS window masks. These custom buttons prevent
issues with mouse events that occur with the standard window toolbar buttons.
This option is only applicable for frameless windows.
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: false })
win.show()
```
## Windows Control Overlay
On macOS, when using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` or using one of the `titleBarStyle`s described above so
that the traffic lights are visible, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and
[CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
titleBarStyle: 'hiddenInset',
titleBarOverlay: true
})
win.show()
```
## Transparent window
By setting the `transparent` option to `true`, you can also make the frameless
window transparent:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ transparent: true, frame: false })
win.show()
```
### Limitations
* You can not click through the transparent area. We are going to introduce an
API to set window shape to solve this, see
[our issue](https://github.com/electron/electron/issues/1335) for details.
* Transparent windows are not resizable. Setting `resizable` to `true` may make
a transparent window stop working on some platforms.
* 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).
* 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
NVidia drivers](https://bugs.chromium.org/p/chromium/issues/detail?id=369209) on
Linux.
* On Mac, the native window shadow will not be shown on a transparent window.
## Click-through window
To create a click-through window, i.e. making the window ignore all mouse
events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events]
API:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
win.setIgnoreMouseEvents(true)
```
### Forwarding
Ignoring mouse messages makes the web page oblivious to mouse movement, meaning
that mouse movement events will not be emitted. On Windows operating systems an
optional parameter can be used to forward mouse move messages to the web page,
allowing events such as `mouseleave` to be emitted:
```javascript
const { ipcRenderer } = require('electron')
const el = document.getElementById('clickThroughElement')
el.addEventListener('mouseenter', () => {
ipcRenderer.send('set-ignore-mouse-events', true, { forward: true })
})
el.addEventListener('mouseleave', () => {
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)
})
```
This makes the web page click-through when over `el`, and returns to normal
outside it.
## Draggable region
By default, the frameless window is non-draggable. Apps need to specify
`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable
(like the OS's standard titlebar), and apps can also use
`-webkit-app-region: no-drag` to exclude the non-draggable area from the
draggable region. Note that only rectangular shapes are currently supported.
Note: `-webkit-app-region: drag` is known to have problems while the developer tools are open. See this [GitHub issue](https://github.com/electron/electron/issues/3647) for more information including a workaround.
To make the whole window draggable, you can add `-webkit-app-region: drag` as
`body`'s style:
```html
<body style="-webkit-app-region: drag">
</body>
```
And note that if you have made the whole window draggable, you must also mark
buttons as non-draggable, otherwise it would be impossible for users to click on
them:
```css
button {
-webkit-app-region: no-drag;
}
```
If you're only setting a custom titlebar as draggable, you also need to make all
buttons in titlebar non-draggable.
## Text selection
In a frameless window the dragging behavior may conflict with selecting text.
For example, when you drag the titlebar you may accidentally select the text on
the titlebar. To prevent this, you need to disable text selection within a
draggable area like this:
```css
.titlebar {
-webkit-user-select: none;
-webkit-app-region: drag;
}
```
## Context menu
On some platforms, the draggable area will be treated as a non-client frame, so
when you right click on it a system menu will pop up. To make the context menu
behave correctly on all platforms you should never use a custom context menu on
draggable areas.
[ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables

View File

@@ -14,7 +14,7 @@ See [`Menu`](menu.md) for examples.
* `menuItem` MenuItem
* `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`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.
@@ -155,7 +155,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme
#### `menuItem.role`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
#### `menuItem.accelerator`

View File

@@ -162,7 +162,7 @@ const template = [
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }

View File

@@ -67,3 +67,8 @@ or is being instructed to show a high-contrast UI.
A `Boolean` for if the OS / Chromium currently has an inverted color scheme
or is being instructed to use an inverted color scheme.
### `nativeTheme.inForcedColorsMode` _Windows_ _Readonly_
A `boolean` indicating whether Chromium is in forced colors mode, controlled by system accessibility settings.
Currently, Windows high contrast is the only system setting that triggers forced colors mode.

View File

@@ -178,7 +178,6 @@ Returns an object with V8 heap statistics. Note that all statistics are reported
Returns `Object`:
* `allocated` Integer - Size of all allocated objects in Kilobytes.
* `marked` Integer - Size of all marked objects in Kilobytes.
* `total` Integer - Total allocated space in Kilobytes.
Returns an object with Blink memory information.

40
docs/api/safe-storage.md Normal file
View File

@@ -0,0 +1,40 @@
# safeStorage
> Allows access to simple encryption and decryption of strings for storage on the local machine.
Process: [Main](../glossary.md#main-process)
This module protects data stored on disk from being accessed by other applications or users with full disk access.
Note that on Mac, access to the system Keychain is required and
these calls can block the current thread to collect user input.
The same is true for Linux, if a password management tool is available.
## Methods
The `safeStorage` module has the following methods:
### `safeStorage.isEncryptionAvailable()`
Returns `Boolean` - Whether encryption is available.
On Linux, returns true if the app has emitted the `ready` event and the secret key is available.
On MacOS, returns true if Keychain is available.
On Windows, returns true once the app has emitted the `ready` event.
### `safeStorage.encryptString(plainText)`
* `plainText` String
Returns `Buffer` - An array of bytes representing the encrypted string.
This function will throw an error if encryption fails.
### `safeStorage.decryptString(encrypted)`
* `encrypted` Buffer
Returns `String` - the decrypted string. Decrypts the encrypted buffer
obtained with `safeStorage.encryptString` back into a string.
This function will throw an error if decryption fails.

View File

@@ -86,8 +86,8 @@ available from next tick of the process.
const { session } = require('electron')
session.defaultSession.on('will-download', (event, item, webContents) => {
event.preventDefault()
require('request')(item.getURL(), (data) => {
require('fs').writeFileSync('/somewhere', data)
require('got')(item.getURL()).then((response) => {
require('fs').writeFileSync('/somewhere', response.body)
})
})
```
@@ -180,7 +180,97 @@ Emitted when a hunspell dictionary file download fails. For details
on the failure you should collect a netlog and inspect the download
request.
#### Event: 'select-serial-port' _Experimental_
#### Event: 'select-hid-device'
Returns:
* `event` Event
* `details` Object
* `deviceList` [HIDDevice[]](structures/hid-device.md)
* `frame` [WebFrameMain](web-frame-main.md)
* `callback` Function
* `deviceId` String | null (optional)
Emitted when a HID device needs to be selected when a call to
`navigator.hid.requestDevice` is made. `callback` should be called with
`deviceId` to be selected; passing no arguments to `callback` will
cancel the request. Additionally, permissioning on `navigator.hid` can
be further managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler)
and [ses.setDevicePermissionHandler(handler)`](#sessetdevicepermissionhandlerhandler).
```javascript
const { app, BrowserWindow } = require('electron')
let win = null
app.whenReady().then(() => {
win = new BrowserWindow()
win.webContents.session.setPermissionCheckHandler((webContents, permission, requestingOrigin, details) => {
if (permission === 'hid') {
// Add logic here to determine if permission should be given to allow HID selection
return true
}
return false
})
// Optionally, retrieve previously persisted devices from a persistent store
const grantedDevices = fetchGrantedDevices()
win.webContents.session.setDevicePermissionHandler((details) => {
if (new URL(details.origin).hostname === 'some-host' && details.deviceType === 'hid') {
if (details.device.vendorId === 123 && details.device.productId === 345) {
// Always allow this type of device (this allows skipping the call to `navigator.hid.requestDevice` first)
return true
}
// Search through the list of devices that have previously been granted permission
return grantedDevices.some((grantedDevice) => {
return grantedDevice.vendorId === details.device.vendorId &&
grantedDevice.productId === details.device.productId &&
grantedDevice.serialNumber && grantedDevice.serialNumber === details.device.serialNumber
})
}
return false
})
win.webContents.session.on('select-hid-device', (event, details, callback) => {
event.preventDefault()
const selectedDevice = details.deviceList.find((device) => {
return device.vendorId === '9025' && device.productId === '67'
})
callback(selectedPort?.deviceId)
})
})
```
#### Event: 'hid-device-added'
Returns:
* `event` Event
* `details` Object
* `device` [HIDDevice[]](structures/hid-device.md)
* `frame` [WebFrameMain](web-frame-main.md)
Emitted when a new HID device becomes available. For example, when a new USB device is plugged in.
This event will only be emitted after `navigator.hid.requestDevice` has been called and `select-hid-device` has fired.
#### Event: 'hid-device-removed'
Returns:
* `event` Event
* `details` Object
* `device` [HIDDevice[]](structures/hid-device.md)
* `frame` [WebFrameMain](web-frame-main.md)
Emitted when a HID device has been removed. For example, this event will fire when a USB device is unplugged.
This event will only be emitted after `navigator.hid.requestDevice` has been called and `select-hid-device` has fired.
#### Event: 'select-serial-port'
Returns:
@@ -197,20 +287,45 @@ cancel the request. Additionally, permissioning on `navigator.serial` can
be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler)
with the `serial` permission.
Because this is an experimental feature it is disabled by default. To enable this feature, you
will need to use the `--enable-features=ElectronSerialChooser` command line switch.
```javascript
const { app, BrowserWindow } = require('electron')
let win = null
app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser')
app.whenReady().then(() => {
win = new BrowserWindow({
width: 800,
height: 600
})
win.webContents.session.setPermissionCheckHandler((webContents, permission, requestingOrigin, details) => {
if (permission === 'serial') {
// Add logic here to determine if permission should be given to allow serial selection
return true
}
return false
})
// Optionally, retrieve previously persisted devices from a persistent store
const grantedDevices = fetchGrantedDevices()
win.webContents.session.setDevicePermissionHandler((details) => {
if (new URL(details.origin).hostname === 'some-host' && details.deviceType === 'serial') {
if (details.device.vendorId === 123 && details.device.productId === 345) {
// Always allow this type of device (this allows skipping the call to `navigator.serial.requestPort` first)
return true
}
// Search through the list of devices that have previously been granted permission
return grantedDevices.some((grantedDevice) => {
return grantedDevice.vendorId === details.device.vendorId &&
grantedDevice.productId === details.device.productId &&
grantedDevice.serialNumber && grantedDevice.serialNumber === details.device.serialNumber
})
}
return false
})
win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
event.preventDefault()
const selectedPort = portList.find((device) => {
@@ -225,7 +340,7 @@ app.whenReady().then(() => {
})
```
#### Event: 'serial-port-added' _Experimental_
#### Event: 'serial-port-added'
Returns:
@@ -235,7 +350,7 @@ Returns:
Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. For example, this event will fire when a new USB device is plugged in.
#### Event: 'serial-port-removed' _Experimental_
#### Event: 'serial-port-removed'
Returns:
@@ -502,6 +617,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
* `permissionGranted` Boolean - Allow or deny the permission.
* `details` Object - Some properties are only available on certain permission types.
* `externalURL` String (optional) - The url of the `openExternal` request.
* `securityOrigin` String (optional) - The security origin of the `media` request.
* `mediaTypes` String[] (optional) - The types of media access being requested, elements can be `video`
or `audio`
* `requestingUrl` String - The last URL the requesting frame loaded
@@ -527,8 +643,8 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
#### `ses.setPermissionCheckHandler(handler)`
* `handler` Function\<Boolean> | null
* `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Cross origin sub frames making permission checks will pass a `null` webContents to this handler. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively.
* `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`.
* `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively.
* `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, `hid`, or `serial`.
* `requestingOrigin` String - The origin URL of the permission check
* `details` Object - Some properties are only available on certain permission types.
* `embeddingOrigin` String (optional) - The origin of the frame embedding the frame that made the permission check. Only set for cross-origin sub frames making permission checks.
@@ -556,6 +672,78 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
})
```
#### `ses.setDevicePermissionHandler(handler)`
* `handler` Function\<Boolean> | null
* `details` Object
* `deviceType` String - The type of device that permission is being requested on, can be `hid` or `serial`.
* `origin` String - The origin URL of the device permission check.
* `device` [HIDDevice](structures/hid-device.md) | [SerialPort](structures/serial-port.md)- the device that permission is being requested for.
* `frame` [WebFrameMain](web-frame-main.md) - WebFrameMain checking the device permission.
Sets the handler which can be used to respond to device permission checks for the `session`.
Returning `true` will allow the device to be permitted and `false` will reject it.
To clear the handler, call `setDevicePermissionHandler(null)`.
This handler can be used to provide default permissioning to devices without first calling for permission
to devices (eg via `navigator.hid.requestDevice`). If this handler is not defined, the default device
permissions as granted through device selection (eg via `navigator.hid.requestDevice`) will be used.
Additionally, the default behavior of Electron is to store granted device permision through the lifetime
of the corresponding WebContents. If longer term storage is needed, a developer can store granted device
permissions (eg when handling the `select-hid-device` event) and then read from that storage with `setDevicePermissionHandler`.
```javascript
const { app, BrowserWindow } = require('electron')
let win = null
app.whenReady().then(() => {
win = new BrowserWindow()
win.webContents.session.setPermissionCheckHandler((webContents, permission, requestingOrigin, details) => {
if (permission === 'hid') {
// Add logic here to determine if permission should be given to allow HID selection
return true
} else if (permission === 'serial') {
// Add logic here to determine if permission should be given to allow serial port selection
}
return false
})
// Optionally, retrieve previously persisted devices from a persistent store
const grantedDevices = fetchGrantedDevices()
win.webContents.session.setDevicePermissionHandler((details) => {
if (new URL(details.origin).hostname === 'some-host' && details.deviceType === 'hid') {
if (details.device.vendorId === 123 && details.device.productId === 345) {
// Always allow this type of device (this allows skipping the call to `navigator.hid.requestDevice` first)
return true
}
// Search through the list of devices that have previously been granted permission
return grantedDevices.some((grantedDevice) => {
return grantedDevice.vendorId === details.device.vendorId &&
grantedDevice.productId === details.device.productId &&
grantedDevice.serialNumber && grantedDevice.serialNumber === details.device.serialNumber
})
} else if (details.deviceType === 'serial') {
if (details.device.vendorId === 123 && details.device.productId === 345) {
// Always allow this type of device (this allows skipping the call to `navigator.hid.requestDevice` first)
return true
}
}
return false
})
win.webContents.session.on('select-hid-device', (event, details, callback) => {
event.preventDefault()
const selectedDevice = details.deviceList.find((device) => {
return device.vendorId === '9025' && device.productId === '67'
})
callback(selectedPort?.deviceId)
})
})
```
#### `ses.clearHostResolverCache()`
Returns `Promise<void>` - Resolves when the operation is complete.

View File

@@ -0,0 +1,8 @@
# HIDDevice Object
* `deviceId` String - Unique identifier for the device.
* `name` String - Name of the device.
* `vendorId` Integer - The USB vendor ID.
* `productId` Integer - The USB product ID.
* `serialNumber` String (optional) - The USB device serial number.
* `guid` String (optional) - Unique identifier for the HID interface. A device may have multiple HID interfaces.

View File

@@ -15,7 +15,7 @@ _This class is not exported from the `'electron'` module. It is only available a
* `highlightedIndex` Integer - The index of the item the user touched.
* `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. Defaults to `none`.
* `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. Defaults to `none`.
* `showArrowButtons` Boolean (optional) - Defaults to `false`.
* `showArrowButtons` Boolean (optional) - Whether to show arrow buttons. Defaults to `false` and is only shown if `items` is non-empty.
* `mode` String (optional) - Can be `fixed` or `free`. The default is `free`.
* `continuous` Boolean (optional) - Defaults to `true`.

View File

@@ -45,6 +45,26 @@ returns `null`.
Returns `WebContents` | undefined - A WebContents instance with the given ID, or
`undefined` if there is no WebContents associated with the given ID.
### `webContents.fromDevToolsTargetId(targetId)`
* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance.
Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or
`undefined` if there is no WebContents associated with the given TargetID.
When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/),
it can be useful to lookup a WebContents instance based on its assigned TargetID.
```js
async function lookupTargetId (browserWindow) {
const wc = browserWindow.webContents
await wc.debugger.attach('1.3')
const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo')
const { targetId } = targetInfo
const targetWebContents = await webContents.fromDevToolsTargetId(targetId)
}
```
## Class: WebContents
> Render and control the contents of a BrowserWindow instance.
@@ -114,7 +134,7 @@ Returns:
* `event` Event
Emitted when the document in the given frame is loaded.
Emitted when the document in the top-level frame is loaded.
#### Event: 'page-title-updated'
@@ -510,6 +530,7 @@ Returns:
* `certificate` [Certificate](structures/certificate.md)
* `callback` Function
* `isTrusted` Boolean - Indicates whether the certificate can be considered trusted.
* `isMainFrame` Boolean
Emitted when failed to verify the `certificate` for `url`.
@@ -630,6 +651,7 @@ Returns:
* `params` Object
* `x` Integer - x coordinate.
* `y` Integer - y coordinate.
* `frame` WebFrameMain - Frame from which the context menu was invoked.
* `linkURL` String - URL of the link that encloses the node the context menu
was invoked on.
* `linkText` String - Text associated with the link. May be an empty
@@ -714,6 +736,8 @@ first available device will be selected. `callback` should be called with
`deviceId` to be selected, passing empty string to `callback` will
cancel the request.
If no event listener is added for this event, all bluetooth requests will be cancelled.
```javascript
const { app, BrowserWindow } = require('electron')
@@ -856,6 +880,16 @@ Emitted when the `WebContents` preferred size has changed.
This event will only be emitted when `enablePreferredSizeMode` is set to `true`
in `webPreferences`.
#### Event: 'frame-created'
Returns:
* `event` Event
* `details` Object
* `frame` WebFrameMain
Emitted when the [mainFrame](web-contents.md#contentsmainframe-readonly), an `<iframe>`, or a nested `<iframe>` is loaded within the page.
### Instance Methods
#### `contents.loadURL(url[, options])`
@@ -1462,8 +1496,8 @@ win.loadURL('http://github.com')
win.webContents.on('did-finish-load', () => {
// Use default printing options
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
win.webContents.printToPDF({}).then(data => {
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
fs.writeFile(pdfPath, data, (error) => {
if (error) throw error
console.log(`Wrote PDF successfully to ${pdfPath}`)
@@ -1578,7 +1612,7 @@ app.whenReady().then(() => {
* `options` Object (optional)
* `mode` String - Opens the devtools with specified dock state, can be
`right`, `bottom`, `undocked`, `detach`. Defaults to last used dock state.
`left`, `right`, `bottom`, `undocked`, `detach`. Defaults to last used dock state.
In `undocked` mode it's possible to dock back. In `detach` mode it's not.
* `activate` Boolean (optional) - Whether to bring the opened devtools window
to the foreground. The default is `true`.
@@ -1795,7 +1829,8 @@ End subscribing for frame presentation events.
#### `contents.startDrag(item)`
* `item` Object
* `file` String[] | String - The path(s) to the file(s) being dragged.
* `file` String - The path to the file being dragged.
* `files` String[] (optional) - The paths to the files being dragged. (`files` will override `file` field)
* `icon` [NativeImage](native-image.md) | String - The image must be
non-empty on macOS.
@@ -1805,7 +1840,7 @@ the cursor when dragging.
#### `contents.savePage(fullPath, saveType)`
* `fullPath` String - The full file path.
* `fullPath` String - The absolute file path.
* `saveType` String - Specify the save type.
* `HTMLOnly` - Save only the HTML of the page.
* `HTMLComplete` - Save complete-html page.
@@ -1992,11 +2027,6 @@ when the DevTools has been closed.
A [`Debugger`](debugger.md) instance for this webContents.
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
[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
@@ -2005,3 +2035,8 @@ when the page becomes backgrounded. This also affects the Page Visibility API.
#### `contents.mainFrame` _Readonly_
A [`WebFrameMain`](web-frame-main.md) property that represents the top frame of the page's frame hierarchy.
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
[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

View File

@@ -71,6 +71,12 @@ or `undefined` if there is no WebFrameMain associated with the given IDs.
Process: [Main](../glossary.md#main-process)<br />
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
### Instance Events
#### Event: 'dom-ready'
Emitted when the document is loaded.
### Instance Methods
#### `frame.executeJavaScript(code[, userGesture])`

View File

@@ -143,12 +143,16 @@ browser plugins. Plugins are disabled by default.
### `preload`
```html
<!-- from a file -->
<webview src="https://www.github.com/" preload="./test.js"></webview>
<!-- or if you want to load from an asar archive -->
<webview src="https://www.github.com/" preload="./app.asar/test.js"></webview>
```
A `String` that specifies a script that will be loaded before other scripts run in the guest
page. The protocol of script's URL must be either `file:` or `asar:`, because it
will be loaded by `require` in guest page under the hood.
page. The protocol of script's URL must be `file:` (even when using `asar:` archives) because
it will be loaded by Node's `require` under the hood, which treats `asar:` archives as virtual
directories.
When the guest page doesn't have node integration this script will still have
access to all Node APIs, but global objects injected by Node will be deleted
@@ -606,6 +610,21 @@ listening to the `channel` event with the [`ipcRenderer`](ipc-renderer.md) modul
See [webContents.send](web-contents.md#contentssendchannel-args) for
examples.
### `<webview>.sendToFrame(frameId, channel, ...args)`
* `frameId` [number, number] - `[processId, frameId]`
* `channel` String
* `...args` any[]
Returns `Promise<void>`
Send an asynchronous message to renderer process via `channel`, you can also
send arbitrary arguments. The renderer process can handle the message by
listening to the `channel` event with the [`ipcRenderer`](ipc-renderer.md) module.
See [webContents.sendToFrame](web-contents.md#contentssendtoframeframeid-channel-args) for
examples.
### `<webview>.sendInputEvent(event)`
* `event` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
@@ -834,6 +853,32 @@ this purpose.
Calling `event.preventDefault()` does __NOT__ have any effect.
### Event: 'did-start-navigation'
Returns:
* `url` String
* `isInPlace` Boolean
* `isMainFrame` Boolean
* `frameProcessId` Integer
* `frameRoutingId` Integer
Emitted when any frame (including main) starts navigating. `isInPlace` will be
`true` for in-page navigations.
### Event: 'did-redirect-navigation'
Returns:
* `url` String
* `isInPlace` Boolean
* `isMainFrame` Boolean
* `frameProcessId` Integer
* `frameRoutingId` Integer
Emitted after a server side redirect occurs during navigation. For example a 302
redirect.
### Event: 'did-navigate'
Returns:
@@ -846,6 +891,23 @@ This event is not emitted for in-page navigations, such as clicking anchor links
or updating the `window.location.hash`. Use `did-navigate-in-page` event for
this purpose.
### Event: 'did-frame-navigate'
Returns:
* `url` String
* `httpResponseCode` Integer - -1 for non HTTP navigations
* `httpStatusText` String - empty for non HTTP navigations,
* `isMainFrame` Boolean
* `frameProcessId` Integer
* `frameRoutingId` Integer
Emitted when any frame navigation is done.
This event is not emitted for in-page navigations, such as clicking anchor links
or updating the `window.location.hash`. Use `did-navigate-in-page` event for
this purpose.
### Event: 'did-navigate-in-page'
Returns:
@@ -877,6 +939,7 @@ webview.addEventListener('close', () => {
Returns:
* `frameId` [number, number] - pair of `[processId, frameId]`.
* `channel` String
* `args` any[]
@@ -962,3 +1025,78 @@ 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/docs/extensions/reference/webviewTag/
### Event: 'context-menu'
Returns:
* `params` Object
* `x` Integer - x coordinate.
* `y` Integer - y coordinate.
* `linkURL` String - URL of the link that encloses the node the context menu
was invoked on.
* `linkText` String - Text associated with the link. May be an empty
string if the contents of the link are an image.
* `pageURL` String - URL of the top level page that the context menu was
invoked on.
* `frameURL` String - URL of the subframe that the context menu was invoked
on.
* `srcURL` String - Source URL for the element that the context menu
was invoked on. Elements with source URLs are images, audio and video.
* `mediaType` String - Type of the node the context menu was invoked on. Can
be `none`, `image`, `audio`, `video`, `canvas`, `file` or `plugin`.
* `hasImageContents` Boolean - Whether the context menu was invoked on an image
which has non-empty contents.
* `isEditable` Boolean - Whether the context is editable.
* `selectionText` String - Text of the selection that the context menu was
invoked on.
* `titleText` String - Title text of the selection that the context menu was
invoked on.
* `altText` String - Alt text of the selection that the context menu was
invoked on.
* `suggestedFilename` String - Suggested filename to be used when saving file through 'Save
Link As' option of context menu.
* `selectionRect` [Rectangle](structures/rectangle.md) - Rect representing the coordinates in the document space of the selection.
* `selectionStartOffset` Number - Start position of the selection text.
* `referrerPolicy` [Referrer](structures/referrer.md) - The referrer policy of the frame on which the menu is invoked.
* `misspelledWord` String - The misspelled word under the cursor, if any.
* `dictionarySuggestions` String[] - An array of suggested words to show the
user to replace the `misspelledWord`. Only available if there is a misspelled
word and spellchecker is enabled.
* `frameCharset` String - The character encoding of the frame on which the
menu was invoked.
* `inputFieldType` String - If the context menu was invoked on an input
field, the type of that field. Possible values are `none`, `plainText`,
`password`, `other`.
* `spellcheckEnabled` Boolean - If the context is editable, whether or not spellchecking is enabled.
* `menuSourceType` String - Input source that invoked the context menu.
Can be `none`, `mouse`, `keyboard`, `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`, `adjustSelection`, or `adjustSelectionReset`.
* `mediaFlags` Object - The flags for the media element the context menu was
invoked on.
* `inError` Boolean - Whether the media element has crashed.
* `isPaused` Boolean - Whether the media element is paused.
* `isMuted` Boolean - Whether the media element is muted.
* `hasAudio` Boolean - Whether the media element has audio.
* `isLooping` Boolean - Whether the media element is looping.
* `isControlsVisible` Boolean - Whether the media element's controls are
visible.
* `canToggleControls` Boolean - Whether the media element's controls are
toggleable.
* `canPrint` Boolean - Whether the media element can be printed.
* `canSave` Boolean - Whether or not the media element can be downloaded.
* `canShowPictureInPicture` Boolean - Whether the media element can show picture-in-picture.
* `isShowingPictureInPicture` Boolean - Whether the media element is currently showing picture-in-picture.
* `canRotate` Boolean - Whether the media element can be rotated.
* `canLoop` Boolean - Whether the media element can be looped.
* `editFlags` Object - These flags indicate whether the renderer believes it
is able to perform the corresponding action.
* `canUndo` Boolean - Whether the renderer believes it can undo.
* `canRedo` Boolean - Whether the renderer believes it can redo.
* `canCut` Boolean - Whether the renderer believes it can cut.
* `canCopy` Boolean - Whether the renderer believes it can copy.
* `canPaste` Boolean - Whether the renderer believes it can paste.
* `canDelete` Boolean - Whether the renderer believes it can delete.
* `canSelectAll` Boolean - Whether the renderer believes it can select all.
* `canEditRichly` Boolean - Whether the renderer believes it can edit text richly.
Emitted when there is a new context menu that needs to be handled.

View File

@@ -64,6 +64,9 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn
`features` will be passed to any registered `webContents`'s
`did-create-window` event handler in the `options` argument.
* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters).
* When opening `about:blank`, the child window's `WebPreferences` will be copied
from the parent window, and there is no way to override it because Chromium
skips browser side navigation in this case.
To customize or cancel the creation of the window, you can optionally set an
override handler with `webContents.setWindowOpenHandler()` from the main

View File

@@ -12,8 +12,39 @@ This document uses the following convention to categorize breaking changes:
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (15.0)
### Default Changed: `nativeWindowOpen` defaults to `true`
Prior to Electron 15, `window.open` was by default shimmed to use
`BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work
to open synchronously scriptable child windows, among other incompatibilities.
`nativeWindowOpen` is no longer experimental, and is now the default.
See the documentation for [window.open in Electron](api/window-open.md)
for more details.
## Planned Breaking API Changes (14.0)
### Removed: `remote` module
The `remote` module was deprecated in Electron 12, and will be removed in
Electron 14. It is replaced by the
[`@electron/remote`](https://github.com/electron/remote) module.
```js
// Deprecated in Electron 12:
const { BrowserWindow } = require('electron').remote
```
```js
// Replace with:
const { BrowserWindow } = require('@electron/remote')
// In the main process:
require('@electron/remote/main').initialize()
```
### Removed: `app.allowRendererProcessReuse`
The `app.allowRendererProcessReuse` property will be removed as part of our plan to
@@ -43,16 +74,6 @@ ensure your code works with this property enabled. It has been enabled by defau
You will be affected by this change if you use either `webFrame.executeJavaScript` or `webFrame.executeJavaScriptInIsolatedWorld`. You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) as these methods use the same value passing semantics.
### Default Changed: `nativeWindowOpen` defaults to `true`
Prior to Electron 14, `window.open` was by default shimmed to use
`BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work
to open synchronously scriptable child windows, among other incompatibilities.
`nativeWindowOpen` is no longer experimental, and is now the default.
See the documentation for [window.open in Electron](api/window-open.md)
for more details.
### Removed: BrowserWindowConstructorOptions inheriting from parent windows
Prior to Electron 14, windows opened with `window.open` would inherit
@@ -556,7 +577,7 @@ error.
### API Changed: `shell.openItem` is now `shell.openPath`
The `shell.openItem` API has been replaced with an asynchronous `shell.openPath` API.
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/master/wg-api/spec-documents/shell-openitem.md).
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/main/wg-api/spec-documents/shell-openitem.md).
## Planned Breaking API Changes (8.0)

View File

@@ -4,8 +4,8 @@ These guides are intended for people working on the Electron project itself.
For guides on Electron app development, see
[/docs/README.md](../README.md#guides-and-tutorials).
* [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md)
* [Contributing to Electron](https://github.com/electron/electron/blob/master/CONTRIBUTING.md)
* [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md)
* [Contributing to Electron](https://github.com/electron/electron/blob/main/CONTRIBUTING.md)
* [Issues](issues.md)
* [Pull Requests](pull-requests.md)
* [Documentation Styleguide](coding-style.md#documentation)

View File

@@ -8,7 +8,7 @@ Example Use Case:
* We need `VS15.9` and we have `VS15.7` installed; this would require us to update an Azure image.
1. Identify the image you wish to modify.
* In [appveyor.yml](https://github.com/electron/electron/blob/master/appveyor.yml), the image is identified by the property *image*.
* In [appveyor.yml](https://github.com/electron/electron/blob/main/appveyor.yml), the image is identified by the property *image*.
* The names used correspond to the *"images"* defined for a build cloud, eg the [libcc-20 cloud](https://windows-ci.electronjs.org/build-clouds/8).
* Find the image you wish to modify in the build cloud and make note of the **VHD Blob Path** for that image, which is the value for that corresponding key.
* You will need this URI path to copy into a new image.

View File

@@ -65,8 +65,8 @@ origin URLs.
$ cd src/electron
$ git remote remove origin
$ git remote add origin https://github.com/electron/electron
$ git checkout master
$ git branch --set-upstream-to=origin/master
$ git checkout main
$ git branch --set-upstream-to=origin/main
$ cd -
```

View File

@@ -26,7 +26,9 @@ you prefer a graphical interface.
* **.lldbinit**: Create or edit `~/.lldbinit` to allow Chromium code to be properly source-mapped.
```text
command script import ~/electron/src/tools/lldb/lldbinit.py
# e.g: ['~/electron/src/tools/lldb']
script sys.path[:0] = ['<...path/to/electron/src/tools/lldb>']
script import lldbinit
```
## Attaching to and Debugging Electron

View File

@@ -72,4 +72,4 @@ to try NW.js.
[nwjs]: https://nwjs.io/
[electron-modules]: https://www.npmjs.com/search?q=electron
[node-bindings]: https://github.com/electron/electron/tree/master/lib/common
[node-bindings]: https://github.com/electron/electron/tree/main/lib/common

View File

@@ -45,10 +45,10 @@ Once you've built the project locally, you're ready to start making changes!
### Step 3: Branch
To keep your development environment organized, create local branches to
hold your work. These should be branched directly off of the `master` branch.
hold your work. These should be branched directly off of the `main` branch.
```sh
$ git checkout -b my-branch -t upstream/master
$ git checkout -b my-branch -t upstream/main
```
## Making Changes
@@ -134,11 +134,11 @@ Once you have committed your changes, it is a good idea to use `git rebase`
```sh
$ git fetch upstream
$ git rebase upstream/master
$ git rebase upstream/main
```
This ensures that your working branch has the latest changes from `electron/electron`
master.
main.
### Step 7: Test
@@ -189,7 +189,7 @@ the requirements below.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->
```
@@ -222,7 +222,7 @@ seem unfamiliar, refer to this
#### Approval and Request Changes Workflow
All pull requests require approval from a
[Code Owner](https://github.com/electron/electron/blob/master/.github/CODEOWNERS)
[Code Owner](https://github.com/electron/electron/blob/main/.github/CODEOWNERS)
of the area you modified in order to land. Whenever a maintainer reviews a pull
request they may request changes. These may be small, such as fixing a typo, or
may involve substantive changes. Such requests are intended to be helpful, but

View File

@@ -43,8 +43,9 @@ SRV*c:\code\symbols\*https://msdl.microsoft.com/download/symbols;SRV*c:\code\sym
## Using the symbol server in Visual Studio
![Tools -> Options](https://mdn.mozillademos.org/files/733/symbol-server-vc8express-menu.jpg)
![Symbols Settings](https://mdn.mozillademos.org/files/2497/2005_options.gif)
![Tools -> Options](../images/vs-tools-options.png)
![Symbols Settings](../images/vs-options-debugging-symbols.png)
## Troubleshooting: Symbols will not load

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Web Bluetooth API</title>
</head>
<body>
<h1>Web Bluetooth API</h1>
<button id="clickme">Test Bluetooth</button>
<p>Currently selected bluetooth device: <strong id="device-name""></strong></p>
<script src="./renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,30 @@
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600
})
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault()
if (deviceList && deviceList.length > 0) {
callback(deviceList[0].deviceId)
}
})
mainWindow.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

View File

@@ -0,0 +1,8 @@
async function testIt() {
const device = await navigator.bluetooth.requestDevice({
acceptAllDevices: true
})
document.getElementById('device-name').innerHTML = device.name || `ID: ${device.id}`
}
document.getElementById('clickme').addEventListener('click',testIt)

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>WebHID API</title>
</head>
<body>
<h1>WebHID API</h1>
<button id="clickme">Test WebHID</button>
<h3>HID devices automatically granted access via <i>setDevicePermissionHandler</i></h3>
<div id="granted-devices"></div>
<h3>HID devices automatically granted access via <i>select-hid-device</i></h3>
<div id="granted-devices2"></div>
<script src="./renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,50 @@
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600
})
mainWindow.webContents.session.on('select-hid-device', (event, details, callback) => {
event.preventDefault()
if (details.deviceList && details.deviceList.length > 0) {
callback(details.deviceList[0].deviceId)
}
})
mainWindow.webContents.session.on('hid-device-added', (event, device) => {
console.log('hid-device-added FIRED WITH', device)
})
mainWindow.webContents.session.on('hid-device-removed', (event, device) => {
console.log('hid-device-removed FIRED WITH', device)
})
mainWindow.webContents.session.setPermissionCheckHandler((webContents, permission, requestingOrigin, details) => {
if (permission === 'hid' && details.securityOrigin === 'file:///') {
return true
}
})
mainWindow.webContents.session.setDevicePermissionHandler((details) => {
if (details.deviceType === 'hid' && details.origin === 'file://') {
return true
}
})
mainWindow.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

View File

@@ -0,0 +1,19 @@
async function testIt() {
const grantedDevices = await navigator.hid.getDevices()
let grantedDeviceList = ''
grantedDevices.forEach(device => {
grantedDeviceList += `<hr>${device.productName}</hr>`
})
document.getElementById('granted-devices').innerHTML = grantedDeviceList
const grantedDevices2 = await navigator.hid.requestDevice({
filters: []
})
grantedDeviceList = ''
grantedDevices2.forEach(device => {
grantedDeviceList += `<hr>${device.productName}</hr>`
})
document.getElementById('granted-devices2').innerHTML = grantedDeviceList
}
document.getElementById('clickme').addEventListener('click',testIt)

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Web Serial API</title>
<body>
<h1>Web Serial API</h1>
<button id="clickme">Test Web Serial API</button>
<p>Matching Arduino Uno device: <strong id="device-name""></strong></p>
<script src="./renderer.js"></script>
</body>
</html>

View File

@@ -0,0 +1,54 @@
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600
})
mainWindow.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
event.preventDefault()
if (portList && portList.length > 0) {
callback(portList[0].portId)
} else {
callback('') //Could not find any matching devices
}
})
mainWindow.webContents.session.on('serial-port-added', (event, port) => {
console.log('serial-port-added FIRED WITH', port)
})
mainWindow.webContents.session.on('serial-port-removed', (event, port) => {
console.log('serial-port-removed FIRED WITH', port)
})
mainWindow.webContents.session.setPermissionCheckHandler((webContents, permission, requestingOrigin, details) => {
if (permission === 'serial' && details.securityOrigin === 'file:///') {
return true
}
})
mainWindow.webContents.session.setDevicePermissionHandler((details) => {
if (details.deviceType === 'serial' && details.origin === 'file://') {
return true
}
})
mainWindow.loadFile('index.html')
mainWindow.webContents.openDevTools()
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

View File

@@ -0,0 +1,19 @@
async function testIt() {
const filters = [
{ usbVendorId: 0x2341, usbProductId: 0x0043 },
{ usbVendorId: 0x2341, usbProductId: 0x0001 }
];
try {
const port = await navigator.serial.requestPort({filters});
const portInfo = port.getInfo();
document.getElementById('device-name').innerHTML = `vendorId: ${portInfo.usbVendorId} | productId: ${portInfo.usbProductId} `
} catch (ex) {
if (ex.name === 'NotFoundError') {
document.getElementById('device-name').innerHTML = 'Device NOT found'
} else {
document.getElementById('device-name').innerHTML = ex
}
}
}
document.getElementById('clickme').addEventListener('click',testIt)

View File

@@ -1,5 +1,5 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, ipcMain, shell } = require('electron')
const { app, BrowserWindow, ipcMain, shell, dialog } = require('electron')
const path = require('path')
let mainWindow;

View File

@@ -59,8 +59,9 @@
<p>
For more details, see the
<a href="https://electronjs.org/docs/api/frameless-window/">
Frameless Window
<a href="https://electronjs.org/docs/tutorial/window-customization/">
Window Customization
</a>
documentation.
</p>

View File

@@ -4,15 +4,39 @@ This page defines some terminology that is commonly used in Electron development
### ASAR
ASAR stands for Atom Shell Archive Format. An [asar][asar] archive is a simple
ASAR stands for Atom Shell Archive Format. An [asar] archive is a simple
`tar`-like format that concatenates files into a single file. Electron can read
arbitrary files from it without unpacking the whole file.
The ASAR format was created primarily to improve performance on Windows... TODO
The ASAR format was created primarily to improve performance on Windows when
reading large quantities of small files (e.g. when loading your app's JavaScript
dependency tree from `node_modules`).
### code signing
Code signing is a process where an app developer digitally signs their code to
ensure that it hasn't been tampered with after packaging. Both Windows and
macOS implement their own version of code signing. As a desktop app developer,
it's important that you sign your code if you plan on distributing it to the
general public.
For more information, read the [Code Signing] tutorial.
### context isolation
Context isolation is a security measure in Electron that ensures that your
preload script cannot leak privileged Electron or Node.js APIs to the web
contents in your renderer process. With context isolation enabled, the
only way to expose APIs from your preload script is through the
`contextBridge` API.
For more information, read the [Context Isolation] tutorial.
See also: [preload script](#preload-script), [renderer process](#renderer-process)
### CRT
The C Run-time Library (CRT) is the part of the C++ Standard Library that
The C Runtime Library (CRT) is the part of the C++ Standard Library that
incorporates the ISO C99 standard library. The Visual C++ libraries that
implement the CRT support native code development, and both mixed native and
managed code, and pure managed code for .NET development.
@@ -20,8 +44,7 @@ managed code, and pure managed code for .NET development.
### DMG
An Apple Disk Image is a packaging format used by macOS. DMG files are
commonly used for distributing application "installers". [electron-builder]
supports `dmg` as a build target.
commonly used for distributing application "installers".
### IME
@@ -31,19 +54,15 @@ keyboards to input Chinese, Japanese, Korean and Indic characters.
### IDL
Interface description language. Write function signatures and data types in a format that can be used to generate interfaces in Java, C++, JavaScript, etc.
Interface description language. Write function signatures and data types in a
format that can be used to generate interfaces in Java, C++, JavaScript, etc.
### IPC
IPC stands for Inter-Process Communication. Electron uses IPC to send
serialized JSON messages between the [main] and [renderer] processes.
IPC stands for inter-process communication. Electron uses IPC to send
serialized JSON messages between the main and renderer processes.
### libchromiumcontent
A shared library that includes the [Chromium Content module] and all its
dependencies (e.g., Blink, [V8], etc.). Also referred to as "libcc".
- [github.com/electron/libchromiumcontent](https://github.com/electron/libchromiumcontent)
see also: [main process](#main-process), [renderer process](#renderer-process)
### main process
@@ -68,10 +87,22 @@ MAS, see the [Mac App Store Submission Guide].
### Mojo
An IPC system for communicating intra- or inter-process, and that's important because Chrome is keen on being able to split its work into separate processes or not, depending on memory pressures etc.
An IPC system for communicating intra- or inter-process, and that's important
because Chrome is keen on being able to split its work into separate processes
or not, depending on memory pressures etc.
See https://chromium.googlesource.com/chromium/src/+/master/mojo/README.md
See also: [IPC](#ipc)
### MSI
On Windows, MSI packages are used by the Windows Installer
(also known as Microsoft Installer) service to install and configure
applications.
More information can be found in [Microsoft's documentation][msi].
### native modules
Native modules (also called [addons] in
@@ -85,22 +116,33 @@ likely to use a different V8 version from the Node binary installed in your
system, you have to manually specify the location of Electrons headers when
building native modules.
See also [Using Native Node Modules].
For more information, read the [Native Node Modules] tutorial.
### NSIS
### notarization
Nullsoft Scriptable Install System is a script-driven Installer
authoring tool for Microsoft Windows. It is released under a combination of
free software licenses, and is a widely-used alternative to commercial
proprietary products like InstallShield. [electron-builder] supports NSIS
as a build target.
Notarization is a macOS-specific process where a developer can send a
code-signed app to Apple servers to get verified for malicious
components through an automated service.
See also: [code signing](#code-signing)
### OSR
OSR (Off-screen rendering) can be used for loading heavy page in
OSR (offscreen rendering) can be used for loading heavy page in
background and then displaying it after (it will be much faster).
It allows you to render page without showing it on screen.
For more information, read the [Offscreen Rendering][osr] tutorial.
### preload script
Preload scripts contain code that executes in a renderer process
before its web contents begin loading. These scripts run within
the renderer context, but are granted more privileges by having
access to Node.js APIs.
See also: [renderer process](#renderer-process), [context isolation](#context-isolation)
### process
A process is an instance of a computer program that is being executed. Electron
@@ -120,13 +162,17 @@ The renderer process is a browser window in your app. Unlike the main process,
there can be multiple of these and each is run in a separate process.
They can also be hidden.
In normal browsers, web pages usually run in a sandboxed environment and are not
allowed access to native resources. Electron users, however, have the power to
use Node.js APIs in web pages allowing lower level operating system
interactions.
See also: [process](#process), [main process](#main-process)
### sandbox
The sandbox is a security feature inherited from Chromium that restricts
your renderer processes to a limited set of permissions.
For more information, read the [Process Sandboxing] tutorial.
See also: [process](#process)
### Squirrel
Squirrel is an open-source framework that enables Electron apps to update
@@ -174,13 +220,15 @@ embedded content.
[addons]: https://nodejs.org/api/addons.html
[asar]: https://github.com/electron/asar
[autoUpdater]: api/auto-updater.md
[Chromium Content module]: https://www.chromium.org/developers/content-module
[electron-builder]: https://github.com/electron-userland/electron-builder
[libchromiumcontent]: #libchromiumcontent
[Mac App Store Submission Guide]: tutorial/mac-app-store-submission-guide.md
[autoupdater]: api/auto-updater.md
[code signing]: tutorial/code-signing.md
[context isolation]: tutorial/context-isolation.md
[mac app store submission guide]: tutorial/mac-app-store-submission-guide.md
[main]: #main-process
[msi]: https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-portal
[offscreen rendering]: tutorial/offscreen-rendering.md
[process sandboxing]: tutorial/sandbox.md
[renderer]: #renderer-process
[userland]: #userland
[Using Native Node Modules]: tutorial/using-native-node-modules.md
[V8]: #v8
[using native node modules]: tutorial/using-native-node-modules.md
[v8]: #v8

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -1,48 +1,7 @@
# Accessibility
Making accessible applications is important and we're happy to provide
functionality to [Devtron][devtron] and [Spectron][spectron] that gives
developers the opportunity to make their apps better for everyone.
---
Accessibility concerns in Electron applications are similar to those of
websites because they're both ultimately HTML. With Electron apps, however,
you can't use the online resources for accessibility audits because your app
doesn't have a URL to point the auditor to.
These features bring those auditing tools to your Electron app. You can
choose to add audits to your tests with Spectron or use them within DevTools
with Devtron. Read on for a summary of the tools.
## Spectron
In the testing framework Spectron, you can now audit each window and `<webview>`
tag in your application. For example:
```javascript
app.client.auditAccessibility().then(function (audit) {
if (audit.failed) {
console.error(audit.message)
}
})
```
You can read more about this feature in [Spectron's documentation][spectron-a11y].
## Devtron
In Devtron, there is an accessibility tab which will allow you to audit a
page in your app, sort and filter the results.
![devtron screenshot][devtron-screenshot]
Both of these tools are using the [Accessibility Developer Tools][a11y-devtools]
library built by Google for Chrome. You can learn more about the accessibility
audit rules this library uses on that [repository's wiki][a11y-devtools-wiki].
If you know of other great accessibility tools for Electron, add them to the
accessibility documentation with a pull request.
websites because they're both ultimately HTML.
## Manually enabling accessibility features
@@ -84,10 +43,6 @@ CFStringRef kAXManualAccessibility = CFSTR("AXManualAccessibility");
}
```
[devtron]: https://electronjs.org/devtron
[devtron-screenshot]: https://cloud.githubusercontent.com/assets/1305617/17156618/9f9bcd72-533f-11e6-880d-389115f40a2a.png
[spectron]: https://electronjs.org/spectron
[spectron-a11y]: https://github.com/electron/spectron#accessibility-testing
[a11y-docs]: https://www.chromium.org/developers/design-documents/accessibility#TOC-How-Chrome-detects-the-presence-of-Assistive-Technology
[a11y-devtools]: https://github.com/GoogleChrome/accessibility-developer-tools
[a11y-devtools-wiki]: https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules

View File

@@ -56,7 +56,7 @@ will then be your distribution to deliver to users.
### With an app source code archive
Instead of from shipping your app by copying all of its source files, you can
Instead of shipping your app by copying all of its source files, you can
package your app into an [asar] archive to improve the performance of reading
files on platforms like Windows, if you are not already using a bundler such
as Parcel or Webpack.

View File

@@ -1,135 +0,0 @@
# Automated Testing with a Custom Driver
To write automated tests for your Electron app, you will need a way to "drive" your application. [Spectron](https://electronjs.org/spectron) is a commonly-used solution which lets you emulate user actions via [WebDriver](https://webdriver.io/). However, it's also possible to write your own custom driver using node's builtin IPC-over-STDIO. The benefit of a custom driver is that it tends to require less overhead than Spectron, and lets you expose custom methods to your test suite.
To create a custom driver, we'll use Node.js' [child_process](https://nodejs.org/api/child_process.html) API. The test suite will spawn the Electron process, then establish a simple messaging protocol:
```js
const childProcess = require('child_process')
const electronPath = require('electron')
// spawn the process
const env = { /* ... */ }
const stdio = ['inherit', 'inherit', 'inherit', 'ipc']
const appProcess = childProcess.spawn(electronPath, ['./app'], { stdio, env })
// listen for IPC messages from the app
appProcess.on('message', (msg) => {
// ...
})
// send an IPC message to the app
appProcess.send({ my: 'message' })
```
From within the Electron app, you can listen for messages and send replies using the Node.js [process](https://nodejs.org/api/process.html) API:
```js
// listen for IPC messages from the test suite
process.on('message', (msg) => {
// ...
})
// send an IPC message to the test suite
process.send({ my: 'message' })
```
We can now communicate from the test suite to the Electron app using the `appProcess` object.
For convenience, you may want to wrap `appProcess` in a driver object that provides more high-level functions. Here is an example of how you can do this:
```js
class TestDriver {
constructor ({ path, args, env }) {
this.rpcCalls = []
// start child process
env.APP_TEST_DRIVER = 1 // let the app know it should listen for messages
this.process = childProcess.spawn(path, args, { stdio: ['inherit', 'inherit', 'inherit', 'ipc'], env })
// handle rpc responses
this.process.on('message', (message) => {
// pop the handler
const rpcCall = this.rpcCalls[message.msgId]
if (!rpcCall) return
this.rpcCalls[message.msgId] = null
// reject/resolve
if (message.reject) rpcCall.reject(message.reject)
else rpcCall.resolve(message.resolve)
})
// wait for ready
this.isReady = this.rpc('isReady').catch((err) => {
console.error('Application failed to start', err)
this.stop()
process.exit(1)
})
}
// simple RPC call
// to use: driver.rpc('method', 1, 2, 3).then(...)
async rpc (cmd, ...args) {
// send rpc request
const msgId = this.rpcCalls.length
this.process.send({ msgId, cmd, args })
return new Promise((resolve, reject) => this.rpcCalls.push({ resolve, reject }))
}
stop () {
this.process.kill()
}
}
```
In the app, you'd need to write a simple handler for the RPC calls:
```js
if (process.env.APP_TEST_DRIVER) {
process.on('message', onMessage)
}
async function onMessage ({ msgId, cmd, args }) {
let method = METHODS[cmd]
if (!method) method = () => new Error('Invalid method: ' + cmd)
try {
const resolve = await method(...args)
process.send({ msgId, resolve })
} catch (err) {
const reject = {
message: err.message,
stack: err.stack,
name: err.name
}
process.send({ msgId, reject })
}
}
const METHODS = {
isReady () {
// do any setup needed
return true
}
// define your RPC-able methods here
}
```
Then, in your test suite, you can use your test-driver as follows:
```js
const test = require('ava')
const electronPath = require('electron')
const app = new TestDriver({
path: electronPath,
args: ['./app'],
env: {
NODE_ENV: 'test'
}
})
test.before(async t => {
await app.isReady
})
test.after.always('cleanup', async t => {
await app.stop()
})
```

View File

@@ -0,0 +1,265 @@
# Automated Testing
Test automation is an efficient way of validating that your application code works as intended.
While Electron doesn't actively maintain its own testing solution, this guide will go over a couple
ways you can run end-to-end automated tests on your Electron app.
## Using the WebDriver interface
From [ChromeDriver - WebDriver for Chrome][chrome-driver]:
> WebDriver is an open source tool for automated testing of web apps across many
> browsers. It provides capabilities for navigating to web pages, user input,
> JavaScript execution, and more. ChromeDriver is a standalone server which
> implements WebDriver's wire protocol for Chromium. It is being developed by
> members of the Chromium and WebDriver teams.
There are a few ways that you can set up testing using WebDriver.
### With WebdriverIO
[WebdriverIO](https://webdriver.io/) (WDIO) is a test automation framework that provides a
Node.js package for testing with WebDriver. Its ecosystem also includes various plugins
(e.g. reporter and services) that can help you put together your test setup.
#### Install the testrunner
First you need to run the WebdriverIO starter toolkit in your project root directory:
```sh npm2yarn
npx wdio . --yes
```
This installs all necessary packages for you and generates a `wdio.conf.js` configuration file.
#### Connect WDIO to your Electron app
Update the capabilities in your configuration file to point to your Electron app binary:
```javascript title='wdio.conf.js'
export.config = {
// ...
capabilities: [{
browserName: 'chrome',
'goog:chromeOptions': {
binary: '/path/to/your/electron/binary', // Path to your Electron binary.
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
}
}]
// ...
}
```
#### Run your tests
To run your tests:
```sh
$ npx wdio run wdio.conf.js
```
[chrome-driver]: https://sites.google.com/chromium.org/driver/
### With Selenium
[Selenium](https://www.selenium.dev/) is a web automation framework that
exposes bindings to WebDriver APIs in many languages. Their Node.js bindings
are available under the `selenium-webdriver` package on NPM.
#### Run a ChromeDriver server
In order to use Selenium with Electron, you need to download the `electron-chromedriver`
binary, and run it:
```sh npm2yarn
npm install --save-dev electron-chromedriver
./node_modules/.bin/chromedriver
Starting ChromeDriver (v2.10.291558) on port 9515
Only local connections are allowed.
```
Remember the port number `9515`, which will be used later.
#### Connect Selenium to ChromeDriver
Next, install Selenium into your project:
```sh npm2yarn
npm install --save-dev selenium-webdriver
```
Usage of `selenium-webdriver` with Electron is the same as with
normal websites, except that you have to manually specify how to connect
ChromeDriver and where to find the binary of your Electron app:
```js title='test.js'
const webdriver = require('selenium-webdriver')
const driver = new webdriver.Builder()
// The "9515" is the port opened by ChromeDriver.
.usingServer('http://localhost:9515')
.withCapabilities({
'goog:chromeOptions': {
// Here is the path to your Electron binary.
binary: '/Path-to-Your-App.app/Contents/MacOS/Electron'
}
})
.forBrowser('chrome') // note: use .forBrowser('electron') for selenium-webdriver <= 3.6.0
.build()
driver.get('http://www.google.com')
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver')
driver.findElement(webdriver.By.name('btnG')).click()
driver.wait(() => {
return driver.getTitle().then((title) => {
return title === 'webdriver - Google Search'
})
}, 1000)
driver.quit()
```
## Using a custom test driver
It's also possible to write your own custom driver using Node.js' built-in IPC-over-STDIO.
Custom test drivers require you to write additional app code, but have lower overhead and let you
expose custom methods to your test suite.
To create a custom driver, we'll use Node.js' [`child_process`](https://nodejs.org/api/child_process.html) API.
The test suite will spawn the Electron process, then establish a simple messaging protocol:
```js title='testDriver.js'
const childProcess = require('child_process')
const electronPath = require('electron')
// spawn the process
const env = { /* ... */ }
const stdio = ['inherit', 'inherit', 'inherit', 'ipc']
const appProcess = childProcess.spawn(electronPath, ['./app'], { stdio, env })
// listen for IPC messages from the app
appProcess.on('message', (msg) => {
// ...
})
// send an IPC message to the app
appProcess.send({ my: 'message' })
```
From within the Electron app, you can listen for messages and send replies using the Node.js
[`process`](https://nodejs.org/api/process.html) API:
```js title='main.js'
// listen for messages from the test suite
process.on('message', (msg) => {
// ...
})
// send a message to the test suite
process.send({ my: 'message' })
```
We can now communicate from the test suite to the Electron app using the `appProcess` object.
For convenience, you may want to wrap `appProcess` in a driver object that provides more
high-level functions. Here is an example of how you can do this. Let's start by creating
a `TestDriver` class:
```js title='testDriver.js'
class TestDriver {
constructor ({ path, args, env }) {
this.rpcCalls = []
// start child process
env.APP_TEST_DRIVER = 1 // let the app know it should listen for messages
this.process = childProcess.spawn(path, args, { stdio: ['inherit', 'inherit', 'inherit', 'ipc'], env })
// handle rpc responses
this.process.on('message', (message) => {
// pop the handler
const rpcCall = this.rpcCalls[message.msgId]
if (!rpcCall) return
this.rpcCalls[message.msgId] = null
// reject/resolve
if (message.reject) rpcCall.reject(message.reject)
else rpcCall.resolve(message.resolve)
})
// wait for ready
this.isReady = this.rpc('isReady').catch((err) => {
console.error('Application failed to start', err)
this.stop()
process.exit(1)
})
}
// simple RPC call
// to use: driver.rpc('method', 1, 2, 3).then(...)
async rpc (cmd, ...args) {
// send rpc request
const msgId = this.rpcCalls.length
this.process.send({ msgId, cmd, args })
return new Promise((resolve, reject) => this.rpcCalls.push({ resolve, reject }))
}
stop () {
this.process.kill()
}
}
module.exports = { TestDriver };
```
In your app code, can then write a simple handler to receive RPC calls:
```js title='main.js'
const METHODS = {
isReady () {
// do any setup needed
return true
}
// define your RPC-able methods here
}
const onMessage = async ({ msgId, cmd, args }) => {
let method = METHODS[cmd]
if (!method) method = () => new Error('Invalid method: ' + cmd)
try {
const resolve = await method(...args)
process.send({ msgId, resolve })
} catch (err) {
const reject = {
message: err.message,
stack: err.stack,
name: err.name
}
process.send({ msgId, reject })
}
}
if (process.env.APP_TEST_DRIVER) {
process.on('message', onMessage)
}
```
Then, in your test suite, you can use your `TestDriver` class with the test automation
framework of your choosing. The following example uses
[`ava`](https://www.npmjs.com/package/ava), but other popular choices like Jest
or Mocha would work as well:
```js title='test.js'
const test = require('ava')
const electronPath = require('electron')
const { TestDriver } = require('./testDriver')
const app = new TestDriver({
path: electronPath,
args: ['./app'],
env: {
NODE_ENV: 'test'
}
})
test.before(async t => {
await app.isReady
})
test.after.always('cleanup', async t => {
await app.stop()
})
```

View File

@@ -88,14 +88,15 @@ without meaning any harm:
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
</dict>
</plist>
```
Note that up until Electron 12, the `com.apple.security.cs.allow-unsigned-executable-memory` entitlement was required
as well. However, it should not be used anymore if it can be avoided.
To see all of this in action, check out Electron Fiddle's source code,
[especially its `electron-forge` configuration
file](https://github.com/electron/fiddle/blob/master/forge.config.js).
@@ -165,14 +166,15 @@ without meaning any harm:
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
</dict>
</plist>
```
Up until Electron 12, the `com.apple.security.cs.allow-unsigned-executable-memory` entitlement was required
as well. However, it should not be used anymore if it can be avoided.
## Mac App Store
See the [Mac App Store Guide].

View File

@@ -4,39 +4,38 @@
Context Isolation is a feature that ensures that both your `preload` scripts and Electron's internal logic run in a separate context to the website you load in a [`webContents`](../api/web-contents.md). This is important for security purposes as it helps prevent the website from accessing Electron internals or the powerful APIs your preload script has access to.
This means that the `window` object that your preload script has access to is actually a **different** object than the website would have access to. For example, if you set `window.hello = 'wave'` in your preload script and context isolation is enabled `window.hello` will be undefined if the website tries to access it.
This means that the `window` object that your preload script has access to is actually a **different** object than the website would have access to. For example, if you set `window.hello = 'wave'` in your preload script and context isolation is enabled, `window.hello` will be undefined if the website tries to access it.
Every single application should have context isolation enabled and from Electron 12 it will be enabled by default.
## How do I enable it?
From Electron 12, it will be enabled by default. For lower versions it is an option in the `webPreferences` option when constructing `new BrowserWindow`'s.
```javascript
const mainWindow = new BrowserWindow({
webPreferences: {
contextIsolation: true
}
})
```
Context isolation has been enabled by default since Electron 12, and it is a recommended security setting for _all applications_.
## Migration
> I used to provide APIs from my preload script using `window.X = apiObject` now what?
> Without context isolation, I used to provide APIs from my preload script using `window.X = apiObject`. Now what?
Exposing APIs from your preload script to the loaded website is a common usecase and there is a dedicated module in Electron to help you do this in a painless way.
### Before: context isolation disabled
**Before: With context isolation disabled**
Exposing APIs from your preload script to a loaded website in the renderer process is a common use-case. With context isolation disabled, your preload script would share a common global `window` object with the renderer. You could then attach arbitrary properties to a preload script:
```javascript
```javascript title='preload.js'
// preload with contextIsolation disabled
window.myAPI = {
doAThing: () => {}
}
```
**After: With context isolation enabled**
The `doAThing()` function could then be used directly in the renderer process:
```javascript
```javascript title='renderer.js'
// use the exposed API in the renderer
window.myAPI.doAThing()
```
### After: context isolation enabled
There is a dedicated module in Electron to help you do this in a painless way. The [`contextBridge`](../api/context-bridge.md) module can be used to **safely** expose APIs from your preload script's isolated context to the context the website is running in. The API will also be accessible from the website on `window.myAPI` just like it was before.
```javascript title='preload.js'
// preload with contextIsolation enabled
const { contextBridge } = require('electron')
contextBridge.exposeInMainWorld('myAPI', {
@@ -44,26 +43,63 @@ contextBridge.exposeInMainWorld('myAPI', {
})
```
The [`contextBridge`](../api/context-bridge.md) module can be used to **safely** expose APIs from the isolated context your preload script runs in to the context the website is running in. The API will also be accessible from the website on `window.myAPI` just like it was before.
```javascript title='renderer.js'
// use the exposed API in the renderer
window.myAPI.doAThing()
```
You should read the `contextBridge` documentation linked above to fully understand its limitations. For instance you can't send custom prototypes or symbols over the bridge.
Please read the `contextBridge` documentation linked above to fully understand its limitations. For instance, you can't send custom prototypes or symbols over the bridge.
## Security Considerations
## Security considerations
Just enabling `contextIsolation` and using `contextBridge` does not automatically mean that everything you do is safe. For instance this code is **unsafe**.
Just enabling `contextIsolation` and using `contextBridge` does not automatically mean that everything you do is safe. For instance, this code is **unsafe**.
```javascript
```javascript title='preload.js'
// ❌ Bad code
contextBridge.exposeInMainWorld('myAPI', {
send: ipcRenderer.send
})
```
It directly exposes a powerful API without any kind of argument filtering. This would allow any website to send arbitrary IPC messages which you do not want to be possible. The correct way to expose IPC-based APIs would instead be to provide one method per IPC message.
It directly exposes a powerful API without any kind of argument filtering. This would allow any website to send arbitrary IPC messages, which you do not want to be possible. The correct way to expose IPC-based APIs would instead be to provide one method per IPC message.
```javascript
```javascript title='preload.js'
// ✅ Good code
contextBridge.exposeInMainWorld('myAPI', {
loadPreferences: () => ipcRenderer.invoke('load-prefs')
})
```
## Usage with TypeScript
If you're building your Electron app with TypeScript, you'll want to add types to your APIs exposed over the context bridge. The renderer's `window` object won't have the correct typings unless you extend the types with a [declaration file].
For example, given this `preload.ts` script:
```typescript title='preload.ts'
contextBridge.exposeInMainWorld('electronAPI', {
loadPreferences: () => ipcRenderer.invoke('load-prefs')
})
```
You can create a `renderer.d.ts` declaration file and globally augment the `Window` interface:
```typescript title='renderer.d.ts'
export interface IElectronAPI {
loadPreferences: () => Promise<void>,
}
declare global {
interface Window {
electronAPI: IElectronAPI
}
}
```
Doing so will ensure that the TypeScript compiler will know about the `electronAPI` property on your global `window` object when writing scripts in your renderer process:
```typescript title='renderer.ts'
window.electronAPI.loadPreferences()
```
[declaration file]: https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html

View File

@@ -1,35 +0,0 @@
# Desktop Environment Integration
Different operating systems provide different features for integrating desktop
applications into their desktop environments. For example, on Windows,
applications can put shortcuts in the JumpList of task bar, and on Mac,
applications can put a custom menu in the dock menu.
This guide explains how to integrate your application into those desktop
environments with Electron APIs.
## Notifications
See the [Notifications documentation](notifications.md).
## Recent Documents
See [Recent Documents documentation](recent-documents.md).
## Progress Bar
See the [Progress Bar documentation](progress-bar.md).
## Unity Launcher
See the [Unity Launcher documentation][unity-launcher].
## Represented File for macOS Window
See the [Represented File documentation](represented-file.md).
## Dragging files out of the window
See the [Native File Drag & Drop documentation](native-file-drag-drop.md).
[unity-launcher]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher

108
docs/tutorial/devices.md Normal file
View File

@@ -0,0 +1,108 @@
# Device Access
Like Chromium based browsers, Electron provides access to device hardware
through web APIs. For the most part these APIs work like they do in a browser,
but there are some differences that need to be taken into account. The primary
difference between Electron and browsers is what happens when device access is
requested. In a browser, users are presented with a popup where they can grant
access to an individual device. In Electron APIs are provided which can be
used by a developer to either automatically pick a device or prompt users to
pick a device via a developer created interface.
## Web Bluetooth API
The [Web Bluetooth API](https://web.dev/bluetooth/) can be used to communicate
with bluetooth devices. In order to use this API in Electron, developers will
need to handle the [`select-bluetooth-device` event on the webContents](../api/web-contents.md#event-select-bluetooth-device)
associated with the device request.
### Example
This example demonstrates an Electron application that automatically selects
the first available bluetooth device when the `Test Bluetooth` button is
clicked.
```javascript fiddle='docs/fiddles/features/web-bluetooth'
```
## WebHID API
The [WebHID API](https://web.dev/hid/) can be used to access HID devices such
as keyboards and gamepads. Electron provides several APIs for working with
the WebHID API:
* The [`select-hid-device` event on the Session](../api/session.md#event-select-hid-device)
can be used to select a HID device when a call to
`navigator.hid.requestDevice` is made. Additionally the [`hid-device-added`](../api/session.md#event-hid-device-added)
and [`hid-device-removed`](../api/session.md#event-hid-device-removed) events
on the Session can be used to handle devices being plugged in or unplugged during the
`navigator.hid.requestDevice` process.
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
can be used to provide default permissioning to devices without first calling
for permission to devices via `navigator.hid.requestDevice`. Additionally,
the default behavior of Electron is to store granted device permision through
the lifetime of the corresponding WebContents. If longer term storage is
needed, a developer can store granted device permissions (eg when handling
the `select-hid-device` event) and then read from that storage with
`setDevicePermissionHandler`.
* [`ses.setPermissionCheckHandler(handler)`](../api/session.md#sessetpermissioncheckhandlerhandler)
can be used to disable HID access for specific origins.
### Blocklist
By default Electron employs the same [blocklist](https://github.com/WICG/webhid/blob/main/blocklist.txt)
used by Chromium. If you wish to override this behavior, you can do so by
setting the `disable-hid-blocklist` flag:
```javascript
app.commandLine.appendSwitch('disable-hid-blocklist')
```
### Example
This example demonstrates an Electron application that automatically selects
HID devices through [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
and through [`select-hid-device` event on the Session](../api/session.md#event-select-hid-device)
when the `Test WebHID` button is clicked.
```javascript fiddle='docs/fiddles/features/web-hid'
```
## Web Serial API
The [Web Serial API](https://web.dev/serial/) can be used to access serial
devices that are connected via serial port, USB, or Bluetooth. In order to use
this API in Electron, developers will need to handle the
[`select-serial-port` event on the Session](../api/session.md#event-select-serial-port)
associated with the serial port request.
There are several additional APIs for working with the Web Serial API:
* The [`serial-port-added`](../api/session.md#event-serial-port-added)
and [`serial-port-removed`](../api/session.md#event-serial-port-removed) events
on the Session can be used to handle devices being plugged in or unplugged during the
`navigator.serial.requestPort` process.
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
can be used to provide default permissioning to devices without first calling
for permission to devices via `navigator.serial.requestPort`. Additionally,
the default behavior of Electron is to store granted device permision through
the lifetime of the corresponding WebContents. If longer term storage is
needed, a developer can store granted device permissions (eg when handling
the `select-serial-port` event) and then read from that storage with
`setDevicePermissionHandler`.
* [`ses.setPermissionCheckHandler(handler)`](../api/session.md#sessetpermissioncheckhandlerhandler)
can be used to disable serial access for specific origins.
### Example
This example demonstrates an Electron application that automatically selects
serial devices through [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
as well as demonstrating selecting the first available Arduino Uno serial device (if connected) through
[`select-serial-port` event on the Session](../api/session.md#event-select-serial-port)
when the `Test Web Serial` button is clicked.
```javascript fiddle='docs/fiddles/features/web-serial'
```

View File

@@ -23,5 +23,6 @@ Special notes:
| 11.0.0 | -- | 2020-Aug-27 | 2020-Nov-17 | M87 | v12.18 |
| 12.0.0 | -- | 2020-Nov-19 | 2021-Mar-02 | M89 | v14.16 |
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | M91 | v14.16 |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | M93 | TBD |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | TBD |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | M93 | v14.17 |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | v16.5 |
| 16.0.0 | -- | 2021-Sep-23 | 2021-Nov-16 | M96 | TBD |

View File

@@ -2,43 +2,31 @@
> A detailed look at our versioning policy and implementation.
As of version 2.0.0, Electron follows [SemVer](#semver). The following command will install the most recent stable build of Electron:
As of version 2.0.0, Electron follows the [SemVer](#semver) spec. The following command will install the most recent stable build of Electron:
```sh
```sh npm2yarn
npm install --save-dev electron
```
To update an existing project to use the latest stable version:
```sh
```sh npm2yarn
npm install --save-dev electron@latest
```
## Version 1.x
Electron versions *< 2.0* did not conform to the [SemVer](https://semver.org) spec: major versions corresponded to end-user API changes, minor versions corresponded to Chromium major releases, and patch versions corresponded to new features and bug fixes. While convenient for developers merging features, it creates problems for developers of client-facing applications. The QA testing cycles of major apps like Slack, Stride, Teams, Skype, VS Code, Atom, and Desktop can be lengthy and stability is a highly desired outcome. There is a high risk in adopting new features while trying to absorb bug fixes.
Here is an example of the 1.x strategy:
![1.x Versioning](../images/versioning-sketch-0.png)
An app developed with `1.8.1` cannot take the `1.8.3` bug fix without either absorbing the `1.8.2` feature, or by backporting the fix and maintaining a new release line.
## Version 2.0 and Beyond
## Versioning scheme
There are several major changes from our 1.x strategy outlined below. Each change is intended to satisfy the needs and priorities of developers/maintainers and app developers.
1. Strict use of SemVer
1. Strict use of the [SemVer](#semver) spec
2. Introduction of semver-compliant `-beta` tags
3. Introduction of [conventional commit messages](https://conventionalcommits.org/)
4. Well-defined stabilization branches
5. The `master` branch is versionless; only stabilization branches contain version information
5. The `main` branch is versionless; only stabilization branches contain version information
We will cover in detail how git branching works, how npm tagging works, what developers should expect to see, and how one can backport changes.
# SemVer
From 2.0 onward, Electron will follow SemVer.
## SemVer
Below is a table explicitly mapping types of changes to their corresponding category of SemVer (e.g. Major, Minor, Patch).
@@ -48,22 +36,25 @@ Below is a table explicitly mapping types of changes to their corresponding cate
| Node.js major version updates | Node.js minor version updates | Node.js patch version updates |
| Chromium version updates | | fix-related chromium patches |
For more information, see the [Semantic Versioning 2.0.0](https://semver.org/) spec.
Note that most Chromium updates will be considered breaking. Fixes that can be backported will likely be cherry-picked as patches.
# Stabilization Branches
## Stabilization branches
Stabilization branches are branches that run parallel to master, taking in only cherry-picked commits that are related to security or stability. These branches are never merged back to master.
Stabilization branches are branches that run parallel to `main`, taking in only cherry-picked commits that are related to security or stability. These branches are never merged back to `main`.
![Stabilization Branches](../images/versioning-sketch-1.png)
Since Electron 8, stabilization branches are always **major** version lines, and named against the following template `$MAJOR-x-y` e.g. `8-x-y`. Prior to that we used **minor** version lines and named them as `$MAJOR-$MINOR-x` e.g. `2-0-x`
Since Electron 8, stabilization branches are always **major** version lines, and named against the following template `$MAJOR-x-y` e.g. `8-x-y`. Prior to that we used **minor** version lines and named them as `$MAJOR-$MINOR-x` e.g. `2-0-x`.
We allow for multiple stabilization branches to exist simultaneously, one for each supported version. For more details on which versions are supported, see our [Electron Release Timelines](./electron-timelines.md) doc.
We allow for multiple stabilization branches to exist simultaneously, and intend to support at least two in parallel at all times, backporting security fixes as necessary.
![Multiple Stability Branches](../images/versioning-sketch-2.png)
Older lines will not be supported by GitHub, but other groups can take ownership and backport stability and security fixes on their own. We discourage this, but recognize that it makes life easier for many app developers.
Older lines will not be supported by the Electron project, but other groups can take ownership and backport stability and security fixes on their own. We discourage this, but recognize that it makes life easier for many app developers.
# Beta Releases and Bug Fixes
## Beta releases and bug fixes
Developers want to know which releases are _safe_ to use. Even seemingly innocent features can introduce regressions in complex applications. At the same time, locking to a fixed version is dangerous because youre ignoring security patches and bug fixes that may have come out since your version. Our goal is to allow the following standard semver ranges in `package.json` :
@@ -116,15 +107,7 @@ A few examples of how various SemVer ranges will pick up new releases:
![Semvers and Releases](../images/versioning-sketch-7.png)
# Missing Features: Alphas
Our strategy has a few tradeoffs, which for now we feel are appropriate. Most importantly that new features in master may take a while before reaching a stable release line. If you want to try a new feature immediately, you will have to build Electron yourself.
As a future consideration, we may introduce one or both of the following:
* alpha releases that have looser stability constraints to betas; for example it would be allowable to admit new features while a stability channel is in _alpha_
# Feature Flags
## Feature flags
Feature flags are a common practice in Chromium, and are well-established in the web-development ecosystem. In the context of Electron, a feature flag or **soft branch** must have the following properties:
@@ -132,20 +115,29 @@ Feature flags are a common practice in Chromium, and are well-established in the
* it completely segments new and old code paths; refactoring old code to support a new feature _violates_ the feature-flag contract
* feature flags are eventually removed after the feature is released
# Semantic Commits
## Semantic commits
We seek to increase clarity at all levels of the update and releases process. Starting with `2.0.0` we will require pull requests adhere to the [Conventional Commits](https://conventionalcommits.org/) spec, which can be summarized as follows:
All pull requests must adhere to the [Conventional Commits](https://conventionalcommits.org/) spec, which can be summarized as follows:
* Commits that would result in a SemVer **major** bump must start their body with `BREAKING CHANGE:`.
* Commits that would result in a SemVer **minor** bump must start with `feat:`.
* Commits that would result in a SemVer **patch** bump must start with `fix:`.
* We allow squashing of commits, provided that the squashed message adheres to the above message format.
* It is acceptable for some commits in a pull request to not include a semantic prefix, as long as the pull request title contains a meaningful encompassing semantic message.
The `electron/electron` repository also enforces squash merging, so you only need to make sure that your pull request has the correct title prefix.
# Versioned `master`
## Versioned `main` branch
* The `master` branch will always contain the next major version `X.0.0-nightly.DATE` in its `package.json`
* Release branches are never merged back to master
* Release branches _do_ contain the correct version in their `package.json`
* As soon as a release branch is cut for a major, master must be bumped to the next major. I.e. `master` is always versioned as the next theoretical release branch
* The `main` branch will always contain the next major version `X.0.0-nightly.DATE` in its `package.json`.
* Release branches are never merged back to `main`.
* Release branches _do_ contain the correct version in their `package.json`.
* As soon as a release branch is cut for a major, `main` must be bumped to the next major (i.e. `main` is always versioned as the next theoretical release branch).
## Historical versioning (Electron 1.X)
Electron versions *< 2.0* did not conform to the [SemVer](https://semver.org) spec: major versions corresponded to end-user API changes, minor versions corresponded to Chromium major releases, and patch versions corresponded to new features and bug fixes. While convenient for developers merging features, it creates problems for developers of client-facing applications. The QA testing cycles of major apps like Slack, Teams, Skype, VS Code, and GitHub Desktop can be lengthy and stability is a highly desired outcome. There is a high risk in adopting new features while trying to absorb bug fixes.
Here is an example of the 1.x strategy:
![1.x Versioning](../images/versioning-sketch-0.png)
An app developed with `1.8.1` cannot take the `1.8.3` bug fix without either absorbing the `1.8.2` feature, or by backporting the fix and maintaining a new release line.

View File

@@ -51,4 +51,4 @@ Somewhere in the Electron binary there will be a sequence of bytes that look lik
To flip a fuse you find its position in the fuse wire and change it to "0" or "1" depending on the state you'd like.
You can view the current schema [here](https://github.com/electron/electron/blob/master/build/fuses/fuses.json5).
You can view the current schema [here](https://github.com/electron/electron/blob/main/build/fuses/fuses.json5).

View File

@@ -1,4 +1,4 @@
# In-App Purchase (macOS)
# In-App Purchases (macOS)
## Preparing

View File

@@ -1,4 +1,4 @@
# Installation
# Advanced Installation Instructions
To install prebuilt Electron binaries, use [`npm`][npm].
The preferred method is to install Electron as a development dependency in your
@@ -90,6 +90,11 @@ ELECTRON_CUSTOM_DIR="{{ version }}"
The above configuration will download from URLs such as
`https://npm.taobao.org/mirrors/electron/8.0.0/electron-v8.0.0-linux-x64.zip`.
If your mirror serves artifacts with different checksums to the official
Electron release you may have to set `electron_use_remote_checksums=1` to
force Electron to use the remote `SHASUMS256.txt` file to verify the checksum
instead of the embedded checksums.
#### Cache
Alternatively, you can override the local cache. `@electron/get` will cache

View File

@@ -1,5 +1,5 @@
---
title: launch-app-from-URL-in-another-app
title: Launching Your Electron App From a URL In Another App
description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol.
slug: launch-app-from-url-in-another-app
hide_title: true
@@ -11,7 +11,7 @@ hide_title: true
<!-- ✍ Update this section if you want to provide more details -->
This guide will take you through the process of setting your electron app as the default
This guide will take you through the process of setting your Electron app as the default
handler for a specific [protocol](https://www.electronjs.org/docs/api/protocol).
By the end of this tutorial, we will have set our app to intercept and handle
@@ -22,16 +22,17 @@ we will use will be "`electron-fiddle://`".
### Main Process (main.js)
First we will import the required modules from `electron`. These modules help control our application life and create a native browser window.
First, we will import the required modules from `electron`. These modules help
control our application lifecycle and create a native browser window.
```js
```javascript
const { app, BrowserWindow, shell } = require('electron')
const path = require('path')
```
Next, we will proceed to register our application to handle all "`electron-fiddle://`" protocols.
```js
```javascript
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('electron-fiddle', process.execPath, [path.resolve(process.argv[1])])
@@ -43,8 +44,8 @@ if (process.defaultApp) {
We will now define the function in charge of creating our browser window and load our application's `index.html` file.
```js
function createWindow () {
```javascript
const createWindow = () => {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
@@ -60,11 +61,11 @@ function createWindow () {
In this next step, we will create our `BrowserWindow` and tell our application how to handle an event in which an external protocol is clicked.
This code will be different in WindowsOS compared to MacOS and Linux. This is due to Windows requiring additional code in order to open the contents of the protocol link within the same electron instance. Read more about this [here](https://www.electronjs.org/docs/api/app#apprequestsingleinstancelock).
This code will be different in Windows compared to MacOS and Linux. This is due to Windows requiring additional code in order to open the contents of the protocol link within the same Electron instance. Read more about this [here](https://www.electronjs.org/docs/api/app#apprequestsingleinstancelock).
### Windows code:
#### Windows code:
```js
```javascript
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
@@ -83,16 +84,16 @@ if (!gotTheLock) {
createWindow()
})
// handling the protocol. In this case, we choose to show an Error Box.
// Handle the protocol. In this case, we choose to show an Error Box.
app.on('open-url', (event, url) => {
dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`)
})
}
```
### MacOS and Linux code:
#### MacOS and Linux code:
```js
```javascript
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
@@ -100,63 +101,101 @@ app.whenReady().then(() => {
createWindow()
})
// handling the protocol. In this case, we choose to show an Error Box.
// Handle the protocol. In this case, we choose to show an Error Box.
app.on('open-url', (event, url) => {
dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`)
})
```
Finally, we will add some additional code to handle when someone closes our application
Finally, we will add some additional code to handle when someone closes our application.
```js
```javascript
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})
```
## Important Note:
## Important notes
### Packaging
This feature will only work on macOS when your app is packaged. It will not work when you're launching it in development from the command-line. When you package your app you'll need to make sure the macOS `plist` for the app is updated to include the new protocol handler. If you're using [`electron-packager`](https://github.com/electron/electron-packager) then you
can add the flag `--extend-info` with a path to the `plist` you've created. The one for this app is below:
On macOS and Linux, this feature will only work when your app is packaged. It will not work when
you're launching it in development from the command-line. When you package your app you'll need to
make sure the macOS `Info.plist` and the Linux `.desktop` files for the app are updated to include
the new protocol handler. Some of the Electron tools for bundling and distributing apps handle
this for you.
### Plist
#### [Electron Forge](https://electronforge.io)
```XML
<p>
<h5>macOS plist</h5>
<pre><code>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>electron-api-demos</string>
</array>
<key>CFBundleURLName</key>
<string>Electron API Demos Protocol</string>
</dict>
</array>
<key>ElectronTeamID</key>
<string>VEKTX9H2N7</string>
</dict>
</plist>
</code>
</pre>
<p>
If you're using Electron Forge, adjust `packagerConfig` for macOS support, and the configuration for
the appropriate Linux makers for Linux support, in your [Forge
configuration](https://www.electronforge.io/configuration) _(please note the following example only
shows the bare minimum needed to add the configuration changes)_:
```json
{
"config": {
"forge": {
"packagerConfig": {
"protocols": [
{
"name": "Electron Fiddle",
"schemes": ["electron-fiddle"]
}
]
},
"makers": [
{
"name": "@electron-forge/maker-deb",
"config": {
"mimeType": ["x-scheme-handler/electron-fiddle"]
}
}
]
}
}
}
```
#### [Electron Packager](https://github.com/electron/electron-packager)
For macOS support:
If you're using Electron Packager's API, adding support for protocol handlers is similar to how
Electron Forge is handled, except
`protocols` is part of the Packager options passed to the `packager` function.
```javascript
const packager = require('electron-packager')
packager({
// ...other options...
protocols: [
{
name: 'Electron Fiddle',
schemes: ['electron-fiddle']
}
]
}).then(paths => console.log(`SUCCESS: Created ${paths.join(', ')}`))
.catch(err => console.error(`ERROR: ${err.message}`))
```
If you're using Electron Packager's CLI, use the `--protocol` and `--protocol-name` flags. For
example:
```shell
npx electron-packager . --protocol=electron-fiddle --protocol-name="Electron Fiddle"
```
## Conclusion
After you start your electron app, you can now enter in a URL in your browser that contains the custom protocol, for example `"electron-fiddle://open"` and observe that the application will respond and show an error dialog box.
After you start your Electron app, you can enter in a URL in your browser that contains the custom
protocol, for example `"electron-fiddle://open"` and observe that the application will respond and
show an error dialog box.
<!--
Because Electron examples usually require multiple files (HTML, CSS, JS

View File

@@ -1,4 +1,4 @@
# Custom Linux Desktop Launcher Actions
# Desktop Launcher Actions (Linux)
## Overview

View File

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

View File

@@ -1,4 +1,4 @@
# Notifications (Windows, Linux, macOS)
# Notifications
## Overview

View File

@@ -17,7 +17,7 @@ the dirty area is passed to the `paint` event to be more efficient.
losses with no benefits.
* When nothing is happening on a webpage, no frames are generated.
* An offscreen window is always created as a
[Frameless Window](../api/frameless-window.md).
[Frameless Window](../tutorial/window-customization.md)..
### Rendering Modes

View File

@@ -120,9 +120,9 @@ file in the directory you executed it in. Both files can be analyzed using
the Chrome Developer Tools, using the `Performance` and `Memory` tabs
respectively.
![Performance CPU Profile][performance-cpu-prof]
![Performance CPU Profile](../images/performance-cpu-prof.png)
![Performance Heap Memory Profile][performance-heap-prof]
![Performance Heap Memory Profile](../images/performance-heap-prof.png)
In this example, on the author's machine, we saw that loading `request` took
almost half a second, whereas `node-fetch` took dramatically less memory
@@ -412,8 +412,6 @@ As of writing this article, the popular choices include [Webpack][webpack],
[Parcel][parcel], and [rollup.js][rollup].
[security]: ./security.md
[performance-cpu-prof]: ../images/performance-cpu-prof.png
[performance-heap-prof]: ../images/performance-heap-prof.png
[chrome-devtools-tutorial]: https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/
[worker-threads]: https://nodejs.org/api/worker_threads.html
[web-workers]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers

View File

@@ -83,7 +83,7 @@ As a practical example, the app shown in the [quick start guide][quick-start-lif
uses `app` APIs to create a more native application window experience.
```js title='main.js'
// quitting the app when no windows are open on macOS
// quitting the app when no windows are open on non-macOS platforms
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
@@ -148,7 +148,9 @@ A preload script can be attached to the main process in the `BrowserWindow` cons
const { BrowserWindow } = require('electron')
//...
const win = new BrowserWindow({
preload: 'path/to/preload.js'
webPreferences: {
preload: 'path/to/preload.js'
}
})
//...
```

View File

@@ -1,4 +1,4 @@
# Progress Bar in Taskbar (Windows, macOS, Unity)
# Taskbar Progress Bar (Windows & macOS)
## Overview
@@ -7,16 +7,16 @@ without the need of switching to the window itself.
On Windows, you can use a taskbar button to display a progress bar.
![Windows Progress Bar][windows-progress-bar]
![Windows Progress Bar](../images/windows-progress-bar.png)
On macOS, the progress bar will be displayed as a part of the dock icon.
![macOS Progress Bar][macos-progress-bar]
![macOS Progress Bar](../images/macos-progress-bar.png)
On Linux, the Unity graphical interface also has a similar feature that allows
you to specify the progress bar in the launcher.
![Linux Progress Bar][linux-progress-bar]
![Linux Progress Bar](../images/linux-progress-bar.png)
> NOTE: on Windows, each window can have its own progress bar, whereas on macOS
and Linux (Unity) there can be only one progress bar for the application.
@@ -102,8 +102,4 @@ For macOS, the progress bar will also be indicated for your application
when using [Mission Control](https://support.apple.com/en-us/HT204100):
![Mission Control Progress Bar](../images/mission-control-progress-bar.png)
[windows-progress-bar]: https://cloud.githubusercontent.com/assets/639601/5081682/16691fda-6f0e-11e4-9676-49b6418f1264.png
[macos-progress-bar]: ../images/macos-progress-bar.png
[linux-progress-bar]: ../images/linux-progress-bar.png
[setprogressbar]: ../api/browser-window.md#winsetprogressbarprogress-options

View File

@@ -1,4 +1,4 @@
# Represented File for macOS BrowserWindows
# Representing Files in a BrowserWindow (macOS)
## Overview

View File

@@ -23,7 +23,7 @@ your responsibility to ensure that the code is not malicious.
## Reporting Security Issues
For information on how to properly disclose an Electron vulnerability,
see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md)
see [SECURITY.md](https://github.com/electron/electron/tree/main/SECURITY.md)
## Chromium Security Issues and Upgrades

View File

@@ -1,4 +1,4 @@
# Snapcraft Guide (Ubuntu Software Center & More)
# Snapcraft Guide (Linux)
This guide provides information on how to package your Electron application
for any Snapcraft environment, including the Ubuntu Software Center.

View File

@@ -3,7 +3,7 @@
## Finding Support
If you have a security concern,
please see the [security document](https://github.com/electron/electron/tree/master/SECURITY.md).
please see the [security document](https://github.com/electron/electron/tree/main/SECURITY.md).
If you're looking for programming help,
for answers to questions,
@@ -26,7 +26,7 @@ you can interact with the community in these locations:
* [`electron-pl`](https://electronpl.github.io) *(Poland)*
If you'd like to contribute to Electron,
see the [contributing document](https://github.com/electron/electron/blob/master/CONTRIBUTING.md).
see the [contributing document](https://github.com/electron/electron/blob/main/CONTRIBUTING.md).
If you've found a bug in a [supported version](#supported-versions) of Electron,
please report it with the [issue tracker](../development/issues.md).
@@ -50,15 +50,15 @@ as the 4.2.x series are supported. We only support the latest minor release
for each stable release series. This means that in the case of a security fix
6.1.x will receive the fix, but we will not release a new version of 6.0.x.
The latest stable release unilaterally receives all fixes from `master`,
The latest stable release unilaterally receives all fixes from `main`,
and the version prior to that receives the vast majority of those fixes
as time and bandwidth warrants. The oldest supported release line will receive
only security fixes directly.
All supported release lines will accept external pull requests to backport
fixes previously merged to `master`, though this may be on a case-by-case
fixes previously merged to `main`, though this may be on a case-by-case
basis for some older supported lines. All contested decisions around release
line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/master/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised.
line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/main/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised.
When an API is changed or removed in a way that breaks existing functionality, the
previous functionality will be supported for a minimum of two major versions when
@@ -70,10 +70,10 @@ until the maintainers feel the maintenance burden is too high to continue doing
### Currently supported versions
* 15.x.y
* 14.x.y
* 13.x.y
* 12.x.y
* 11.x.y
* 12
### End-of-life

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