Compare commits

...

355 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
10ce3725c2 Bump v16.2.8 2022-05-24 09:31:07 -07:00
Shelley Vohr
83f6303394 fix: BrowserView background color in webContents (#33546)
* chore: fix BrowserView background color in webContents

* disable screen capture test on linux

* spec: fix platform failure condition
2022-05-24 09:29:26 -07:00
Jeremy Rose
d1b75716ad chore: cherry-pick b321ac924772 from chromium (#34097)
* chore: cherry-pick b321ac924772 from chromium

* fix patch

* fix patch compile error

Co-authored-by: Electron Bot <electron@github.com>
2022-05-24 09:28:13 -07:00
trop[bot]
1c6d5ea377 fix: pointer lock escape handling (#32826)
* fix: pointer lock escape handling

* refactor: don't drop permission controls

* chore: cancel active pending requests if denied

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-24 07:44:17 -07:00
trop[bot]
547d144706 fix: crash on navigator.serial.getPorts() (#34334)
(cherry picked from commit 7f9431764f)
(cherry picked from commit 1b5738e308)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-24 07:41:38 -07:00
trop[bot]
38dd2a7c91 fix: delayed bounds when moving/resizing and preventing default (#34282)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-19 13:57:12 +02:00
Darshan Sen
f464c58fdc fix: crash in safeStorage on Linux (#34262) 2022-05-19 10:04:01 +02:00
Sudowoodo Release Bot
4396c8782e Bump v16.2.7 2022-05-18 08:31:58 -07:00
Pedro Pontes
9590295102 chore: cherry-pick 99c3f3bfd507 from chromium (#34226)
* 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:16:36 -04:00
trop[bot]
10036238e0 docs: add missing explanation for [angle|dawn]_enable_vulkan_validation_layers = false (#34258)
* docs: add missing explanation for [angle|dawn]_enable_vulkan_validation_layers = false

* Trigger Build

Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-17 15:09:07 -04:00
Pedro Pontes
1cd89aabc8 chore: cherry-pick 14e51893e5 from icu (#34223)
* chore: cherry-pick 14e51893e5 from icu

* chore: fixup patch for lint

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-17 11:28:50 -04:00
Darshan Sen
1f15e8319c docs: note safeStorage.isEncryptionAvailable() needs ready event (#34219)
docs: note safeStorage.isEncryptionAvailable() needs ready event (#33724)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-16 16:06:56 -04:00
Pedro Pontes
ce93e5fadb chore: cherry-pick a4f71e40e571 from angle (#34230)
* chore: cherry-pick a4f71e40e571 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-16 12:10:17 -04:00
Pedro Pontes
62124241c4 chore: cherry-pick ec0cce63f47d from chromium (#34233)
* chore: cherry-pick ec0cce63f47d from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-16 12:07:15 -04:00
trop[bot]
8f0526f9c0 fix: crash when loading extension with missing manifest (#34192)
* fix: crash when loading extension missing manifest

* Update electron_paks.gni

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2022-05-13 11:33:40 -05:00
Pedro Pontes
b1ddee468d chore: cherry-pick a602a068e022 from angle (#34200)
* chore: cherry-pick a602a068e022 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-12 21:48:17 -04:00
trop[bot]
3d82701377 fix: tray icon not highlighting on empty menu (#34205)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-12 16:20:22 -07:00
Samuel Attard
a6cee3acd5 fix: disable SIGUSR1 when --inspect is disabled (#34182)
* fix: disable SIGUSR1 when --inspect is disabled (#33188)

* Update .patches

* chore: rebase patches
2022-05-12 16:18:38 -07:00
trop[bot]
086d40d566 test: fixup done being called multiple times (#34185)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-11 13:02:02 -07:00
Samuel Attard
1234a27369 build: improve CI speeds and reduce CI costs (#34183)
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:21 -07:00
Sudowoodo Release Bot
93c0c9da82 Bump v16.2.6 2022-05-11 08:32:07 -07:00
trop[bot]
c955f9347a build: change upload-to-s3 vars to upload-to-storage (#34145)
* 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:00:28 -04:00
trop[bot]
67729c767b chore: backport a536de469 from node (#34167)
* chore: backport a536de469 from nod

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-11 10:55:20 +02:00
Milan Burda
6f467871f2 fix: building with printing disabled (#34153) 2022-05-10 11:13:00 -07:00
Pedro Pontes
a0c4f8fdf2 chore: cherry-pick d49484c21e3c from angle (#34013) 2022-05-09 12:53:11 -04:00
trop[bot]
c7006b5740 build: use azure function to hash assets instead of lambda (#34120)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-06 23:51:36 -07:00
trop[bot]
6d561f464d build: stop uploading assets to S3 (#34113)
* 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-06 23:51:01 -07:00
Pedro Pontes
3de21c4909 chore: cherry-pick 12ba78f3fa7a from chromium (#34050)
* chore: cherry-pick 12ba78f3fa7a 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 21:17:39 -07:00
Pedro Pontes
8221ab7a9b chore: cherry-pick d24570fb65 from angle (#34036)
* chore: cherry-pick d24570fb65 from angle

* 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-05 21:16:52 -07:00
Pedro Pontes
2e737734d5 chore: cherry-pick cf64617c1cc5 from chromium (#34054)
Co-authored-by: Electron Bot <electron@github.com>
2022-05-05 21:24:35 -04:00
trop[bot]
a3680b0119 test: unflake some more tests (#34099)
* test: unflake webview fullscreen test

* test: unflake net throttle test

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

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

Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-05-05 20:45:41 -04:00
Pedro Pontes
0bdca55bd6 chore: cherry-pick 6b66a45021 from chromium (#34074) 2022-05-05 12:06:31 -07:00
trop[bot]
e29c0ce313 test: unflake some focus tests (#34081)
* spec: unflake some focus tests

* test: disable flaky webFrame visibiilty spec

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-05 11:43:05 -07:00
trop[bot]
4de4d8c23e test: fix nativeModulesEnabled in spec/webview-spec.js (#34065)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-05 11:25:17 -04:00
Samuel Attard
ab1df46536 test: also disable flaky WOA test on v16 (#34083) 2022-05-05 00:32:49 -07:00
Samuel Attard
6b04cce91a 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>
2022-05-04 16:38:47 -07:00
Sudowoodo Release Bot
32f91f19e0 Bump v16.2.5 2022-05-04 08:34:10 -07:00
trop[bot]
d71d648669 test: scope internal test fixtures under @electron-ci (#34022)
* test: scope internal test fixtures under `@electron`

* Missed references

* Move packages from @electron to @electron-ci scope

* Fix tests

* fix require

Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-04 00:05:55 -07:00
Pedro Pontes
ae5367293c chore: cherry-pick 5ff02e4d7368 from chromium (#34018)
* 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:26 -07:00
Pedro Pontes
730c7d3b10 chore: cherry-pick 5be8e065f43e from chromium (#34039)
* chore: cherry-pick 5be8e065f43e from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-03 16:22:29 -07:00
Pedro Pontes
db4fdae287 chore: cherry-pick d27d9d059b51 from angle (#34044)
* chore: cherry-pick d27d9d059b51 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-03 16:15:28 -07:00
Pedro Pontes
05828cd284 chore: cherry-pick 5361d836aeb1 from chromium (#34008)
* chore: cherry-pick 5361d836aeb1 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-02 12:20:51 -04:00
trop[bot]
6e59d52787 build: allow script/spec-runner.js with empty list of runners (#34000)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 09:46:46 -04:00
trop[bot]
e20fe5a17b spec: allow connections to port 2049 (#33990)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 14:48:15 +09:00
Samuel Attard
c59fd3fb83 build: use dev-cdn instead of sysroots s3 bucket (#33986)
* 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:23 +09:00
Sudowoodo Release Bot
62f7c777b7 Bump v16.2.4 2022-04-28 14:42:04 -07:00
Sudowoodo Release Bot
44de2c9596 Revert "Bump v16.2.4"
This reverts commit 26fdde4dc8.
2022-04-28 12:51:24 -07:00
Sudowoodo Release Bot
26fdde4dc8 Bump v16.2.4 2022-04-28 11:25:57 -07:00
Pedro Pontes
916acaa4f7 chore: cherry-pick 38ab9c5b06a4 from chromium (#33885)
* chore: cherry-pick 38ab9c5b06a4 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-28 11:23:18 -04:00
trop[bot]
66fa9f6066 build: ensure sync-done file exists during git cache save (#33955)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-27 18:27:23 -07:00
Pedro Pontes
5c28bdc70f chore: cherry-pick 1a31e2110440 from chromium (#33855)
* 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-27 16:42:02 -04:00
Samuel Attard
4cd6426bae build: improve circleci config (#33944)
* 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 11:16:19 -07:00
Samuel Attard
1e949f1cac build: upload to AZ as well as S3 (#33926)
* build: upload to AZ as well as S3

* build: actually verify az urls too
2022-04-27 10:43:59 -07:00
Sudowoodo Release Bot
faec32b419 Revert "Bump v16.2.4"
This reverts commit 9554722913.
2022-04-27 09:33:53 -07:00
Sudowoodo Release Bot
9554722913 Bump v16.2.4 2022-04-27 08:33:45 -07:00
trop[bot]
f7d172932f chore: use semantic-commit-action (#33864)
* 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-26 19:07:39 +09:00
Pedro Pontes
b12d8a358d chore: cherry-pick 4d26949260aa from chromium (#33675)
* 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-25 10:06:04 +09:00
Pedro Pontes
cbe137e60b chore: cherry-pick 2004594a46c8 from v8 (#33883)
* chore: cherry-pick 2004594a46c8 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-25 09:44:22 +09:00
Pedro Pontes
01a49e799f chore: cherry-pick e42dbcdedb7a from v8 (#33830)
* 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-25 09:43:37 +09:00
Pedro Pontes
504daa7b8d chore: cherry-pick 4deb522c22 and d88e959e01 from chromium (#33851)
* 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

* 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:38:49 +09:00
trop[bot]
1603cd4ccf chore: backport 7c9b3938d from libuv (#33869)
* chore: backport 7c9b3938d from libuv

Backports https://github.com/libuv/libuv/pull/3597

* Update .patches

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-21 06:38:10 -07:00
Pedro Pontes
41e460c44f chore: cherry-pick 5cb934a23d from chromium (#33859) 2022-04-21 17:24:09 +09:00
Pedro Pontes
1d780d716e chore: cherry-pick b2d3ef69ef99 from v8 (#33835) 2022-04-20 13:51:46 -07:00
Sudowoodo Release Bot
9a564930a1 Bump v16.2.3 2022-04-20 08:32:57 -07:00
trop[bot]
a6c71cc914 fix: getting focused window with destroyed webContents (#33540)
* fix: getting focused window with destroyed webContents

* fix: add extra safeguards

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-19 09:20:04 +09:00
Pedro Pontes
7d979882fb chore: cherry-pick f546ac11eec7 from v8 (#33762)
* chore: cherry-pick f546ac11eec7 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-18 09:36:53 -04:00
Shelley Vohr
66b255d1f5 fix: pend bounds change when moving BrowserWindows (#33544)
* fix: ensure bounds changes apply when moving windows

* chore: remove unused queue include
2022-04-18 13:58:08 +09:00
Pedro Pontes
3d7bea1f53 chore: cherry-pick ac341df436 from webrtc (#33672)
Co-authored-by: Electron Bot <electron@github.com>
2022-04-18 12:36:19 +09:00
trop[bot]
50fb4e245d fix: apply senderFrame details to ipcMain port event (#33780)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-14 19:17:27 +09:00
trop[bot]
b76b7baab8 chore: interpret bytes to string (#33774)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-13 21:50:41 -07:00
trop[bot]
a4fd0d3351 build: migrate urllib to python3 (#33742)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-13 10:45:19 +02:00
trop[bot]
40fef39431 build: explicitly run scripts with python3 (#33726)
* build: explicitly run scripts with python3

* chore: update patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 14:21:29 -07:00
Pedro Pontes
3da3edd613 chore: cherry-pick 1665a1d16d46 from chromium (#33681)
* chore: cherry-pick 1665a1d16d46 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-12 18:41:39 +02:00
Pedro Pontes
ecc35a43e8 chore: cherry-pick 652dd12a85 from chromium (#33669)
Co-authored-by: Electron Bot <electron@github.com>
2022-04-12 11:05:02 +02:00
Jeremy Rose
c01ca5edaa chore: cherry-pick a18fddcb53e6 from webrtc (#33710)
* chore: cherry-pick a18fddcb53e6 from webrtc

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 11:04:09 +02:00
trop[bot]
4f16275d16 build: use python3 to lint (#33716) 2022-04-12 11:02:39 +02:00
trop[bot]
8f2d8e0336 fix: revert "fix: some frameless windows showing a frame on Windows" (#33607)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-04-11 16:36:17 -07:00
trop[bot]
9ca00c6afe fix: report more detailed errors in shell.openExternal() on Windows (#33657)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-04-11 11:59:56 -07:00
Pedro Pontes
c163154cc9 chore: cherry-pick a1dc371d66 from chromium (#33678) 2022-04-11 20:24:32 +02:00
Milan Burda
7be0d42658 fix: Emojis appearing black and white in Chrome 96 (#33683) 2022-04-11 08:48:58 -07:00
Milan Burda
0b06b686d6 build: fix numpy package install on mac arm64 (#33629) 2022-04-07 11:07:14 -07:00
Jeremy Rose
0dd20a20a0 fix: prevent UAF crash in setCertificateVerifyProc (#33255)
* fix: prevent UAF crash in setCertificateVerifyProc

* fix patch
2022-04-06 14:21:08 -04:00
Sudowoodo Release Bot
f1d7143310 Bump v16.2.2 2022-04-06 08:31:28 -07:00
Jeremy Rose
0817274bf9 chore: cherry-pick f599381978f2 from v8 (#33605) 2022-04-05 09:41:59 -07:00
Milan Burda
75e48b99a8 fix: building with printing disabled (#33602) 2022-04-04 15:51:14 -07:00
trop[bot]
5dae280b79 fix: gn check when //printing component is disabled (#33600)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-04 15:50:42 -07:00
David Sanders
3f5e040652 fix: on macOS show BrowserWindow on maximize if not currently shown (#33535) 2022-04-04 17:56:32 +09:00
trop[bot]
43d242f4dc fix: create userData on requestSingleInstanceLock() if needed (#33590) 2022-04-04 10:48:21 +02:00
trop[bot]
ba8a1588bf fix: don't unmaximize on macOS if user set max bounds (#33552)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-31 10:22:51 -04:00
Jeremy Rose
9bdb2d9d94 chore: cherry-pick a1427aad7cef from v8 (#33524)
* chore: cherry-pick a1427aad7cef from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-30 19:18:00 -04:00
Sudowoodo Release Bot
53450220c2 Bump v16.2.1 2022-03-30 08:33:38 -07:00
trop[bot]
7761ea6713 fix: crash when WindowButtonsProxy references cleared NSWindow (#33489)
* resets WindowButtonsProxy on window delete on macOS

* fixes reset

Co-authored-by: Gellert Hegyi <gellert.hegyi@around.co>
2022-03-29 11:40:05 -04:00
Sudowoodo Release Bot
b31f855ea4 Bump v16.2.0 2022-03-28 13:23:08 -07:00
Pedro Pontes
7ef2a0d8ed chore: cherry-pick 26b7ad6967b1 from v8 (#33472)
* chore: cherry-pick 26b7ad6967b1 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-28 13:10:59 -07:00
Pedro Pontes
ccce1e642b chore: cherry-pick 2a58cc86bf from angle (#33340)
* chore: cherry-pick 2a58cc86bf from angle

* chore: update patches

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-28 12:51:42 -04:00
trop[bot]
2d1398bd44 fix: use stricter options in SecStaticCodeCheckValidity (#33377)
* 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>

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-28 10:01:50 -04:00
trop[bot]
06a3bdadd7 fix: non-client windows messages on legacy widget host (again) (#33444)
Co-authored-by: clavin <clavin@electronjs.org>
2022-03-28 16:34:20 +09:00
trop[bot]
8873984bd0 chore: cherry-pick 1aa9b09 from chromium (#33381)
* chore: cherry-pick 1aa9b09 from chromium (#33231)

* chore: cherry-pick 1aa9b09 from chromium

* chore: update patches

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

* chore: update patches

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>
2022-03-24 21:09:58 -04:00
Pedro Pontes
9a32bf98dd chore: cherry-pick eb967bf21108 from chromium (#33240)
* chore: cherry-pick eb967bf21108 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-24 19:59:13 -04:00
Pedro Pontes
0315f070f4 chore: cherry-pick 161f0866e8 from angle (#33341)
* chore: cherry-pick 161f0866e8 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-03-24 19:56:56 -04:00
Milan Burda
d0131444c1 feat: add nativeTheme.inForcedColorsMode (#32956) (#33359) 2022-03-24 19:53:06 -04:00
Pedro Pontes
7d8c387666 chore: cherry-pick 2b75a29bf241 from angle (#33389)
* chore: cherry-pick 2b75a29bf241 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-24 13:27:43 -04:00
trop[bot]
e500406f47 fix: libuv patches to address child_process.spawn slowness (#33405)
* fix: libuv patches to address child_process.spawn slowness

* chore: backport additional patches

* Update .patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-24 13:24:34 -04:00
Pedro Pontes
dc3232e690 chore: cherry-pick c46fb3a15ec2 from v8 (#33392)
* chore: cherry-pick c46fb3a15ec2 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-24 13:17:43 -04:00
trop[bot]
6bca1d6622 test: disable webview.capturePage test (#33434)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-03-24 12:19:12 -04:00
trop[bot]
5d5708cf48 ci: abort CI if goma authentication is invalid (#33418)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-24 10:29:07 -04:00
Sudowoodo Release Bot
f8c521d795 Bump v16.1.1 2022-03-23 08:31:37 -07:00
Robo
45e14a5ef5 fix: iocp integration when process is reused (#33207) (#33363) 2022-03-23 00:02:25 -07:00
trop[bot]
f0fa9b5f56 fix: fire show event when BrowserWindow shown via maximize() (#33212)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-21 20:33:51 -04:00
Pedro Pontes
d6ef6c368a chore: cherry-pick ca32852e4f from angle (#33219) 2022-03-21 20:28:26 -04:00
Pedro Pontes
b5de806b42 chore: cherry-pick 246c10dede97 from chromium (#33244)
* 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-22 08:26:18 +09:00
Pedro Pontes
e6859b8ef3 chore: cherry-pick 905302eb3a2b from chromium (#33236)
* 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-21 16:43:55 +09:00
Shelley Vohr
4a28bb2010 fix: crash when showin item in folder on DevTools (#33313) 2022-03-21 11:10:45 +09:00
Pedro Pontes
1c6b450f1e chore: cherry-pick c11809b8c0 from chromium (#33258)
Co-authored-by: Electron Bot <electron@github.com>
2022-03-21 10:25:01 +09:00
trop[bot]
d76743fd1c build: drop pywin32 usage (#33297)
* build: drop pywin32 usage

* chore: ignore extra output on AppVeyor

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-21 10:16:43 +09:00
trop[bot]
df6f78950d docs: remove "marked" from process.getBlinkMemoryInfo() (#33290)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-21 10:16:00 +09:00
trop[bot]
75191f812f fix: crash when destroying node env with pending promises (#33301)
* fix: crash when destroying node env with pending promises

* chore: add spec

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-18 04:11:40 -07:00
Shelley Vohr
679c979f40 fix: desktop screen capture on macOS not releasing (#33314) 2022-03-17 09:44:59 +01:00
David Sanders
2b5c403e48 fix: ensure external memory adjustments are balanced (#33312) 2022-03-16 22:16:59 -07:00
trop[bot]
a3d4c4e84d chore: cherry-pick 2ed58f4 from chromium (#33249)
* chore: cherry-pick 2ed58f4 from chromium (#33109)

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>

* chore: update patches

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-16 11:33:03 -04:00
trop[bot]
f75bd998fa fix: non-client mouse events on WCO-enabled windows (#33200)
Co-authored-by: clavin <clavin@electronjs.org>
2022-03-10 16:22:07 -06:00
Jeremy Rose
e0fe73521d chore: cherry-pick 1887414c016d from chromium (#33179)
* chore: cherry-pick 1887414c016d 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-03-09 12:05:44 -05:00
Sudowoodo Release Bot
5a4bdde636 Bump v16.1.0 2022-03-09 07:31:25 -08:00
Jeremy Rose
cbf5a75572 chore: cherry-pick 62142d222a80 from chromium (#33186)
* chore: cherry-pick 62142d222a80 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-08 16:14:39 -05:00
Jeremy Rose
7205c97421 chore: cherry-pick 49e8ff16f1fe from angle (#33182)
* chore: cherry-pick 49e8ff16f1fe from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-08 14:14:10 -05:00
trop[bot]
f9fb8abe59 fix: really strip crashpad handler binary (#33174)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-03-07 17:05:27 -05:00
Jeremy Rose
013b38c964 chore: cherry-pick 6b2643846ae3 from chromium (#33169)
* chore: cherry-pick 6b2643846ae3 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-03-07 16:40:22 -05:00
trop[bot]
b11b40e640 fix: macOS tray icon alternate images (#33106)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-01 09:47:33 -08:00
Michaela Laurencin
079ec9d9c0 feat: add WCO height option (#33061)
* 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:36:30 -08:00
trop[bot]
8608b785db fix: tray garbage collection (#33075)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-25 14:17:37 +01:00
trop[bot]
e08c317065 fix: DCHECK when calling app.exit() (#33058)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-24 16:31:06 -05:00
Sudowoodo Release Bot
b9f4112209 Bump v16.0.10 2022-02-23 10:06:36 -08:00
trop[bot]
32d5cc03ef fix: broken OSR transparent option (#33051)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-23 11:40:06 -05:00
Robo
a29a04afaf chore: cherry-pick 7fabaa4d from chromium (#32808)
* chore: cherry-pick 7fabaa4d from chromium

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

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-22 19:49:39 +09:00
Shelley Vohr
f92f97972a fix: savePage throw on relative paths (#33017) 2022-02-22 16:30:18 +09:00
trop[bot]
23d22d7a5b fix: command string for windows protocol handler (#33010)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-02-22 16:26:47 +09:00
trop[bot]
a9fe62cc8f fix: don't restore maximized BrowserWindow when calling showInactive (#33020)
* fix: don't restore maximized BrowserWindow when calling showInactive

* chore: update patches

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-02-22 16:26:00 +09:00
trop[bot]
8391e5226d chore: backport EPROTOTYPE fixes from libuv (#32942)
* chore: backport EPROTOTYPE fixes from libuv

This commit backports three commits from libuv's 1.x branch to fix
issues with CPU going to 100% on macOS when EPROTOTYPE is returned.

See: abb109f30f
See: 3a7b95593a
See: de24da8c11

* Update .patches

Co-authored-by: Fedor Indutny <fedor@indutny.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-22 16:18:23 +09:00
Robo
1082e6c764 chore: cherry-pick 55f6cb375 from chromium (#32806)
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-21 10:37:06 -08:00
trop[bot]
5bf4483f3b chore: add @electron/wg-security to patches/ CODEOWNERS (#33005)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-21 15:04:26 +01:00
trop[bot]
d4942d0760 docs: fix broken link to GNOME notifications spec (#33001)
Co-authored-by: Kev <kevslashnull@gmail.com>
2022-02-21 16:37:40 +09:00
Robo
88074b0ef7 chore: cherry-pick 349a35b19 from chromium (#32803)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3226142

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-21 16:36:07 +09:00
trop[bot]
a8a200f4c9 fix: stale renderer process on quit (#32969)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-02-21 10:25:42 +09:00
Robo
d58765681c chore: cherry-pick 06504ff3b1 from chromium (#32805)
* 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-18 11:12:27 +09:00
Pedro Pontes
def17fe6f9 chore: cherry-pick e3805f29fed7 from chromium (#32900)
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-02-17 10:02:56 -08:00
Pedro Pontes
fc1c566613 chore: cherry-pick b790affce3 and 9c1efd3def from angle (#32903) 2022-02-17 21:06:32 +09:00
Pedro Pontes
3c57345f82 chore: cherry-pick be50c60b4225 from chromium (#32916)
* 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>
2022-02-17 14:59:43 +09:00
Robo
c2e6903a33 chore: cherry-pick a1c1ec1ea9 from chromium (#32807)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3244046

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-17 14:54:21 +09:00
Robo
1587fbd4c3 chore: cherry-pick ebddaedee from v8 (#32809)
* chore: cherry-pick ebddaedee from v8

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

* chore: update patches

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-02-17 14:52:23 +09:00
Pedro Pontes
c190c2120e chore: cherry-pick 0081bb347e67 from chromium (#32918)
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-02-16 13:52:13 -08:00
Pedro Pontes
26e4da36e4 chore: cherry-pick 05e714a87c from chromium (#32907)
Co-authored-by: Electron Bot <electron@github.com>
2022-02-16 15:02:59 +01:00
Pedro Pontes
187dc7b8c0 chore: cherry-pick 11505c3867 from chromium (#32911) 2022-02-15 17:39:26 -05:00
Sudowoodo Release Bot
48e78496ce Bump v16.0.9 2022-02-14 11:53:12 -08:00
Raymond Zhao
984e24ee16 chore: cherry-pick 5841c2bf1 from devtools-frontend (#32860)
Backports 5841c2bf19
2022-02-11 18:11:03 +09:00
Robo
33055eb1e0 chore: cherry-pick efdfe711d from chromium (#32802)
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>
2022-02-10 12:10:55 -05:00
Robo
4a7b5aa45b chore: cherry-pick 5f8ddef5a6 from chromium (#32804)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3193885
2022-02-09 12:09:22 -05:00
Jeremy Rose
77451d2cf3 chore: cherry-pick 27bc67f761e6 from v8 (#32738)
* chore: cherry-pick 27bc67f761e6 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-02-09 12:04:48 -05:00
trop[bot]
e8f90e57d8 test: disable the test that makes spec runner hang on exit (#32837)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-09 12:01:25 -05:00
trop[bot]
0b5c5d97bd build: rebuild the dist_zips when the deps get modified (#32817)
* 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 09:34:49 -05:00
Robo
70c0f06890 chore: cherry-pick bab8254c3 and 2dd23f757 from v8 (#32801)
* chore: cherry-pick bab8254c3 and 2dd23f757 from v8

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

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-02-08 11:40:05 -05:00
trop[bot]
1413e815ec fix: WCO window hover on window controls on Windows (#32720) 2022-02-03 10:05:44 +01:00
Robo
c899294a12 chore: bump chromium in DEPS to 96.0.4664.174 (#32715) 2022-02-02 17:13:30 -05:00
trop[bot]
736f9f21f1 docs: fix missing tag end in clipboard example (#32694)
Co-authored-by: Paul Hollinsky <paulhollinsky@gmail.com>
2022-02-02 10:13:09 -05:00
trop[bot]
2045d85d54 docs: fix typo in BrowserWindow description (#32698)
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
2022-02-02 10:08:49 -05:00
trop[bot]
fe842f52b6 fix: some frameless windows showing a frame on Windows (#32710)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-02 15:10:05 +01:00
trop[bot]
c5f16f36f0 build(deps): bump node-fetch from 2.6.1 to 2.6.7 (#32634)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-01 19:32:24 -05:00
trop[bot]
7d5d1a1e1b fix: expose all serial devices to setDevicePermissionHandler (#32687)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-02-01 20:22:48 +09:00
trop[bot]
476447c6ea fix: transparent window max/unmax event firing (#32689)
* 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:36 +09:00
trop[bot]
0e71144a8f docs: update the build docs for electron (#32680)
Co-authored-by: Harshil Jain <twitharshil@gmail.com>
2022-02-01 17:54:23 +09:00
trop[bot]
d62b02af05 Update config.py (#32677)
* Fix missing comma

Co-authored-by: Marek Šuppa <mrshu@users.noreply.github.com>
2022-02-01 17:52:21 +09:00
Shelley Vohr
f998093fad fix: undefined backgroundColor (#32654) 2022-01-31 09:24:54 +01:00
Sudowoodo Release Bot
b1ffac5969 Bump v16.0.8 2022-01-27 09:43:12 -08:00
trop[bot]
0bb5f136f4 fix: css transparent background being lost (#32648)
* fix: css transparent background being lost

* fix: also call SetContentBackgroundColor initially

* spec: add a test for correct behavior

* chore: address feedback from review

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-01-27 09:42:07 -08:00
trop[bot]
0027bd5979 fix: crash when saving edited PDF files (#32538)
* 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-27 14:46:47 +01:00
trop[bot]
41926c1773 docs: update context bridge docs about Promises and Errors (#32533) (#32645)
* 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-27 14:44:39 +01:00
trop[bot]
bce34419b6 ci: update ts-compile-doc-change to properly use src cache (#32626)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-26 10:26:01 -05:00
trop[bot]
702645d84b fix: webContents.setZoomFactor crash (#32620)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-26 20:05:36 +09:00
trop[bot]
facee77287 docs: correct requestSingleInstanceLock parameter (#32622)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-01-26 20:04:13 +09:00
trop[bot]
37ca29a27e test: disable flaky test on WOA (#32561)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-25 16:14:40 -05:00
trop[bot]
03381c0281 fix: make window without rounded corners closable (#32611)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-01-25 13:28:51 -05:00
trop[bot]
71c8dd7028 fix: strip crashpad_handler binary (#32554)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-01-24 20:06:19 +09:00
David Sanders
0294075751 docs: fix anchors for broken relative links (#32566) 2022-01-24 19:58:39 +09:00
trop[bot]
39bb2a4cbf ci: call autoninja without ninjalog_uploader_wrapper.py (#32572)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-24 19:54:44 +09:00
Keeley Hammond
d8ad2afcad docs: fix supported versions (#32563) 2022-01-20 13:07:23 -08:00
trop[bot]
9ef4825b77 docs: fix broken images for symbol server setup (#32525)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-01-19 10:31:33 -05:00
trop[bot]
6b0479b556 fix: check for maximized window before unmaximizings (#32495)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-01-18 15:47:21 -05:00
Shelley Vohr
891374e794 fix: maximize/unmaximize firing on linux (#32497) 2022-01-18 15:20:39 -05:00
trop[bot]
de8623db8a fix: Corrupted title of alert dialog (#32470)
Co-authored-by: Takao Baba <babatakao@gmail.com>
2022-01-17 16:31:47 +09:00
trop[bot]
ada1e9137b fix: optional postMessage transfer arg (#32460)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-01-14 09:41:17 +09:00
trop[bot]
b6492686e4 fix: use setAspectRatio for frameless window on mac (#32446)
* 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 16:55:19 +09:00
trop[bot]
0b57386492 fix: will-attach-webview handler modifying params.instanceId does not break <webview> (#32429)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-01-13 09:40:30 +09:00
trop[bot]
ad1101e610 build: pin colors to v1.4.0 in package.json (#32425)
* 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:14 +09:00
Sudowoodo Release Bot
86cf473d81 Bump v16.0.7 2022-01-11 09:04:42 -08:00
trop[bot]
26e37db25c fix: Support running git-[im,ex]port-patches with Python3 too (#32409)
* script: Python3 compatibility for utf8 conversion

The unicode() method has been renamed to str() in Python3,
add a wrapper around it to support running against both versions.

* script: don't require python2 for git-[import,export]-patches

The scripts work just fine with python3 too, so use the generic
python executable as the script interpreter.
Most setups don't even require or provide python 2 anymore,
so this saves one from having to install it just for the scripts.

Co-authored-by: Romain Pokrzywka <rpokrzywka@nvidia.com>
2022-01-11 10:03:15 +01:00
trop[bot]
3ddb61fc3a fix: incorrect skipTransformProcessType option parsing in win.setVisibleOnAllWorkspaces() (#32397)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-01-11 14:44:51 +09:00
Milan Burda
68a512a541 docs: left is a valid mode in contents.openDevTools() options (#32372) (#32403) 2022-01-10 16:53:13 -05:00
trop[bot]
adb571bcde docs: clarify case insensitive dictionary hosting (#32401)
You must either (1) have a case-insensitive file server (2) upload files in both casings. This improves the docs to clarify that.

[0]: https://github.com/electron/electron/issues/22482#issuecomment-593617375

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2022-01-10 16:51:06 -05:00
trop[bot]
9183cf6a66 docs: fix note for will-move event (#32399)
* docs: fix note for `will-move` event

* Trigger Build

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-01-10 16:34:29 -05:00
trop[bot]
c5d5c28a79 fix: Don't create console window when creating process (#32379)
* fix: Don't create console window when creating process

* Update patches/node/fix_don_t_create_console_window_when_creating_process.patch

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

* Remove extra line in description

* Update .patches

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
Co-authored-by: Raymond Zhao <rzhao271@gmail.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2022-01-10 07:55:06 -08:00
trop[bot]
59aba70e8f fix: allow npm_config_arch override on mac (#32381)
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:58:35 +01:00
trop[bot]
e640ab47fd docs: improve BrowserView example (#32365)
* working example

previous example not beginner-friendly

* Update browser-view.md

Co-authored-by: MikeBusuttil <31480000+MikeBusuttil@users.noreply.github.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2022-01-06 15:33:13 +09:00
John Kleinschmidt
fff7e18c70 fix: text input performance regression (#32352) 2022-01-06 09:22:20 +09:00
trop[bot]
569440962d Rename patch file to .patch to conform to naming standard which utilizes .gitattributes settings (#32345)
Co-authored-by: stsean <stsean@justin.tv>
2022-01-05 09:00:44 -08:00
trop[bot]
bee9ff83dd fix: #32141 register wrong command for setAsDefaultProtocolClient for windows (#32331)
Co-authored-by: Shubham-Kumar-2000 <shukhu10@gmail.com>
2022-01-05 18:34:44 +09:00
trop[bot]
41b7a0c9c2 fix: crash caused by app.getLocaleCountryCode() (#32321)
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-04 16:04:51 +09:00
trop[bot]
cefa1bb82f docs: correct webFrame description (#32326)
The current description incorrectly states that the webFrame export represents the top frame but it actually represents the current frame.

Co-authored-by: Maciej Krawczyk <mckravchyk@gmail.com>
2022-01-04 16:04:11 +09:00
Sudowoodo Release Bot
eb7a897849 Bump v16.0.6 2022-01-03 10:39:59 -08:00
trop[bot]
ac0143af8e Fix typo in quick-start.md (#32312)
Resolve a grammar issue in the quick-start guide.

Co-authored-by: Jack Nemitz <62447711+terminalPoltergeist@users.noreply.github.com>
2022-01-03 11:55:30 -05:00
trop[bot]
6dc9d0629a fix: check for single bluetooth listener (#32243)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-12-20 12:48:34 +09:00
trop[bot]
187b009a70 fix: older systems crash when playing media files (#32215)
* 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:23 -08:00
electron-roller[bot]
040910b1d0 chore: bump chromium to 96.0.4664.110 (16-x-y) (#32123)
* chore: bump chromium in DEPS to 96.0.4664.93

* chore: update patches

* chore: bump chromium in DEPS to 96.0.4664.110

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-12-16 14:41:06 -08:00
Sudowoodo Release Bot
27a2f89b2b Bump v16.0.5 2021-12-16 14:06:44 -08:00
Sudowoodo Release Bot
a3f736e655 Revert "Bump v16.0.5"
This reverts commit 8091d72019.
2021-12-16 12:45:54 -08:00
Sudowoodo Release Bot
8091d72019 Bump v16.0.5 2021-12-16 08:42:41 -08:00
trop[bot]
8a2f487605 fix: ensure bluetooth devices are not returned by default (#32199)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-12-15 19:51:22 -08:00
trop[bot]
66dec80e48 Update discord url to electronjs (#32175)
The discord url in this page is discord.gg/electron, which refers to a (supposed) roblox scripting group.

Co-authored-by: Dennis <70665154+dennisrijsdijk@users.noreply.github.com>
2021-12-14 15:53:01 -08:00
trop[bot]
ca946ac23e docs: Fix environment variable name (#32163)
The names of environment variables are case-sensitive on Linux and Mac.

Co-authored-by: stephen9357 <stephen9357@gmail.com>
2021-12-14 19:43:07 +09:00
trop[bot]
73ba0cb46b fix: window.open not overriding parent's webPreferences (#32108)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-12-07 09:47:59 +09:00
Keeley Hammond
cf0b1e1b68 build: add CI path-filtering for docs-only changes (#32055)
* 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 specifically for the newest Chrome roll and doesn't apply to 16-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:35:02 +09:00
trop[bot]
371a61dc59 fix: gtk_native_dialog_run() calls show() internally (#32082)
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:41 +09:00
Sudowoodo Release Bot
4aef2d7cc3 Bump v16.0.4 2021-12-02 17:46:05 -08:00
Keeley Hammond
ebd3360601 fix: avoid double call in OnRefreshComplete on aura platforms (#32052) (#32089) 2021-12-02 17:43:50 -08:00
Sudowoodo Release Bot
f1017d553d Bump v16.0.3 2021-11-30 12:54:02 -08:00
trop[bot]
f6c16b4966 fix: fix aspect ratio when max width/height is set (#31957)
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.

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
2021-11-24 15:57:53 -05:00
Sudowoodo Release Bot
e029f65fe1 Bump v16.0.2 2021-11-24 12:47:45 -08:00
trop[bot]
a2b79a2450 docs: add playwright e2e testing docs (#31974)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-11-23 19:30:06 -08:00
trop[bot]
51d448c22d fix: console windows from ELECTRON_RUN_AS_NODE instances (#31973)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-11-23 12:59:59 -08:00
electron-roller[bot]
28230978e8 chore: bump chromium in DEPS to 96.0.4664.55 (#31909)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2021-11-22 20:07:46 -05:00
trop[bot]
93ae6e3f73 fix: BrowserView setBackgroundColor needs two calls (#31947)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-22 16:38:15 +09:00
trop[bot]
b088673a5d fix: ninja build failed on some system (#31943)
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2021-11-22 16:36:26 +09:00
trop[bot]
a66d541471 fix: lint Objective-C header files (#31939)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-22 16:35:07 +09:00
Sudowoodo Release Bot
beac90fba4 Bump v16.0.1 2021-11-18 08:07:12 -08:00
trop[bot]
b4a6e0ad34 docs: fix typo in distribution docs (#31879)
Co-authored-by: Sergey Zolotarev <sryze@protonmail.com>
2021-11-18 20:32:31 +09:00
trop[bot]
483d4fa603 fix: add resource strings for file selection (#31883)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-11-17 16:16:01 -08:00
trop[bot]
358bffbcb0 chore: use std::forward() in ConvertToV8() (#31858)
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:59 -05:00
Sudowoodo Release Bot
dae224619f Bump v16.0.0 2021-11-15 15:32:15 -08:00
Keeley Hammond
9110380ef6 fix: provide paths for all NetworkContextFilePaths keys (#31852)
* fix: provide paths for all NetworkContextFilePaths keys

* chore: include chrome features header

* chore: build browser_features

* yolo

* add pref service

* fix: include sandbox policy features

* fix pref key

* fix: gate pref key to OS_WIN

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-11-15 15:25:57 -08:00
trop[bot]
00dff390ac fix: make BrowserView aware of owning window (#31842)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-15 11:52:18 -08:00
trop[bot]
16d3917334 fix: media shouldn't open permissions dialog (#31837)
* 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

Co-authored-by: Fedor Indutny <fedor@indutny.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-11-15 11:51:22 -08:00
trop[bot]
2cc843737b fix: crash on browserView.webContents.destroy() (#31827)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-15 11:50:47 -08:00
Charles Kerr
fe248d310d fix: revert "refactor: only create webContents after 'will-attach-webview'… (#31848)
* Revert "refactor: only create webContents after 'will-attach-webview' (#30311)" (#31785)

This reverts commit 6e43b0bcbf.

* fix: backport 31785 to fix localStorage persistence regression
2021-11-15 11:34:19 -08:00
Sudowoodo Release Bot
b2ea9fd381 Revert "Bump v16.0.0-beta.10"
This reverts commit 347f18a634.
2021-11-15 11:14:56 -08:00
trop[bot]
55a293cfaf fix: change cookie default from NO_RESTRICTION to LAX_MODE (#31839)
* fix: change default from NO_RESTRICTION to LAX_MODE

* chore: update cookie docs, redirect tests

Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-11-15 10:33:44 -08:00
trop[bot]
e8ba44c632 fix: setContentProtection affects BrowserWindow frame (#31832)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2021-11-15 16:26:24 +01:00
trop[bot]
ddab5ac3fc fix: in GTK open dialog, do not preview huge files (#31821)
* 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 09:14:54 -06:00
Sudowoodo Release Bot
347f18a634 Bump v16.0.0-beta.10 2021-11-15 05:31:01 -08:00
trop[bot]
a2332646fa fix: crash caused by GetHostNameW on Windows 7 (#31814)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-11-15 13:42:31 +01:00
trop[bot]
cdf312e16f fix: correct default text for button labels in gtk dialogs (#31824) 2021-11-15 11:22:34 +01:00
electron-roller[bot]
445099073a chore: bump chromium to 96.0.4664.45 (16-x-y) (#31806)
* chore: bump chromium in DEPS to 96.0.4664.45

* 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-11-14 16:37:40 -08:00
trop[bot]
05eb145d2b doc: Update E17 release dates (#31788)
Co-authored-by: Sofia Nguy <sofianguy@gmail.com>
2021-11-11 10:08:16 -05:00
Sudowoodo Release Bot
c16e94ebbf Bump v16.0.0-beta.9 2021-11-11 05:30:51 -08:00
trop[bot]
48be5c3387 fix: failing Node.js certificate spec (#31771)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-11 11:35:24 +09:00
trop[bot]
9fd781073f fix: BrowserView setBackgroundColor() (#31772)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-10 10:06:03 +09:00
trop[bot]
c25edb5fdd chore: cleanup obsolete lib/common/remote/ipc-messages.ts (#31767)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-09 12:11:11 -05:00
trop[bot]
cf6df4ae36 test: fix crash in electron::NativeWindowMac::Close() (#31761)
* test: fix crash in electron::NativeWindowMac::Close()

* remove extra close

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-09 11:24:57 -05:00
trop[bot]
6729edf590 chore: remove Breakpad tests for crashReporter on Linux (#31745)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-08 11:46:39 -05:00
Sudowoodo Release Bot
2415813313 Bump v16.0.0-beta.8 2021-11-08 05:31:29 -08:00
trop[bot]
136c539836 refactor: move certificate_manager_model to shell (#31740)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-08 11:03:25 +01:00
trop[bot]
a76f2a07a9 fix: crash dump location on Linux (#31711)
* 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-07 21:13:17 -08:00
trop[bot]
8b6aecc6f0 fix: <webview> background transparency (#31728)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-11-07 18:11:34 -08:00
trop[bot]
3186a246a5 test: deflake <webview> tag loads devtools extensions on WOA (#31715)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-04 19:46:23 -04:00
trop[bot]
15ff515437 fix: clipboard.writeBuffer raw format access (#31116) (#31719)
* 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>

Co-authored-by: henrit <henrit@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-04 17:41:42 -04:00
electron-roller[bot]
d3a24c24af chore: bump chromium to 96.0.4664.35 (16-x-y) (#31709)
* chore: bump chromium in DEPS to 96.0.4664.35

* 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-11-04 12:59:30 -04:00
Sudowoodo Release Bot
f4a51e2adc Bump v16.0.0-beta.7 2021-11-04 06:36:00 -07:00
trop[bot]
cdc897c745 fix: second-instance additionalData parameter (#31708)
* test: second-instance additionalData parameter

* Fix posix implementation

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
2021-11-04 19:59:51 +09:00
trop[bot]
8c842552b0 fix: incorrect Content-Disposition serialization (#31694)
* fix: incorrect Content-Disposition serialization

* test: fixup test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-04 09:59:47 +09:00
trop[bot]
e918fe6030 fix: apply transparency settings to WebContentsPreferences (#31700)
* fix: add transparency to web_contents_preferences

* fix: correctly apply transparency settings to new webContents from webPreferences

Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-11-03 12:50:57 -07:00
trop[bot]
d9e0025429 fix: do not run dialog callback inside transaction commit (#31657)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-11-02 14:55:52 +01:00
trop[bot]
5fc4a4768e test: fix test-datetime-change-notify after daylight change (#31656)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-01 20:23:37 -04:00
Milan Burda
cf54123ec6 chore: update chore_add_context_to_context_aware_module_prevention.patch (#31579) (#31629) 2021-11-01 15:53:37 -04:00
trop[bot]
948aa12af0 fix: clipboard.read() to recognize custom types (#31652)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-01 14:31:20 -04:00
trop[bot]
5fdf37eac9 fix: use disable-hid-blocklist to allow FIDO (#31650)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-11-01 14:23:07 -04:00
trop[bot]
1dcf237c8d fix: crash on close window when webContents destroyed (#31646)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-01 13:57:22 -04:00
Sudowoodo Release Bot
8285172412 Bump v16.0.0-beta.6 2021-11-01 06:35:12 -07:00
trop[bot]
5735cb3cb0 fix: navigator.keyboard.lock() not working (#31621)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-28 19:41:01 +02:00
Shelley Vohr
1adea9e34e fix: silent print settings (#31615) 2021-10-28 12:04:35 -04:00
electron-roller[bot]
0cb6a2ea8a chore: bump chromium to 96.0.4664.27 (16-x-y) (#31619)
* chore: bump chromium in DEPS to 96.0.4664.27

* 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-28 12:04:02 -04:00
Sudowoodo Release Bot
48e9e34acd Bump v16.0.0-beta.5 2021-10-28 06:33:05 -07:00
trop[bot]
1433180472 docs: update test automation doc (#31613)
* 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: Erick Zhao <erick@hotmail.ca>
2021-10-28 16:24:41 +09:00
trop[bot]
48a1117cbf docs: link to Apple developer docs for app.ready event (#31600)
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:16:57 +09:00
Sudowoodo Release Bot
b213c345bf Bump v16.0.0-beta.4 2021-10-27 14:24:52 -07:00
trop[bot]
46b8dcfb03 fix: use shorter paths for creating singleton sockets (#31612)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-10-27 14:23:34 -07:00
trop[bot]
5c48a94b48 fix: clipboard.read() crash (#31592)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-26 18:56:08 -04:00
electron-roller[bot]
22df8eadbf chore: bump chromium to 96.0.4664.18 (16-x-y) (#31593)
* chore: bump chromium in DEPS to 96.0.4664.18

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-10-26 17:23:41 -04:00
trop[bot]
8520fa8e6f fix: do not trigger CSP violations when checking eval (#31589)
* fix: do not trigger CSP violations when checking eval

* Update shell/renderer/api/electron_api_web_frame.cc

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-10-26 16:57:50 -04:00
trop[bot]
517493a1f3 chore: import base/macros.h into asar archive.h (#31597)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-10-26 11:54:28 -07:00
trop[bot]
c10c449258 build: retry hasher function if it fails first time (#31581)
* 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:41:14 +09:00
trop[bot]
5026e7823e docs: win.getParentWindow() returns BrowserWindow | null (#31577)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-26 17:37:51 +09:00
trop[bot]
c063a2d9fe chore: fix malformed mojom::CreateNewWindowParams patch (#31584)
* chore: fix malformed mojom::CreateNewWindowParams patch

* chore: update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-26 09:36:17 +02:00
trop[bot]
c46620d4ba chore: bump chromium to 96.0.4664.4 (16-x-y) (#31529)
* chore: bump chromium in DEPS to 96.0.4662.0

* chore: bump chromium in DEPS to 96.0.4663.0

* chore: update patches

* Remove RuntimeData entirely

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

* Make helper macros behave consistently for //content/public UserData types

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

* Enabling sandboxing for the speech recognition service browser tests

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

* Add 'RegisterPreference' host binding

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

* Add persistAcrossSessions flag (scripting API)

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

* Add Passkey prompt dialog for bonding.

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

* Clipboard: Remove ReadImage path in browser

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

* Split printing metafile code into its own target.

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

* Cleanup unused DesktopMediaListObserver params

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

* Remove base::DictionaryValue::GetBinary

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

* Window Placement: change RWHV::GetDisplayList to GetScreenInfos

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

* Add a preview to the Tab Capture picker dialog

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

* Add service-based usage to update print settings

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

* chore: bump chromium in DEPS to 96.0.4664.2

* chore: update patches

* chore: bump chromium in DEPS to 96.0.4664.4

* chore: update patches

* chore: bump chromium in DEPS to 97.0.4666.0

* Revert "chore: bump chromium in DEPS to 97.0.4666.0"

This reverts commit d73caae8ba4b39efc9b3ea4de52685b9c92ef3d0.

* Reland "Block external protocol handler with sandbox."

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

* fixup for lint

* Add CookiePartitionKeychain parameter to CookeManager.GetCookieList.

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

* Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry

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

* fixup Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry

* ozone: //chrome/browser clean up from USE_X11

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

* content: don't load v8 snapshot in browser process

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

* Add 'RegisterPreference' host binding

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

* 3186491: Add 'devtools.sync_preferences' preference

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

* 2951147: DCHECK accessible names for focusable Views

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

* 3201014: Use real font size for calculation of SmallTextRatio

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

* fixup Clipboard: Remove ReadImage path in browser

* chore: update patches

* fix: disable PlzServiceWorker to fix custom protocol SW script loading

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

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-10-25 13:33:33 -04:00
Sudowoodo Release Bot
92f20955bd Bump v16.0.0-beta.3 2021-10-25 06:33:46 -07:00
trop[bot]
762ecfef24 fix: vibrant window should have transparent background (#31537)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-25 09:48:13 +09:00
trop[bot]
ea96f4c176 fix: MediaMetadata not working properly (#31535)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-22 21:17:24 +09:00
Erick Zhao
d085de4787 docs: add window customization guide (#31054) (#31508)
* 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-22 21:15:57 +09:00
trop[bot]
dd7a8da6be fix: event with invalid timestamp in trace log (#31423)
* 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.

* update patches for 16-x-y

Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-10-21 13:55:02 -04:00
Sudowoodo Release Bot
a4ded39e61 Bump v16.0.0-beta.2 2021-10-21 06:33:22 -07:00
trop[bot]
d3ff2033ed feat: Add data parameter to app.requestSingleInstanceLock() (#31444)
* WIP

* Use serialization

* Rebase windows impl of new app requestSingleInstanceLock parameter

* Fix test

* Implement posix side

* Add backwards compatibility test

* Apply PR feedback Windows

* Fix posix impl

* Switch mac impl back to vector

* Refactor Windows impl

* Use vectors, inline make_span

* Use blink converter

* fix: ownership across sequences

* Fix upstream merge from Chromium

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-10-21 21:52:15 +09:00
trop[bot]
005b193307 feat: warn when ipcRenderer.sendSync() called with no listeners for channel (#31435)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-21 09:08:47 +09:00
trop[bot]
369269c475 fix: remove 'NOTREACHED()' from 'GetWindowResizeEdge' (#31479)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2021-10-21 09:05:33 +09:00
Sudowoodo Release Bot
339eccfc42 Bump v16.0.0-beta.1 2021-10-20 07:57:25 -07:00
trop[bot]
65c8415bac fix: don't use private enterprise APIs in MAS build (#31488)
* fix: don't use private enterprise APIs in MAS build

* Update .patches

Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2021-10-20 07:50:32 -07:00
trop[bot]
30be3150ff fix: ensure TracingAgent in place for SWs (#31477)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-19 11:43:23 -04:00
trop[bot]
7d9ce1379f 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. (#31473)
Co-authored-by: Daniel Ramp <12480131+DanielRamp@users.noreply.github.com>
2021-10-19 20:39:45 +09:00
trop[bot]
27d1f6a360 Avoid Undefined Variable In printToPdf Example (#31466)
Co-authored-by: universalstrapping <90921972+universalstrapping@users.noreply.github.com>
2021-10-19 17:41:05 +09:00
trop[bot]
be46387f22 fix: add isDestroyed check (#31469)
* 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:33 +09:00
Cheng Zhao
fe160165b6 fix: generate valid config.gypi (#31441) 2021-10-18 10:35:07 -05:00
Sudowoodo Release Bot
be1c18096b Bump v16.0.0-alpha.9 2021-10-18 08:30:43 -07:00
trop[bot]
2e3b05bcad fix: also pass securityOrigin to media permissions request handler (#31416)
Co-authored-by: Maxime Serrano <mserrano@alumni.cmu.edu>
2021-10-15 13:32:01 +09:00
trop[bot]
54657fb667 fix: mac window crash native theme update (#31430)
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2021-10-15 09:05:53 +09:00
Sudowoodo Release Bot
c83d65eab0 Bump v16.0.0-alpha.8 2021-10-14 11:22:30 -07:00
trop[bot]
3daad4fd40 fix: reset render_frame_disposed_ after render frame host change (#31427)
* 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 11:21:31 -07:00
trop[bot]
b4a79672cf test: fix flaky contentTracing.startRecording spec (#31411)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-10-13 16:52:19 -04:00
trop[bot]
a71c610747 docs: update Versioning doc (#31389)
* fix information

* move historical section to bottom

* Update docs/tutorial/electron-versioning.md

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

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-13 11:24:30 +09:00
trop[bot]
b1366421d1 chore: bump chromium to 96.0.4647.0 (main) (#31302)
* chore: bump chromium in DEPS to 95.0.4630.0

* 3133701: Fix chrome root store codegen for cross-compile builds.

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

* 49125: Include SHA512-256 in EVP_get_digestbyname and EVP_MD_do_all.

https://boringssl-review.googlesource.com/c/boringssl/+/49125

* chore: fixup patch indices

* 3131662: [Code Health] Remove ListValue::Append(Integer|Boolean)

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

* chore: bump chromium in DEPS to 95.0.4631.0

* chore: update patches

* chore: bump chromium in DEPS to 95.0.4635.0

* chore: update patches

* chore: bump chromium in DEPS to 95.0.4636.0

* chore: bump chromium in DEPS to 95.0.4637.0

* chore: update patches

* refactor: move PlatformNotificationService into BrowserContext

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

* refactor: ListValue::GetSize and ListValue::AppendString were removed

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

* chore: bump chromium in DEPS to 95.0.4638.0

* chore: bump chromium in DEPS to 95.0.4638.4

* chore: bump chromium in DEPS to 96.0.4640.0

* chore: bump chromium in DEPS to 96.0.4641.0

* chore: bump chromium in DEPS to 96.0.4642.0

* chore: update patches

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* 3134756: Move extensions/browser/value_store to components/value_store.

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

* 3150092: [Autofill] Allow aligning Autofill suggestions to the field's center

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

* chore: bump chromium in DEPS to 96.0.4643.0

* chore: update patches

* chore: bump chromium in DEPS to 96.0.4644.0

* chore: update patches

* chore: bump chromium in DEPS to 96.0.4645.0

* chore: update patches

* chore: bump chromium in DEPS to 96.0.4646.0

* chore: bump chromium in DEPS to 96.0.4647.0

* chore: update patches

Ref (for chromium): https://chromium-review.googlesource.com/c/chromium/src/+/3165772

* 3162087: Reland "Ensure Branch Target Identification is enabled for executable pages."

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

* chore: update evert_add_inline_and_inline_origin_records_to_symbol_file.patch

Xref: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3166678

Xref: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3166674

* chore: update Allocator construction

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

Change RefCount::kAllowed/Disallowed semantics into BackupRefPtr::kEnabled/Disabled

* chore: add UseConfigurablePool to v8::ArrayBuffer::Allocator invocation

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

* chore: do not set network_context_params.context_name

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

Remove name field from mojom::NetworkContext

* fix: use ForEachRenderFrameHost to iterate frames.

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

New implementation partially cribbed from
https://source.chromium.org/chromium/chromium/src/+/main:extensions/browser/script_executor.cc;drc=f894f106c6d5fac8e0b75158f622256e0f34f593;l=109

* Remove WebLocalFrame::RequestExecuteScriptAndReturnValue()

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

ExecuteJavaScript's RequestExecuteScript() new params are cribbed from
https://chromium-review.googlesource.com/c/chromium/src/+/3149699/4/third_party/blink/renderer/core/frame/web_local_frame_impl.cc

* Remove IsDescendantOf API on RenderFrameHost.

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

function is trivial to implement, so make a local copy in anon namespace

* Rewrite IsDescendantOf check to check GetParentOrOuterDocument.

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

* Remove GetFramesInSubtree from RenderFrameHost

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

* fix: dump_syms for macOS

* chore: update patches

* Remove ListValue::AppendString and ListValue::GetSize

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

* fix: gn check

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

* fix: crash with Isolate::GetHeapCodeAndMetadataStatistics

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

* chore: update patches

* chore: fix windows build

* Add kPrintWithPostScriptType42Fonts feature.

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

* chore: update patches

* chore: fix tests

* ozone/x11: fix VA-API.

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

* Revert "ozone/x11: fix VA-API."

This reverts commit 23e742acb1.

* Reland "Make Ozone/X11 default."

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

* fixup Reland "Make Ozone/X11 default."

* fixup Reland "Make Ozone/X11 default." for clipboard

* test: unflake contentTracing test

* Revert "test: unflake contentTracing test"

This reverts commit 62a6525235.

* chore: debug large contentTracing file

* fixup debug patch

* Revert "fixup debug patch"

* Roll Perfetto Trace Processor Linux from b852166f90d5 to e90b9fb93385

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

* update patch after merge

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2021-10-12 13:56:37 -04:00
trop[bot]
f2696fb431 chore: refactor persisting permission granted to serial ports (#31324)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-10-12 09:19:07 +09:00
trop[bot]
25c536d355 fix: black window on screen capture when content protection is enabled (#31386)
Co-authored-by: Micha Hanselmann <mhanselmann@microsoft.com>
2021-10-12 09:07:27 +09:00
trop[bot]
6530067b85 feat: add commandLine.removeSwitch (#31327)
* 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:06:16 +09:00
Sudowoodo Release Bot
8626aa29d1 Bump v16.0.0-alpha.7 2021-10-11 07:57:39 -07:00
Keeley Hammond
9e0a182821 chore: cherry-pick ec42dfd3545f from chromium (#31331)
* chore: cherry-pick ec42dfd3545f from chromium

* chore: cherry-pick 39090918efac from chromium

* chore: reconcile FPS patch differences

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-10-11 13:03:53 +02:00
trop[bot]
2d8fa4d225 fix: correctly notify WebViewGuestDelegate when webview is detached (#31375)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-10-11 14:35:56 +09:00
trop[bot]
5a7ba8ba8c chore: add logging for print_backend failures (#31288)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-11 14:32:46 +09:00
trop[bot]
ede6b45bc1 test: add missing context-menu event spec for <webview> (#31307)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-11 14:29:40 +09:00
trop[bot]
1000ddfcab docs: add missing 'context-menu' event to webview-tag.md (#31311)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-11 14:28:17 +09:00
trop[bot]
63110a7159 fix: crash on missing render frame (#31336)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-10-11 09:33:59 +09:00
trop[bot]
308ef699e6 docs: nativeWindowOpen default was changed in Electron 15 (#31356)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-10 15:50:20 -07:00
Sudowoodo Release Bot
764b2a6041 Bump v16.0.0-alpha.6 2021-10-07 08:16:39 -07:00
trop[bot]
5009694dc9 refactor: only access memory coordinator interface from browser process (#31301)
Refs https://chromium-review.googlesource.com/c/chromium/src/+/3174305

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2021-10-05 19:19:11 -07:00
trop[bot]
c07016e1d1 fix: return HTNOWHERE in resize hit test to allow draggable regions to kick in when required (#31300)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2021-10-06 09:22:06 +09:00
Sudowoodo Release Bot
7c5a346464 Bump v16.0.0-alpha.5 2021-10-04 12:44:25 -07:00
trop[bot]
4f54cc0d18 fix: "Failed to serialize arguments" when emitting 'context-menu' for webview (#31278)
* 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:43:11 -04:00
Sudowoodo Release Bot
520e7077d4 Bump v16.0.0-alpha.4 2021-10-04 04:48:37 -07:00
trop[bot]
eb41f5b70e fix: dialog is not defined (#31270)
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:36 +09:00
trop[bot]
23afedcea8 fix: fix typo in description of secureDnsMode (#31268)
Co-authored-by: Tobias Nießen <tniessen@users.noreply.github.com>
2021-10-04 12:13:45 +09:00
Alexey Kuzmin
9bc6e1a584 chore: fix pylint (#31201)
* chore: fix pylint

* chore: fix linter errors
2021-09-30 17:19:54 -04:00
Sudowoodo Release Bot
89b08817a9 Bump v16.0.0-alpha.3 2021-09-30 13:55:43 -07:00
trop[bot]
cb6a22a7a4 fix: Enable X509_V_FLAG_TRUSTED_FIRST flag in BoringSSL (#31217)
Fixes: https://github.com/electron/electron/issues/31212
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

Co-authored-by: Juan Cruz Viotti <jv@jviotti.com>
2021-09-30 16:30:32 -04:00
trop[bot]
74c53ad0c3 fix: draggable regions in BrowserViews are independent (#31199)
* fix: draggable regions in BrowserViews are independent

* Trigger Build

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2021-09-30 11:14:40 -04:00
trop[bot]
88235cb2bc fix: crash creating private key with unsupported algorithm (#31136)
* fix: crash creating private key with unsupported algorithm

* test: add regression test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-30 10:11:32 -04:00
Sudowoodo Release Bot
f8b4dc98b9 Bump v16.0.0-alpha.2 2021-09-30 07:08:25 -07:00
trop[bot]
79108c7acd fix: running tests with release build (#31141)
* fix: running tests with release build

* Update electron_api_v8_util.cc

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-29 15:31:54 -04:00
trop[bot]
b0273b96c1 feat: add support for WebHID (#30213) (#31090)
* 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>

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-09-29 13:05:46 -04:00
trop[bot]
f7dd18466b fix: BrowserView drag now delegates to the OS when possible (#31178)
Co-authored-by: @anulman <@anulman>
2021-09-29 12:24:01 +02:00
trop[bot]
80175c5828 refactor: use native WeakRef instead of v8util.weaklyTrackValue() (#31166)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-28 10:16:01 +02:00
trop[bot]
2a36199b35 fix: .lldbinit config stale (unavailable) (#31161)
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2021-09-28 09:54:25 +02:00
trop[bot]
f5c2bab02b docs: update branch name (#31150) 2021-09-28 09:52:19 +02:00
trop[bot]
acca212814 fix: avoid double free when destroying WebContents (#31132)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2021-09-28 09:48:33 +02:00
trop[bot]
ebbaa3b352 fix: crash in v8 due to regexp reentrancy (#31145)
* 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

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2021-09-27 16:53:39 -07:00
trop[bot]
c42ed97535 fix: first mouse not dragging BrowserView (#31101)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-27 09:38:57 +02:00
trop[bot]
cec707ce67 chore: remove gin::Wrappable crash keys (#31105)
* chore: remove gin wrappable crash keys

* chore: remove class headers from crash keys

Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-09-24 10:15:59 -07:00
trop[bot]
0080a61c1d feat: add width option to dialog.showMessageBox() (#31089)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-09-23 17:34:51 -04:00
trop[bot]
2f543c3fd4 fix: startDrag params type incorrect (#31084)
Co-authored-by: Black-Hole1 <158blackhole@gmail.com>
2021-09-23 19:49:49 +09:00
trop[bot]
f6da3b43c2 fix: update Windows' cache after changing window's style (#31080)
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:42 +09:00
trop[bot]
6029315e1a chore: clarify new-window fix comment (#31072)
Co-authored-by: VerteDinde <khammond@slack-corp.com>
2021-09-22 17:26:22 -07:00
Sudowoodo Release Bot
f6748f9795 Bump v16.0.0-alpha.1 2021-09-22 12:49:14 -07:00
trop[bot]
6500bcbb32 fix: proper localization when using GtkFileChooserNative (#31067)
* fix: proper localization when using GtkFileChooserNative

* fix: iwyu

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-22 15:48:19 -04:00
593 changed files with 29907 additions and 8240 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

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") {
@@ -347,6 +353,7 @@ source_set("electron_lib") {
"//base/allocator:buildflags",
"//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
"//components/autofill/core/common:features",
"//components/certificate_transparency",
"//components/language/core/browser",
"//components/net_log",
@@ -379,6 +386,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",
@@ -412,7 +420,6 @@ source_set("electron_lib") {
]
include_dirs = [
"chromium_src",
".",
"$target_gen_dir",
@@ -546,8 +553,9 @@ source_set("electron_lib") {
"GLIB_DISABLE_DEPRECATION_WARNINGS",
]
sources += filenames.lib_sources_nss
sources += [
"shell/browser/certificate_manager_model.cc",
"shell/browser/certificate_manager_model.h",
"shell/browser/ui/gtk/app_indicator_icon.cc",
"shell/browser/ui/gtk/app_indicator_icon.h",
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
@@ -1242,6 +1250,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" ]
}
}
}
@@ -1378,11 +1390,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" ]
}
@@ -1400,6 +1414,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" ]
}
@@ -1418,6 +1433,7 @@ group("electron_mksnapshot") {
dist_zip("electron_mksnapshot_zip") {
data_deps = mksnapshot_deps
deps = data_deps
outputs = [ "$root_build_dir/mksnapshot.zip" ]
}
@@ -1428,6 +1444,7 @@ copy("hunspell_dictionaries") {
dist_zip("hunspell_dictionaries_zip") {
data_deps = [ ":hunspell_dictionaries" ]
deps = data_deps
flatten = true
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
@@ -1441,6 +1458,7 @@ copy("libcxx_headers") {
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",
@@ -1456,6 +1474,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':
'95.0.4629.0',
'96.0.4664.174',
'node_version':
'v16.9.1',
'nan_version':

View File

@@ -1 +1 @@
16.0.0-nightly.20210922
16.2.8

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).
@@ -97,6 +97,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

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

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import subprocess

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess

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

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import subprocess
import sys

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess

View File

@@ -15,6 +15,10 @@ static_library("chrome") {
sources = [
"//chrome/browser/accessibility/accessibility_ui.cc",
"//chrome/browser/accessibility/accessibility_ui.h",
"//chrome/browser/app_mode/app_mode_utils.cc",
"//chrome/browser/app_mode/app_mode_utils.h",
"//chrome/browser/browser_features.cc",
"//chrome/browser/browser_features.h",
"//chrome/browser/browser_process.cc",
"//chrome/browser/browser_process.h",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
@@ -25,6 +29,7 @@ static_library("chrome") {
"//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/devtools/devtools_settings.h",
"//chrome/browser/extensions/global_shortcut_listener.cc",
"//chrome/browser/extensions/global_shortcut_listener.h",
"//chrome/browser/icon_loader.cc",
@@ -50,6 +55,20 @@ static_library("chrome") {
"//chrome/browser/process_singleton.h",
"//chrome/browser/ui/browser_dialogs.cc",
"//chrome/browser/ui/browser_dialogs.h",
"//chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc",
"//chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h",
"//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc",
"//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h",
"//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc",
"//chrome/browser/ui/exclusive_access/exclusive_access_manager.h",
"//chrome/browser/ui/exclusive_access/fullscreen_controller.cc",
"//chrome/browser/ui/exclusive_access/fullscreen_controller.h",
"//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc",
"//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h",
"//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc",
"//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.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",
@@ -96,7 +115,7 @@ static_library("chrome") {
}
if (is_linux) {
sources += [ "//chrome/browser/media/webrtc/window_icon_util_linux.cc" ]
sources += [ "//chrome/browser/media/webrtc/window_icon_util_ozone.cc" ]
}
if (use_aura) {
@@ -113,13 +132,13 @@ static_library("chrome") {
"//components/keyed_service/content",
"//components/paint_preview/buildflags",
"//components/proxy_config",
"//components/services/language_detection/public/mojom",
"//content/public/browser",
"//services/strings",
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/services/speech:buildflags",
"//components/optimization_guide/proto:optimization_guide_proto",
]
@@ -129,16 +148,6 @@ static_library("chrome") {
if (is_linux) {
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
if (use_x11 || use_ozone) {
sources +=
[ "//chrome/browser/extensions/global_shortcut_listener_linux.cc" ]
}
if (use_x11) {
sources += [
"//chrome/browser/extensions/global_shortcut_listener_x11.cc",
"//chrome/browser/extensions/global_shortcut_listener_x11.h",
]
}
if (use_ozone) {
deps += [ "//ui/ozone" ]
sources += [
@@ -168,6 +177,7 @@ static_library("chrome") {
if (enable_desktop_capturer) {
sources += [
"//chrome/browser/media/webrtc/desktop_media_list.cc",
"//chrome/browser/media/webrtc/desktop_media_list.h",
"//chrome/browser/media/webrtc/desktop_media_list_base.cc",
"//chrome/browser/media/webrtc/desktop_media_list_base.h",
@@ -205,6 +215,13 @@ static_library("chrome") {
"//chrome/browser/printing/printing_service.h",
]
if (enable_oop_printing) {
sources += [
"//chrome/browser/printing/print_backend_service_manager.cc",
"//chrome/browser/printing/print_backend_service_manager.h",
]
}
public_deps += [
"//chrome/services/printing:lib",
"//components/printing/browser",
@@ -212,6 +229,7 @@ static_library("chrome") {
"//components/services/print_compositor",
"//components/services/print_compositor/public/cpp",
"//components/services/print_compositor/public/mojom",
"//printing/backend",
]
deps += [

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'
@@ -483,6 +483,7 @@ Returns:
* `event` Event
* `argv` String[] - An array of the second instance's command line arguments
* `workingDirectory` String - The second instance's working directory
* `additionalData` unknown - A JSON object of additional data passed from the second instance
This event will be emitted inside the primary instance of your application
when a second instance has been executed and calls `app.requestSingleInstanceLock()`.
@@ -939,7 +940,9 @@ app.setJumpList([
])
```
### `app.requestSingleInstanceLock()`
### `app.requestSingleInstanceLock([additionalData])`
* `additionalData` Record<any, any> (optional) - A JSON object containing additional data to send to the first instance.
Returns `Boolean`
@@ -966,12 +969,16 @@ starts:
const { app } = require('electron')
let myWindow = null
const gotTheLock = app.requestSingleInstanceLock()
const additionalData = { myKey: 'myValue' }
const gotTheLock = app.requestSingleInstanceLock(additionalData)
if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', (event, commandLine, workingDirectory) => {
app.on('second-instance', (event, commandLine, workingDirectory, additionalData) => {
// Print out data received from the second instance.
console.log(additionalData)
// Someone tried to run a second instance, we should focus our window.
if (myWindow) {
if (myWindow.isMinimized()) myWindow.restore()
@@ -1072,7 +1079,7 @@ indicates success while any other value indicates failure according to Chromium
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 peformed first if DoH is
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

View File

@@ -15,14 +15,16 @@ Process: [Main](../glossary.md#main-process)
```javascript
// In the main process.
const { BrowserView, BrowserWindow } = require('electron')
const { app, BrowserView, BrowserWindow } = require('electron')
const win = new BrowserWindow({ width: 800, height: 600 })
app.whenReady().then(() => {
const win = new BrowserWindow({ width: 800, height: 600 })
const view = new BrowserView()
win.setBrowserView(view)
view.setBounds({ x: 0, y: 0, width: 300, height: 300 })
view.webContents.loadURL('https://electronjs.org')
const view = new BrowserView()
win.setBrowserView(view)
view.setBounds({ x: 0, y: 0, width: 300, height: 300 })
view.webContents.loadURL('https://electronjs.org')
})
```
### `new BrowserView([options])` _Experimental_

View File

@@ -17,10 +17,11 @@ 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 the window gracefully
@@ -184,7 +185,7 @@ 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`.
@@ -206,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.
@@ -393,6 +394,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `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
@@ -558,7 +560,7 @@ Returns:
Emitted before the window is moved. On Windows, calling `event.preventDefault()` will prevent the window from being moved.
Note that this is only emitted when the window is being resized manually. Resizing the window with `setBounds`/`setSize` will not emit this event.
Note that this is only emitted when the window is being moved manually. Moving the window with `setPosition`/`setBounds`/`center` will not emit this event.
#### Event: 'move'
@@ -998,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_
@@ -1043,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])`
@@ -1696,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

@@ -99,7 +99,7 @@ the response.
* `expirationDate` Double (optional) - The expiration date of the cookie as the number of
seconds since the UNIX epoch. If omitted then the cookie becomes a session
cookie and will not be retained between sessions.
* `sameSite` String (optional) - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy to apply to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`. Default is `no_restriction`.
* `sameSite` String (optional) - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy to apply to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`. Default is `lax`.
Returns `Promise<void>` - A promise which resolves when the cookie has been set

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,221 +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
There's an alternative way to specify a chromeless window on macOS and Windows.
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" on macOS) 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. On macOS, 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()
```
### Alternatives on macOS
#### `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
When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so
that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, 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. Specifying `true` will result in an overlay with default system colors.
On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons:
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
titleBarStyle: 'hidden',
titleBarOverlay: true
})
win.show()
```
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
titleBarStyle: 'hidden',
titleBarOverlay: {
color: '#2f3241',
symbolColor: '#74b1be'
}
})
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

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

View File

@@ -18,9 +18,9 @@ The `safeStorage` module has the following methods:
Returns `Boolean` - Whether encryption is available.
On Linux, returns true if the secret key is
available. On MacOS, returns true if Keychain is available.
On Windows, returns true with no other preconditions.
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)`

View File

@@ -180,6 +180,96 @@ 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-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:
@@ -207,6 +297,35 @@ app.whenReady().then(() => {
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) => {
@@ -499,6 +618,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
@@ -525,7 +645,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
* `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. 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`, or `serial`.
* `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.
@@ -553,6 +673,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.
@@ -711,8 +903,10 @@ setting with the current OS locale. This setting is persisted across restarts.
By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this
behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell
dictionaries. We publish a `hunspell_dictionaries.zip` file with each release which contains the files you need
to host here, the file server must be **case insensitive** you must upload each file twice, once with the case it
has in the ZIP file and once with the filename as all lower case.
to host here.
The file server must be **case insensitive**. If you cannot do this, you must upload each file twice: once with
the case it has in the ZIP file and once with the filename as all lowercase.
If the files present in `hunspell_dictionaries.zip` are available at `https://example.com/dictionaries/language-code.bdic`
then you should call this api with `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`. Please

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

@@ -736,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')
@@ -1494,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}`)
@@ -1610,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`.
@@ -1827,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.
@@ -1837,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.

View File

@@ -5,8 +5,8 @@
Process: [Renderer](../glossary.md#renderer-process)
`webFrame` export of the Electron module is an instance of the `WebFrame`
class representing the top frame of the current `BrowserWindow`. Sub-frames can
be retrieved by certain properties and methods (e.g. `webFrame.firstChild`).
class representing the current frame. Sub-frames can be retrieved by
certain properties and methods (e.g. `webFrame.firstChild`).
An example of zooming current page to 200%.

View File

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

@@ -69,6 +69,18 @@ Electron apps.
See [here](#removed-desktopcapturergetsources-in-the-renderer) for details on
how to replace this API in your app.
## 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
@@ -119,16 +131,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
@@ -632,7 +634,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 -
```
@@ -85,42 +85,37 @@ $ gclient sync -f
## Building
**Set the environment variable for chromium build tools**
On Linux & MacOS
```sh
$ cd src
$ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") $GN_EXTRA_ARGS"
```
Or on Windows (without the optional argument):
On Windows:
```sh
$ cd src
$ set CHROMIUM_BUILDTOOLS_PATH=%cd%\buildtools
```
**To generate Testing build config of Electron:**
```sh
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")"
```
This will generate a build directory `out/Testing` under `src/` with
the testing build configuration. You can replace `Testing` with another name,
but it should be a subdirectory of `out`.
Also you shouldn't have to run `gn gen` again—if you want to change the
build arguments, you can run `gn args out/Testing` to bring up an editor.
To see the list of available build configuration options, run `gn args
out/Testing --list`.
**For generating Testing build config of
Electron:**
**To generate Release build config of Electron:**
```sh
$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") $GN_EXTRA_ARGS"
$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"
```
**For generating Release (aka "non-component" or "static") build config of
Electron:**
**Note:** This will generate a `out/Testing` or `out/Release` build directory under `src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.
```sh
$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\") $GN_EXTRA_ARGS"
```
Also you shouldn't have to run `gn gen` again—if you want to change the build arguments, you can run `gn args out/Testing` to bring up an editor. To see the list of available build configuration options, run `gn args out/Testing --list`.
**To build, run `ninja` with the `electron` target:**
Nota Bene: This will also take a while and probably heat up your lap.
@@ -156,13 +151,13 @@ $ ./out/Testing/electron
On linux, first strip the debugging and symbol information:
```sh
electron/script/strip-binaries.py -d out/Release
$ electron/script/strip-binaries.py -d out/Release
```
To package the electron build as a distributable zip file:
```sh
ninja -C out/Release electron:electron_dist_zip
$ ninja -C out/Release electron:electron_dist_zip
```
### Cross-compiling

View File

@@ -7,21 +7,7 @@ Follow the guidelines below for building **Electron itself** on Linux, for the p
## Prerequisites
* At least 25GB disk space and 8GB RAM.
* Python 2.7.x. Some distributions like CentOS 6.x still use Python 2.6.x
so you may need to check your Python version with `python -V`.
Please also ensure that your system and Python version support at least TLS 1.2.
For a quick test, run the following script:
```sh
$ npx @electron/check-python-tls
```
If the script returns that your configuration is using an outdated security
protocol, use your system's package manager to update Python to the latest
version in the 2.7.x branch. Alternatively, visit https://www.python.org/downloads/
for detailed instructions.
* Python >= 3.7.
* Node.js. There are various ways to install Node. You can download
source code from [nodejs.org](https://nodejs.org) and compile it.
Doing so permits installing Node on your own home directory as a standard user.

View File

@@ -6,45 +6,12 @@ Follow the guidelines below for building **Electron itself** on macOS, for the p
## Prerequisites
* macOS >= 10.11.6
* [Xcode](https://developer.apple.com/technologies/tools/) >= 9.0.0
* macOS >= 11.6.0
* [Xcode](https://developer.apple.com/technologies/tools/). The exact version
needed depends on what branch you are building, but the latest version of
Xcode is generally a good bet for building `main`.
* [node.js](https://nodejs.org) (external)
* Python 2.7 with support for TLS 1.2
## Python
Please also ensure that your system and Python version support at least TLS 1.2.
This depends on both your version of macOS and Python. For a quick test, run:
```sh
$ npx @electron/check-python-tls
```
If the script returns that your configuration is using an outdated security
protocol, you can either update macOS to High Sierra or install a new version
of Python 2.7.x. To upgrade Python, use [Homebrew](https://brew.sh/):
```sh
$ brew install python@2 && brew link python@2 --force
```
If you are using Python as provided by Homebrew, you also need to install
the following Python modules:
* [pyobjc](https://pypi.org/project/pyobjc/#description)
You can use `pip` to install it:
```sh
$ pip install pyobjc
```
## macOS SDK
If you're developing Electron and don't plan to redistribute your
custom Electron build, you may skip this section.
Official Electron builds are built with [Xcode 12.2](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip), and the macOS 11.0 SDK. Building with a newer SDK works too, but the releases currently use the 11.0 SDK.
* Python >= 3.7
## Building Electron

View File

@@ -29,7 +29,7 @@ Style](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/stylegui
[clang-format](clang-format.md) to format the C++ code automatically. There is
also a script `script/cpplint.py` to check whether all files conform.
The Python version we are using now is Python 2.7.
The Python version we are using now is Python 3.9.
The C++ code uses a lot of Chromium's abstractions and types, so it's
recommended to get acquainted with them. A good place to start is

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>

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((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
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 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,409 @@
# 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
```
### 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 Playwright
[Microsoft Playwright](https://playwright.dev) is an end-to-end testing framework built
using browser-specific remote debugging protocols, similar to the [Puppeteer] headless
Node.js API but geared towards end-to-end testing. Playwright has experimental Electron
support via Electron's support for the [Chrome DevTools Protocol] (CDP).
### Install dependencies
You can install Playwright through your preferred Node.js package manager. The Playwright team
recommends using the `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` environment variable to avoid
unnecessary browser downloads when testing an Electron app.
```sh npm2yarn
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install --save-dev playwright
```
Playwright also comes with its own test runner, Playwright Test, which is built for end-to-end
testing. You can also install it as a dev dependency in your project:
```sh npm2yarn
npm install --save-dev @playwright/test
```
:::caution Dependencies
This tutorial was written `playwright@1.16.3` and `@playwright/test@1.16.3`. Check out
[Playwright's releases][playwright-releases] page to learn about
changes that might affect the code below.
:::
:::info Using third-party test runners
If you're interested in using an alternative test runner (e.g. Jest or Mocha), check out
Playwright's [Third-Party Test Runner][playwright-test-runners] guide.
:::
### Write your tests
Playwright launches your app in development mode through the `_electron.launch` API.
To point this API to your Electron app, you can pass the path to your main process
entry point (here, it is `main.js`).
```js {5}
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
test('launch app', async () => {
const electronApp = await electron.launch({ args: ['main.js'] })
// close app
await electronApp.close()
})
```
After that, you will access to an instance of Playwright's `ElectronApp` class. This
is a powerful class that has access to main process modules for example:
```js {6-11}
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
test('get isPackaged', async () => {
const electronApp = await electron.launch({ args: ['main.js'] })
const isPackaged = await electronApp.evaluate(async ({ app }) => {
// This runs in Electron's main process, parameter here is always
// the result of the require('electron') in the main app script.
return app.isPackaged
})
console.log(isPackaged) // false (because we're in development mode)
// close app
await electronApp.close()
})
```
It can also create individual [Page][playwright-page] objects from Electron BrowserWindow instances.
For example, to grab the first BrowserWindow and save a screenshot:
```js {6-7}
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
test('save screenshot', async () => {
const electronApp = await electron.launch({ args: ['main.js'] })
const window = await electronApp.firstWindow()
await window.screenshot({ path: 'intro.png' })
// close app
await electronApp.close()
})
```
Putting all this together using the PlayWright Test runner, let's create a `example.spec.js`
test file with a single test and assertion:
```js title='example.spec.js'
const { _electron: electron } = require('playwright')
const { test, expect } = require('@playwright/test')
test('example test', async () => {
const electronApp = await electron.launch({ args: ['.'] })
const isPackaged = await electronApp.evaluate(async ({ app }) => {
// This runs in Electron's main process, parameter here is always
// the result of the require('electron') in the main app script.
return app.isPackaged;
});
expect(isPackaged).toBe(false);
// Wait for the first BrowserWindow to open
// and return its Page object
const window = await electronApp.firstWindow()
await window.screenshot({ path: 'intro.png' })
// close app
await electronApp.close()
});
```
Then, run Playwright Test using `npx playwright test`. You should see the test pass in your
console, and have an `intro.png` screenshot on your filesystem.
```console
☁ $ npx playwright test
Running 1 test using 1 worker
✓ example.spec.js:4:1 example test (1s)
```
:::info
Playwright Test will automatically run any files matching the `.*(test|spec)\.(js|ts|mjs)` regex.
You can customize this match in the [Playwright Test configuration options][playwright-test-config].
:::
:::tip Further reading
Check out Playwright's documentation for the full [Electron][playwright-electron]
and [ElectronApplication][playwright-electronapplication] class APIs.
:::
## 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()
})
```
[chrome-driver]: https://sites.google.com/chromium.org/driver/
[Puppeteer]: https://github.com/puppeteer/puppeteer
[playwright-electron]: https://playwright.dev/docs/api/class-electron/
[playwright-electronapplication]: https://playwright.dev/docs/api/class-electronapplication
[playwright-page]: https://playwright.dev/docs/api/class-page
[playwright-releases]: https://github.com/microsoft/playwright/releases
[playwright-test-config]: https://playwright.dev/docs/api/class-testconfig#test-config-test-match
[playwright-test-runners]: https://playwright.dev/docs/test-runners/
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/

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

@@ -7,7 +7,7 @@ Special notes:
* All dates are our goals but there may be reasons for adjusting the stable deadline, such as security bugs.
* Take a look at the [5.0.0 Timeline blog post](https://electronjs.org/blog/electron-5-0-timeline) for info about publicizing our release dates.
* Since Electron 6.0, we've been targeting every other Chromium version and releasing our stable on the same day as Chrome stable. You can reference Chromium's release schedule [here](https://chromiumdash.appspot.com/schedule). See [Electron's new release cadence blog post](https://www.electronjs.org/blog/12-week-cadence) for more details on our release schedule.
* Electron 15.0 only will include a special Alpha release. Starting in Electron 16.0, we will release on an 8-week cadence. See [Electron's new 8-week cadence blog post](https://www.electronjs.org/blog/8-week-cadence) for more details.
* Starting in Electron 16.0, we will release on an 8-week cadence. See [Electron's new 8-week cadence blog post](https://www.electronjs.org/blog/8-week-cadence) for more details.
| Electron | Alpha | Beta | Stable | Chrome | Node |
| ------- | ----- | ------- | ------ | ------ | ---- |
@@ -25,4 +25,5 @@ Special notes:
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | M91 | v14.16 |
| 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 |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | M96 | v16.9 |
| 17.0.0 | 2021-Nov-18 | 2022-Jan-06 | 2022-Feb-01 | M98 | 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 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

@@ -91,7 +91,7 @@ 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
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.

View File

@@ -56,4 +56,4 @@ problem. If not, feel free to fill out our bug report template and submit a new
[comic]: https://www.google.com/googlebooks/chrome/
[fiddle]: https://electronjs.org/fiddle
[issue-tracker]: https://github.com/electron/electron/issues
[discord]: https://discord.gg/electron
[discord]: https://discord.gg/electronjs

View File

@@ -146,7 +146,7 @@ desktop environment that follows [Desktop Notifications
Specification][notification-spec], including Cinnamon, Enlightenment, Unity,
GNOME, KDE.
[notification-spec]: https://developer.gnome.org/notification-spec/
[notification-spec]: https://developer-old.gnome.org/notification-spec/
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[set-app-user-model-id]: ../api/app.md#appsetappusermodelidid-windows
[squirrel-events]: https://github.com/electron/windows-installer/blob/master/README.md#handling-squirrel-events

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

@@ -7,7 +7,7 @@ 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][https://cloud.githubusercontent.com/assets/639601/5081682/16691fda-6f0e-11e4-9676-49b6418f1264.png]
![Windows Progress Bar](../images/windows-progress-bar.png)
On macOS, the progress bar will be displayed as a part of the dock icon.

View File

@@ -119,7 +119,7 @@ of your project.
Before we can create a window for our application, we need to create the content that
will be loaded into it. In Electron, each window displays web contents that can be loaded
from either from a local HTML file or a remote URL.
from either a local HTML file or a remote URL.
For this tutorial, you will be doing the former. Create an `index.html` file in the root
folder of your project:

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

@@ -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
@@ -73,7 +73,7 @@ until the maintainers feel the maintenance burden is too high to continue doing
* 16.x.y
* 15.x.y
* 14.x.y
* 13
* 13.x.y
### End-of-life

View File

@@ -1,173 +0,0 @@
# Selenium and WebDriver
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.
## Setting up Spectron
[Spectron][spectron] is the officially supported ChromeDriver testing framework
for Electron. It is built on top of [WebdriverIO](https://webdriver.io/) and
has helpers to access Electron APIs in your tests and bundles ChromeDriver.
```sh
$ npm install --save-dev spectron
```
```javascript
// A simple test to verify a visible window is opened with a title
const Application = require('spectron').Application
const assert = require('assert')
const myApp = new Application({
path: '/Applications/MyApp.app/Contents/MacOS/MyApp'
})
const verifyWindowIsVisibleWithTitle = async (app) => {
await app.start()
try {
// Check if the window is visible
const isVisible = await app.browserWindow.isVisible()
// Verify the window is visible
assert.strictEqual(isVisible, true)
// Get the window's title
const title = await app.client.getTitle()
// Verify the window's title
assert.strictEqual(title, 'My App')
} catch (error) {
// Log any failures
console.error('Test failed', error.message)
}
// Stop the application
await app.stop()
}
verifyWindowIsVisibleWithTitle(myApp)
```
## Setting up with WebDriverJs
[WebDriverJs](https://www.selenium.dev/selenium/docs/api/javascript/index.html) provides
a Node package for testing with web driver, we will use it as an example.
### 1. Start ChromeDriver
First you need to download the `chromedriver` binary, and run it:
```sh
$ npm install 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
### 2. Install WebDriverJS
```sh
$ npm install selenium-webdriver
```
### 3. Connect to ChromeDriver
The usage of `selenium-webdriver` with Electron is the same with
upstream, except that you have to manually specify how to connect
chrome driver and where to find Electron's binary:
```javascript
const webdriver = require('selenium-webdriver')
const driver = new webdriver.Builder()
// The "9515" is the port opened by chrome driver.
.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()
```
## Setting up with WebdriverIO
[WebdriverIO](https://webdriver.io/) provides a Node package for testing with web
driver.
### 1. Start ChromeDriver
First you need to download the `chromedriver` binary, and run it:
```sh
$ npm install electron-chromedriver
$ ./node_modules/.bin/chromedriver --url-base=wd/hub --port=9515
Starting ChromeDriver (v2.10.291558) on port 9515
Only local connections are allowed.
```
Remember the port number `9515`, which will be used later
### 2. Install WebdriverIO
```sh
$ npm install webdriverio
```
### 3. Connect to chrome driver
```javascript
const webdriverio = require('webdriverio')
const options = {
host: 'localhost', // Use localhost as chrome driver server
port: 9515, // "9515" is the port opened by chrome driver.
desiredCapabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
binary: '/Path-to-Your-App/electron', // Path to your Electron binary.
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
}
}
}
const client = webdriverio.remote(options)
client
.init()
.url('http://google.com')
.setValue('#q', 'webdriverio')
.click('#btnG')
.getTitle().then((title) => {
console.log('Title was: ' + title)
})
.end()
```
## Workflow
To test your application without rebuilding Electron,
[place](application-distribution.md)
your app source into Electron's resource directory.
Alternatively, pass an argument to run with your Electron binary that points to
your app's folder. This eliminates the need to copy-paste your app into
Electron's resource directory.
[chrome-driver]: https://sites.google.com/a/chromium.org/chromedriver/
[spectron]: https://electronjs.org/spectron

View File

@@ -0,0 +1,271 @@
# Window Customization
The `BrowserWindow` module is the foundation of your Electron application, and it exposes
many APIs that can change the look and behavior of your browser windows. In this
tutorial, we will be going over the various use-cases for window customization on
macOS, Windows, and Linux.
## Create frameless windows
A frameless window is a window that has no [chrome]. Not to be confused with the Google
Chrome browser, window _chrome_ refers to the parts of the window (e.g. toolbars, controls)
that are not a part of the web page.
To create a frameless window, you need to set `frame` to `false` in the `BrowserWindow`
constructor.
```javascript title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ frame: false })
```
## Apply custom title bar styles _macOS_ _Windows_
Title bar styles allow you to hide most of a BrowserWindow's chrome while keeping the
system's native window controls intact and can be configured with the `titleBarStyle`
option in the `BrowserWindow` constructor.
Applying the `hidden` title bar style results in a hidden title bar and a full-size
content window.
```javascript title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ titleBarStyle: 'hidden' })
```
### Control the traffic lights _macOS_
On macOS, applying the `hidden` title bar style will still expose the standard window
controls (“traffic lights”) in the top left.
#### Customize the look of your traffic lights _macOS_
The `customButtonsOnHover` title bar style will hide the traffic lights until you hover
over them. This is useful if you want to create custom traffic lights in your HTML but still
use the native UI to control the window.
```javascript
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover' })
```
#### Customize the traffic light position _macOS_
To modify the position of the traffic light window controls, there are two configuration
options available.
Applying `hiddenInset` title bar style will shift the vertical inset of the traffic lights
by a fixed amount.
```javascript title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
```
If you need more granular control over the positioning of the traffic lights, you can pass
a set of coordinates to the `trafficLightPosition` option in the `BrowserWindow`
constructor.
```javascript title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
titleBarStyle: 'hidden',
trafficLightPosition: { x: 10, y: 10 }
})
```
#### Show and hide the traffic lights programmatically _macOS_
You can also show and hide the traffic lights programmatically from the main process.
The `win.setWindowButtonVisibility` forces traffic lights to be show or hidden depending
on the value of its boolean parameter.
```javascript title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
// hides the traffic lights
win.setWindowButtonVisibility(false)
```
> Note: Given the number of APIs available, there are many ways of achieving this. For instance,
> combining `frame: false` with `win.setWindowButtonVisibility(true)` will yield the same
> layout outcome as setting `titleBarStyle: 'hidden'`.
## Window Controls Overlay _macOS_ _Windows_
The [Window Controls Overlay API] is a web standard that gives web apps the ability to
customize their title bar region when installed on desktop. Electron exposes this API
through the `BrowserWindow` constructor option `titleBarOverlay`.
This option only works whenever a custom `titlebarStyle` is applied on macOS or Windows.
When `titleBarOverlay` is enabled, the window controls become exposed in their default
position, and DOM elements cannot use the area underneath this region.
The `titleBarOverlay` option accepts two different value formats.
Specifying `true` on either platform will result in an overlay region with default
system colors:
```javascript title='main.js'
// on macOS or Windows
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
titleBarStyle: 'hidden',
titleBarOverlay: true
})
```
On Windows, you can also specify the color of the overlay and its symbols by setting
`titleBarOverlay` to an object with the `color` and `symbolColor` properties. If an option
is not specified, the color will default to its system color for the window control buttons:
```javascript title='main.js'
// on Windows
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
titleBarStyle: 'hidden',
titleBarOverlay: {
color: '#2f3241',
symbolColor: '#74b1be'
}
})
```
> Note: Once your title bar overlay is enabled from the main process, you can access the overlay's
> color and dimension values from a renderer using a set of readonly
> [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars].
## Create transparent windows
By setting the `transparent` option to `true`, you can make a fully transparent window.
```javascript title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ transparent: true })
```
### Limitations
* You cannot click through the transparent area. See
[#1335](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 CSS [`blur()`] filter only applies to the window's web contents, 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_:
* 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
PR [#28207](https://github.com/electron/electron/pull/28207).
* On _macOS_:
* The native window shadow will not be shown on a transparent window.
## Create click-through windows
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 title='main.js'
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
win.setIgnoreMouseEvents(true)
```
### Forward mouse events _macOS_ _Windows_
Ignoring mouse messages makes the web contents oblivious to mouse movement,
meaning that mouse movement events will not be emitted. On Windows and macOS, an
optional parameter can be used to forward mouse move messages to the web page,
allowing events such as `mouseleave` to be emitted:
```javascript title='main.js'
const { BrowserWindow, ipcMain } = require('electron')
const path = require('path')
const win = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
ipcMain.on('set-ignore-mouse-events', (event, ...args) => {
const win = BrowserWindow.fromWebContents(event.sender)
win.setIgnoreMouseEvents(...args)
})
```
```javascript title='preload.js'
window.addEventListener('DOMContentLoaded', () => {
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)
})
})
```
This makes the web page click-through when over the `#clickThroughElement` element,
and returns to normal outside it.
## Set custom 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.
To make the whole window draggable, you can add `-webkit-app-region: drag` as
`body`'s style:
```css title='styles.css'
body {
-webkit-app-region: drag;
}
```
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 title='styles.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.
### Tip: disable text selection
When creating a draggable region, the dragging behavior may conflict with text selection.
For example, when you drag the titlebar, you may accidentally select its text contents.
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;
}
```
### Tip: disable context menus
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.
[`blur()`]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/blur()
[`BrowserWindow`]: ../api/browser-window.md
[chrome]: https://developer.mozilla.org/en-US/docs/Glossary/Chrome
[ignore-mouse-events]: ../api/browser-window.md#winsetignoremouseeventsignore-options
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
[Window Controls Overlay API]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md

View File

@@ -177,6 +177,7 @@ template("electron_paks") {
"${root_gen_dir}/components/strings/components_strings_",
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
"${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
"${root_gen_dir}/extensions/strings/extensions_strings_",
"${root_gen_dir}/services/strings/services_strings_",
"${root_gen_dir}/ui/strings/app_locale_settings_",
"${root_gen_dir}/ui/strings/ui_strings_",
@@ -185,6 +186,7 @@ template("electron_paks") {
"//chrome/app/resources:platform_locale_settings",
"//components/strings:components_strings",
"//device/bluetooth/strings",
"//extensions/strings",
"//services/strings",
"//third_party/blink/public/strings",
"//ui/strings:app_locale_settings",

View File

@@ -33,6 +33,23 @@
{SCREEN_INDEX, plural, =1{Screen #} other{Screen #}}
</message>
<!-- File Select Helper-->
<message name="IDS_IMAGE_FILES" desc="The description of the image file extensions in the select file dialog.">
Image Files
</message>
<message name="IDS_AUDIO_FILES" desc="The description of the audio file extensions in the select file dialog.">
Audio Files
</message>
<message name="IDS_VIDEO_FILES" desc="The description of the video file extensions in the select file dialog.">
Video Files
</message>
<message name="IDS_CUSTOM_FILES" desc="The description of the custom file extensions in the select file dialog.">
Custom Files
</message>
<message name="IDS_DEFAULT_DOWNLOAD_FILENAME" desc="Default name for downloaded files when we have no idea what they could be.">
download
</message>
<!-- Picture-in-Picture -->
<if expr="is_macosx">
<message name="IDS_PICTURE_IN_PICTURE_TITLE_TEXT" desc="Title of the Picture-in-Picture window. This appears in the system tray and window header.">
@@ -125,5 +142,7 @@
</message>
<message name="IDS_BADGE_UNREAD_NOTIFICATIONS" desc="The accessibility text which will be read by a screen reader when there are notifcatications">
{UNREAD_NOTIFICATIONS, plural, =1 {1 Unread Notification} other {# Unread Notifications}}
</message>
</message>
<message name="IDS_HID_CHOOSER_ITEM_WITHOUT_NAME" desc="User option displaying the device IDs for a Human Interface Device (HID) without a device name.">
Unknown Device (<ph name="DEVICE_ID">$1<ex>1234:abcd</ex></ph>) </message>
</grit-part>

View File

@@ -23,7 +23,6 @@ auto_filenames = {
"docs/api/environment-variables.md",
"docs/api/extensions.md",
"docs/api/file-object.md",
"docs/api/frameless-window.md",
"docs/api/global-shortcut.md",
"docs/api/in-app-purchase.md",
"docs/api/incoming-message.md",
@@ -84,6 +83,7 @@ auto_filenames = {
"docs/api/structures/file-filter.md",
"docs/api/structures/file-path-with-headers.md",
"docs/api/structures/gpu-feature-status.md",
"docs/api/structures/hid-device.md",
"docs/api/structures/input-event.md",
"docs/api/structures/io-counters.md",
"docs/api/structures/ipc-main-event.md",

View File

@@ -347,6 +347,8 @@ filenames = {
"shell/browser/child_web_contents_tracker.h",
"shell/browser/cookie_change_notifier.cc",
"shell/browser/cookie_change_notifier.h",
"shell/browser/electron_api_ipc_handler_impl.cc",
"shell/browser/electron_api_ipc_handler_impl.h",
"shell/browser/electron_autofill_driver.cc",
"shell/browser/electron_autofill_driver.h",
"shell/browser/electron_autofill_driver_factory.cc",
@@ -355,8 +357,6 @@ filenames = {
"shell/browser/electron_browser_client.h",
"shell/browser/electron_browser_context.cc",
"shell/browser/electron_browser_context.h",
"shell/browser/electron_browser_handler_impl.cc",
"shell/browser/electron_browser_handler_impl.h",
"shell/browser/electron_browser_main_parts.cc",
"shell/browser/electron_browser_main_parts.h",
"shell/browser/electron_download_manager_delegate.cc",
@@ -373,6 +373,8 @@ filenames = {
"shell/browser/electron_quota_permission_context.h",
"shell/browser/electron_speech_recognition_manager_delegate.cc",
"shell/browser/electron_speech_recognition_manager_delegate.h",
"shell/browser/electron_web_contents_utility_handler_impl.cc",
"shell/browser/electron_web_contents_utility_handler_impl.h",
"shell/browser/electron_web_ui_controller_factory.cc",
"shell/browser/electron_web_ui_controller_factory.h",
"shell/browser/event_emitter_mixin.cc",
@@ -387,6 +389,14 @@ filenames = {
"shell/browser/font/electron_font_access_delegate.h",
"shell/browser/font_defaults.cc",
"shell/browser/font_defaults.h",
"shell/browser/hid/electron_hid_delegate.cc",
"shell/browser/hid/electron_hid_delegate.h",
"shell/browser/hid/hid_chooser_context.cc",
"shell/browser/hid/hid_chooser_context.h",
"shell/browser/hid/hid_chooser_context_factory.cc",
"shell/browser/hid/hid_chooser_context_factory.h",
"shell/browser/hid/hid_chooser_controller.cc",
"shell/browser/hid/hid_chooser_controller.h",
"shell/browser/javascript_environment.cc",
"shell/browser/javascript_environment.h",
"shell/browser/lib/bluetooth_chooser.cc",
@@ -667,11 +677,6 @@ filenames = {
"shell/utility/electron_content_utility_client.h",
]
lib_sources_nss = [
"chromium_src/chrome/browser/certificate_manager_model.cc",
"chromium_src/chrome/browser/certificate_manager_model.h",
]
lib_sources_extensions = [
"shell/browser/extensions/api/i18n/i18n_api.cc",
"shell/browser/extensions/api/i18n/i18n_api.h",

View File

@@ -39,7 +39,8 @@ Object.assign(app, {
hasSwitch: (theSwitch: string) => commandLine.hasSwitch(String(theSwitch)),
getSwitchValue: (theSwitch: string) => commandLine.getSwitchValue(String(theSwitch)),
appendSwitch: (theSwitch: string, value?: string) => commandLine.appendSwitch(String(theSwitch), typeof value === 'undefined' ? value : String(value)),
appendArgument: (arg: string) => commandLine.appendArgument(String(arg))
appendArgument: (arg: string) => commandLine.appendArgument(String(arg)),
removeSwitch: (theSwitch: string) => commandLine.removeSwitch(String(theSwitch))
} as Electron.CommandLine
});

View File

@@ -72,7 +72,10 @@ BrowserWindow.getAllWindows = () => {
BrowserWindow.getFocusedWindow = () => {
for (const window of BrowserWindow.getAllWindows()) {
if (window.isFocused() || window.isDevToolsFocused()) return window;
const hasWC = window.webContents && !window.webContents.isDestroyed();
if (!window.isDestroyed() && hasWC) {
if (window.isFocused() || window.isDevToolsFocused()) return window;
}
}
return null;
};

View File

@@ -168,6 +168,7 @@ const messageBox = (sync: boolean, window: BrowserWindow | null, options?: Messa
defaultId = -1,
detail = '',
icon = null,
textWidth = 0,
noLink = false,
message = '',
title = '',
@@ -225,7 +226,8 @@ const messageBox = (sync: boolean, window: BrowserWindow | null, options?: Messa
detail,
checkboxLabel,
checkboxChecked,
icon
icon,
textWidth
};
if (sync) {

View File

@@ -593,12 +593,16 @@ WebContents.prototype._init = function () {
ipcMainInternal.emit(channel, event, ...args);
} else {
addReplyToEvent(event);
if (this.listenerCount('ipc-message-sync') === 0 && ipcMain.listenerCount(channel) === 0) {
console.warn(`WebContents #${this.id} called ipcRenderer.sendSync() with '${channel}' channel without listeners.`);
}
this.emit('ipc-message-sync', event, channel, ...args);
ipcMain.emit(channel, event, ...args);
}
});
this.on('-ipc-ports' as any, function (event: Electron.IpcMainEvent, internal: boolean, channel: string, message: any, ports: any[]) {
addSenderFrameToEvent(event);
event.ports = ports.map(p => new MessagePortMain(p));
ipcMain.emit(channel, event, message);
});
@@ -666,16 +670,6 @@ WebContents.prototype._init = function () {
postBody
};
windowOpenOverriddenOptions = this._callWindowOpenHandler(event, details);
// if attempting to use this API with the deprecated window.open event,
// windowOpenOverriddenOptions will always return null. This ensures
// short-term backwards compatibility until window.open is removed.
const parsedFeatures = parseFeatures(rawFeatures);
const overriddenFeatures: BrowserWindowConstructorOptions = {
...parsedFeatures.options,
webPreferences: parsedFeatures.webPreferences
};
windowOpenOverriddenOptions = windowOpenOverriddenOptions || overriddenFeatures;
if (!event.defaultPrevented) {
const secureOverrideWebPreferences = windowOpenOverriddenOptions ? {
// Allow setting of backgroundColor as a webPreference even though
@@ -685,9 +679,19 @@ WebContents.prototype._init = function () {
transparent: windowOpenOverriddenOptions.transparent,
...windowOpenOverriddenOptions.webPreferences
} : undefined;
this._setNextChildWebPreferences(
makeWebPreferences({ embedder: event.sender, secureOverrideWebPreferences })
);
// TODO(zcbenz): The features string is parsed twice: here where it is
// passed to C++, and in |makeBrowserWindowOptions| later where it is
// not actually used since the WebContents is created here.
// We should be able to remove the latter once the |nativeWindowOpen|
// option is removed.
const { webPreferences: parsedWebPreferences } = parseFeatures(rawFeatures);
// Parameters should keep same with |makeBrowserWindowOptions|.
const webPreferences = makeWebPreferences({
embedder: event.sender,
insecureParsedWebPreferences: parsedWebPreferences,
secureOverrideWebPreferences
});
this._setNextChildWebPreferences(webPreferences);
}
});
@@ -735,6 +739,14 @@ WebContents.prototype._init = function () {
}
});
this.on('select-bluetooth-device', (event, devices, callback) => {
if (this.listenerCount('select-bluetooth-device') === 1) {
// Cancel it if there are no handlers
event.preventDefault();
callback('');
}
});
const event = process._linkedBinding('electron_browser_event').createEmpty();
app.emit('web-contents-created', event, this);

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