mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
252 Commits
refactor/a
...
v11.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8805b996e0 | ||
|
|
47adc0a2b7 | ||
|
|
1559dc74da | ||
|
|
207dbb8d4e | ||
|
|
3bda527e83 | ||
|
|
e3b76f71de | ||
|
|
6be5244111 | ||
|
|
f398ba08a9 | ||
|
|
aa4f3550fd | ||
|
|
095de8114e | ||
|
|
5737bac6f4 | ||
|
|
c95eda8420 | ||
|
|
7fb97f041b | ||
|
|
b4ea9e0fc8 | ||
|
|
19b7336fc3 | ||
|
|
f809e74905 | ||
|
|
f6eb88ac08 | ||
|
|
56e926ce23 | ||
|
|
5e0e91510a | ||
|
|
9bfd5d4a4b | ||
|
|
8afd7877f6 | ||
|
|
bf0b82dc8e | ||
|
|
122d8910d5 | ||
|
|
cb281b7954 | ||
|
|
91cfa96c80 | ||
|
|
a21ed83751 | ||
|
|
c0b48658d8 | ||
|
|
c68f0f04d0 | ||
|
|
a2b61f9b97 | ||
|
|
fc478f4e96 | ||
|
|
b710412e7b | ||
|
|
9a7bda51a3 | ||
|
|
615e467a15 | ||
|
|
f8a900fdde | ||
|
|
c188ed065d | ||
|
|
dcd216984f | ||
|
|
e012f61aee | ||
|
|
50e3a2ae20 | ||
|
|
b4413e9398 | ||
|
|
25df0f5d31 | ||
|
|
6b91371b6e | ||
|
|
8e6d332e96 | ||
|
|
eebd7cfa05 | ||
|
|
a4d73be9c5 | ||
|
|
0e9214a82b | ||
|
|
24c7365bef | ||
|
|
686aefb2cd | ||
|
|
0e0a1421fd | ||
|
|
c4e8c0fd0e | ||
|
|
101a2282ab | ||
|
|
429400040e | ||
|
|
ca7528a2d0 | ||
|
|
d58812b517 | ||
|
|
5942c84288 | ||
|
|
f920463b47 | ||
|
|
296cba563e | ||
|
|
90a96c0b73 | ||
|
|
2c325cd654 | ||
|
|
c26b78bbc0 | ||
|
|
6951c09b61 | ||
|
|
fe21892974 | ||
|
|
0fd6a8ca83 | ||
|
|
de12232df5 | ||
|
|
d12674f9f1 | ||
|
|
75cdd02697 | ||
|
|
08b7f5a569 | ||
|
|
a5077e2586 | ||
|
|
4fa9122151 | ||
|
|
56fa037a46 | ||
|
|
13a9e15a27 | ||
|
|
badc01c2d8 | ||
|
|
b0862a6e63 | ||
|
|
18cde2ef04 | ||
|
|
e6c94854a0 | ||
|
|
94d8b7d4c1 | ||
|
|
c0769d77e5 | ||
|
|
2a6c3bb7d1 | ||
|
|
d892fde98b | ||
|
|
edb6723157 | ||
|
|
9dda9a894a | ||
|
|
90ab868b50 | ||
|
|
4dc98f1347 | ||
|
|
2189ddb14e | ||
|
|
680569e404 | ||
|
|
e119699ae2 | ||
|
|
63e6f08768 | ||
|
|
b14c57e30c | ||
|
|
8a68a304e0 | ||
|
|
60cef385d5 | ||
|
|
4f281e3d31 | ||
|
|
eb2710e483 | ||
|
|
7a15dca09c | ||
|
|
387a15f582 | ||
|
|
38fab63863 | ||
|
|
1b156c53fd | ||
|
|
e4f3f9e1db | ||
|
|
612acc04b0 | ||
|
|
717271095e | ||
|
|
76e54ae0c8 | ||
|
|
0c21ce02c1 | ||
|
|
01fa45fc50 | ||
|
|
832ce14bda | ||
|
|
07318e5146 | ||
|
|
79dff5f782 | ||
|
|
9c9e40294e | ||
|
|
5b617a7f39 | ||
|
|
ff717d4a93 | ||
|
|
51bced4ee3 | ||
|
|
b0fd7cf430 | ||
|
|
a56c1d3f2f | ||
|
|
98b6403e3b | ||
|
|
e9c12688e6 | ||
|
|
8d88d1e2ed | ||
|
|
2e730fe48b | ||
|
|
88de23b241 | ||
|
|
3faa2c2a46 | ||
|
|
cab14277b8 | ||
|
|
ce243f8172 | ||
|
|
da4790d944 | ||
|
|
4088566a4d | ||
|
|
ac425c0cf3 | ||
|
|
ccb471e5d5 | ||
|
|
f44880f065 | ||
|
|
7ec001486e | ||
|
|
dd3fbae447 | ||
|
|
e9710f6a77 | ||
|
|
699a771288 | ||
|
|
f679dd8ad7 | ||
|
|
9f1b913793 | ||
|
|
9328725e93 | ||
|
|
cea757f59c | ||
|
|
d93cb942fc | ||
|
|
4d280ed483 | ||
|
|
bb69770267 | ||
|
|
d4112d38de | ||
|
|
b1eec448f0 | ||
|
|
becfe25528 | ||
|
|
a461001677 | ||
|
|
aa15eeed78 | ||
|
|
6daac26f49 | ||
|
|
3551c81cc5 | ||
|
|
2b1004919d | ||
|
|
d200b9192a | ||
|
|
c2e8704683 | ||
|
|
0b2862b184 | ||
|
|
d959222bb8 | ||
|
|
e5550e5bad | ||
|
|
8546f98a87 | ||
|
|
7a6965087c | ||
|
|
2558455be4 | ||
|
|
65fdfc1e16 | ||
|
|
139e20367f | ||
|
|
e84aa04bb5 | ||
|
|
7a06ae575e | ||
|
|
460594480f | ||
|
|
6e676c3695 | ||
|
|
e6fa69bfd2 | ||
|
|
df3fa7ddb7 | ||
|
|
c090fbfd11 | ||
|
|
6d99158379 | ||
|
|
bb11bdce36 | ||
|
|
ca163f9cf7 | ||
|
|
5598025884 | ||
|
|
df82bbab43 | ||
|
|
ed5fd9c910 | ||
|
|
0ac14ce30c | ||
|
|
3793cfc0ff | ||
|
|
1c8377967d | ||
|
|
485612ae68 | ||
|
|
4016def2d0 | ||
|
|
c35a67f31e | ||
|
|
fd5896919b | ||
|
|
7a669cbbb0 | ||
|
|
8acf548c62 | ||
|
|
dc9282d6ff | ||
|
|
a4cb3e2af9 | ||
|
|
1eea063c3a | ||
|
|
583e2b76d9 | ||
|
|
ca215070e9 | ||
|
|
9852e1f190 | ||
|
|
9ce7d133d8 | ||
|
|
c157521bd0 | ||
|
|
309df5a99d | ||
|
|
f298d4d54f | ||
|
|
ca227ede76 | ||
|
|
7120698f1f | ||
|
|
5eb225b5ae | ||
|
|
71c26dab90 | ||
|
|
f8ee8b2ee2 | ||
|
|
639fb15dc4 | ||
|
|
c6fa081558 | ||
|
|
dcbca5448a | ||
|
|
0667110350 | ||
|
|
e089cab8cd | ||
|
|
634b76e5a2 | ||
|
|
11c20477e4 | ||
|
|
fca920de40 | ||
|
|
ce5660db36 | ||
|
|
f8bdaa04d8 | ||
|
|
08ebf7c03b | ||
|
|
9f164607b7 | ||
|
|
d88ce0be9c | ||
|
|
e17b770690 | ||
|
|
ff97c5255b | ||
|
|
2ab7143b69 | ||
|
|
96f258b866 | ||
|
|
e6d5fc23a7 | ||
|
|
fe1b40ce9e | ||
|
|
fb7f783ee1 | ||
|
|
9ff208f898 | ||
|
|
a8dc3ae5c2 | ||
|
|
07ec50b547 | ||
|
|
8bdff7acbc | ||
|
|
a66ba564fd | ||
|
|
0f4f5ac32c | ||
|
|
4e080c4b15 | ||
|
|
7e40dc2237 | ||
|
|
e2b90ee28c | ||
|
|
69ded48ce4 | ||
|
|
a22dfc813f | ||
|
|
c1d04d8e49 | ||
|
|
80efb6d9da | ||
|
|
51a35f8b4d | ||
|
|
b88396cf00 | ||
|
|
35d2727de0 | ||
|
|
23c32766e5 | ||
|
|
db492c3178 | ||
|
|
86cc6a7b44 | ||
|
|
2ed7f0f4fc | ||
|
|
9e9cc8f606 | ||
|
|
1e1d35fb87 | ||
|
|
119cd24a7f | ||
|
|
138fa6cdf3 | ||
|
|
7745e48498 | ||
|
|
b62e00f0ae | ||
|
|
ad876ac1b1 | ||
|
|
c35ec6bc34 | ||
|
|
a08b3682c3 | ||
|
|
c3ad33c28b | ||
|
|
59f9e417d4 | ||
|
|
7931c8abfd | ||
|
|
622f5f84cf | ||
|
|
c8944df576 | ||
|
|
3efbee2061 | ||
|
|
aafada554f | ||
|
|
56e81665fb | ||
|
|
e68f086d95 | ||
|
|
74edd99570 | ||
|
|
63720fd603 | ||
|
|
d6bea2a681 | ||
|
|
5b53a08132 | ||
|
|
09e33b3420 |
@@ -69,7 +69,7 @@ parameters:
|
|||||||
# Build machines configs.
|
# Build machines configs.
|
||||||
docker-image: &docker-image
|
docker-image: &docker-image
|
||||||
docker:
|
docker:
|
||||||
- image: electronjs/build:d09fd95029bd8c1c73069888231b29688ef385ed
|
- image: electron.azurecr.io/build:4cec2c5ab66765caa724e37bae2bffb9b29722a5
|
||||||
|
|
||||||
machine-linux-medium: &machine-linux-medium
|
machine-linux-medium: &machine-linux-medium
|
||||||
<<: *docker-image
|
<<: *docker-image
|
||||||
@@ -85,17 +85,17 @@ machine-linux-2xlarge: &machine-linux-2xlarge
|
|||||||
|
|
||||||
machine-mac: &machine-mac
|
machine-mac: &machine-mac
|
||||||
macos:
|
macos:
|
||||||
xcode: "11.5.0"
|
xcode: "12.2.0"
|
||||||
|
|
||||||
machine-mac-large: &machine-mac-large
|
machine-mac-large: &machine-mac-large
|
||||||
resource_class: large
|
resource_class: large
|
||||||
macos:
|
macos:
|
||||||
xcode: "11.5.0"
|
xcode: "12.2.0"
|
||||||
|
|
||||||
machine-mac-large-arm: &machine-mac-large-arm
|
machine-mac-large-arm: &machine-mac-large-arm
|
||||||
resource_class: large
|
resource_class: large
|
||||||
macos:
|
macos:
|
||||||
xcode: "12.0.0-large"
|
xcode: "12.2.0"
|
||||||
|
|
||||||
# Build configurations options.
|
# Build configurations options.
|
||||||
env-testing-build: &env-testing-build
|
env-testing-build: &env-testing-build
|
||||||
@@ -107,6 +107,7 @@ env-release-build: &env-release-build
|
|||||||
STRIP_BINARIES: true
|
STRIP_BINARIES: true
|
||||||
GENERATE_SYMBOLS: true
|
GENERATE_SYMBOLS: true
|
||||||
CHECK_DIST_MANIFEST: '1'
|
CHECK_DIST_MANIFEST: '1'
|
||||||
|
IS_RELEASE: true
|
||||||
|
|
||||||
env-headless-testing: &env-headless-testing
|
env-headless-testing: &env-headless-testing
|
||||||
DISPLAY: ':99.0'
|
DISPLAY: ':99.0'
|
||||||
@@ -256,23 +257,34 @@ step-gclient-sync: &step-gclient-sync
|
|||||||
"$CIRCLE_REPOSITORY_URL"
|
"$CIRCLE_REPOSITORY_URL"
|
||||||
|
|
||||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags
|
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags
|
||||||
# Re-export all the patches to check if there were changes.
|
if [ "$IS_RELEASE" != "true" ]; then
|
||||||
python src/electron/script/export_all_patches.py src/electron/patches/config.json
|
# Re-export all the patches to check if there were changes.
|
||||||
cd src/electron
|
python src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||||
git update-index --refresh || true
|
cd src/electron
|
||||||
if ! git diff-index --quiet HEAD --; then
|
git update-index --refresh || true
|
||||||
# There are changes to the patches. Make a git commit with the updated patches
|
if ! git diff-index --quiet HEAD --; then
|
||||||
git add patches
|
# There are changes to the patches. Make a git commit with the updated patches
|
||||||
GIT_COMMITTER_NAME="Electron Bot" GIT_COMMITTER_EMAIL="anonymous@electronjs.org" git commit -m "update patches" --author="Electron Bot <anonymous@electronjs.org>"
|
git add patches
|
||||||
# Export it
|
GIT_COMMITTER_NAME="Electron Bot" GIT_COMMITTER_EMAIL="electron@github.com" git commit -m "update patches" --author="Electron Bot <electron@github.com>"
|
||||||
mkdir -p ../../patches
|
# Export it
|
||||||
git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
|
mkdir -p ../../patches
|
||||||
echo
|
git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
|
||||||
echo "======================================================================"
|
if (node ./script/push-patch.js 2> /dev/null > /dev/null); then
|
||||||
echo "There were changes to the patches when applying."
|
echo
|
||||||
echo "Check the CI artifacts for a patch you can apply to fix it."
|
echo "======================================================================"
|
||||||
echo "======================================================================"
|
echo "Changes to the patches when applying, we have auto-pushed the diff to the current branch"
|
||||||
exit 1
|
echo "A new CI job will kick off shortly"
|
||||||
|
echo "======================================================================"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "======================================================================"
|
||||||
|
echo "There were changes to the patches when applying."
|
||||||
|
echo "Check the CI artifacts for a patch you can apply to fix it."
|
||||||
|
echo "======================================================================"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -299,10 +311,10 @@ step-setup-goma-for-build: &step-setup-goma-for-build
|
|||||||
name: Setup Goma
|
name: Setup Goma
|
||||||
command: |
|
command: |
|
||||||
echo 'export USE_GOMA=true' >> $BASH_ENV
|
echo 'export USE_GOMA=true' >> $BASH_ENV
|
||||||
if [ "`uname`" == "Linux" ]; then
|
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
|
||||||
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
|
if [ "`uname`" == "Darwin" ]; then
|
||||||
else
|
echo 'ulimit -n 10000' >> $BASH_ENV
|
||||||
echo 'export NUMBER_OF_NINJA_PROCESSES=25' >> $BASH_ENV
|
echo 'sudo launchctl limit maxfiles 65536 200000' >> $BASH_ENV
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$RAW_GOMA_AUTH" ]; then
|
if [ ! -z "$RAW_GOMA_AUTH" ]; then
|
||||||
echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
|
echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
|
||||||
@@ -311,7 +323,7 @@ step-setup-goma-for-build: &step-setup-goma-for-build
|
|||||||
cd build-tools
|
cd build-tools
|
||||||
npm install
|
npm install
|
||||||
mkdir third_party
|
mkdir third_party
|
||||||
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
|
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||||
node -e "require('./src/utils/goma.js').ensure()"
|
node -e "require('./src/utils/goma.js').ensure()"
|
||||||
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
|
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
|
||||||
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
||||||
@@ -320,15 +332,17 @@ step-setup-goma-for-build: &step-setup-goma-for-build
|
|||||||
step-restore-brew-cache: &step-restore-brew-cache
|
step-restore-brew-cache: &step-restore-brew-cache
|
||||||
restore_cache:
|
restore_cache:
|
||||||
paths:
|
paths:
|
||||||
- /usr/local/Homebrew
|
- /usr/local/Cellar/gnu-tar
|
||||||
|
- /usr/local/bin/gtar
|
||||||
keys:
|
keys:
|
||||||
- v1-brew-cache-{{ arch }}
|
- v4-brew-cache-{{ arch }}
|
||||||
|
|
||||||
step-save-brew-cache: &step-save-brew-cache
|
step-save-brew-cache: &step-save-brew-cache
|
||||||
save_cache:
|
save_cache:
|
||||||
paths:
|
paths:
|
||||||
- /usr/local/Homebrew
|
- /usr/local/Cellar/gnu-tar
|
||||||
key: v1-brew-cache-{{ arch }}
|
- /usr/local/bin/gtar
|
||||||
|
key: v4-brew-cache-{{ arch }}
|
||||||
name: Persisting brew cache
|
name: Persisting brew cache
|
||||||
|
|
||||||
step-get-more-space-on-mac: &step-get-more-space-on-mac
|
step-get-more-space-on-mac: &step-get-more-space-on-mac
|
||||||
@@ -468,8 +482,10 @@ step-install-gnutar-on-mac: &step-install-gnutar-on-mac
|
|||||||
name: Install gnu-tar on macos
|
name: Install gnu-tar on macos
|
||||||
command: |
|
command: |
|
||||||
if [ "`uname`" == "Darwin" ]; then
|
if [ "`uname`" == "Darwin" ]; then
|
||||||
brew update
|
if [ ! -d /usr/local/Cellar/gnu-tar/ ]; then
|
||||||
brew install gnu-tar
|
brew update
|
||||||
|
brew install gnu-tar
|
||||||
|
fi
|
||||||
ln -fs /usr/local/bin/gtar /usr/local/bin/tar
|
ln -fs /usr/local/bin/gtar /usr/local/bin/tar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -572,6 +588,9 @@ step-electron-dist-build: &step-electron-dist-build
|
|||||||
if [ x"$MAS_BUILD" == x"true" ]; then
|
if [ x"$MAS_BUILD" == x"true" ]; then
|
||||||
target_os=mac_mas
|
target_os=mac_mas
|
||||||
fi
|
fi
|
||||||
|
if [ "$TARGET_ARCH" == "arm64" ]; then
|
||||||
|
target_cpu=arm64
|
||||||
|
fi
|
||||||
elif [ "`uname`" == "Linux" ]; then
|
elif [ "`uname`" == "Linux" ]; then
|
||||||
target_os=linux
|
target_os=linux
|
||||||
if [ x"$TARGET_ARCH" == x ]; then
|
if [ x"$TARGET_ARCH" == x ]; then
|
||||||
@@ -659,10 +678,10 @@ step-electron-publish: &step-electron-publish
|
|||||||
cd src/electron
|
cd src/electron
|
||||||
if [ "$UPLOAD_TO_S3" == "1" ]; then
|
if [ "$UPLOAD_TO_S3" == "1" ]; then
|
||||||
echo 'Uploading Electron release distribution to S3'
|
echo 'Uploading Electron release distribution to S3'
|
||||||
script/release/uploaders/upload.py --upload_to_s3
|
script/release/uploaders/upload.py --verbose --upload_to_s3
|
||||||
else
|
else
|
||||||
echo 'Uploading Electron release distribution to Github releases'
|
echo 'Uploading Electron release distribution to Github releases'
|
||||||
script/release/uploaders/upload.py
|
script/release/uploaders/upload.py --verbose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
step-persist-data-for-tests: &step-persist-data-for-tests
|
step-persist-data-for-tests: &step-persist-data-for-tests
|
||||||
@@ -764,14 +783,20 @@ step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
|
|||||||
|
|
||||||
step-show-sccache-stats: &step-show-sccache-stats
|
step-show-sccache-stats: &step-show-sccache-stats
|
||||||
run:
|
run:
|
||||||
|
shell: /bin/bash
|
||||||
name: Check sccache/goma stats after build
|
name: Check sccache/goma stats after build
|
||||||
command: |
|
command: |
|
||||||
if [ "$SCCACHE_PATH" != "" ]; then
|
if [ "$SCCACHE_PATH" != "" ]; then
|
||||||
$SCCACHE_PATH -s
|
$SCCACHE_PATH -s
|
||||||
fi
|
fi
|
||||||
if [ "$USE_GOMA" == "true" ]; then
|
if [ "$USE_GOMA" == "true" ]; then
|
||||||
|
set +e
|
||||||
|
set +o pipefail
|
||||||
$LOCAL_GOMA_DIR/goma_ctl.py stat
|
$LOCAL_GOMA_DIR/goma_ctl.py stat
|
||||||
|
$LOCAL_GOMA_DIR/diagnose_goma_log.py
|
||||||
|
true
|
||||||
fi
|
fi
|
||||||
|
when: always
|
||||||
|
|
||||||
step-mksnapshot-build: &step-mksnapshot-build
|
step-mksnapshot-build: &step-mksnapshot-build
|
||||||
run:
|
run:
|
||||||
@@ -909,6 +934,8 @@ step-ninja-summary: &step-ninja-summary
|
|||||||
run:
|
run:
|
||||||
name: Print ninja summary
|
name: Print ninja summary
|
||||||
command: |
|
command: |
|
||||||
|
set +e
|
||||||
|
set +o pipefail
|
||||||
python depot_tools/post_build_ninja_summary.py -C src/out/Default
|
python depot_tools/post_build_ninja_summary.py -C src/out/Default
|
||||||
|
|
||||||
step-ninja-report: &step-ninja-report
|
step-ninja-report: &step-ninja-report
|
||||||
@@ -1135,7 +1162,6 @@ steps-checkout-and-save-cache: &steps-checkout-and-save-cache
|
|||||||
- *step-maybe-early-exit-doc-only-change
|
- *step-maybe-early-exit-doc-only-change
|
||||||
- *step-depot-tools-get
|
- *step-depot-tools-get
|
||||||
- *step-depot-tools-add-to-path
|
- *step-depot-tools-add-to-path
|
||||||
- *step-restore-brew-cache
|
|
||||||
- *step-get-more-space-on-mac
|
- *step-get-more-space-on-mac
|
||||||
- *step-install-gnutar-on-mac
|
- *step-install-gnutar-on-mac
|
||||||
|
|
||||||
@@ -1799,7 +1825,7 @@ jobs:
|
|||||||
|
|
||||||
# Layer 2: Builds.
|
# Layer 2: Builds.
|
||||||
linux-x64-testing:
|
linux-x64-testing:
|
||||||
<<: *machine-linux-xlarge
|
<<: *machine-linux-2xlarge
|
||||||
environment:
|
environment:
|
||||||
<<: *env-global
|
<<: *env-global
|
||||||
<<: *env-testing-build
|
<<: *env-testing-build
|
||||||
@@ -1879,7 +1905,7 @@ jobs:
|
|||||||
checkout: false
|
checkout: false
|
||||||
|
|
||||||
linux-ia32-testing:
|
linux-ia32-testing:
|
||||||
<<: *machine-linux-xlarge
|
<<: *machine-linux-2xlarge
|
||||||
environment:
|
environment:
|
||||||
<<: *env-global
|
<<: *env-global
|
||||||
<<: *env-ia32
|
<<: *env-ia32
|
||||||
@@ -1945,7 +1971,7 @@ jobs:
|
|||||||
checkout: false
|
checkout: false
|
||||||
|
|
||||||
linux-arm-testing:
|
linux-arm-testing:
|
||||||
<<: *machine-linux-xlarge
|
<<: *machine-linux-2xlarge
|
||||||
environment:
|
environment:
|
||||||
<<: *env-global
|
<<: *env-global
|
||||||
<<: *env-arm
|
<<: *env-arm
|
||||||
@@ -2012,7 +2038,7 @@ jobs:
|
|||||||
checkout: false
|
checkout: false
|
||||||
|
|
||||||
linux-arm64-testing:
|
linux-arm64-testing:
|
||||||
<<: *machine-linux-xlarge
|
<<: *machine-linux-2xlarge
|
||||||
environment:
|
environment:
|
||||||
<<: *env-global
|
<<: *env-global
|
||||||
<<: *env-arm64
|
<<: *env-arm64
|
||||||
|
|||||||
10
.gitattributes
vendored
10
.gitattributes
vendored
@@ -2,3 +2,13 @@
|
|||||||
# files to be checked out with LF endings even if core.autocrlf is true.
|
# files to be checked out with LF endings even if core.autocrlf is true.
|
||||||
*.patch text eol=lf
|
*.patch text eol=lf
|
||||||
patches/**/.patches merge=union
|
patches/**/.patches merge=union
|
||||||
|
|
||||||
|
# Source code and markdown files should always use LF as line ending.
|
||||||
|
*.cc text eol=lf
|
||||||
|
*.mm text eol=lf
|
||||||
|
*.h text eol=lf
|
||||||
|
*.js text eol=lf
|
||||||
|
*.ts text eol=lf
|
||||||
|
*.py text eol=lf
|
||||||
|
*.ps1 text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
|||||||
116
BUILD.gn
116
BUILD.gn
@@ -325,7 +325,6 @@ source_set("electron_lib") {
|
|||||||
"//base/allocator:buildflags",
|
"//base/allocator:buildflags",
|
||||||
"//chrome/app:command_ids",
|
"//chrome/app:command_ids",
|
||||||
"//chrome/app/resources:platform_locale_settings",
|
"//chrome/app/resources:platform_locale_settings",
|
||||||
"//chrome/services/printing/public/mojom",
|
|
||||||
"//components/certificate_transparency",
|
"//components/certificate_transparency",
|
||||||
"//components/language/core/browser",
|
"//components/language/core/browser",
|
||||||
"//components/net_log",
|
"//components/net_log",
|
||||||
@@ -372,6 +371,7 @@ source_set("electron_lib") {
|
|||||||
"//third_party/libyuv",
|
"//third_party/libyuv",
|
||||||
"//third_party/webrtc_overrides:webrtc_component",
|
"//third_party/webrtc_overrides:webrtc_component",
|
||||||
"//third_party/widevine/cdm:headers",
|
"//third_party/widevine/cdm:headers",
|
||||||
|
"//third_party/zlib/google:zip",
|
||||||
"//ui/base/idle",
|
"//ui/base/idle",
|
||||||
"//ui/events:dom_keycode_converter",
|
"//ui/events:dom_keycode_converter",
|
||||||
"//ui/gl",
|
"//ui/gl",
|
||||||
@@ -405,44 +405,26 @@ source_set("electron_lib") {
|
|||||||
defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
|
defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
extra_source_filters = []
|
|
||||||
if (!is_linux) {
|
|
||||||
extra_source_filters += [
|
|
||||||
"*\bx/*",
|
|
||||||
"*_x11.h",
|
|
||||||
"*_x11.cc",
|
|
||||||
"*_gtk.h",
|
|
||||||
"*_gtk.cc",
|
|
||||||
"*\blibrary_loaders/*",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
if (!is_win) {
|
|
||||||
extra_source_filters += [
|
|
||||||
"*\bwin_*.h",
|
|
||||||
"*\bwin_*.cc",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
if (!is_posix) {
|
|
||||||
extra_source_filters += [
|
|
||||||
"*_posix.cc",
|
|
||||||
"*_posix.h",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
if (is_mac) {
|
|
||||||
extra_source_filters += [
|
|
||||||
"*_views.cc",
|
|
||||||
"*_views.h",
|
|
||||||
"*\bviews/*",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
if (!is_mas_build) {
|
if (!is_mas_build) {
|
||||||
deps += [ "//components/crash/core/app" ]
|
deps += [ "//components/crash/core/app" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
set_sources_assignment_filter(
|
|
||||||
sources_assignment_filter + extra_source_filters)
|
|
||||||
sources = filenames.lib_sources
|
sources = filenames.lib_sources
|
||||||
set_sources_assignment_filter(sources_assignment_filter)
|
if (is_win) {
|
||||||
|
sources += filenames.lib_sources_win
|
||||||
|
}
|
||||||
|
if (is_mac) {
|
||||||
|
sources += filenames.lib_sources_mac
|
||||||
|
}
|
||||||
|
if (is_posix) {
|
||||||
|
sources += filenames.lib_sources_posix
|
||||||
|
}
|
||||||
|
if (is_linux) {
|
||||||
|
sources += filenames.lib_sources_linux
|
||||||
|
}
|
||||||
|
if (!is_mac) {
|
||||||
|
sources += filenames.lib_sources_views
|
||||||
|
}
|
||||||
|
|
||||||
if (is_component_build) {
|
if (is_component_build) {
|
||||||
defines += [ "NODE_SHARED_MODE" ]
|
defines += [ "NODE_SHARED_MODE" ]
|
||||||
@@ -531,7 +513,9 @@ source_set("electron_lib") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
configs += [ ":gio_unix" ]
|
configs += [ ":gio_unix" ]
|
||||||
configs += [ "//build/config/linux:x11" ]
|
if (use_x11) {
|
||||||
|
deps += [ "//ui/gfx/x" ]
|
||||||
|
}
|
||||||
defines += [
|
defines += [
|
||||||
# Disable warnings for g_settings_list_schemas.
|
# Disable warnings for g_settings_list_schemas.
|
||||||
"GLIB_DISABLE_DEPRECATION_WARNINGS",
|
"GLIB_DISABLE_DEPRECATION_WARNINGS",
|
||||||
@@ -587,7 +571,6 @@ source_set("electron_lib") {
|
|||||||
sources += [
|
sources += [
|
||||||
"shell/browser/osr/osr_host_display_client.cc",
|
"shell/browser/osr/osr_host_display_client.cc",
|
||||||
"shell/browser/osr/osr_host_display_client.h",
|
"shell/browser/osr/osr_host_display_client.h",
|
||||||
"shell/browser/osr/osr_host_display_client_mac.mm",
|
|
||||||
"shell/browser/osr/osr_render_widget_host_view.cc",
|
"shell/browser/osr/osr_render_widget_host_view.cc",
|
||||||
"shell/browser/osr/osr_render_widget_host_view.h",
|
"shell/browser/osr/osr_render_widget_host_view.h",
|
||||||
"shell/browser/osr/osr_video_consumer.cc",
|
"shell/browser/osr/osr_video_consumer.cc",
|
||||||
@@ -596,8 +579,13 @@ source_set("electron_lib") {
|
|||||||
"shell/browser/osr/osr_view_proxy.h",
|
"shell/browser/osr/osr_view_proxy.h",
|
||||||
"shell/browser/osr/osr_web_contents_view.cc",
|
"shell/browser/osr/osr_web_contents_view.cc",
|
||||||
"shell/browser/osr/osr_web_contents_view.h",
|
"shell/browser/osr/osr_web_contents_view.h",
|
||||||
"shell/browser/osr/osr_web_contents_view_mac.mm",
|
|
||||||
]
|
]
|
||||||
|
if (is_mac) {
|
||||||
|
sources += [
|
||||||
|
"shell/browser/osr/osr_host_display_client_mac.mm",
|
||||||
|
"shell/browser/osr/osr_web_contents_view_mac.mm",
|
||||||
|
]
|
||||||
|
}
|
||||||
deps += [
|
deps += [
|
||||||
"//components/viz/service",
|
"//components/viz/service",
|
||||||
"//services/viz/public/mojom",
|
"//services/viz/public/mojom",
|
||||||
@@ -632,7 +620,10 @@ source_set("electron_lib") {
|
|||||||
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
|
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
|
||||||
"shell/renderer/printing/print_render_frame_helper_delegate.h",
|
"shell/renderer/printing/print_render_frame_helper_delegate.h",
|
||||||
]
|
]
|
||||||
deps += [ "//components/printing/common:mojo_interfaces" ]
|
deps += [
|
||||||
|
"//chrome/services/printing/public/mojom",
|
||||||
|
"//components/printing/common:mojo_interfaces",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable_electron_extensions) {
|
if (enable_electron_extensions) {
|
||||||
@@ -670,6 +661,14 @@ source_set("electron_lib") {
|
|||||||
"shell/browser/electron_pdf_web_contents_helper_client.h",
|
"shell/browser/electron_pdf_web_contents_helper_client.h",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_win && enable_win_dark_mode_window_ui) {
|
||||||
|
sources += [
|
||||||
|
"shell/browser/win/dark_mode.cc",
|
||||||
|
"shell/browser/win/dark_mode.h",
|
||||||
|
]
|
||||||
|
libs += [ "uxtheme.lib" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
electron_paks("packed_resources") {
|
electron_paks("packed_resources") {
|
||||||
@@ -695,10 +694,10 @@ if (is_mac) {
|
|||||||
action("fake_v8_context_snapshot_generator") {
|
action("fake_v8_context_snapshot_generator") {
|
||||||
script = "build/fake_v8_context_snapshot_generator.py"
|
script = "build/fake_v8_context_snapshot_generator.py"
|
||||||
args = [
|
args = [
|
||||||
rebase_path("$root_out_dir/v8_context_snapshot.bin"),
|
rebase_path("$root_out_dir/$v8_context_snapshot_filename"),
|
||||||
rebase_path("$root_out_dir/fake/v8_context_snapshot.bin"),
|
rebase_path("$root_out_dir/fake/$v8_context_snapshot_filename"),
|
||||||
]
|
]
|
||||||
outputs = [ "$root_out_dir/fake/v8_context_snapshot.bin" ]
|
outputs = [ "$root_out_dir/fake/$v8_context_snapshot_filename" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle_data("electron_framework_resources") {
|
bundle_data("electron_framework_resources") {
|
||||||
@@ -712,10 +711,10 @@ if (is_mac) {
|
|||||||
public_deps += [ "//v8" ]
|
public_deps += [ "//v8" ]
|
||||||
if (use_v8_context_snapshot) {
|
if (use_v8_context_snapshot) {
|
||||||
if (use_prebuilt_v8_context_snapshot) {
|
if (use_prebuilt_v8_context_snapshot) {
|
||||||
sources += [ "$root_out_dir/fake/v8_context_snapshot.bin" ]
|
sources += [ "$root_out_dir/fake/$v8_context_snapshot_filename" ]
|
||||||
public_deps += [ ":fake_v8_context_snapshot_generator" ]
|
public_deps += [ ":fake_v8_context_snapshot_generator" ]
|
||||||
} else {
|
} else {
|
||||||
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
|
sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
|
||||||
public_deps += [ "//tools/v8_context_snapshot" ]
|
public_deps += [ "//tools/v8_context_snapshot" ]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1138,22 +1137,37 @@ if (is_mac) {
|
|||||||
"//components/crash/core/app:run_as_crashpad_handler",
|
"//components/crash/core/app:run_as_crashpad_handler",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
ldflags = []
|
||||||
|
|
||||||
libs = [
|
libs = [
|
||||||
"comctl32.lib",
|
"comctl32.lib",
|
||||||
"uiautomationcore.lib",
|
"uiautomationcore.lib",
|
||||||
"wtsapi32.lib",
|
"wtsapi32.lib",
|
||||||
]
|
]
|
||||||
|
|
||||||
configs += [ "//build/config/win:windowed" ]
|
configs += [
|
||||||
|
"//build/config/win:windowed",
|
||||||
ldflags = [
|
"//build/config/win:delayloads",
|
||||||
# Windows 7 doesn't have these DLLs.
|
|
||||||
# TODO: are there other DLLs we need to list here to be win7
|
|
||||||
# compatible?
|
|
||||||
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
|
|
||||||
"/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (target_cpu == "arm64") {
|
||||||
|
configs -= [ "//build/config/win:cfi_linker" ]
|
||||||
|
ldflags += [ "/guard:cf,nolongjmp" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current_cpu == "x86") {
|
||||||
|
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB needed by
|
||||||
|
# Chrome's main thread. This saves significant memory on threads (like
|
||||||
|
# those in the Windows thread pool, and others) whose stack size we can
|
||||||
|
# only control through this setting. Because Chrome's main thread needs
|
||||||
|
# a minimum 1.5 MiB stack, the main thread (in 32-bit builds only) uses
|
||||||
|
# fibers to switch to a 1.5 MiB stack before running any other code.
|
||||||
|
ldflags += [ "/STACK:0x80000" ]
|
||||||
|
} else {
|
||||||
|
# Increase the initial stack size. The default is 1MB, this is 8MB.
|
||||||
|
ldflags += [ "/STACK:0x800000" ]
|
||||||
|
}
|
||||||
|
|
||||||
# This is to support renaming of electron.exe. node-gyp has hard-coded
|
# This is to support renaming of electron.exe. node-gyp has hard-coded
|
||||||
# executable names which it will recognise as node. This module definition
|
# executable names which it will recognise as node. This module definition
|
||||||
# file claims that the electron executable is in fact named "node.exe",
|
# file claims that the electron executable is in fact named "node.exe",
|
||||||
|
|||||||
4
DEPS
4
DEPS
@@ -14,13 +14,13 @@ gclient_gn_args = [
|
|||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
'chromium_version':
|
'chromium_version':
|
||||||
'b04584161e07d4ac110045b7647fa8a81f5f0709',
|
'87.0.4280.141',
|
||||||
'node_version':
|
'node_version':
|
||||||
'v12.18.3',
|
'v12.18.3',
|
||||||
'nan_version':
|
'nan_version':
|
||||||
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
|
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
|
||||||
'squirrel.mac_version':
|
'squirrel.mac_version':
|
||||||
'44468f858ce0d25c27bd5e674abfa104e0119738',
|
'a3a5b3f03b824441c014893b18f99a103b2603e9',
|
||||||
|
|
||||||
'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
|
'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
|
||||||
'pyyaml_version': '3.12',
|
'pyyaml_version': '3.12',
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
11.0.0-nightly.20200826
|
11.2.1
|
||||||
30
appveyor.yml
30
appveyor.yml
@@ -53,7 +53,9 @@ build_script:
|
|||||||
} else {
|
} else {
|
||||||
node script/yarn.js install --frozen-lockfile
|
node script/yarn.js install --frozen-lockfile
|
||||||
|
|
||||||
if ($(node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH;$LASTEXITCODE -eq 0)) {
|
$result = node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
|
||||||
|
Write-Output $result
|
||||||
|
if ($result.ExitCode -eq 0) {
|
||||||
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
|
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,6 +101,11 @@ build_script:
|
|||||||
} else {
|
} else {
|
||||||
# update external binaries
|
# update external binaries
|
||||||
python src/electron/script/update-external-binaries.py
|
python src/electron/script/update-external-binaries.py
|
||||||
|
# update angle
|
||||||
|
cd src\third_party\angle
|
||||||
|
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||||
|
git fetch
|
||||||
|
cd ..\..\..
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# file does not exist, gclient sync, then zip
|
# file does not exist, gclient sync, then zip
|
||||||
@@ -114,14 +121,16 @@ build_script:
|
|||||||
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
|
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
|
||||||
# archive current source for future use
|
# archive current source for future use
|
||||||
# only run on x64/woa to avoid contention saving
|
# only run on x64/woa to avoid contention saving
|
||||||
if ($(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30;$LASTEXITCODE -ne 0)) {
|
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
Write-warning "Could not save source to shared drive; continuing anyway"
|
Write-warning "Could not save source to shared drive; continuing anyway"
|
||||||
}
|
}
|
||||||
# build time generation of file gen/angle/commit.h depends on
|
# build time generation of file gen/angle/angle_commit.h depends on
|
||||||
# third_party/angle/.git/HEAD.
|
# third_party/angle/.git
|
||||||
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
|
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
|
||||||
if ($(7z a $zipfile src\third_party\angle\.git\HEAD;$LASTEXITCODE -ne 0)) {
|
$(7z a $zipfile src\third_party\angle\.git)
|
||||||
Write-warning "Failed to add third_party\angle\.git\HEAD; continuing anyway"
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- ps: >-
|
- ps: >-
|
||||||
@@ -134,7 +143,7 @@ build_script:
|
|||||||
cd build-tools
|
cd build-tools
|
||||||
npm install
|
npm install
|
||||||
mkdir third_party
|
mkdir third_party
|
||||||
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
|
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||||
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||||
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||||
cd ..
|
cd ..
|
||||||
@@ -205,7 +214,8 @@ test_script:
|
|||||||
echo "Skipping tests for $env:GN_CONFIG build"
|
echo "Skipping tests for $env:GN_CONFIG build"
|
||||||
}
|
}
|
||||||
- cd electron
|
- cd electron
|
||||||
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --trace-uncaught --enable-logging)
|
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
||||||
|
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --trace-uncaught --enable-logging --disable-features=CalculateNativeWinOcclusion )
|
||||||
- cd ..
|
- cd ..
|
||||||
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
|
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
|
||||||
- echo "About to verify mksnapshot"
|
- echo "About to verify mksnapshot"
|
||||||
@@ -219,10 +229,10 @@ deploy_script:
|
|||||||
if (Test-Path Env:\ELECTRON_RELEASE) {
|
if (Test-Path Env:\ELECTRON_RELEASE) {
|
||||||
if (Test-Path Env:\UPLOAD_TO_S3) {
|
if (Test-Path Env:\UPLOAD_TO_S3) {
|
||||||
Write-Output "Uploading Electron release distribution to s3"
|
Write-Output "Uploading Electron release distribution to s3"
|
||||||
& python script\release\uploaders\upload.py --upload_to_s3
|
& python script\release\uploaders\upload.py --verbose --upload_to_s3
|
||||||
} else {
|
} else {
|
||||||
Write-Output "Uploading Electron release distribution to github releases"
|
Write-Output "Uploading Electron release distribution to github releases"
|
||||||
& python script\release\uploaders\upload.py
|
& python script\release\uploaders\upload.py --verbose
|
||||||
}
|
}
|
||||||
} elseif (Test-Path Env:\TEST_WOA) {
|
} elseif (Test-Path Env:\TEST_WOA) {
|
||||||
node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
|
node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ steps:
|
|||||||
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
||||||
set npm_config_arch=arm64
|
set npm_config_arch=arm64
|
||||||
cd electron
|
cd electron
|
||||||
node script/yarn test -- --enable-logging --verbose
|
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
||||||
|
node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion
|
||||||
displayName: 'Run Electron tests'
|
displayName: 'Run Electron tests'
|
||||||
env:
|
env:
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
|||||||
root_extra_deps = [ "//electron" ]
|
root_extra_deps = [ "//electron" ]
|
||||||
|
|
||||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
|
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
|
||||||
node_module_version = 82
|
node_module_version = 85
|
||||||
|
|
||||||
v8_promise_internal_field_count = 1
|
v8_promise_internal_field_count = 1
|
||||||
v8_typed_array_max_size_in_heap = 0
|
v8_typed_array_max_size_in_heap = 0
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ config.output = {
|
|||||||
filename: path.basename(outPath)
|
filename: path.basename(outPath)
|
||||||
};
|
};
|
||||||
|
|
||||||
const { wrapInitWithProfilingTimeout } = config;
|
const { wrapInitWithProfilingTimeout, wrapInitWithTryCatch, ...webpackConfig } = config;
|
||||||
delete config.wrapInitWithProfilingTimeout;
|
|
||||||
|
|
||||||
webpack(config, (err, stats) => {
|
webpack(webpackConfig, (err, stats) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@@ -21,9 +20,17 @@ webpack(config, (err, stats) => {
|
|||||||
console.error(stats.toString('normal'));
|
console.error(stats.toString('normal'));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
|
let contents = fs.readFileSync(outPath, 'utf8');
|
||||||
|
if (wrapInitWithTryCatch) {
|
||||||
|
contents = `try {
|
||||||
|
${contents}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Electron ${webpackConfig.output.filename} script failed to run');
|
||||||
|
console.error(err);
|
||||||
|
}`;
|
||||||
|
}
|
||||||
if (wrapInitWithProfilingTimeout) {
|
if (wrapInitWithProfilingTimeout) {
|
||||||
const contents = fs.readFileSync(outPath, 'utf8');
|
contents = `function ___electron_webpack_init__() {
|
||||||
const newContents = `function ___electron_webpack_init__() {
|
|
||||||
${contents}
|
${contents}
|
||||||
};
|
};
|
||||||
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
|
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
|
||||||
@@ -31,8 +38,8 @@ if ((globalThis.process || binding.process).argv.includes("--profile-electron-in
|
|||||||
} else {
|
} else {
|
||||||
___electron_webpack_init__();
|
___electron_webpack_init__();
|
||||||
}`;
|
}`;
|
||||||
fs.writeFileSync(outPath, newContents);
|
|
||||||
}
|
}
|
||||||
|
fs.writeFileSync(outPath, contents);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ module.exports = ({
|
|||||||
loadElectronFromAlternateTarget,
|
loadElectronFromAlternateTarget,
|
||||||
targetDeletesNodeGlobals,
|
targetDeletesNodeGlobals,
|
||||||
target,
|
target,
|
||||||
wrapInitWithProfilingTimeout
|
wrapInitWithProfilingTimeout,
|
||||||
|
wrapInitWithTryCatch
|
||||||
}) => {
|
}) => {
|
||||||
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts');
|
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts');
|
||||||
if (!fs.existsSync(entry)) {
|
if (!fs.existsSync(entry)) {
|
||||||
@@ -87,6 +88,7 @@ module.exports = ({
|
|||||||
filename: `${target}.bundle.js`
|
filename: `${target}.bundle.js`
|
||||||
},
|
},
|
||||||
wrapInitWithProfilingTimeout,
|
wrapInitWithProfilingTimeout,
|
||||||
|
wrapInitWithTryCatch,
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@electron/internal': path.resolve(electronRoot, 'lib'),
|
'@electron/internal': path.resolve(electronRoot, 'lib'),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
module.exports = require('./webpack.config.base')({
|
module.exports = require('./webpack.config.base')({
|
||||||
target: 'isolated_renderer',
|
target: 'isolated_renderer',
|
||||||
alwaysHasNode: false
|
alwaysHasNode: false,
|
||||||
|
wrapInitWithTryCatch: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ module.exports = require('./webpack.config.base')({
|
|||||||
target: 'renderer',
|
target: 'renderer',
|
||||||
alwaysHasNode: true,
|
alwaysHasNode: true,
|
||||||
targetDeletesNodeGlobals: true,
|
targetDeletesNodeGlobals: true,
|
||||||
wrapInitWithProfilingTimeout: true
|
wrapInitWithProfilingTimeout: true,
|
||||||
|
wrapInitWithTryCatch: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
module.exports = require('./webpack.config.base')({
|
module.exports = require('./webpack.config.base')({
|
||||||
target: 'sandboxed_renderer',
|
target: 'sandboxed_renderer',
|
||||||
alwaysHasNode: false,
|
alwaysHasNode: false,
|
||||||
wrapInitWithProfilingTimeout: true
|
wrapInitWithProfilingTimeout: true,
|
||||||
|
wrapInitWithTryCatch: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ module.exports = require('./webpack.config.base')({
|
|||||||
target: 'worker',
|
target: 'worker',
|
||||||
loadElectronFromAlternateTarget: 'renderer',
|
loadElectronFromAlternateTarget: 'renderer',
|
||||||
alwaysHasNode: true,
|
alwaysHasNode: true,
|
||||||
targetDeletesNodeGlobals: true
|
targetDeletesNodeGlobals: true,
|
||||||
|
wrapInitWithTryCatch: true
|
||||||
});
|
});
|
||||||
|
|||||||
21
build/zip.py
21
build/zip.py
@@ -13,27 +13,30 @@ EXTENSIONS_TO_SKIP = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
PATHS_TO_SKIP = [
|
PATHS_TO_SKIP = [
|
||||||
'angledata', #Skipping because it is an output of //ui/gl that we don't need
|
# Skip because it is an output of //ui/gl that we don't need.
|
||||||
'./libVkICD_mock_', #Skipping because these are outputs that we don't need
|
'angledata',
|
||||||
'./VkICD_mock_', #Skipping because these are outputs that we don't need
|
# Skip because these are outputs that we don't need.
|
||||||
|
'./libVkICD_mock_',
|
||||||
# Skipping because its an output of create_bundle from //build/config/mac/rules.gni
|
# Skip because these are outputs that we don't need.
|
||||||
|
'./VkICD_mock_',
|
||||||
|
# Skip because its an output of create_bundle from //build/config/mac/rules.gni
|
||||||
# that we don't need
|
# that we don't need
|
||||||
'Electron.dSYM',
|
'Electron.dSYM',
|
||||||
|
# Refs https://chromium-review.googlesource.com/c/angle/angle/+/2425197.
|
||||||
|
# Remove this when Angle themselves remove the file: https://issuetracker.google.com/issues/168736059
|
||||||
|
'gen/angle/angle_commit.h',
|
||||||
# //chrome/browser:resources depends on this via
|
# //chrome/browser:resources depends on this via
|
||||||
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
|
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
|
||||||
# ship it.
|
# ship it.
|
||||||
'pyproto',
|
'pyproto',
|
||||||
|
|
||||||
# On Windows, this binary doesn't exist (the crashpad handler is built-in).
|
# On Windows, this binary doesn't exist (the crashpad handler is built-in).
|
||||||
# On MacOS, the binary is called 'chrome_crashpad_handler' and is inside the
|
# On MacOS, the binary is called 'chrome_crashpad_handler' and is inside the
|
||||||
# app bundle.
|
# app bundle.
|
||||||
# On Linux, we don't use crashpad, but this binary is still built for some
|
# On Linux, we don't use crashpad, but this binary is still built for some
|
||||||
# reason. Exclude it from the zip.
|
# reason. Exclude it from the zip.
|
||||||
'./crashpad_handler',
|
'./crashpad_handler',
|
||||||
|
# Skip because these are outputs that we don't need.
|
||||||
'resources/inspector', #Skipping because these are outputs that we don't need
|
'resources/inspector',
|
||||||
]
|
]
|
||||||
|
|
||||||
def skip_path(dep, dist_zip, target_cpu):
|
def skip_path(dep, dist_zip, target_cpu):
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ buildflag_header("buildflags") {
|
|||||||
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
|
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
|
||||||
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
|
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
|
||||||
"ENABLE_PICTURE_IN_PICTURE=$enable_picture_in_picture",
|
"ENABLE_PICTURE_IN_PICTURE=$enable_picture_in_picture",
|
||||||
|
"ENABLE_WIN_DARK_MODE_WINDOW_UI=$enable_win_dark_mode_window_ui",
|
||||||
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
|
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,7 @@ declare_args() {
|
|||||||
|
|
||||||
# Enable Spellchecker support
|
# Enable Spellchecker support
|
||||||
enable_builtin_spellchecker = true
|
enable_builtin_spellchecker = true
|
||||||
|
|
||||||
|
# Undocumented Windows dark mode API
|
||||||
|
enable_win_dark_mode_window_ui = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,18 +26,10 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/devtools/devtools_file_system_indexer.h",
|
"//chrome/browser/devtools/devtools_file_system_indexer.h",
|
||||||
"//chrome/browser/extensions/global_shortcut_listener.cc",
|
"//chrome/browser/extensions/global_shortcut_listener.cc",
|
||||||
"//chrome/browser/extensions/global_shortcut_listener.h",
|
"//chrome/browser/extensions/global_shortcut_listener.h",
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_win.cc",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_win.h",
|
|
||||||
"//chrome/browser/icon_loader.cc",
|
"//chrome/browser/icon_loader.cc",
|
||||||
"//chrome/browser/icon_loader.h",
|
"//chrome/browser/icon_loader.h",
|
||||||
"//chrome/browser/icon_loader_mac.mm",
|
|
||||||
"//chrome/browser/icon_loader_win.cc",
|
|
||||||
"//chrome/browser/icon_manager.cc",
|
"//chrome/browser/icon_manager.cc",
|
||||||
"//chrome/browser/icon_manager.h",
|
"//chrome/browser/icon_manager.h",
|
||||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
|
|
||||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
|
|
||||||
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
|
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
|
||||||
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
|
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
|
||||||
"//chrome/browser/net/proxy_config_monitor.cc",
|
"//chrome/browser/net/proxy_config_monitor.cc",
|
||||||
@@ -57,14 +49,32 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/ssl/tls_deprecation_config.cc",
|
"//chrome/browser/ssl/tls_deprecation_config.cc",
|
||||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
|
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
|
||||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
|
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
|
||||||
"//chrome/browser/win/chrome_process_finder.cc",
|
|
||||||
"//chrome/browser/win/chrome_process_finder.h",
|
|
||||||
"//chrome/child/v8_crashpad_support_win.cc",
|
|
||||||
"//chrome/child/v8_crashpad_support_win.h",
|
|
||||||
"//extensions/browser/app_window/size_constraints.cc",
|
"//extensions/browser/app_window/size_constraints.cc",
|
||||||
"//extensions/browser/app_window/size_constraints.h",
|
"//extensions/browser/app_window/size_constraints.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (is_mac) {
|
||||||
|
sources += [
|
||||||
|
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
|
||||||
|
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
|
||||||
|
"//chrome/browser/icon_loader_mac.mm",
|
||||||
|
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
|
||||||
|
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_win) {
|
||||||
|
sources += [
|
||||||
|
"//chrome/browser/extensions/global_shortcut_listener_win.cc",
|
||||||
|
"//chrome/browser/extensions/global_shortcut_listener_win.h",
|
||||||
|
"//chrome/browser/icon_loader_win.cc",
|
||||||
|
"//chrome/browser/win/chrome_process_finder.cc",
|
||||||
|
"//chrome/browser/win/chrome_process_finder.h",
|
||||||
|
"//chrome/child/v8_crashpad_support_win.cc",
|
||||||
|
"//chrome/child/v8_crashpad_support_win.h",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
public_deps = [
|
public_deps = [
|
||||||
"//chrome/common",
|
"//chrome/common",
|
||||||
"//chrome/common:version_header",
|
"//chrome/common:version_header",
|
||||||
@@ -266,6 +276,17 @@ static_library("chrome") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_mas_build) {
|
||||||
|
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ]
|
||||||
|
if (is_mac) {
|
||||||
|
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ]
|
||||||
|
} else if (is_win) {
|
||||||
|
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_win.cc" ]
|
||||||
|
} else {
|
||||||
|
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
source_set("plugins") {
|
source_set("plugins") {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
|
|||||||
// Linux has only a single persistent slot compared to ChromeOS's separate
|
// Linux has only a single persistent slot compared to ChromeOS's separate
|
||||||
// public and private slot.
|
// public and private slot.
|
||||||
// Redirect any slot usage to this persistent slot on Linux.
|
// Redirect any slot usage to this persistent slot on Linux.
|
||||||
|
crypto::EnsureNSSInit();
|
||||||
g_nss_cert_database = new net::NSSCertDatabase(
|
g_nss_cert_database = new net::NSSCertDatabase(
|
||||||
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* public slot */,
|
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* public slot */,
|
||||||
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* private slot */);
|
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* private slot */);
|
||||||
|
|||||||
@@ -826,10 +826,9 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
|
|||||||
to_send.append(current_dir.value());
|
to_send.append(current_dir.value());
|
||||||
|
|
||||||
const std::vector<std::string>& argv = electron::ElectronCommandLine::argv();
|
const std::vector<std::string>& argv = electron::ElectronCommandLine::argv();
|
||||||
for (std::vector<std::string>::const_iterator it = argv.begin();
|
for (const auto& arg : argv) {
|
||||||
it != argv.end(); ++it) {
|
|
||||||
to_send.push_back(kTokenDelimiter);
|
to_send.push_back(kTokenDelimiter);
|
||||||
to_send.append(*it);
|
to_send.append(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the message
|
// Send the message
|
||||||
|
|||||||
@@ -122,8 +122,7 @@ void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */,
|
|||||||
GParamSpec* /* ignored */) {
|
GParamSpec* /* ignored */) {
|
||||||
// If the name owner changed, we need to reregister all the live x11::Window
|
// If the name owner changed, we need to reregister all the live x11::Window
|
||||||
// with the system.
|
// with the system.
|
||||||
for (std::set<x11::Window>::const_iterator it = live_windows_.begin();
|
for (const auto& window : live_windows_) {
|
||||||
it != live_windows_.end(); ++it) {
|
RegisterXWindow(window);
|
||||||
RegisterXWindow(*it);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ In most cases, you should do everything in the `ready` event handler.
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `launchInfo` unknown _macOS_
|
* `event` Event
|
||||||
|
* `launchInfo` Record<string, any> _macOS_
|
||||||
|
|
||||||
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
|
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
|
||||||
holds the `userInfo` of the `NSUserNotification` that was used to open the
|
holds the `userInfo` of the `NSUserNotification` that was used to open the
|
||||||
@@ -402,7 +403,7 @@ Returns:
|
|||||||
* `killed` - Process was sent a SIGTERM or otherwise killed externally
|
* `killed` - Process was sent a SIGTERM or otherwise killed externally
|
||||||
* `crashed` - Process crashed
|
* `crashed` - Process crashed
|
||||||
* `oom` - Process ran out of memory
|
* `oom` - Process ran out of memory
|
||||||
* `launch-failure` - Process never successfully launched
|
* `launch-failed` - Process never successfully launched
|
||||||
* `integrity-failure` - Windows code integrity checks failed
|
* `integrity-failure` - Windows code integrity checks failed
|
||||||
|
|
||||||
Emitted when the renderer process unexpectedly disappears. This is normally
|
Emitted when the renderer process unexpectedly disappears. This is normally
|
||||||
@@ -428,7 +429,7 @@ Returns:
|
|||||||
* `killed` - Process was sent a SIGTERM or otherwise killed externally
|
* `killed` - Process was sent a SIGTERM or otherwise killed externally
|
||||||
* `crashed` - Process crashed
|
* `crashed` - Process crashed
|
||||||
* `oom` - Process ran out of memory
|
* `oom` - Process ran out of memory
|
||||||
* `launch-failure` - Process never successfully launched
|
* `launch-failed` - Process never successfully launched
|
||||||
* `integrity-failure` - Windows code integrity checks failed
|
* `integrity-failure` - Windows code integrity checks failed
|
||||||
* `exitCode` Number - The exit code for the process
|
* `exitCode` Number - The exit code for the process
|
||||||
(e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows).
|
(e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows).
|
||||||
@@ -1340,7 +1341,7 @@ systems Application folder. Use in combination with `app.moveToApplicationsFolde
|
|||||||
### `app.moveToApplicationsFolder([options])` _macOS_
|
### `app.moveToApplicationsFolder([options])` _macOS_
|
||||||
|
|
||||||
* `options` Object (optional)
|
* `options` Object (optional)
|
||||||
* `conflictHandler` Function<Boolean> (optional) - A handler for potential conflict in move failure.
|
* `conflictHandler` Function\<Boolean> (optional) - A handler for potential conflict in move failure.
|
||||||
* `conflictType` String - The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.
|
* `conflictType` String - The type of move conflict encountered by the handler; can be `exists` or `existsAndRunning`, where `exists` means that an app of the same name is present in the Applications directory and `existsAndRunning` means both that it exists and that it's presently running.
|
||||||
|
|
||||||
Returns `Boolean` - Whether the move was successful. Please note that if
|
Returns `Boolean` - Whether the move was successful. Please note that if
|
||||||
@@ -1484,3 +1485,12 @@ which native modules you can use in the renderer process. For more information
|
|||||||
on the direction Electron is going with renderer process restarts and usage of
|
on the direction Electron is going with renderer process restarts and usage of
|
||||||
native modules in the renderer process please check out this
|
native modules in the renderer process please check out this
|
||||||
[Tracking Issue](https://github.com/electron/electron/issues/18397).
|
[Tracking Issue](https://github.com/electron/electron/issues/18397).
|
||||||
|
|
||||||
|
### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_
|
||||||
|
|
||||||
|
A `Boolean` which when `true` indicates that the app is currently running
|
||||||
|
under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)).
|
||||||
|
|
||||||
|
You can use this property to prompt users to download the arm64 version of
|
||||||
|
your application when they are running the x64 version under Rosetta
|
||||||
|
incorrectly.
|
||||||
|
|||||||
@@ -541,6 +541,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
|
|||||||
|
|
||||||
Emitted after the window has been resized.
|
Emitted after the window has been resized.
|
||||||
|
|
||||||
|
#### Event: 'resized' _macOS_ _Windows_
|
||||||
|
|
||||||
|
Emitted once when the window has finished being resized.
|
||||||
|
|
||||||
|
This is usually emitted when the window has been resized manually. On macOS, resizing the window with `setBounds`/`setSize` and setting the `animate` parameter to `true` will also emit this event once resizing has finished.
|
||||||
|
|
||||||
#### Event: 'will-move' _macOS_ _Windows_
|
#### Event: 'will-move' _macOS_ _Windows_
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -556,12 +562,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
|
|||||||
|
|
||||||
Emitted when the window is being moved to a new position.
|
Emitted when the window is being moved to a new position.
|
||||||
|
|
||||||
__Note__: On macOS this event is an alias of `moved`.
|
#### Event: 'moved' _macOS_ _Windows_
|
||||||
|
|
||||||
#### Event: 'moved' _macOS_
|
|
||||||
|
|
||||||
Emitted once when the window is moved to a new position.
|
Emitted once when the window is moved to a new position.
|
||||||
|
|
||||||
|
__Note__: On macOS this event is an alias of `move`.
|
||||||
|
|
||||||
#### Event: 'enter-full-screen'
|
#### Event: 'enter-full-screen'
|
||||||
|
|
||||||
Emitted when the window enters a full-screen state.
|
Emitted when the window enters a full-screen state.
|
||||||
@@ -670,6 +676,20 @@ Emitted when the window has closed a sheet.
|
|||||||
|
|
||||||
Emitted when the native new tab button is clicked.
|
Emitted when the native new tab button is clicked.
|
||||||
|
|
||||||
|
#### Event: 'system-context-menu' _Windows_
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `point` [Point](structures/point.md) - The screen coordinates the context menu was triggered at
|
||||||
|
|
||||||
|
Emitted when the system context menu is triggered on the window, this is
|
||||||
|
normally only triggered when the user right clicks on the non-client area
|
||||||
|
of your window. This is the window titlebar or any area you have declared
|
||||||
|
as `-webkit-app-region: drag` in a frameless window.
|
||||||
|
|
||||||
|
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||||
|
|
||||||
### Static Methods
|
### Static Methods
|
||||||
|
|
||||||
The `BrowserWindow` class has the following static methods:
|
The `BrowserWindow` class has the following static methods:
|
||||||
@@ -1029,7 +1049,7 @@ Returns `Boolean` - Whether the window is in simple (pre-Lion) fullscreen mode.
|
|||||||
|
|
||||||
Returns `Boolean` - Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).
|
Returns `Boolean` - Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).
|
||||||
|
|
||||||
#### `win.setAspectRatio(aspectRatio[, extraSize])` _macOS_ _Linux_
|
#### `win.setAspectRatio(aspectRatio[, extraSize])`
|
||||||
|
|
||||||
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
|
* `aspectRatio` Float - The aspect ratio to maintain for some portion of the
|
||||||
content view.
|
content view.
|
||||||
@@ -1050,6 +1070,9 @@ the player itself we would call this function with arguments of 16/9 and
|
|||||||
are within the content view--only that they exist. Sum any extra width and
|
are within the content view--only that they exist. Sum any extra width and
|
||||||
height areas you have within the overall content view.
|
height areas you have within the overall content view.
|
||||||
|
|
||||||
|
The aspect ratio is not respected when window is resized programmingly with
|
||||||
|
APIs like `win.setSize`.
|
||||||
|
|
||||||
#### `win.setBackgroundColor(backgroundColor)`
|
#### `win.setBackgroundColor(backgroundColor)`
|
||||||
|
|
||||||
* `backgroundColor` String - Window's background color as a hexadecimal value,
|
* `backgroundColor` String - Window's background color as a hexadecimal value,
|
||||||
|
|||||||
@@ -198,6 +198,14 @@ logging level for all code in the source files under a `foo/bar` directory.
|
|||||||
|
|
||||||
This switch only works when `--enable-logging` is also passed.
|
This switch only works when `--enable-logging` is also passed.
|
||||||
|
|
||||||
|
### --force_high_performance_gpu
|
||||||
|
|
||||||
|
Force using discrete GPU when there are multiple GPUs available.
|
||||||
|
|
||||||
|
### --force_low_power_gpu
|
||||||
|
|
||||||
|
Force using integrated GPU when there are multiple GPUs available.
|
||||||
|
|
||||||
## Node.js Flags
|
## Node.js Flags
|
||||||
|
|
||||||
Electron supports some of the [CLI flags][node-cli] supported by Node.js.
|
Electron supports some of the [CLI flags][node-cli] supported by Node.js.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const { app, contentTracing } = require('electron')
|
|||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
await contentTracing.startRecording({
|
await contentTracing.startRecording({
|
||||||
include_categories: ['*']
|
included_categories: ['*']
|
||||||
})
|
})
|
||||||
console.log('Tracing started')
|
console.log('Tracing started')
|
||||||
await new Promise(resolve => setTimeout(resolve, 5000))
|
await new Promise(resolve => setTimeout(resolve, 5000))
|
||||||
|
|||||||
@@ -72,50 +72,6 @@ const constraints = {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This example shows how to capture a video from a [WebContents](web-contents.md)
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// In the renderer process.
|
|
||||||
const { desktopCapturer, remote } = require('electron')
|
|
||||||
|
|
||||||
desktopCapturer.getMediaSourceIdForWebContents(remote.getCurrentWebContents().id).then(async mediaSourceId => {
|
|
||||||
try {
|
|
||||||
const stream = await navigator.mediaDevices.getUserMedia({
|
|
||||||
audio: {
|
|
||||||
mandatory: {
|
|
||||||
chromeMediaSource: 'tab',
|
|
||||||
chromeMediaSourceId: mediaSourceId
|
|
||||||
}
|
|
||||||
},
|
|
||||||
video: {
|
|
||||||
mandatory: {
|
|
||||||
chromeMediaSource: 'tab',
|
|
||||||
chromeMediaSourceId: mediaSourceId,
|
|
||||||
minWidth: 1280,
|
|
||||||
maxWidth: 1280,
|
|
||||||
minHeight: 720,
|
|
||||||
maxHeight: 720
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
handleStream(stream)
|
|
||||||
} catch (e) {
|
|
||||||
handleError(e)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
function handleStream (stream) {
|
|
||||||
const video = document.querySelector('video')
|
|
||||||
video.srcObject = stream
|
|
||||||
video.onloadedmetadata = (e) => video.play()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleError (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
The `desktopCapturer` module has the following methods:
|
The `desktopCapturer` module has the following methods:
|
||||||
@@ -138,15 +94,6 @@ Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`Desktop
|
|||||||
**Note** Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
|
**Note** Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
|
||||||
which can detected by [`systemPreferences.getMediaAccessStatus`].
|
which can detected by [`systemPreferences.getMediaAccessStatus`].
|
||||||
|
|
||||||
### `desktopCapturer.getMediaSourceIdForWebContents(webContentsId)`
|
|
||||||
|
|
||||||
* `webContentsId` number - Id of the WebContents to get stream of
|
|
||||||
|
|
||||||
Returns `Promise<string>` - Resolves with the identifier of a WebContents stream, this identifier can be
|
|
||||||
used with [`navigator.mediaDevices.getUserMedia`].
|
|
||||||
The identifier is **only valid for 10 seconds**.
|
|
||||||
The identifier may be empty if not requested from a renderer process.
|
|
||||||
|
|
||||||
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
|
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
|
||||||
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-macos
|
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-macos
|
||||||
|
|
||||||
|
|||||||
@@ -102,3 +102,21 @@ The following methods of `chrome.tabs` are supported:
|
|||||||
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
|
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
|
||||||
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
|
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
|
||||||
> supported and will raise an error.
|
> supported and will raise an error.
|
||||||
|
|
||||||
|
### `chrome.management`
|
||||||
|
|
||||||
|
The following methods of `chrome.management` are supported:
|
||||||
|
|
||||||
|
- `chrome.management.getAll`
|
||||||
|
- `chrome.management.get`
|
||||||
|
- `chrome.management.getSelf`
|
||||||
|
- `chrome.management.getPermissionWarningsById`
|
||||||
|
- `chrome.management.getPermissionWarningsByManifest`
|
||||||
|
- `chrome.management.onEnabled`
|
||||||
|
- `chrome.management.onDisabled`
|
||||||
|
|
||||||
|
### `chrome.webRequest`
|
||||||
|
|
||||||
|
All features of this API are supported.
|
||||||
|
|
||||||
|
> **NOTE:** Electron's [`webRequest`](web-request.md) module takes precedence over `chrome.webRequest` if there are conflicting handlers.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ with the operating system so that you can customize the operations for various
|
|||||||
shortcuts.
|
shortcuts.
|
||||||
|
|
||||||
**Note:** The shortcut is global; it will work even if the app does
|
**Note:** The shortcut is global; it will work even if the app does
|
||||||
not have the keyboard focus. You should not use this module until the `ready`
|
not have the keyboard focus. This module cannot be used before the `ready`
|
||||||
event of the app module is emitted.
|
event of the app module is emitted.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ Removes listeners of the specified `channel`.
|
|||||||
### `ipcMain.handle(channel, listener)`
|
### `ipcMain.handle(channel, listener)`
|
||||||
|
|
||||||
* `channel` String
|
* `channel` String
|
||||||
* `listener` Function<Promise<void> | any>
|
* `listener` Function<Promise\<void> | any>
|
||||||
* `event` IpcMainInvokeEvent
|
* `event` IpcMainInvokeEvent
|
||||||
* `...args` any[]
|
* `...args` any[]
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ WebContents is the source of the invoke request.
|
|||||||
### `ipcMain.handleOnce(channel, listener)`
|
### `ipcMain.handleOnce(channel, listener)`
|
||||||
|
|
||||||
* `channel` String
|
* `channel` String
|
||||||
* `listener` Function<Promise<void> | any>
|
* `listener` Function<Promise\<void> | any>
|
||||||
* `event` IpcMainInvokeEvent
|
* `event` IpcMainInvokeEvent
|
||||||
* `...args` any[]
|
* `...args` any[]
|
||||||
|
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ Process: [Main](../glossary.md#main-process)
|
|||||||
|
|
||||||
The `powerMonitor` module emits the following events:
|
The `powerMonitor` module emits the following events:
|
||||||
|
|
||||||
### Event: 'suspend'
|
### Event: 'suspend' _macOS_ _Windows_
|
||||||
|
|
||||||
Emitted when the system is suspending.
|
Emitted when the system is suspending.
|
||||||
|
|
||||||
### Event: 'resume'
|
### Event: 'resume' _macOS_ _Windows_
|
||||||
|
|
||||||
Emitted when system is resuming.
|
Emitted when system is resuming.
|
||||||
|
|
||||||
### Event: 'on-ac' _Windows_
|
### Event: 'on-ac' _macOS_ _Windows_
|
||||||
|
|
||||||
Emitted when the system changes to AC power.
|
Emitted when the system changes to AC power.
|
||||||
|
|
||||||
### Event: 'on-battery' _Windows_
|
### Event: 'on-battery' _macOS_ _Windows_
|
||||||
|
|
||||||
Emitted when system changes to battery power.
|
Emitted when system changes to battery power.
|
||||||
|
|
||||||
|
|||||||
@@ -349,6 +349,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
|
|||||||
* `handler` Function | null
|
* `handler` Function | null
|
||||||
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
|
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
|
||||||
* `permission` String - The type of requested permission.
|
* `permission` String - The type of requested permission.
|
||||||
|
* `clipboard-read` - Request access to read from the clipboard.
|
||||||
* `media` - Request access to media devices such as camera, microphone and speakers.
|
* `media` - Request access to media devices such as camera, microphone and speakers.
|
||||||
* `mediaKeySystem` - Request access to DRM protected content.
|
* `mediaKeySystem` - Request access to DRM protected content.
|
||||||
* `geolocation` - Request access to user's current location.
|
* `geolocation` - Request access to user's current location.
|
||||||
@@ -384,7 +385,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents
|
|||||||
|
|
||||||
#### `ses.setPermissionCheckHandler(handler)`
|
#### `ses.setPermissionCheckHandler(handler)`
|
||||||
|
|
||||||
* `handler` Function<Boolean> | null
|
* `handler` Function\<Boolean> | null
|
||||||
* `webContents` [WebContents](web-contents.md) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
|
* `webContents` [WebContents](web-contents.md) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
|
||||||
* `permission` String - Enum of 'media'.
|
* `permission` String - Enum of 'media'.
|
||||||
* `requestingOrigin` String - The origin URL of the permission check
|
* `requestingOrigin` String - The origin URL of the permission check
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# IpcMainEvent Object extends `Event`
|
# IpcMainEvent Object extends `Event`
|
||||||
|
|
||||||
|
* `processId` Integer - The internal ID of the renderer process that sent this message
|
||||||
* `frameId` Integer - The ID of the renderer frame that sent this message
|
* `frameId` Integer - The ID of the renderer frame that sent this message
|
||||||
* `returnValue` any - Set this to the value to be returned in a synchronous message
|
* `returnValue` any - Set this to the value to be returned in a synchronous message
|
||||||
* `sender` WebContents - Returns the `webContents` that sent the message
|
* `sender` WebContents - Returns the `webContents` that sent the message
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# IpcMainInvokeEvent Object extends `Event`
|
# IpcMainInvokeEvent Object extends `Event`
|
||||||
|
|
||||||
|
* `processId` Integer - The internal ID of the renderer process that sent this message
|
||||||
* `frameId` Integer - The ID of the renderer frame that sent this message
|
* `frameId` Integer - The ID of the renderer frame that sent this message
|
||||||
* `sender` WebContents - Returns the `webContents` that sent the message
|
* `sender` WebContents - Returns the `webContents` that sent the message
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
# StreamProtocolResponse Object
|
|
||||||
|
|
||||||
* `statusCode` Number (optional) - The HTTP response code.
|
|
||||||
* `headers` Record<String, String | String[]> (optional) - An object containing the response headers.
|
|
||||||
* `data` ReadableStream | null - A Node.js readable stream representing the response body.
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# StringProtocolResponse Object
|
|
||||||
|
|
||||||
* `mimeType` String (optional) - MIME type of the response.
|
|
||||||
* `charset` String (optional) - Charset of the response.
|
|
||||||
* `data` String | null - A string representing the response body.
|
|
||||||
@@ -42,7 +42,8 @@ returns `null`.
|
|||||||
|
|
||||||
* `id` Integer
|
* `id` Integer
|
||||||
|
|
||||||
Returns `WebContents` - A WebContents instance with the given ID.
|
Returns `WebContents` | undefined - A WebContents instance with the given ID, or
|
||||||
|
`undefined` if there is no WebContents associated with the given ID.
|
||||||
|
|
||||||
## Class: WebContents
|
## Class: WebContents
|
||||||
|
|
||||||
@@ -364,7 +365,7 @@ Returns:
|
|||||||
* `killed` - Process was sent a SIGTERM or otherwise killed externally
|
* `killed` - Process was sent a SIGTERM or otherwise killed externally
|
||||||
* `crashed` - Process crashed
|
* `crashed` - Process crashed
|
||||||
* `oom` - Process ran out of memory
|
* `oom` - Process ran out of memory
|
||||||
* `launch-failure` - Process never successfully launched
|
* `launch-failed` - Process never successfully launched
|
||||||
* `integrity-failure` - Windows code integrity checks failed
|
* `integrity-failure` - Windows code integrity checks failed
|
||||||
|
|
||||||
Emitted when the renderer process unexpectedly disappears. This is normally
|
Emitted when the renderer process unexpectedly disappears. This is normally
|
||||||
@@ -998,6 +999,34 @@ Navigates to the specified offset from the "current entry".
|
|||||||
|
|
||||||
Returns `Boolean` - Whether the renderer process has crashed.
|
Returns `Boolean` - Whether the renderer process has crashed.
|
||||||
|
|
||||||
|
#### `contents.forcefullyCrashRenderer()`
|
||||||
|
|
||||||
|
Forcefully terminates the renderer process that is currently hosting this
|
||||||
|
`webContents`. This will cause the `render-process-gone` event to be emitted
|
||||||
|
with the `reason=killed || reason=crashed`. Please note that some webContents share renderer
|
||||||
|
processes and therefore calling this method may also crash the host process
|
||||||
|
for other webContents as well.
|
||||||
|
|
||||||
|
Calling `reload()` immediately after calling this
|
||||||
|
method will force the reload to occur in a new process. This should be used
|
||||||
|
when this process is unstable or unusable, for instance in order to recover
|
||||||
|
from the `unresponsive` event.
|
||||||
|
|
||||||
|
```js
|
||||||
|
contents.on('unresponsive', async () => {
|
||||||
|
const { response } = await dialog.showMessageBox({
|
||||||
|
message: 'App X has become unresponsive',
|
||||||
|
title: 'Do you want to try forcefully reloading the app?',
|
||||||
|
buttons: ['OK', 'Cancel'],
|
||||||
|
cancelId: 1
|
||||||
|
})
|
||||||
|
if (response === 0) {
|
||||||
|
contents.forcefullyCrashRenderer()
|
||||||
|
contents.reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
#### `contents.setUserAgent(userAgent)`
|
#### `contents.setUserAgent(userAgent)`
|
||||||
|
|
||||||
* `userAgent` String
|
* `userAgent` String
|
||||||
@@ -1296,9 +1325,9 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
|
|||||||
* `pagesPerSheet` Number (optional) - The number of pages to print per page sheet.
|
* `pagesPerSheet` Number (optional) - The number of pages to print per page sheet.
|
||||||
* `collate` Boolean (optional) - Whether the web page should be collated.
|
* `collate` Boolean (optional) - Whether the web page should be collated.
|
||||||
* `copies` Number (optional) - The number of copies of the web page to print.
|
* `copies` Number (optional) - The number of copies of the web page to print.
|
||||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
* `pageRanges` Object[] (optional) - The page range to print. On macOS, only one range is honored.
|
||||||
* `from` Number - the start page.
|
* `from` Number - Index of the first page to print (0-based).
|
||||||
* `to` Number - the end page.
|
* `to` Number - Index of the last page to print (inclusive) (0-based).
|
||||||
* `duplexMode` String (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
|
* `duplexMode` String (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
|
||||||
* `dpi` Record<string, number> (optional)
|
* `dpi` Record<string, number> (optional)
|
||||||
* `horizontal` Number (optional) - The horizontal dpi.
|
* `horizontal` Number (optional) - The horizontal dpi.
|
||||||
@@ -1324,10 +1353,10 @@ Example usage:
|
|||||||
const options = {
|
const options = {
|
||||||
silent: true,
|
silent: true,
|
||||||
deviceName: 'My-Printer',
|
deviceName: 'My-Printer',
|
||||||
pageRanges: {
|
pageRanges: [{
|
||||||
from: 0,
|
from: 0,
|
||||||
to: 1
|
to: 1
|
||||||
}
|
}]
|
||||||
}
|
}
|
||||||
win.webContents.print(options, (success, errorType) => {
|
win.webContents.print(options, (success, errorType) => {
|
||||||
if (!success) console.log(errorType)
|
if (!success) console.log(errorType)
|
||||||
@@ -1345,8 +1374,8 @@ win.webContents.print(options, (success, errorType) => {
|
|||||||
default margin, 1 for no margin, and 2 for minimum margin.
|
default margin, 1 for no margin, and 2 for minimum margin.
|
||||||
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
||||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
||||||
* `from` Number - zero-based index of the first page to print.
|
* `from` Number - Index of the first page to print (0-based).
|
||||||
* `to` Number - zero-based index of the last page to print (inclusive).
|
* `to` Number - Index of the last page to print (inclusive) (0-based).
|
||||||
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
||||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
|
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
|
||||||
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
|
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
|
||||||
@@ -1593,7 +1622,9 @@ app.whenReady().then(() => {
|
|||||||
|
|
||||||
#### `contents.sendToFrame(frameId, channel, ...args)`
|
#### `contents.sendToFrame(frameId, channel, ...args)`
|
||||||
|
|
||||||
* `frameId` Integer
|
* `frameId` Integer | [number, number] - the ID of the frame to send to, or a
|
||||||
|
pair of `[processId, frameId]` if the frame is in a different process to the
|
||||||
|
main frame.
|
||||||
* `channel` String
|
* `channel` String
|
||||||
* `...args` any[]
|
* `...args` any[]
|
||||||
|
|
||||||
@@ -1767,7 +1798,7 @@ Returns `Boolean` - If *offscreen rendering* is enabled returns whether it is cu
|
|||||||
* `fps` Integer
|
* `fps` Integer
|
||||||
|
|
||||||
If *offscreen rendering* is enabled sets the frame rate to the specified number.
|
If *offscreen rendering* is enabled sets the frame rate to the specified number.
|
||||||
Only values between 1 and 60 are accepted.
|
Only values between 1 and 240 are accepted.
|
||||||
|
|
||||||
#### `contents.getFrameRate()`
|
#### `contents.getFrameRate()`
|
||||||
|
|
||||||
@@ -1865,7 +1896,7 @@ The zoom factor is the zoom percent divided by 100, so 300% = 3.0.
|
|||||||
#### `contents.frameRate`
|
#### `contents.frameRate`
|
||||||
|
|
||||||
An `Integer` property that sets the frame rate of the web contents to the specified number.
|
An `Integer` property that sets the frame rate of the web contents to the specified number.
|
||||||
Only values between 1 and 60 are accepted.
|
Only values between 1 and 240 are accepted.
|
||||||
|
|
||||||
Only applicable if *offscreen rendering* is enabled.
|
Only applicable if *offscreen rendering* is enabled.
|
||||||
|
|
||||||
|
|||||||
@@ -560,9 +560,9 @@ Stops any `findInPage` request for the `webview` with the provided `action`.
|
|||||||
* `pagesPerSheet` Number (optional) - The number of pages to print per page sheet.
|
* `pagesPerSheet` Number (optional) - The number of pages to print per page sheet.
|
||||||
* `collate` Boolean (optional) - Whether the web page should be collated.
|
* `collate` Boolean (optional) - Whether the web page should be collated.
|
||||||
* `copies` Number (optional) - The number of copies of the web page to print.
|
* `copies` Number (optional) - The number of copies of the web page to print.
|
||||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
* `pageRanges` Object[] (optional) - The page range to print.
|
||||||
* `from` Number - zero-based index of the first page to print.
|
* `from` Number - Index of the first page to print (0-based).
|
||||||
* `to` Number - zero-based index of the last page to print (inclusive).
|
* `to` Number - Index of the last page to print (inclusive) (0-based).
|
||||||
* `duplexMode` String (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
|
* `duplexMode` String (optional) - Set the duplex mode of the printed web page. Can be `simplex`, `shortEdge`, or `longEdge`.
|
||||||
* `dpi` Record<string, number> (optional)
|
* `dpi` Record<string, number> (optional)
|
||||||
* `horizontal` Number (optional) - The horizontal dpi.
|
* `horizontal` Number (optional) - The horizontal dpi.
|
||||||
@@ -588,8 +588,8 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
|
|||||||
and `width` in microns.
|
and `width` in microns.
|
||||||
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
||||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
||||||
* `from` Number - the first page to print.
|
* `from` Number - Index of the first page to print (0-based).
|
||||||
* `to` Number - the last page to print (inclusive).
|
* `to` Number - Index of the last page to print (inclusive) (0-based).
|
||||||
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
||||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
|
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
|
||||||
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
|
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
|
||||||
@@ -968,4 +968,4 @@ Emitted when DevTools is closed.
|
|||||||
Emitted when DevTools is focused / opened.
|
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
|
[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70
|
||||||
[chrome-webview]: https://developer.chrome.com/apps/tags/webview
|
[chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
# Breaking changes (NetworkService) (Draft)
|
|
||||||
|
|
||||||
This document describes changes to Electron APIs after migrating network code
|
|
||||||
to NetworkService API.
|
|
||||||
|
|
||||||
We don't currently have an estimate of when we will enable `NetworkService` by
|
|
||||||
default in Electron, but as Chromium is already removing non-`NetworkService`
|
|
||||||
code, we might switch before Electron 10.
|
|
||||||
|
|
||||||
The content of this document should be moved to `breaking-changes.md` once we have
|
|
||||||
determined when to enable `NetworkService` in Electron.
|
|
||||||
|
|
||||||
## Planned Breaking API Changes
|
|
||||||
|
|
||||||
### `protocol.unregisterProtocol`
|
|
||||||
### `protocol.uninterceptProtocol`
|
|
||||||
|
|
||||||
The APIs are now synchronous and the optional callback is no longer needed.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Deprecated
|
|
||||||
protocol.unregisterProtocol(scheme, () => { /* ... */ })
|
|
||||||
// Replace with
|
|
||||||
protocol.unregisterProtocol(scheme)
|
|
||||||
```
|
|
||||||
|
|
||||||
### `protocol.registerFileProtocol`
|
|
||||||
### `protocol.registerBufferProtocol`
|
|
||||||
### `protocol.registerStringProtocol`
|
|
||||||
### `protocol.registerHttpProtocol`
|
|
||||||
### `protocol.registerStreamProtocol`
|
|
||||||
### `protocol.interceptFileProtocol`
|
|
||||||
### `protocol.interceptStringProtocol`
|
|
||||||
### `protocol.interceptBufferProtocol`
|
|
||||||
### `protocol.interceptHttpProtocol`
|
|
||||||
### `protocol.interceptStreamProtocol`
|
|
||||||
|
|
||||||
The APIs are now synchronous and the optional callback is no longer needed.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Deprecated
|
|
||||||
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
|
|
||||||
// Replace with
|
|
||||||
protocol.registerFileProtocol(scheme, handler)
|
|
||||||
```
|
|
||||||
|
|
||||||
The registered or intercepted protocol does not have effect on current page
|
|
||||||
until navigation happens.
|
|
||||||
|
|
||||||
### `protocol.isProtocolHandled`
|
|
||||||
|
|
||||||
This API is deprecated and users should use `protocol.isProtocolRegistered`
|
|
||||||
and `protocol.isProtocolIntercepted` instead.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Deprecated
|
|
||||||
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
|
|
||||||
// Replace with
|
|
||||||
const isRegistered = protocol.isProtocolRegistered(scheme)
|
|
||||||
const isIntercepted = protocol.isProtocolIntercepted(scheme)
|
|
||||||
```
|
|
||||||
@@ -133,6 +133,54 @@ const w = new BrowserWindow({
|
|||||||
We [recommend moving away from the remote
|
We [recommend moving away from the remote
|
||||||
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
||||||
|
|
||||||
|
### `protocol.unregisterProtocol`
|
||||||
|
### `protocol.uninterceptProtocol`
|
||||||
|
|
||||||
|
The APIs are now synchronous and the optional callback is no longer needed.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Deprecated
|
||||||
|
protocol.unregisterProtocol(scheme, () => { /* ... */ })
|
||||||
|
// Replace with
|
||||||
|
protocol.unregisterProtocol(scheme)
|
||||||
|
```
|
||||||
|
|
||||||
|
### `protocol.registerFileProtocol`
|
||||||
|
### `protocol.registerBufferProtocol`
|
||||||
|
### `protocol.registerStringProtocol`
|
||||||
|
### `protocol.registerHttpProtocol`
|
||||||
|
### `protocol.registerStreamProtocol`
|
||||||
|
### `protocol.interceptFileProtocol`
|
||||||
|
### `protocol.interceptStringProtocol`
|
||||||
|
### `protocol.interceptBufferProtocol`
|
||||||
|
### `protocol.interceptHttpProtocol`
|
||||||
|
### `protocol.interceptStreamProtocol`
|
||||||
|
|
||||||
|
The APIs are now synchronous and the optional callback is no longer needed.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Deprecated
|
||||||
|
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
|
||||||
|
// Replace with
|
||||||
|
protocol.registerFileProtocol(scheme, handler)
|
||||||
|
```
|
||||||
|
|
||||||
|
The registered or intercepted protocol does not have effect on current page
|
||||||
|
until navigation happens.
|
||||||
|
|
||||||
|
### `protocol.isProtocolHandled`
|
||||||
|
|
||||||
|
This API is deprecated and users should use `protocol.isProtocolRegistered`
|
||||||
|
and `protocol.isProtocolIntercepted` instead.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Deprecated
|
||||||
|
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
|
||||||
|
// Replace with
|
||||||
|
const isRegistered = protocol.isProtocolRegistered(scheme)
|
||||||
|
const isIntercepted = protocol.isProtocolIntercepted(scheme)
|
||||||
|
```
|
||||||
|
|
||||||
## Planned Breaking API Changes (9.0)
|
## Planned Breaking API Changes (9.0)
|
||||||
|
|
||||||
### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
|
### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
|
||||||
@@ -147,6 +195,45 @@ you should plan to update your native modules to be context aware.
|
|||||||
|
|
||||||
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
|
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
|
||||||
|
|
||||||
|
### Deprecated: `BrowserWindow` extension APIs
|
||||||
|
|
||||||
|
The following extension APIs have been deprecated:
|
||||||
|
* `BrowserWindow.addExtension(path)`
|
||||||
|
* `BrowserWindow.addDevToolsExtension(path)`
|
||||||
|
* `BrowserWindow.removeExtension(name)`
|
||||||
|
* `BrowserWindow.removeDevToolsExtension(name)`
|
||||||
|
* `BrowserWindow.getExtensions()`
|
||||||
|
* `BrowserWindow.getDevToolsExtensions()`
|
||||||
|
|
||||||
|
Use the session APIs instead:
|
||||||
|
* `ses.loadExtension(path)`
|
||||||
|
* `ses.removeExtension(extension_id)`
|
||||||
|
* `ses.getAllExtensions()`
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Deprecated in Electron 9
|
||||||
|
BrowserWindow.addExtension(path)
|
||||||
|
BrowserWindow.addDevToolsExtension(path)
|
||||||
|
// Replace with
|
||||||
|
session.defaultSession.loadExtension(path)
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Deprecated in Electron 9
|
||||||
|
BrowserWindow.removeExtension(name)
|
||||||
|
BrowserWindow.removeDevToolsExtension(name)
|
||||||
|
// Replace with
|
||||||
|
session.defaultSession.removeExtension(extension_id)
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Deprecated in Electron 9
|
||||||
|
BrowserWindow.getExtensions()
|
||||||
|
BrowserWindow.getDevToolsExtensions()
|
||||||
|
// Replace with
|
||||||
|
session.defaultSession.getAllExtensions()
|
||||||
|
```
|
||||||
|
|
||||||
### Removed: `<webview>.getWebContents()`
|
### Removed: `<webview>.getWebContents()`
|
||||||
|
|
||||||
This API, which was deprecated in Electron 8.0, is now removed.
|
This API, which was deprecated in Electron 8.0, is now removed.
|
||||||
@@ -290,6 +377,52 @@ in Electron 8.x, and cease to exist in Electron 9.x. The layout zoom level
|
|||||||
limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
|
limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
|
||||||
[here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11).
|
[here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11).
|
||||||
|
|
||||||
|
### Deprecated events in `systemPreferences`
|
||||||
|
|
||||||
|
The following `systemPreferences` events have been deprecated:
|
||||||
|
* `inverted-color-scheme-changed`
|
||||||
|
* `high-contrast-color-scheme-changed`
|
||||||
|
|
||||||
|
Use the new `updated` event on the `nativeTheme` module instead.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Deprecated
|
||||||
|
systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ })
|
||||||
|
systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ })
|
||||||
|
|
||||||
|
// Replace with
|
||||||
|
nativeTheme.on('updated', () => { /* ... */ })
|
||||||
|
```
|
||||||
|
|
||||||
|
### Deprecated: methods in `systemPreferences`
|
||||||
|
|
||||||
|
The following `systemPreferences` methods have been deprecated:
|
||||||
|
* `systemPreferences.isDarkMode()`
|
||||||
|
* `systemPreferences.isInvertedColorScheme()`
|
||||||
|
* `systemPreferences.isHighContrastColorScheme()`
|
||||||
|
|
||||||
|
Use the following `nativeTheme` properties instead:
|
||||||
|
* `nativeTheme.shouldUseDarkColors`
|
||||||
|
* `nativeTheme.shouldUseInvertedColorScheme`
|
||||||
|
* `nativeTheme.shouldUseHighContrastColors`
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Deprecated
|
||||||
|
systemPreferences.isDarkMode()
|
||||||
|
// Replace with
|
||||||
|
nativeTheme.shouldUseDarkColors
|
||||||
|
|
||||||
|
// Deprecated
|
||||||
|
systemPreferences.isInvertedColorScheme()
|
||||||
|
// Replace with
|
||||||
|
nativeTheme.shouldUseInvertedColorScheme
|
||||||
|
|
||||||
|
// Deprecated
|
||||||
|
systemPreferences.isHighContrastColorScheme()
|
||||||
|
// Replace with
|
||||||
|
nativeTheme.shouldUseHighContrastColors
|
||||||
|
```
|
||||||
|
|
||||||
## Planned Breaking API Changes (7.0)
|
## Planned Breaking API Changes (7.0)
|
||||||
|
|
||||||
### Deprecated: Atom.io Node Headers URL
|
### Deprecated: Atom.io Node Headers URL
|
||||||
|
|||||||
@@ -177,12 +177,12 @@ $ gn gen out/Testing-x86 --args='... target_cpu = "x86"'
|
|||||||
|
|
||||||
Not all combinations of source and target CPU/OS are supported by Chromium.
|
Not all combinations of source and target CPU/OS are supported by Chromium.
|
||||||
|
|
||||||
<table>
|
| Host | Target | Status |
|
||||||
<tr><th>Host</th><th>Target</th><th>Status</th></tr>
|
|-------------|---------------|----------------------|
|
||||||
<tr><td>Windows x64</td><td>Windows arm64</td><td>Experimental</td>
|
| Windows x64 | Windows arm64 | Experimental |
|
||||||
<tr><td>Windows x64</td><td>Windows x86</td><td>Automatically tested</td></tr>
|
| Windows x64 | Windows x86 | Automatically tested |
|
||||||
<tr><td>Linux x64</td><td>Linux x86</td><td>Automatically tested</td></tr>
|
| Linux x64 | Linux x86 | Automatically tested |
|
||||||
</table>
|
|
||||||
|
|
||||||
If you test other combinations and find them to work, please update this document :)
|
If you test other combinations and find them to work, please update this document :)
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ SRV*c:\code\symbols\*https://msdl.microsoft.com/download/symbols;SRV*c:\code\sym
|
|||||||
|
|
||||||
## Using the symbol server in Visual Studio
|
## Using the symbol server in Visual Studio
|
||||||
|
|
||||||
<img src='https://mdn.mozillademos.org/files/733/symbol-server-vc8express-menu.jpg'>
|

|
||||||
<img src='https://mdn.mozillademos.org/files/2497/2005_options.gif'>
|

|
||||||
|
|
||||||
## Troubleshooting: Symbols will not load
|
## Troubleshooting: Symbols will not load
|
||||||
|
|
||||||
|
|||||||
18
docs/fiddles/features/drag-and-drop/index.html
Normal file
18
docs/fiddles/features/drag-and-drop/index.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
<a href="#" id="drag">Drag me</a>
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
41
docs/fiddles/features/drag-and-drop/main.js
Normal file
41
docs/fiddles/features/drag-and-drop/main.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
const { app, BrowserWindow, ipcMain, nativeImage, NativeImage } = require('electron')
|
||||||
|
const fs = require('fs');
|
||||||
|
const http = require('http');
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
const iconName = 'iconForDragAndDrop.png';
|
||||||
|
const icon = fs.createWriteStream(`${process.cwd()}/${iconName}`);
|
||||||
|
http.get('http://img.icons8.com/ios/452/drag-and-drop.png', (response) => {
|
||||||
|
response.pipe(icon);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
ipcMain.on('ondragstart', (event, filePath) => {
|
||||||
|
event.sender.startDrag({
|
||||||
|
file: filePath,
|
||||||
|
icon: `${process.cwd()}/${iconName}`
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
9
docs/fiddles/features/drag-and-drop/renderer.js
Normal file
9
docs/fiddles/features/drag-and-drop/renderer.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
const { ipcRenderer } = require('electron')
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
document.getElementById('drag').ondragstart = (event) => {
|
||||||
|
const fileName = 'drag-and-drop.md'
|
||||||
|
fs.writeFileSync(fileName, '# Test drag and drop');
|
||||||
|
event.preventDefault()
|
||||||
|
ipcRenderer.send('ondragstart', process.cwd() + `/${fileName}`)
|
||||||
|
}
|
||||||
16
docs/fiddles/features/keyboard-shortcuts/global/index.html
Normal file
16
docs/fiddles/features/keyboard-shortcuts/global/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
31
docs/fiddles/features/keyboard-shortcuts/global/main.js
Normal file
31
docs/fiddles/features/keyboard-shortcuts/global/main.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
const { app, BrowserWindow, globalShortcut } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
globalShortcut.register('Alt+CommandOrControl+I', () => {
|
||||||
|
console.log('Electron loves global shortcuts!')
|
||||||
|
})
|
||||||
|
}).then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
const win = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true } })
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
win.webContents.on('before-input-event', (event, input) => {
|
||||||
|
if (input.control && input.key.toLowerCase() === 'i') {
|
||||||
|
console.log('Pressed Control+I')
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
16
docs/fiddles/features/keyboard-shortcuts/local/index.html
Normal file
16
docs/fiddles/features/keyboard-shortcuts/local/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
39
docs/fiddles/features/keyboard-shortcuts/local/main.js
Normal file
39
docs/fiddles/features/keyboard-shortcuts/local/main.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
const { app, BrowserWindow, Menu, MenuItem } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
const menu = new Menu()
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: 'Electron',
|
||||||
|
submenu: [{
|
||||||
|
role: 'help',
|
||||||
|
accelerator: process.platform === 'darwin' ? 'Alt+Cmd+I' : 'Alt+Shift+I',
|
||||||
|
click: () => { console.log('Electron rocks!') }
|
||||||
|
}]
|
||||||
|
}))
|
||||||
|
|
||||||
|
Menu.setApplicationMenu(menu)
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
19
docs/fiddles/features/macos-dark-mode/index.html
Normal file
19
docs/fiddles/features/macos-dark-mode/index.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="./styles.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>Current theme source: <strong id="theme-source">System</strong></p>
|
||||||
|
|
||||||
|
<button id="toggle-dark-mode">Toggle Dark Mode</button>
|
||||||
|
<button id="reset-to-system">Reset to System Theme</button>
|
||||||
|
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
40
docs/fiddles/features/macos-dark-mode/main.js
Normal file
40
docs/fiddles/features/macos-dark-mode/main.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
const { app, BrowserWindow, ipcMain, nativeTheme } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
|
||||||
|
ipcMain.handle('dark-mode:toggle', () => {
|
||||||
|
if (nativeTheme.shouldUseDarkColors) {
|
||||||
|
nativeTheme.themeSource = 'light'
|
||||||
|
} else {
|
||||||
|
nativeTheme.themeSource = 'dark'
|
||||||
|
}
|
||||||
|
return nativeTheme.shouldUseDarkColors
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.handle('dark-mode:system', () => {
|
||||||
|
nativeTheme.themeSouce = 'system'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
11
docs/fiddles/features/macos-dark-mode/renderer.js
Normal file
11
docs/fiddles/features/macos-dark-mode/renderer.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
const { ipcRenderer } = require('electron')
|
||||||
|
|
||||||
|
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
|
||||||
|
const isDarkMode = await ipcRenderer.invoke('dark-mode:toggle')
|
||||||
|
document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'
|
||||||
|
})
|
||||||
|
|
||||||
|
document.getElementById('reset-to-system').addEventListener('click', async () => {
|
||||||
|
await ipcRenderer.invoke('dark-mode:system')
|
||||||
|
document.getElementById('theme-source').innerHTML = 'System'
|
||||||
|
})
|
||||||
7
docs/fiddles/features/macos-dark-mode/styles.css
Normal file
7
docs/fiddles/features/macos-dark-mode/styles.css
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body { background: #333; color: white; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
body { background: #ddd; color: black; }
|
||||||
|
}
|
||||||
16
docs/fiddles/features/macos-dock-menu/index.html
Normal file
16
docs/fiddles/features/macos-dock-menu/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
43
docs/fiddles/features/macos-dock-menu/main.js
Normal file
43
docs/fiddles/features/macos-dock-menu/main.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
const { app, BrowserWindow, Menu } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
const dockMenu = Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: 'New Window',
|
||||||
|
click () { console.log('New Window') }
|
||||||
|
}, {
|
||||||
|
label: 'New Window with Settings',
|
||||||
|
submenu: [
|
||||||
|
{ label: 'Basic' },
|
||||||
|
{ label: 'Pro' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ label: 'New Command...' }
|
||||||
|
])
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
app.dock.setMenu(dockMenu)
|
||||||
|
}).then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
16
docs/fiddles/features/notifications/main/index.html
Normal file
16
docs/fiddles/features/notifications/main/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
35
docs/fiddles/features/notifications/main/main.js
Normal file
35
docs/fiddles/features/notifications/main/main.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const { app, BrowserWindow, Notification } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
function showNotification () {
|
||||||
|
const notification = {
|
||||||
|
title: 'Basic Notification',
|
||||||
|
body: 'Notification from the Main process'
|
||||||
|
}
|
||||||
|
new Notification(notification).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow).then(showNotification)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
17
docs/fiddles/features/notifications/renderer/index.html
Normal file
17
docs/fiddles/features/notifications/renderer/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
27
docs/fiddles/features/notifications/renderer/main.js
Normal file
27
docs/fiddles/features/notifications/renderer/main.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
7
docs/fiddles/features/notifications/renderer/renderer.js
Normal file
7
docs/fiddles/features/notifications/renderer/renderer.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
const myNotification = new Notification('Title', {
|
||||||
|
body: 'Notification from the Renderer process'
|
||||||
|
})
|
||||||
|
|
||||||
|
myNotification.onclick = () => {
|
||||||
|
console.log('Notification clicked')
|
||||||
|
}
|
||||||
15
docs/fiddles/features/offscreen-rendering/index.html
Normal file
15
docs/fiddles/features/offscreen-rendering/index.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
28
docs/fiddles/features/offscreen-rendering/main.js
Normal file
28
docs/fiddles/features/offscreen-rendering/main.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
app.disableHardwareAcceleration()
|
||||||
|
|
||||||
|
let win
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
win = new BrowserWindow({ webPreferences: { offscreen: true } })
|
||||||
|
win.loadURL('https://github.com')
|
||||||
|
win.webContents.on('paint', (event, dirty, image) => {
|
||||||
|
fs.writeFileSync('ex.png', image.toPNG())
|
||||||
|
})
|
||||||
|
win.webContents.setFrameRate(60)
|
||||||
|
console.log(`The screenshot has been successfully saved to ${process.cwd()}/ex.png`)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
17
docs/fiddles/features/online-detection/main/index.html
Normal file
17
docs/fiddles/features/online-detection/main/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
24
docs/fiddles/features/online-detection/main/main.js
Normal file
24
docs/fiddles/features/online-detection/main/main.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
const { app, BrowserWindow, ipcMain } = require('electron')
|
||||||
|
|
||||||
|
let onlineStatusWindow
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false, webPreferences: { nodeIntegration: true } })
|
||||||
|
onlineStatusWindow.loadURL(`file://${__dirname}/index.html`)
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.on('online-status-changed', (event, status) => {
|
||||||
|
console.log(status)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
7
docs/fiddles/features/online-detection/main/renderer.js
Normal file
7
docs/fiddles/features/online-detection/main/renderer.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
const { ipcRenderer } = require('electron')
|
||||||
|
const updateOnlineStatus = () => { ipcRenderer.send('online-status-changed', navigator.onLine ? 'online' : 'offline') }
|
||||||
|
|
||||||
|
window.addEventListener('online', updateOnlineStatus)
|
||||||
|
window.addEventListener('offline', updateOnlineStatus)
|
||||||
|
|
||||||
|
updateOnlineStatus()
|
||||||
17
docs/fiddles/features/online-detection/renderer/index.html
Normal file
17
docs/fiddles/features/online-detection/renderer/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
20
docs/fiddles/features/online-detection/renderer/main.js
Normal file
20
docs/fiddles/features/online-detection/renderer/main.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
let onlineStatusWindow
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
|
||||||
|
onlineStatusWindow.loadURL(`file://${__dirname}/index.html`)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
const alertOnlineStatus = () => { window.alert(navigator.onLine ? 'online' : 'offline') }
|
||||||
|
|
||||||
|
window.addEventListener('online', alertOnlineStatus)
|
||||||
|
window.addEventListener('offline', alertOnlineStatus)
|
||||||
|
|
||||||
|
alertOnlineStatus()
|
||||||
16
docs/fiddles/features/progress-bar/index.html
Normal file
16
docs/fiddles/features/progress-bar/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
30
docs/fiddles/features/progress-bar/main.js
Normal file
30
docs/fiddles/features/progress-bar/main.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
win.setProgressBar(0.5)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
16
docs/fiddles/features/recent-documents/index.html
Normal file
16
docs/fiddles/features/recent-documents/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
34
docs/fiddles/features/recent-documents/main.js
Normal file
34
docs/fiddles/features/recent-documents/main.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
const fileName = 'recently-used.md'
|
||||||
|
fs.writeFile(fileName, 'Lorem Ipsum', () => {
|
||||||
|
app.addRecentDocument(path.join(process.cwd(), `${fileName}`))
|
||||||
|
})
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
app.clearRecentDocuments()
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
16
docs/fiddles/features/represented-file/index.html
Normal file
16
docs/fiddles/features/represented-file/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
33
docs/fiddles/features/represented-file/main.js
Normal file
33
docs/fiddles/features/represented-file/main.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
const os = require('os');
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
const win = new BrowserWindow()
|
||||||
|
|
||||||
|
win.setRepresentedFilename(os.homedir())
|
||||||
|
win.setDocumentEdited(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
16
docs/fiddles/quick-start/index.html
Normal file
16
docs/fiddles/quick-start/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
<p>
|
||||||
|
We are using node <script>document.write(process.versions.node)</script>,
|
||||||
|
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||||
|
and Electron <script>document.write(process.versions.electron)</script>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
27
docs/fiddles/quick-start/main.js
Normal file
27
docs/fiddles/quick-start/main.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
win.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,25 +1,28 @@
|
|||||||
# DevTools Extension
|
# DevTools Extension
|
||||||
|
|
||||||
Electron supports the [Chrome DevTools Extension][devtools-extension], which can
|
Electron supports [Chrome DevTools extensions][devtools-extension], which can
|
||||||
be used to extend the ability of devtools for debugging popular web frameworks.
|
be used to extend the ability of Chrome's developer tools for debugging
|
||||||
|
popular web frameworks.
|
||||||
|
|
||||||
## How to load a DevTools Extension
|
## Loading a DevTools extension with tooling
|
||||||
|
|
||||||
This document outlines the process for manually loading an extension.
|
The easiest way to load a DevTools extension is to use third-party tooling to automate the
|
||||||
You may also try
|
process for you. [electron-devtools-installer][electron-devtools-installer] is a popular
|
||||||
[electron-devtools-installer](https://github.com/GPMDP/electron-devtools-installer),
|
NPM package that does just that.
|
||||||
a third-party tool that downloads extensions directly from the Chrome WebStore.
|
|
||||||
|
|
||||||
To load an extension in Electron, you need to download it in Chrome browser,
|
## Manually loading a DevTools extension
|
||||||
locate its filesystem path, and then load it by calling the
|
|
||||||
`BrowserWindow.addDevToolsExtension(extension)` API.
|
|
||||||
|
|
||||||
Using the [React Developer Tools][react-devtools] as example:
|
If you don't want to use the tooling approach, you can also do all of the necessary
|
||||||
|
operations by hand. To load an extension in Electron, you need to download it via Chrome,
|
||||||
|
locate its filesystem path, and then load it into your [Session][session] by calling the
|
||||||
|
[`ses.loadExtension`] API.
|
||||||
|
|
||||||
1. Install it in Chrome browser.
|
Using the [React Developer Tools][react-devtools] as an example:
|
||||||
|
|
||||||
|
1. Install the extension in Google Chrome.
|
||||||
1. Navigate to `chrome://extensions`, and find its extension ID, which is a hash
|
1. Navigate to `chrome://extensions`, and find its extension ID, which is a hash
|
||||||
string like `fmkadmapgofadopljbjfkapdkoienihi`.
|
string like `fmkadmapgofadopljbjfkapdkoienihi`.
|
||||||
1. Find out filesystem location used by Chrome for storing extensions:
|
1. Find out the filesystem location used by Chrome for storing extensions:
|
||||||
* on Windows it is `%LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions`;
|
* on Windows it is `%LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions`;
|
||||||
* on Linux it could be:
|
* on Linux it could be:
|
||||||
* `~/.config/google-chrome/Default/Extensions/`
|
* `~/.config/google-chrome/Default/Extensions/`
|
||||||
@@ -27,36 +30,48 @@ Using the [React Developer Tools][react-devtools] as example:
|
|||||||
* `~/.config/google-chrome-canary/Default/Extensions/`
|
* `~/.config/google-chrome-canary/Default/Extensions/`
|
||||||
* `~/.config/chromium/Default/Extensions/`
|
* `~/.config/chromium/Default/Extensions/`
|
||||||
* on macOS it is `~/Library/Application Support/Google/Chrome/Default/Extensions`.
|
* on macOS it is `~/Library/Application Support/Google/Chrome/Default/Extensions`.
|
||||||
1. Pass the location of the extension to `BrowserWindow.addDevToolsExtension`
|
1. Pass the location of the extension to the [`ses.loadExtension`][load-extension]
|
||||||
API, for the React Developer Tools, it is something like:
|
API. For React Developer Tools `v4.9.0`, it looks something like:
|
||||||
```javascript
|
```javascript
|
||||||
const path = require('path')
|
const { app, session } = require('electron')
|
||||||
const os = require('os')
|
const path = require('path')
|
||||||
|
const os = require('os')
|
||||||
|
|
||||||
BrowserWindow.addDevToolsExtension(
|
// on macOS
|
||||||
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.3.0_0')
|
const reactDevToolsPath = path.join(
|
||||||
)
|
os.homedir(),
|
||||||
|
'/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.9.0_0'
|
||||||
|
)
|
||||||
|
|
||||||
|
app.whenReady().then(async () => {
|
||||||
|
await session.defaultSession.loadExtension(reactDevToolsPath)
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** The `BrowserWindow.addDevToolsExtension` API cannot be called before the
|
**Notes:**
|
||||||
ready event of the app module is emitted.
|
|
||||||
|
|
||||||
The extension will be remembered so you only need to call this API once per
|
* `loadExtension` returns a Promise with an [Extension object][extension-structure],
|
||||||
extension. If you try to add an extension that has already been loaded, this method
|
which contains metadata about the extension that was loaded. This promise needs to
|
||||||
will not return and instead log a warning to the console.
|
resolve (e.g. with an `await` expression) before loading a page. Otherwise, the
|
||||||
|
extension won't be guaranteed to load.
|
||||||
|
* `loadExtension` cannot be called before the `ready` event of the `app` module
|
||||||
|
is emitted, nor can it be called on in-memory (non-persistent) sessions.
|
||||||
|
* `loadExtension` must be called on every boot of your app if you want the
|
||||||
|
extension to be loaded.
|
||||||
|
|
||||||
### How to remove a DevTools Extension
|
### Removing a DevTools extension
|
||||||
|
|
||||||
You can pass the name of the extension to the `BrowserWindow.removeDevToolsExtension`
|
You can pass the extension's ID to the [`ses.removeExtension`][remove-extension] API to
|
||||||
API to remove it. The name of the extension is returned by
|
remove it from your Session. Loaded extensions are not persisted between
|
||||||
`BrowserWindow.addDevToolsExtension` and you can get the names of all installed
|
app launches.
|
||||||
DevTools Extensions using the `BrowserWindow.getDevToolsExtensions` API.
|
|
||||||
|
|
||||||
## Supported DevTools Extensions
|
## DevTools extension support
|
||||||
|
|
||||||
Electron only supports a limited set of `chrome.*` APIs, so some extensions
|
Electron only supports
|
||||||
using unsupported `chrome.*` APIs for chrome extension features may not work.
|
[a limited set of `chrome.*` APIs][supported-extension-apis],
|
||||||
Following Devtools Extensions are tested and guaranteed to work in Electron:
|
so extensions using unsupported `chrome.*` APIs under the hood may not work.
|
||||||
|
|
||||||
|
The following Devtools extensions have been tested to work in Electron:
|
||||||
|
|
||||||
* [Ember Inspector](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
|
* [Ember Inspector](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
|
||||||
* [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi)
|
* [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi)
|
||||||
@@ -68,14 +83,22 @@ Following Devtools Extensions are tested and guaranteed to work in Electron:
|
|||||||
* [Redux DevTools Extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd)
|
* [Redux DevTools Extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd)
|
||||||
* [MobX Developer Tools](https://chrome.google.com/webstore/detail/mobx-developer-tools/pfgnfdagidkfgccljigdamigbcnndkod)
|
* [MobX Developer Tools](https://chrome.google.com/webstore/detail/mobx-developer-tools/pfgnfdagidkfgccljigdamigbcnndkod)
|
||||||
|
|
||||||
### What should I do if a DevTools Extension is not working?
|
### What should I do if a DevTools extension is not working?
|
||||||
|
|
||||||
First please make sure the extension is still being maintained, some extensions
|
First, please make sure the extension is still being maintained and is compatible
|
||||||
can not even work for recent versions of Chrome browser, and we are not able to
|
with the latest version of Google Chrome. We cannot provide additional support for
|
||||||
do anything for them.
|
unsupported extensions.
|
||||||
|
|
||||||
Then file a bug at Electron's issues list, and describe which part of the
|
If the extension works on Chrome but not on Electron, file a bug in Electron's
|
||||||
extension is not working as expected.
|
[issue tracker][issue-tracker] and describe which part
|
||||||
|
of the extension is not working as expected.
|
||||||
|
|
||||||
[devtools-extension]: https://developer.chrome.com/extensions/devtools
|
[devtools-extension]: https://developer.chrome.com/extensions/devtools
|
||||||
|
[session]: ../api/session.md
|
||||||
[react-devtools]: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
|
[react-devtools]: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
|
||||||
|
[load-extension]: ../api/session.md#sesloadextensionpath
|
||||||
|
[extension-structure]: ../api/structures/extension.md
|
||||||
|
[remove-extension]: ../api/session.md#sesremoveextensionextensionid
|
||||||
|
[electron-devtools-installer]: https://github.com/MarshallOfSound/electron-devtools-installer
|
||||||
|
[supported-extension-apis]: ../api/extensions.md
|
||||||
|
[issue-tracker]: https://github.com/electron/electron/issues
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Two modes of rendering can be used and only the dirty area is passed in the
|
|||||||
`'paint'` event to be more efficient. The rendering can be stopped, continued
|
`'paint'` event to be more efficient. The rendering can be stopped, continued
|
||||||
and the frame rate can be set. The specified frame rate is a top limit value,
|
and the frame rate can be set. The specified frame rate is a top limit value,
|
||||||
when there is nothing happening on a webpage, no frames are generated. The
|
when there is nothing happening on a webpage, no frames are generated. The
|
||||||
maximum frame rate is 60, because above that there is no benefit, only
|
maximum frame rate is 240, because above that there is no benefit, only
|
||||||
performance loss.
|
performance loss.
|
||||||
|
|
||||||
**Note:** An offscreen window is always created as a [Frameless Window](../api/frameless-window.md).
|
**Note:** An offscreen window is always created as a [Frameless Window](../api/frameless-window.md).
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ and then enable it in your application.
|
|||||||
## Prepare a Copy of Flash Plugin
|
## Prepare a Copy of Flash Plugin
|
||||||
|
|
||||||
On macOS and Linux, the details of the Pepper Flash plugin can be found by
|
On macOS and Linux, the details of the Pepper Flash plugin can be found by
|
||||||
navigating to `chrome://flash` in the Chrome browser. Its location and version
|
navigating to `chrome://version` in the Chrome browser. Its location and version
|
||||||
are useful for Electron's Pepper Flash support. You can also copy it to another
|
are useful for Electron's Pepper Flash support. You can also copy it to another
|
||||||
location.
|
location.
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ template("electron_extra_paks") {
|
|||||||
output = "${invoker.output_dir}/resources.pak"
|
output = "${invoker.output_dir}/resources.pak"
|
||||||
sources = [
|
sources = [
|
||||||
"$root_gen_dir/chrome/dev_ui_browser_resources.pak",
|
"$root_gen_dir/chrome/dev_ui_browser_resources.pak",
|
||||||
"$root_gen_dir/chrome/print_preview_pdf_resources.pak",
|
|
||||||
"$root_gen_dir/components/components_resources.pak",
|
"$root_gen_dir/components/components_resources.pak",
|
||||||
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
||||||
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
||||||
@@ -71,7 +70,6 @@ template("electron_extra_paks") {
|
|||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
"//chrome/browser:dev_ui_browser_resources",
|
"//chrome/browser:dev_ui_browser_resources",
|
||||||
"//chrome/browser/resources:print_preview_pdf_resources",
|
|
||||||
"//components/resources",
|
"//components/resources",
|
||||||
"//content:content_resources",
|
"//content:content_resources",
|
||||||
"//content:dev_ui_content_resources",
|
"//content:dev_ui_content_resources",
|
||||||
@@ -96,6 +94,10 @@ template("electron_extra_paks") {
|
|||||||
sources +=
|
sources +=
|
||||||
[ "$root_gen_dir/content/browser/devtools/devtools_resources.pak" ]
|
[ "$root_gen_dir/content/browser/devtools/devtools_resources.pak" ]
|
||||||
deps += [ "//content/browser/devtools:devtools_resources" ]
|
deps += [ "//content/browser/devtools:devtools_resources" ]
|
||||||
|
if (enable_pdf_viewer) {
|
||||||
|
sources += [ "$root_gen_dir/chrome/print_preview_pdf_resources.pak" ]
|
||||||
|
deps += [ "//chrome/browser/resources:print_preview_pdf_resources" ]
|
||||||
|
}
|
||||||
if (enable_print_preview) {
|
if (enable_print_preview) {
|
||||||
sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ]
|
sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ]
|
||||||
deps += [ "//chrome/browser/resources:print_preview_resources" ]
|
deps += [ "//chrome/browser/resources:print_preview_resources" ]
|
||||||
|
|||||||
@@ -80,4 +80,8 @@
|
|||||||
Windows Utilities
|
Windows Utilities
|
||||||
</message>
|
</message>
|
||||||
</if>
|
</if>
|
||||||
|
<message name="IDS_DOWNLOAD_MORE_ACTIONS"
|
||||||
|
desc="Tooltip of a button on the downloads page that shows a menu with actions like 'Open downloads folder' or 'Clear all'">
|
||||||
|
More actions
|
||||||
|
</message>
|
||||||
</grit-part>
|
</grit-part>
|
||||||
|
|||||||
@@ -119,8 +119,6 @@ auto_filenames = {
|
|||||||
"docs/api/structures/shared-worker-info.md",
|
"docs/api/structures/shared-worker-info.md",
|
||||||
"docs/api/structures/shortcut-details.md",
|
"docs/api/structures/shortcut-details.md",
|
||||||
"docs/api/structures/size.md",
|
"docs/api/structures/size.md",
|
||||||
"docs/api/structures/stream-protocol-response.md",
|
|
||||||
"docs/api/structures/string-protocol-response.md",
|
|
||||||
"docs/api/structures/task.md",
|
"docs/api/structures/task.md",
|
||||||
"docs/api/structures/thumbar-button.md",
|
"docs/api/structures/thumbar-button.md",
|
||||||
"docs/api/structures/trace-categories-and-options.md",
|
"docs/api/structures/trace-categories-and-options.md",
|
||||||
|
|||||||
406
filenames.gni
406
filenames.gni
@@ -21,12 +21,215 @@ filenames = {
|
|||||||
"node_modules/@primer/octicons/build/svg/star-fill-24.svg",
|
"node_modules/@primer/octicons/build/svg/star-fill-24.svg",
|
||||||
]
|
]
|
||||||
|
|
||||||
lib_sources = [
|
lib_sources_linux = [
|
||||||
"chromium_src/chrome/browser/process_singleton.h",
|
|
||||||
"chromium_src/chrome/browser/process_singleton_posix.cc",
|
|
||||||
"chromium_src/chrome/browser/process_singleton_win.cc",
|
|
||||||
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc",
|
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc",
|
||||||
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h",
|
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h",
|
||||||
|
"shell/browser/ui/file_dialog_gtk.cc",
|
||||||
|
"shell/browser/ui/message_box_gtk.cc",
|
||||||
|
"shell/browser/ui/tray_icon_gtk.cc",
|
||||||
|
"shell/browser/ui/tray_icon_gtk.h",
|
||||||
|
"shell/browser/ui/views/global_menu_bar_x11.cc",
|
||||||
|
"shell/browser/ui/views/global_menu_bar_x11.h",
|
||||||
|
"shell/browser/ui/x/event_disabler.cc",
|
||||||
|
"shell/browser/ui/x/event_disabler.h",
|
||||||
|
"shell/browser/ui/x/window_state_watcher.cc",
|
||||||
|
"shell/browser/ui/x/window_state_watcher.h",
|
||||||
|
"shell/browser/ui/x/x_window_utils.cc",
|
||||||
|
"shell/browser/ui/x/x_window_utils.h",
|
||||||
|
"shell/browser/browser_linux.cc",
|
||||||
|
"shell/browser/lib/power_observer_linux.cc",
|
||||||
|
"shell/browser/lib/power_observer_linux.h",
|
||||||
|
"shell/browser/notifications/linux/notification_presenter_linux.cc",
|
||||||
|
"shell/browser/notifications/linux/notification_presenter_linux.h",
|
||||||
|
"shell/browser/relauncher_linux.cc",
|
||||||
|
"shell/common/application_info_linux.cc",
|
||||||
|
"shell/common/language_util_linux.cc",
|
||||||
|
"shell/common/node_bindings_linux.cc",
|
||||||
|
"shell/common/node_bindings_linux.h",
|
||||||
|
"shell/common/platform_util_linux.cc",
|
||||||
|
"shell/browser/linux/unity_service.h",
|
||||||
|
"shell/browser/notifications/linux/libnotify_notification.cc",
|
||||||
|
"shell/browser/notifications/linux/libnotify_notification.h",
|
||||||
|
"shell/browser/linux/unity_service.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
lib_sources_posix = [
|
||||||
|
"chromium_src/chrome/browser/process_singleton_posix.cc",
|
||||||
|
"shell/browser/electron_browser_main_parts_posix.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
lib_sources_win = [
|
||||||
|
"chromium_src/chrome/browser/process_singleton_win.cc",
|
||||||
|
"shell/browser/api/electron_api_power_monitor_win.cc",
|
||||||
|
"shell/browser/api/electron_api_system_preferences_win.cc",
|
||||||
|
"shell/browser/browser_win.cc",
|
||||||
|
"shell/browser/native_window_views_win.cc",
|
||||||
|
"shell/browser/notifications/win/notification_presenter_win.cc",
|
||||||
|
"shell/browser/notifications/win/notification_presenter_win.h",
|
||||||
|
"shell/browser/notifications/win/notification_presenter_win7.cc",
|
||||||
|
"shell/browser/notifications/win/notification_presenter_win7.h",
|
||||||
|
"shell/browser/relauncher_win.cc",
|
||||||
|
"shell/browser/ui/certificate_trust_win.cc",
|
||||||
|
"shell/browser/ui/file_dialog_win.cc",
|
||||||
|
"shell/browser/ui/message_box_win.cc",
|
||||||
|
"shell/browser/ui/tray_icon_win.cc",
|
||||||
|
"shell/browser/ui/views/electron_views_delegate_win.cc",
|
||||||
|
"shell/browser/ui/views/win_frame_view.cc",
|
||||||
|
"shell/browser/ui/views/win_frame_view.h",
|
||||||
|
"shell/browser/ui/win/electron_desktop_window_tree_host_win.cc",
|
||||||
|
"shell/browser/ui/win/electron_desktop_window_tree_host_win.h",
|
||||||
|
"shell/common/api/electron_api_native_image_win.cc",
|
||||||
|
"shell/common/application_info_win.cc",
|
||||||
|
"shell/common/language_util_win.cc",
|
||||||
|
"shell/common/node_bindings_win.cc",
|
||||||
|
"shell/common/node_bindings_win.h",
|
||||||
|
"shell/common/platform_util_win.cc",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/common.h",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/toast.cc",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/toast.h",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc",
|
||||||
|
"shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h",
|
||||||
|
"shell/browser/notifications/win/win32_notification.cc",
|
||||||
|
"shell/browser/notifications/win/win32_notification.h",
|
||||||
|
"shell/browser/notifications/win/windows_toast_notification.cc",
|
||||||
|
"shell/browser/notifications/win/windows_toast_notification.h",
|
||||||
|
"shell/browser/ui/win/dialog_thread.cc",
|
||||||
|
"shell/browser/ui/win/dialog_thread.h",
|
||||||
|
"shell/browser/ui/win/electron_desktop_native_widget_aura.cc",
|
||||||
|
"shell/browser/ui/win/electron_desktop_native_widget_aura.h",
|
||||||
|
"shell/browser/ui/win/jump_list.cc",
|
||||||
|
"shell/browser/ui/win/jump_list.h",
|
||||||
|
"shell/browser/ui/win/notify_icon.cc",
|
||||||
|
"shell/browser/ui/win/notify_icon.h",
|
||||||
|
"shell/browser/ui/win/notify_icon_host.cc",
|
||||||
|
"shell/browser/ui/win/notify_icon_host.h",
|
||||||
|
"shell/browser/ui/win/taskbar_host.cc",
|
||||||
|
"shell/browser/ui/win/taskbar_host.h",
|
||||||
|
"shell/browser/win/scoped_hstring.cc",
|
||||||
|
"shell/browser/win/scoped_hstring.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
lib_sources_mac = [
|
||||||
|
"shell/app/electron_main_delegate_mac.h",
|
||||||
|
"shell/app/electron_main_delegate_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_app_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_browser_window_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_menu_mac.h",
|
||||||
|
"shell/browser/api/electron_api_menu_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_native_theme_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_power_monitor_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_system_preferences_mac.mm",
|
||||||
|
"shell/browser/api/electron_api_web_contents_mac.mm",
|
||||||
|
"shell/browser/auto_updater_mac.mm",
|
||||||
|
"shell/browser/browser_mac.mm",
|
||||||
|
"shell/browser/notifications/mac/notification_center_delegate.h",
|
||||||
|
"shell/browser/notifications/mac/notification_center_delegate.mm",
|
||||||
|
"shell/common/mac/main_application_bundle.h",
|
||||||
|
"shell/common/mac/main_application_bundle.mm",
|
||||||
|
"shell/browser/common_web_contents_delegate_mac.mm",
|
||||||
|
"shell/browser/electron_browser_main_parts_mac.mm",
|
||||||
|
"shell/browser/native_browser_view_mac.h",
|
||||||
|
"shell/browser/native_browser_view_mac.mm",
|
||||||
|
"shell/browser/native_window_mac.h",
|
||||||
|
"shell/browser/native_window_mac.mm",
|
||||||
|
"shell/browser/notifications/mac/notification_presenter_mac.h",
|
||||||
|
"shell/browser/notifications/mac/notification_presenter_mac.mm",
|
||||||
|
"shell/browser/relauncher_mac.cc",
|
||||||
|
"shell/browser/ui/certificate_trust_mac.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_native_widget_mac.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_native_widget_mac.mm",
|
||||||
|
"shell/browser/ui/cocoa/root_view_mac.h",
|
||||||
|
"shell/browser/ui/cocoa/root_view_mac.mm",
|
||||||
|
"shell/browser/ui/cocoa/views_delegate_mac.h",
|
||||||
|
"shell/browser/ui/cocoa/views_delegate_mac.mm",
|
||||||
|
"shell/browser/ui/drag_util_mac.mm",
|
||||||
|
"shell/browser/ui/file_dialog_mac.mm",
|
||||||
|
"shell/browser/ui/inspectable_web_contents_view_mac.h",
|
||||||
|
"shell/browser/ui/inspectable_web_contents_view_mac.mm",
|
||||||
|
"shell/browser/ui/message_box_mac.mm",
|
||||||
|
"shell/common/api/electron_api_clipboard_mac.mm",
|
||||||
|
"shell/common/api/electron_api_native_image_mac.mm",
|
||||||
|
"shell/common/application_info_mac.mm",
|
||||||
|
"shell/common/language_util_mac.mm",
|
||||||
|
"shell/common/node_bindings_mac.cc",
|
||||||
|
"shell/common/node_bindings_mac.h",
|
||||||
|
"shell/common/platform_util_mac.mm",
|
||||||
|
"shell/browser/notifications/mac/cocoa_notification.h",
|
||||||
|
"shell/browser/notifications/mac/cocoa_notification.mm",
|
||||||
|
"shell/browser/ui/cocoa/NSColor+Hex.h",
|
||||||
|
"shell/browser/ui/cocoa/NSColor+Hex.mm",
|
||||||
|
"shell/browser/ui/cocoa/NSString+ANSI.h",
|
||||||
|
"shell/browser/ui/cocoa/NSString+ANSI.mm",
|
||||||
|
"shell/browser/ui/cocoa/delayed_native_view_host.cc",
|
||||||
|
"shell/browser/ui/cocoa/delayed_native_view_host.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_bundle_mover.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_bundle_mover.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_menu_controller.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_menu_controller.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_ns_window.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_ns_window.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_ns_window_delegate.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_ns_window_delegate.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_preview_item.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_preview_item.mm",
|
||||||
|
"shell/browser/ui/cocoa/electron_touch_bar.h",
|
||||||
|
"shell/browser/ui/cocoa/electron_touch_bar.mm",
|
||||||
|
"shell/browser/ui/cocoa/event_dispatching_window.h",
|
||||||
|
"shell/browser/ui/cocoa/event_dispatching_window.mm",
|
||||||
|
"shell/browser/ui/tray_icon_cocoa.h",
|
||||||
|
"shell/browser/ui/tray_icon_cocoa.mm",
|
||||||
|
"shell/browser/mac/dict_util.h",
|
||||||
|
"shell/browser/mac/dict_util.mm",
|
||||||
|
"shell/browser/mac/electron_application.h",
|
||||||
|
"shell/browser/mac/electron_application.mm",
|
||||||
|
"shell/browser/mac/electron_application_delegate.h",
|
||||||
|
"shell/browser/mac/electron_application_delegate.mm",
|
||||||
|
"shell/browser/mac/in_app_purchase.h",
|
||||||
|
"shell/browser/mac/in_app_purchase.mm",
|
||||||
|
"shell/browser/mac/in_app_purchase_observer.h",
|
||||||
|
"shell/browser/mac/in_app_purchase_observer.mm",
|
||||||
|
"shell/browser/mac/in_app_purchase_product.h",
|
||||||
|
"shell/browser/mac/in_app_purchase_product.mm",
|
||||||
|
]
|
||||||
|
|
||||||
|
lib_sources_views = [
|
||||||
|
"shell/browser/api/electron_api_browser_window_views.cc",
|
||||||
|
"shell/browser/api/electron_api_menu_views.cc",
|
||||||
|
"shell/browser/api/electron_api_menu_views.h",
|
||||||
|
"shell/browser/common_web_contents_delegate_views.cc",
|
||||||
|
"shell/browser/native_browser_view_views.cc",
|
||||||
|
"shell/browser/native_browser_view_views.h",
|
||||||
|
"shell/browser/native_window_views.cc",
|
||||||
|
"shell/browser/native_window_views.h",
|
||||||
|
"shell/browser/ui/drag_util_views.cc",
|
||||||
|
"shell/browser/ui/views/inspectable_web_contents_view_views.cc",
|
||||||
|
"shell/browser/ui/views/inspectable_web_contents_view_views.h",
|
||||||
|
"shell/browser/ui/views/autofill_popup_view.cc",
|
||||||
|
"shell/browser/ui/views/autofill_popup_view.h",
|
||||||
|
"shell/browser/ui/views/electron_views_delegate.cc",
|
||||||
|
"shell/browser/ui/views/electron_views_delegate.h",
|
||||||
|
"shell/browser/ui/views/frameless_view.cc",
|
||||||
|
"shell/browser/ui/views/frameless_view.h",
|
||||||
|
"shell/browser/ui/views/menu_bar.cc",
|
||||||
|
"shell/browser/ui/views/menu_bar.h",
|
||||||
|
"shell/browser/ui/views/menu_delegate.cc",
|
||||||
|
"shell/browser/ui/views/menu_delegate.h",
|
||||||
|
"shell/browser/ui/views/menu_model_adapter.cc",
|
||||||
|
"shell/browser/ui/views/menu_model_adapter.h",
|
||||||
|
"shell/browser/ui/views/native_frame_view.cc",
|
||||||
|
"shell/browser/ui/views/native_frame_view.h",
|
||||||
|
"shell/browser/ui/views/root_view.cc",
|
||||||
|
"shell/browser/ui/views/root_view.h",
|
||||||
|
"shell/browser/ui/views/submenu_button.cc",
|
||||||
|
"shell/browser/ui/views/submenu_button.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
lib_sources = [
|
||||||
|
"chromium_src/chrome/browser/process_singleton.h",
|
||||||
"shell/app/command_line_args.cc",
|
"shell/app/command_line_args.cc",
|
||||||
"shell/app/command_line_args.h",
|
"shell/app/command_line_args.h",
|
||||||
"shell/app/electron_content_client.cc",
|
"shell/app/electron_content_client.cc",
|
||||||
@@ -35,13 +238,10 @@ filenames = {
|
|||||||
"shell/app/electron_crash_reporter_client.h",
|
"shell/app/electron_crash_reporter_client.h",
|
||||||
"shell/app/electron_main_delegate.cc",
|
"shell/app/electron_main_delegate.cc",
|
||||||
"shell/app/electron_main_delegate.h",
|
"shell/app/electron_main_delegate.h",
|
||||||
"shell/app/electron_main_delegate_mac.h",
|
|
||||||
"shell/app/electron_main_delegate_mac.mm",
|
|
||||||
"shell/app/uv_task_runner.cc",
|
"shell/app/uv_task_runner.cc",
|
||||||
"shell/app/uv_task_runner.h",
|
"shell/app/uv_task_runner.h",
|
||||||
"shell/browser/api/electron_api_app.cc",
|
"shell/browser/api/electron_api_app.cc",
|
||||||
"shell/browser/api/electron_api_app.h",
|
"shell/browser/api/electron_api_app.h",
|
||||||
"shell/browser/api/electron_api_app_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_auto_updater.cc",
|
"shell/browser/api/electron_api_auto_updater.cc",
|
||||||
"shell/browser/api/electron_api_auto_updater.h",
|
"shell/browser/api/electron_api_auto_updater.h",
|
||||||
"shell/browser/api/electron_api_base_window.cc",
|
"shell/browser/api/electron_api_base_window.cc",
|
||||||
@@ -50,8 +250,6 @@ filenames = {
|
|||||||
"shell/browser/api/electron_api_browser_view.h",
|
"shell/browser/api/electron_api_browser_view.h",
|
||||||
"shell/browser/api/electron_api_browser_window.cc",
|
"shell/browser/api/electron_api_browser_window.cc",
|
||||||
"shell/browser/api/electron_api_browser_window.h",
|
"shell/browser/api/electron_api_browser_window.h",
|
||||||
"shell/browser/api/electron_api_browser_window_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_browser_window_views.cc",
|
|
||||||
"shell/browser/api/electron_api_content_tracing.cc",
|
"shell/browser/api/electron_api_content_tracing.cc",
|
||||||
"shell/browser/api/electron_api_cookies.cc",
|
"shell/browser/api/electron_api_cookies.cc",
|
||||||
"shell/browser/api/electron_api_cookies.h",
|
"shell/browser/api/electron_api_cookies.h",
|
||||||
@@ -73,13 +271,8 @@ filenames = {
|
|||||||
"shell/browser/api/electron_api_in_app_purchase.h",
|
"shell/browser/api/electron_api_in_app_purchase.h",
|
||||||
"shell/browser/api/electron_api_menu.cc",
|
"shell/browser/api/electron_api_menu.cc",
|
||||||
"shell/browser/api/electron_api_menu.h",
|
"shell/browser/api/electron_api_menu.h",
|
||||||
"shell/browser/api/electron_api_menu_mac.h",
|
|
||||||
"shell/browser/api/electron_api_menu_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_menu_views.cc",
|
|
||||||
"shell/browser/api/electron_api_menu_views.h",
|
|
||||||
"shell/browser/api/electron_api_native_theme.cc",
|
"shell/browser/api/electron_api_native_theme.cc",
|
||||||
"shell/browser/api/electron_api_native_theme.h",
|
"shell/browser/api/electron_api_native_theme.h",
|
||||||
"shell/browser/api/electron_api_native_theme_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_net.cc",
|
"shell/browser/api/electron_api_net.cc",
|
||||||
"shell/browser/api/electron_api_net_log.cc",
|
"shell/browser/api/electron_api_net_log.cc",
|
||||||
"shell/browser/api/electron_api_net_log.h",
|
"shell/browser/api/electron_api_net_log.h",
|
||||||
@@ -87,8 +280,6 @@ filenames = {
|
|||||||
"shell/browser/api/electron_api_notification.h",
|
"shell/browser/api/electron_api_notification.h",
|
||||||
"shell/browser/api/electron_api_power_monitor.cc",
|
"shell/browser/api/electron_api_power_monitor.cc",
|
||||||
"shell/browser/api/electron_api_power_monitor.h",
|
"shell/browser/api/electron_api_power_monitor.h",
|
||||||
"shell/browser/api/electron_api_power_monitor_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_power_monitor_win.cc",
|
|
||||||
"shell/browser/api/electron_api_power_save_blocker.cc",
|
"shell/browser/api/electron_api_power_save_blocker.cc",
|
||||||
"shell/browser/api/electron_api_power_save_blocker.h",
|
"shell/browser/api/electron_api_power_save_blocker.h",
|
||||||
"shell/browser/api/electron_api_protocol.cc",
|
"shell/browser/api/electron_api_protocol.cc",
|
||||||
@@ -101,8 +292,6 @@ filenames = {
|
|||||||
"shell/browser/api/electron_api_session.h",
|
"shell/browser/api/electron_api_session.h",
|
||||||
"shell/browser/api/electron_api_system_preferences.cc",
|
"shell/browser/api/electron_api_system_preferences.cc",
|
||||||
"shell/browser/api/electron_api_system_preferences.h",
|
"shell/browser/api/electron_api_system_preferences.h",
|
||||||
"shell/browser/api/electron_api_system_preferences_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_system_preferences_win.cc",
|
|
||||||
"shell/browser/api/electron_api_tray.cc",
|
"shell/browser/api/electron_api_tray.cc",
|
||||||
"shell/browser/api/electron_api_tray.h",
|
"shell/browser/api/electron_api_tray.h",
|
||||||
"shell/browser/api/electron_api_url_loader.cc",
|
"shell/browser/api/electron_api_url_loader.cc",
|
||||||
@@ -112,7 +301,6 @@ filenames = {
|
|||||||
"shell/browser/api/electron_api_web_contents.cc",
|
"shell/browser/api/electron_api_web_contents.cc",
|
||||||
"shell/browser/api/electron_api_web_contents.h",
|
"shell/browser/api/electron_api_web_contents.h",
|
||||||
"shell/browser/api/electron_api_web_contents_impl.cc",
|
"shell/browser/api/electron_api_web_contents_impl.cc",
|
||||||
"shell/browser/api/electron_api_web_contents_mac.mm",
|
|
||||||
"shell/browser/api/electron_api_web_contents_view.cc",
|
"shell/browser/api/electron_api_web_contents_view.cc",
|
||||||
"shell/browser/api/electron_api_web_contents_view.h",
|
"shell/browser/api/electron_api_web_contents_view.h",
|
||||||
"shell/browser/api/electron_api_web_request.cc",
|
"shell/browser/api/electron_api_web_request.cc",
|
||||||
@@ -136,21 +324,15 @@ filenames = {
|
|||||||
"shell/browser/api/ui_event.h",
|
"shell/browser/api/ui_event.h",
|
||||||
"shell/browser/auto_updater.cc",
|
"shell/browser/auto_updater.cc",
|
||||||
"shell/browser/auto_updater.h",
|
"shell/browser/auto_updater.h",
|
||||||
"shell/browser/auto_updater_mac.mm",
|
|
||||||
"shell/browser/browser.cc",
|
"shell/browser/browser.cc",
|
||||||
"shell/browser/browser.h",
|
"shell/browser/browser.h",
|
||||||
"shell/browser/browser_linux.cc",
|
|
||||||
"shell/browser/browser_mac.mm",
|
|
||||||
"shell/browser/browser_observer.h",
|
"shell/browser/browser_observer.h",
|
||||||
"shell/browser/browser_process_impl.cc",
|
"shell/browser/browser_process_impl.cc",
|
||||||
"shell/browser/browser_process_impl.h",
|
"shell/browser/browser_process_impl.h",
|
||||||
"shell/browser/browser_win.cc",
|
|
||||||
"shell/browser/child_web_contents_tracker.cc",
|
"shell/browser/child_web_contents_tracker.cc",
|
||||||
"shell/browser/child_web_contents_tracker.h",
|
"shell/browser/child_web_contents_tracker.h",
|
||||||
"shell/browser/common_web_contents_delegate.cc",
|
"shell/browser/common_web_contents_delegate.cc",
|
||||||
"shell/browser/common_web_contents_delegate.h",
|
"shell/browser/common_web_contents_delegate.h",
|
||||||
"shell/browser/common_web_contents_delegate_mac.mm",
|
|
||||||
"shell/browser/common_web_contents_delegate_views.cc",
|
|
||||||
"shell/browser/cookie_change_notifier.cc",
|
"shell/browser/cookie_change_notifier.cc",
|
||||||
"shell/browser/cookie_change_notifier.h",
|
"shell/browser/cookie_change_notifier.h",
|
||||||
"shell/browser/electron_autofill_driver.cc",
|
"shell/browser/electron_autofill_driver.cc",
|
||||||
@@ -163,8 +345,6 @@ filenames = {
|
|||||||
"shell/browser/electron_browser_context.h",
|
"shell/browser/electron_browser_context.h",
|
||||||
"shell/browser/electron_browser_main_parts.cc",
|
"shell/browser/electron_browser_main_parts.cc",
|
||||||
"shell/browser/electron_browser_main_parts.h",
|
"shell/browser/electron_browser_main_parts.h",
|
||||||
"shell/browser/electron_browser_main_parts_mac.mm",
|
|
||||||
"shell/browser/electron_browser_main_parts_posix.cc",
|
|
||||||
"shell/browser/electron_download_manager_delegate.cc",
|
"shell/browser/electron_download_manager_delegate.cc",
|
||||||
"shell/browser/electron_download_manager_delegate.h",
|
"shell/browser/electron_download_manager_delegate.h",
|
||||||
"shell/browser/electron_gpu_client.cc",
|
"shell/browser/electron_gpu_client.cc",
|
||||||
@@ -183,32 +363,20 @@ filenames = {
|
|||||||
"shell/browser/electron_web_ui_controller_factory.h",
|
"shell/browser/electron_web_ui_controller_factory.h",
|
||||||
"shell/browser/event_emitter_mixin.cc",
|
"shell/browser/event_emitter_mixin.cc",
|
||||||
"shell/browser/event_emitter_mixin.h",
|
"shell/browser/event_emitter_mixin.h",
|
||||||
|
"shell/browser/extended_web_contents_observer.h",
|
||||||
"shell/browser/feature_list.cc",
|
"shell/browser/feature_list.cc",
|
||||||
"shell/browser/feature_list.h",
|
"shell/browser/feature_list.h",
|
||||||
|
"shell/browser/file_select_helper.cc",
|
||||||
|
"shell/browser/file_select_helper.h",
|
||||||
|
"shell/browser/file_select_helper_mac.mm",
|
||||||
"shell/browser/font_defaults.cc",
|
"shell/browser/font_defaults.cc",
|
||||||
"shell/browser/font_defaults.h",
|
"shell/browser/font_defaults.h",
|
||||||
"shell/browser/javascript_environment.cc",
|
"shell/browser/javascript_environment.cc",
|
||||||
"shell/browser/javascript_environment.h",
|
"shell/browser/javascript_environment.h",
|
||||||
"shell/browser/lib/bluetooth_chooser.cc",
|
"shell/browser/lib/bluetooth_chooser.cc",
|
||||||
"shell/browser/lib/bluetooth_chooser.h",
|
"shell/browser/lib/bluetooth_chooser.h",
|
||||||
"shell/browser/lib/power_observer_linux.cc",
|
|
||||||
"shell/browser/lib/power_observer_linux.h",
|
|
||||||
"shell/browser/linux/unity_service.cc",
|
|
||||||
"shell/browser/linux/unity_service.h",
|
|
||||||
"shell/browser/login_handler.cc",
|
"shell/browser/login_handler.cc",
|
||||||
"shell/browser/login_handler.h",
|
"shell/browser/login_handler.h",
|
||||||
"shell/browser/mac/dict_util.h",
|
|
||||||
"shell/browser/mac/dict_util.mm",
|
|
||||||
"shell/browser/mac/electron_application.h",
|
|
||||||
"shell/browser/mac/electron_application.mm",
|
|
||||||
"shell/browser/mac/electron_application_delegate.h",
|
|
||||||
"shell/browser/mac/electron_application_delegate.mm",
|
|
||||||
"shell/browser/mac/in_app_purchase.h",
|
|
||||||
"shell/browser/mac/in_app_purchase.mm",
|
|
||||||
"shell/browser/mac/in_app_purchase_observer.h",
|
|
||||||
"shell/browser/mac/in_app_purchase_observer.mm",
|
|
||||||
"shell/browser/mac/in_app_purchase_product.h",
|
|
||||||
"shell/browser/mac/in_app_purchase_product.mm",
|
|
||||||
"shell/browser/media/media_capture_devices_dispatcher.cc",
|
"shell/browser/media/media_capture_devices_dispatcher.cc",
|
||||||
"shell/browser/media/media_capture_devices_dispatcher.h",
|
"shell/browser/media/media_capture_devices_dispatcher.h",
|
||||||
"shell/browser/media/media_device_id_salt.cc",
|
"shell/browser/media/media_device_id_salt.cc",
|
||||||
@@ -219,18 +387,9 @@ filenames = {
|
|||||||
"shell/browser/microtasks_runner.h",
|
"shell/browser/microtasks_runner.h",
|
||||||
"shell/browser/native_browser_view.cc",
|
"shell/browser/native_browser_view.cc",
|
||||||
"shell/browser/native_browser_view.h",
|
"shell/browser/native_browser_view.h",
|
||||||
"shell/browser/native_browser_view_mac.h",
|
|
||||||
"shell/browser/native_browser_view_mac.mm",
|
|
||||||
"shell/browser/native_browser_view_views.cc",
|
|
||||||
"shell/browser/native_browser_view_views.h",
|
|
||||||
"shell/browser/native_window.cc",
|
"shell/browser/native_window.cc",
|
||||||
"shell/browser/native_window.h",
|
"shell/browser/native_window.h",
|
||||||
"shell/browser/native_window_mac.h",
|
|
||||||
"shell/browser/native_window_mac.mm",
|
|
||||||
"shell/browser/native_window_observer.h",
|
"shell/browser/native_window_observer.h",
|
||||||
"shell/browser/native_window_views.cc",
|
|
||||||
"shell/browser/native_window_views.h",
|
|
||||||
"shell/browser/native_window_views_win.cc",
|
|
||||||
"shell/browser/net/asar/asar_url_loader.cc",
|
"shell/browser/net/asar/asar_url_loader.cc",
|
||||||
"shell/browser/net/asar/asar_url_loader.h",
|
"shell/browser/net/asar/asar_url_loader.h",
|
||||||
"shell/browser/net/cert_verifier_client.cc",
|
"shell/browser/net/cert_verifier_client.cc",
|
||||||
@@ -258,16 +417,6 @@ filenames = {
|
|||||||
"shell/browser/network_hints_handler_impl.h",
|
"shell/browser/network_hints_handler_impl.h",
|
||||||
"shell/browser/node_debugger.cc",
|
"shell/browser/node_debugger.cc",
|
||||||
"shell/browser/node_debugger.h",
|
"shell/browser/node_debugger.h",
|
||||||
"shell/browser/notifications/linux/libnotify_notification.cc",
|
|
||||||
"shell/browser/notifications/linux/libnotify_notification.h",
|
|
||||||
"shell/browser/notifications/linux/notification_presenter_linux.cc",
|
|
||||||
"shell/browser/notifications/linux/notification_presenter_linux.h",
|
|
||||||
"shell/browser/notifications/mac/cocoa_notification.h",
|
|
||||||
"shell/browser/notifications/mac/cocoa_notification.mm",
|
|
||||||
"shell/browser/notifications/mac/notification_center_delegate.h",
|
|
||||||
"shell/browser/notifications/mac/notification_center_delegate.mm",
|
|
||||||
"shell/browser/notifications/mac/notification_presenter_mac.h",
|
|
||||||
"shell/browser/notifications/mac/notification_presenter_mac.mm",
|
|
||||||
"shell/browser/notifications/notification.cc",
|
"shell/browser/notifications/notification.cc",
|
||||||
"shell/browser/notifications/notification.h",
|
"shell/browser/notifications/notification.h",
|
||||||
"shell/browser/notifications/notification_delegate.h",
|
"shell/browser/notifications/notification_delegate.h",
|
||||||
@@ -275,21 +424,6 @@ filenames = {
|
|||||||
"shell/browser/notifications/notification_presenter.h",
|
"shell/browser/notifications/notification_presenter.h",
|
||||||
"shell/browser/notifications/platform_notification_service.cc",
|
"shell/browser/notifications/platform_notification_service.cc",
|
||||||
"shell/browser/notifications/platform_notification_service.h",
|
"shell/browser/notifications/platform_notification_service.h",
|
||||||
"shell/browser/notifications/win/notification_presenter_win.cc",
|
|
||||||
"shell/browser/notifications/win/notification_presenter_win.h",
|
|
||||||
"shell/browser/notifications/win/notification_presenter_win7.cc",
|
|
||||||
"shell/browser/notifications/win/notification_presenter_win7.h",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/common.h",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/toast.cc",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/toast.h",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc",
|
|
||||||
"shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h",
|
|
||||||
"shell/browser/notifications/win/win32_notification.cc",
|
|
||||||
"shell/browser/notifications/win/win32_notification.h",
|
|
||||||
"shell/browser/notifications/win/windows_toast_notification.cc",
|
|
||||||
"shell/browser/notifications/win/windows_toast_notification.h",
|
|
||||||
"shell/browser/plugins/plugin_utils.cc",
|
"shell/browser/plugins/plugin_utils.cc",
|
||||||
"shell/browser/plugins/plugin_utils.h",
|
"shell/browser/plugins/plugin_utils.h",
|
||||||
"shell/browser/pref_store_delegate.cc",
|
"shell/browser/pref_store_delegate.cc",
|
||||||
@@ -298,9 +432,6 @@ filenames = {
|
|||||||
"shell/browser/protocol_registry.h",
|
"shell/browser/protocol_registry.h",
|
||||||
"shell/browser/relauncher.cc",
|
"shell/browser/relauncher.cc",
|
||||||
"shell/browser/relauncher.h",
|
"shell/browser/relauncher.h",
|
||||||
"shell/browser/relauncher_linux.cc",
|
|
||||||
"shell/browser/relauncher_mac.cc",
|
|
||||||
"shell/browser/relauncher_win.cc",
|
|
||||||
"shell/browser/session_preferences.cc",
|
"shell/browser/session_preferences.cc",
|
||||||
"shell/browser/session_preferences.h",
|
"shell/browser/session_preferences.h",
|
||||||
"shell/browser/special_storage_policy.cc",
|
"shell/browser/special_storage_policy.cc",
|
||||||
@@ -310,116 +441,27 @@ filenames = {
|
|||||||
"shell/browser/ui/autofill_popup.cc",
|
"shell/browser/ui/autofill_popup.cc",
|
||||||
"shell/browser/ui/autofill_popup.h",
|
"shell/browser/ui/autofill_popup.h",
|
||||||
"shell/browser/ui/certificate_trust.h",
|
"shell/browser/ui/certificate_trust.h",
|
||||||
"shell/browser/ui/certificate_trust_mac.mm",
|
|
||||||
"shell/browser/ui/certificate_trust_win.cc",
|
|
||||||
"shell/browser/ui/cocoa/NSColor+Hex.h",
|
|
||||||
"shell/browser/ui/cocoa/NSColor+Hex.mm",
|
|
||||||
"shell/browser/ui/cocoa/NSString+ANSI.h",
|
|
||||||
"shell/browser/ui/cocoa/NSString+ANSI.mm",
|
|
||||||
"shell/browser/ui/cocoa/delayed_native_view_host.cc",
|
|
||||||
"shell/browser/ui/cocoa/delayed_native_view_host.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_bundle_mover.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_bundle_mover.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_menu_controller.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_menu_controller.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_native_widget_mac.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_native_widget_mac.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_ns_window.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_ns_window.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_ns_window_delegate.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_ns_window_delegate.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_preview_item.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_preview_item.mm",
|
|
||||||
"shell/browser/ui/cocoa/electron_touch_bar.h",
|
|
||||||
"shell/browser/ui/cocoa/electron_touch_bar.mm",
|
|
||||||
"shell/browser/ui/cocoa/event_dispatching_window.h",
|
|
||||||
"shell/browser/ui/cocoa/event_dispatching_window.mm",
|
|
||||||
"shell/browser/ui/cocoa/root_view_mac.h",
|
|
||||||
"shell/browser/ui/cocoa/root_view_mac.mm",
|
|
||||||
"shell/browser/ui/cocoa/views_delegate_mac.h",
|
|
||||||
"shell/browser/ui/cocoa/views_delegate_mac.mm",
|
|
||||||
"shell/browser/ui/devtools_manager_delegate.cc",
|
"shell/browser/ui/devtools_manager_delegate.cc",
|
||||||
"shell/browser/ui/devtools_manager_delegate.h",
|
"shell/browser/ui/devtools_manager_delegate.h",
|
||||||
"shell/browser/ui/devtools_ui.cc",
|
"shell/browser/ui/devtools_ui.cc",
|
||||||
"shell/browser/ui/devtools_ui.h",
|
"shell/browser/ui/devtools_ui.h",
|
||||||
|
"shell/browser/ui/drag_util.cc",
|
||||||
"shell/browser/ui/drag_util.h",
|
"shell/browser/ui/drag_util.h",
|
||||||
"shell/browser/ui/drag_util_mac.mm",
|
|
||||||
"shell/browser/ui/drag_util_views.cc",
|
|
||||||
"shell/browser/ui/electron_menu_model.cc",
|
"shell/browser/ui/electron_menu_model.cc",
|
||||||
"shell/browser/ui/electron_menu_model.h",
|
"shell/browser/ui/electron_menu_model.h",
|
||||||
"shell/browser/ui/file_dialog.h",
|
"shell/browser/ui/file_dialog.h",
|
||||||
"shell/browser/ui/file_dialog_gtk.cc",
|
|
||||||
"shell/browser/ui/file_dialog_mac.mm",
|
|
||||||
"shell/browser/ui/file_dialog_win.cc",
|
|
||||||
"shell/browser/ui/inspectable_web_contents.cc",
|
"shell/browser/ui/inspectable_web_contents.cc",
|
||||||
"shell/browser/ui/inspectable_web_contents.h",
|
"shell/browser/ui/inspectable_web_contents.h",
|
||||||
"shell/browser/ui/inspectable_web_contents_delegate.h",
|
"shell/browser/ui/inspectable_web_contents_delegate.h",
|
||||||
"shell/browser/ui/inspectable_web_contents_view.h",
|
"shell/browser/ui/inspectable_web_contents_view.h",
|
||||||
"shell/browser/ui/inspectable_web_contents_view_delegate.cc",
|
"shell/browser/ui/inspectable_web_contents_view_delegate.cc",
|
||||||
"shell/browser/ui/inspectable_web_contents_view_delegate.h",
|
"shell/browser/ui/inspectable_web_contents_view_delegate.h",
|
||||||
"shell/browser/ui/inspectable_web_contents_view_mac.h",
|
|
||||||
"shell/browser/ui/inspectable_web_contents_view_mac.mm",
|
|
||||||
"shell/browser/ui/message_box.h",
|
"shell/browser/ui/message_box.h",
|
||||||
"shell/browser/ui/message_box_gtk.cc",
|
|
||||||
"shell/browser/ui/message_box_mac.mm",
|
|
||||||
"shell/browser/ui/message_box_win.cc",
|
|
||||||
"shell/browser/ui/tray_icon.cc",
|
"shell/browser/ui/tray_icon.cc",
|
||||||
"shell/browser/ui/tray_icon.h",
|
"shell/browser/ui/tray_icon.h",
|
||||||
"shell/browser/ui/tray_icon_cocoa.h",
|
|
||||||
"shell/browser/ui/tray_icon_cocoa.mm",
|
|
||||||
"shell/browser/ui/tray_icon_gtk.cc",
|
|
||||||
"shell/browser/ui/tray_icon_gtk.h",
|
|
||||||
"shell/browser/ui/tray_icon_observer.h",
|
"shell/browser/ui/tray_icon_observer.h",
|
||||||
"shell/browser/ui/tray_icon_win.cc",
|
|
||||||
"shell/browser/ui/views/autofill_popup_view.cc",
|
|
||||||
"shell/browser/ui/views/autofill_popup_view.h",
|
|
||||||
"shell/browser/ui/views/electron_views_delegate.cc",
|
|
||||||
"shell/browser/ui/views/electron_views_delegate.h",
|
|
||||||
"shell/browser/ui/views/electron_views_delegate_win.cc",
|
|
||||||
"shell/browser/ui/views/frameless_view.cc",
|
|
||||||
"shell/browser/ui/views/frameless_view.h",
|
|
||||||
"shell/browser/ui/views/global_menu_bar_x11.cc",
|
|
||||||
"shell/browser/ui/views/global_menu_bar_x11.h",
|
|
||||||
"shell/browser/ui/views/inspectable_web_contents_view_views.cc",
|
|
||||||
"shell/browser/ui/views/inspectable_web_contents_view_views.h",
|
|
||||||
"shell/browser/ui/views/menu_bar.cc",
|
|
||||||
"shell/browser/ui/views/menu_bar.h",
|
|
||||||
"shell/browser/ui/views/menu_delegate.cc",
|
|
||||||
"shell/browser/ui/views/menu_delegate.h",
|
|
||||||
"shell/browser/ui/views/menu_model_adapter.cc",
|
|
||||||
"shell/browser/ui/views/menu_model_adapter.h",
|
|
||||||
"shell/browser/ui/views/native_frame_view.cc",
|
|
||||||
"shell/browser/ui/views/native_frame_view.h",
|
|
||||||
"shell/browser/ui/views/root_view.cc",
|
|
||||||
"shell/browser/ui/views/root_view.h",
|
|
||||||
"shell/browser/ui/views/submenu_button.cc",
|
|
||||||
"shell/browser/ui/views/submenu_button.h",
|
|
||||||
"shell/browser/ui/views/win_frame_view.cc",
|
|
||||||
"shell/browser/ui/views/win_frame_view.h",
|
|
||||||
"shell/browser/ui/webui/accessibility_ui.cc",
|
"shell/browser/ui/webui/accessibility_ui.cc",
|
||||||
"shell/browser/ui/webui/accessibility_ui.h",
|
"shell/browser/ui/webui/accessibility_ui.h",
|
||||||
"shell/browser/ui/win/dialog_thread.cc",
|
|
||||||
"shell/browser/ui/win/dialog_thread.h",
|
|
||||||
"shell/browser/ui/win/electron_desktop_native_widget_aura.cc",
|
|
||||||
"shell/browser/ui/win/electron_desktop_native_widget_aura.h",
|
|
||||||
"shell/browser/ui/win/electron_desktop_window_tree_host_win.cc",
|
|
||||||
"shell/browser/ui/win/electron_desktop_window_tree_host_win.h",
|
|
||||||
"shell/browser/ui/win/jump_list.cc",
|
|
||||||
"shell/browser/ui/win/jump_list.h",
|
|
||||||
"shell/browser/ui/win/notify_icon.cc",
|
|
||||||
"shell/browser/ui/win/notify_icon.h",
|
|
||||||
"shell/browser/ui/win/notify_icon_host.cc",
|
|
||||||
"shell/browser/ui/win/notify_icon_host.h",
|
|
||||||
"shell/browser/ui/win/taskbar_host.cc",
|
|
||||||
"shell/browser/ui/win/taskbar_host.h",
|
|
||||||
"shell/browser/ui/x/event_disabler.cc",
|
|
||||||
"shell/browser/ui/x/event_disabler.h",
|
|
||||||
"shell/browser/ui/x/window_state_watcher.cc",
|
|
||||||
"shell/browser/ui/x/window_state_watcher.h",
|
|
||||||
"shell/browser/ui/x/x_window_utils.cc",
|
|
||||||
"shell/browser/ui/x/x_window_utils.h",
|
|
||||||
"shell/browser/unresponsive_suppressor.cc",
|
"shell/browser/unresponsive_suppressor.cc",
|
||||||
"shell/browser/unresponsive_suppressor.h",
|
"shell/browser/unresponsive_suppressor.h",
|
||||||
"shell/browser/web_contents_permission_helper.cc",
|
"shell/browser/web_contents_permission_helper.cc",
|
||||||
@@ -434,8 +476,6 @@ filenames = {
|
|||||||
"shell/browser/web_view_guest_delegate.h",
|
"shell/browser/web_view_guest_delegate.h",
|
||||||
"shell/browser/web_view_manager.cc",
|
"shell/browser/web_view_manager.cc",
|
||||||
"shell/browser/web_view_manager.h",
|
"shell/browser/web_view_manager.h",
|
||||||
"shell/browser/win/scoped_hstring.cc",
|
|
||||||
"shell/browser/win/scoped_hstring.h",
|
|
||||||
"shell/browser/window_list.cc",
|
"shell/browser/window_list.cc",
|
||||||
"shell/browser/window_list.h",
|
"shell/browser/window_list.h",
|
||||||
"shell/browser/window_list_observer.h",
|
"shell/browser/window_list_observer.h",
|
||||||
@@ -444,13 +484,10 @@ filenames = {
|
|||||||
"shell/common/api/electron_api_asar.cc",
|
"shell/common/api/electron_api_asar.cc",
|
||||||
"shell/common/api/electron_api_clipboard.cc",
|
"shell/common/api/electron_api_clipboard.cc",
|
||||||
"shell/common/api/electron_api_clipboard.h",
|
"shell/common/api/electron_api_clipboard.h",
|
||||||
"shell/common/api/electron_api_clipboard_mac.mm",
|
|
||||||
"shell/common/api/electron_api_command_line.cc",
|
"shell/common/api/electron_api_command_line.cc",
|
||||||
"shell/common/api/electron_api_key_weak_map.h",
|
"shell/common/api/electron_api_key_weak_map.h",
|
||||||
"shell/common/api/electron_api_native_image.cc",
|
"shell/common/api/electron_api_native_image.cc",
|
||||||
"shell/common/api/electron_api_native_image.h",
|
"shell/common/api/electron_api_native_image.h",
|
||||||
"shell/common/api/electron_api_native_image_mac.mm",
|
|
||||||
"shell/common/api/electron_api_native_image_win.cc",
|
|
||||||
"shell/common/api/electron_api_shell.cc",
|
"shell/common/api/electron_api_shell.cc",
|
||||||
"shell/common/api/electron_api_v8_util.cc",
|
"shell/common/api/electron_api_v8_util.cc",
|
||||||
"shell/common/api/electron_bindings.cc",
|
"shell/common/api/electron_bindings.cc",
|
||||||
@@ -460,9 +497,6 @@ filenames = {
|
|||||||
"shell/common/api/object_life_monitor.h",
|
"shell/common/api/object_life_monitor.h",
|
||||||
"shell/common/application_info.cc",
|
"shell/common/application_info.cc",
|
||||||
"shell/common/application_info.h",
|
"shell/common/application_info.h",
|
||||||
"shell/common/application_info_linux.cc",
|
|
||||||
"shell/common/application_info_mac.mm",
|
|
||||||
"shell/common/application_info_win.cc",
|
|
||||||
"shell/common/asar/archive.cc",
|
"shell/common/asar/archive.cc",
|
||||||
"shell/common/asar/archive.h",
|
"shell/common/asar/archive.h",
|
||||||
"shell/common/asar/asar_util.cc",
|
"shell/common/asar/asar_util.cc",
|
||||||
@@ -545,30 +579,16 @@ filenames = {
|
|||||||
"shell/common/keyboard_util.cc",
|
"shell/common/keyboard_util.cc",
|
||||||
"shell/common/keyboard_util.h",
|
"shell/common/keyboard_util.h",
|
||||||
"shell/common/language_util.h",
|
"shell/common/language_util.h",
|
||||||
"shell/common/language_util_linux.cc",
|
|
||||||
"shell/common/language_util_mac.mm",
|
|
||||||
"shell/common/language_util_win.cc",
|
|
||||||
"shell/common/mac/main_application_bundle.h",
|
|
||||||
"shell/common/mac/main_application_bundle.mm",
|
|
||||||
"shell/common/mouse_util.cc",
|
"shell/common/mouse_util.cc",
|
||||||
"shell/common/mouse_util.h",
|
"shell/common/mouse_util.h",
|
||||||
"shell/common/node_bindings.cc",
|
"shell/common/node_bindings.cc",
|
||||||
"shell/common/node_bindings.h",
|
"shell/common/node_bindings.h",
|
||||||
"shell/common/node_bindings_linux.cc",
|
|
||||||
"shell/common/node_bindings_linux.h",
|
|
||||||
"shell/common/node_bindings_mac.cc",
|
|
||||||
"shell/common/node_bindings_mac.h",
|
|
||||||
"shell/common/node_bindings_win.cc",
|
|
||||||
"shell/common/node_bindings_win.h",
|
|
||||||
"shell/common/node_includes.h",
|
"shell/common/node_includes.h",
|
||||||
"shell/common/node_util.cc",
|
"shell/common/node_util.cc",
|
||||||
"shell/common/node_util.h",
|
"shell/common/node_util.h",
|
||||||
"shell/common/options_switches.cc",
|
"shell/common/options_switches.cc",
|
||||||
"shell/common/options_switches.h",
|
"shell/common/options_switches.h",
|
||||||
"shell/common/platform_util.h",
|
"shell/common/platform_util.h",
|
||||||
"shell/common/platform_util_linux.cc",
|
|
||||||
"shell/common/platform_util_mac.mm",
|
|
||||||
"shell/common/platform_util_win.cc",
|
|
||||||
"shell/common/process_util.cc",
|
"shell/common/process_util.cc",
|
||||||
"shell/common/process_util.h",
|
"shell/common/process_util.h",
|
||||||
"shell/common/skia_util.cc",
|
"shell/common/skia_util.cc",
|
||||||
@@ -625,6 +645,8 @@ filenames = {
|
|||||||
"shell/browser/extensions/api/resources_private/resources_private_api.h",
|
"shell/browser/extensions/api/resources_private/resources_private_api.h",
|
||||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
|
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
|
||||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
|
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
|
||||||
|
"shell/browser/extensions/api/management/electron_management_api_delegate.cc",
|
||||||
|
"shell/browser/extensions/api/management/electron_management_api_delegate.h",
|
||||||
"shell/browser/extensions/api/tabs/tabs_api.cc",
|
"shell/browser/extensions/api/tabs/tabs_api.cc",
|
||||||
"shell/browser/extensions/api/tabs/tabs_api.h",
|
"shell/browser/extensions/api/tabs/tabs_api.h",
|
||||||
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
|
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
|
||||||
|
|||||||
@@ -612,9 +612,10 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
|||||||
if (options.withFileTypes) {
|
if (options.withFileTypes) {
|
||||||
const dirents = [];
|
const dirents = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const stats = archive.stat(file);
|
const childPath = path.join(filePath, file);
|
||||||
|
const stats = archive.stat(childPath);
|
||||||
if (!stats) {
|
if (!stats) {
|
||||||
const error = createError(AsarError.NOT_FOUND, { asarPath, filePath: file });
|
const error = createError(AsarError.NOT_FOUND, { asarPath, filePath: childPath });
|
||||||
nextTick(callback!, [error]);
|
nextTick(callback!, [error]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -654,9 +655,10 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
|||||||
if (options && (options as any).withFileTypes) {
|
if (options && (options as any).withFileTypes) {
|
||||||
const dirents = [];
|
const dirents = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const stats = archive.stat(file);
|
const childPath = path.join(filePath, file);
|
||||||
|
const stats = archive.stat(childPath);
|
||||||
if (!stats) {
|
if (!stats) {
|
||||||
throw createError(AsarError.NOT_FOUND, { asarPath, filePath: file });
|
throw createError(AsarError.NOT_FOUND, { asarPath, filePath: childPath });
|
||||||
}
|
}
|
||||||
if (stats.isFile) {
|
if (stats.isFile) {
|
||||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
|
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
|
||||||
@@ -686,7 +688,8 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
|||||||
if (info.size === 0) return ['', false];
|
if (info.size === 0) return ['', false];
|
||||||
if (info.unpacked) {
|
if (info.unpacked) {
|
||||||
const realPath = archive.copyFileOut(filePath);
|
const realPath = archive.copyFileOut(filePath);
|
||||||
return fs.readFileSync(realPath, { encoding: 'utf8' });
|
const str = fs.readFileSync(realPath, { encoding: 'utf8' });
|
||||||
|
return [str, str.length > 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
logASARAccess(asarPath, filePath, info.offset);
|
logASARAccess(asarPath, filePath, info.offset);
|
||||||
|
|||||||
@@ -28,9 +28,11 @@ Object.setPrototypeOf(BrowserWindow.prototype, BaseWindow.prototype);
|
|||||||
// Though this hack is only needed on macOS when the app is launched from
|
// Though this hack is only needed on macOS when the app is launched from
|
||||||
// Finder, we still do it on all platforms in case of other bugs we don't
|
// Finder, we still do it on all platforms in case of other bugs we don't
|
||||||
// know.
|
// know.
|
||||||
this.webContents.once('load-url' as any, function (this: WebContents) {
|
if (this.webContents._initiallyShown) {
|
||||||
this.focus();
|
this.webContents.once('load-url' as any, function (this: WebContents) {
|
||||||
});
|
this.focus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Redirect focus/blur event to app instance too.
|
// Redirect focus/blur event to app instance too.
|
||||||
this.on('blur', (event: Event) => {
|
this.on('blur', (event: Event) => {
|
||||||
|
|||||||
@@ -157,9 +157,12 @@ function sortGroups<T> (groups: {id?: T}[][]) {
|
|||||||
return sortedGroupIndexes.map(i => groups[i]);
|
return sortedGroupIndexes.map(i => groups[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sortMenuItems (menuItems: {type?: string, id?: string}[]) {
|
export function sortMenuItems (menuItems: (Electron.MenuItemConstructorOptions | Electron.MenuItem)[]) {
|
||||||
const isSeparator = (item: {type?: string}) => item.type === 'separator';
|
const isSeparator = (i: Electron.MenuItemConstructorOptions | Electron.MenuItem) => {
|
||||||
const separators = menuItems.filter(i => i.type === 'separator');
|
const opts = i as Electron.MenuItemConstructorOptions;
|
||||||
|
return i.type === 'separator' && !opts.before && !opts.after && !opts.beforeGroupContaining && !opts.afterGroupContaining;
|
||||||
|
};
|
||||||
|
const separators = menuItems.filter(isSeparator);
|
||||||
|
|
||||||
// Split the items into their implicit groups based upon separators.
|
// Split the items into their implicit groups based upon separators.
|
||||||
const groups = splitArray(menuItems, isSeparator);
|
const groups = splitArray(menuItems, isSeparator);
|
||||||
|
|||||||
@@ -182,11 +182,11 @@ Menu.buildFromTemplate = function (template) {
|
|||||||
throw new TypeError('Invalid template for MenuItem: must have at least one of label, role or type');
|
throw new TypeError('Invalid template for MenuItem: must have at least one of label, role or type');
|
||||||
}
|
}
|
||||||
|
|
||||||
const filtered = removeExtraSeparators(template);
|
const sorted = sortTemplate(template);
|
||||||
const sorted = sortTemplate(filtered);
|
const filtered = removeExtraSeparators(sorted);
|
||||||
|
|
||||||
const menu = new Menu();
|
const menu = new Menu();
|
||||||
sorted.forEach(item => {
|
filtered.forEach(item => {
|
||||||
if (item instanceof MenuItem) {
|
if (item instanceof MenuItem) {
|
||||||
menu.append(item);
|
menu.append(item);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -17,8 +17,12 @@ Object.setPrototypeOf(protocol, new Proxy({}, {
|
|||||||
|
|
||||||
ownKeys () {
|
ownKeys () {
|
||||||
if (!app.isReady()) return [];
|
if (!app.isReady()) return [];
|
||||||
|
return Reflect.ownKeys(session.defaultSession!.protocol);
|
||||||
|
},
|
||||||
|
|
||||||
return Object.getOwnPropertyNames(Object.getPrototypeOf(session.defaultSession!.protocol));
|
has: (target, property: string) => {
|
||||||
|
if (!app.isReady()) return false;
|
||||||
|
return Reflect.has(session.defaultSession!.protocol, property);
|
||||||
},
|
},
|
||||||
|
|
||||||
getOwnPropertyDescriptor () {
|
getOwnPropertyDescriptor () {
|
||||||
|
|||||||
@@ -1,20 +1,47 @@
|
|||||||
|
import { EventEmitter } from 'events';
|
||||||
const { createScreen } = process._linkedBinding('electron_common_screen');
|
const { createScreen } = process._linkedBinding('electron_common_screen');
|
||||||
|
|
||||||
let _screen: Electron.Screen;
|
let _screen: Electron.Screen;
|
||||||
|
|
||||||
|
const createScreenIfNeeded = () => {
|
||||||
|
if (_screen === undefined) {
|
||||||
|
_screen = createScreen();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// We can't call createScreen until after app.on('ready'), but this module
|
// We can't call createScreen until after app.on('ready'), but this module
|
||||||
// exposes an instance created by createScreen. In order to avoid
|
// exposes an instance created by createScreen. In order to avoid
|
||||||
// side-effecting and calling createScreen upon import of this module, instead
|
// side-effecting and calling createScreen upon import of this module, instead
|
||||||
// we export a proxy which lazily calls createScreen on first access.
|
// we export a proxy which lazily calls createScreen on first access.
|
||||||
export default new Proxy({}, {
|
export default new Proxy({}, {
|
||||||
get: (target, prop) => {
|
get: (target, property: keyof Electron.Screen) => {
|
||||||
if (_screen === undefined) {
|
createScreenIfNeeded();
|
||||||
_screen = createScreen();
|
const value = _screen[property];
|
||||||
|
if (typeof value === 'function') {
|
||||||
|
return value.bind(_screen);
|
||||||
}
|
}
|
||||||
const v = (_screen as any)[prop];
|
return value;
|
||||||
if (typeof v === 'function') {
|
},
|
||||||
return v.bind(_screen);
|
set: (target, property: string, value: unknown) => {
|
||||||
}
|
createScreenIfNeeded();
|
||||||
return v;
|
return Reflect.set(_screen, property, value);
|
||||||
|
},
|
||||||
|
ownKeys: () => {
|
||||||
|
createScreenIfNeeded();
|
||||||
|
return Reflect.ownKeys(_screen);
|
||||||
|
},
|
||||||
|
has: (target, property: string) => {
|
||||||
|
createScreenIfNeeded();
|
||||||
|
return property in _screen;
|
||||||
|
},
|
||||||
|
getOwnPropertyDescriptor: (target, property: string) => {
|
||||||
|
createScreenIfNeeded();
|
||||||
|
return Reflect.getOwnPropertyDescriptor(_screen, property);
|
||||||
|
},
|
||||||
|
getPrototypeOf: () => {
|
||||||
|
// This is necessary as a result of weirdness with EventEmitterMixin
|
||||||
|
// and FunctionTemplate - we need to explicitly ensure it's returned
|
||||||
|
// in the prototype.
|
||||||
|
return EventEmitter.prototype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if ('getAppLevelAppearance' in systemPreferences) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('getEffectiveAppearance' in systemPreferences) {
|
if ('getEffectiveAppearance' in systemPreferences) {
|
||||||
const nativeEAGetter = systemPreferences.getAppLevelAppearance;
|
const nativeEAGetter = systemPreferences.getEffectiveAppearance;
|
||||||
Object.defineProperty(systemPreferences, 'effectiveAppearance', {
|
Object.defineProperty(systemPreferences, 'effectiveAppearance', {
|
||||||
get: () => nativeEAGetter.call(systemPreferences)
|
get: () => nativeEAGetter.call(systemPreferences)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -161,29 +161,29 @@ WebContents.prototype._sendInternalToAll = function (channel, ...args) {
|
|||||||
|
|
||||||
return this._send(internal, sendToAll, channel, args);
|
return this._send(internal, sendToAll, channel, args);
|
||||||
};
|
};
|
||||||
WebContents.prototype.sendToFrame = function (frameId, channel, ...args) {
|
WebContents.prototype.sendToFrame = function (frame, channel, ...args) {
|
||||||
if (typeof channel !== 'string') {
|
if (typeof channel !== 'string') {
|
||||||
throw new Error('Missing required channel argument');
|
throw new Error('Missing required channel argument');
|
||||||
} else if (typeof frameId !== 'number') {
|
} else if (!(typeof frame === 'number' || Array.isArray(frame))) {
|
||||||
throw new Error('Missing required frameId argument');
|
throw new Error('Missing required frame argument (must be number or array)');
|
||||||
}
|
}
|
||||||
|
|
||||||
const internal = false;
|
const internal = false;
|
||||||
const sendToAll = false;
|
const sendToAll = false;
|
||||||
|
|
||||||
return this._sendToFrame(internal, sendToAll, frameId, channel, args);
|
return this._sendToFrame(internal, sendToAll, frame, channel, args);
|
||||||
};
|
};
|
||||||
WebContents.prototype._sendToFrameInternal = function (frameId, channel, ...args) {
|
WebContents.prototype._sendToFrameInternal = function (frame, channel, ...args) {
|
||||||
if (typeof channel !== 'string') {
|
if (typeof channel !== 'string') {
|
||||||
throw new Error('Missing required channel argument');
|
throw new Error('Missing required channel argument');
|
||||||
} else if (typeof frameId !== 'number') {
|
} else if (!(typeof frame === 'number' || Array.isArray(frame))) {
|
||||||
throw new Error('Missing required frameId argument');
|
throw new Error('Missing required frame argument (must be number or array)');
|
||||||
}
|
}
|
||||||
|
|
||||||
const internal = true;
|
const internal = true;
|
||||||
const sendToAll = false;
|
const sendToAll = false;
|
||||||
|
|
||||||
return this._sendToFrame(internal, sendToAll, frameId, channel, args);
|
return this._sendToFrame(internal, sendToAll, frame, channel, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Following methods are mapped to webFrame.
|
// Following methods are mapped to webFrame.
|
||||||
@@ -439,8 +439,9 @@ WebContents.prototype.loadFile = function (filePath, options = {}) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addReplyToEvent = (event: any) => {
|
const addReplyToEvent = (event: any) => {
|
||||||
|
const { processId, frameId } = event;
|
||||||
event.reply = (...args: any[]) => {
|
event.reply = (...args: any[]) => {
|
||||||
event.sender.sendToFrame(event.frameId, ...args);
|
event.sender.sendToFrame([processId, frameId], ...args);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -461,6 +462,10 @@ const addReturnValueToEvent = (event: any) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const loggingEnabled = () => {
|
||||||
|
return process.env.ELECTRON_ENABLE_LOGGING || app.commandLine.hasSwitch('enable-logging');
|
||||||
|
};
|
||||||
|
|
||||||
// Add JavaScript wrappers for WebContents class.
|
// Add JavaScript wrappers for WebContents class.
|
||||||
WebContents.prototype._init = function () {
|
WebContents.prototype._init = function () {
|
||||||
// The navigation controller.
|
// The navigation controller.
|
||||||
@@ -481,6 +486,13 @@ WebContents.prototype._init = function () {
|
|||||||
this.goToOffset = navigationController.goToOffset.bind(navigationController);
|
this.goToOffset = navigationController.goToOffset.bind(navigationController);
|
||||||
this.getActiveIndex = navigationController.getActiveIndex.bind(navigationController);
|
this.getActiveIndex = navigationController.getActiveIndex.bind(navigationController);
|
||||||
this.length = navigationController.length.bind(navigationController);
|
this.length = navigationController.length.bind(navigationController);
|
||||||
|
// Read off the ID at construction time, so that it's accessible even after
|
||||||
|
// the underlying C++ WebContents is destroyed.
|
||||||
|
const id = this.id;
|
||||||
|
Object.defineProperty(this, 'id', {
|
||||||
|
value: id,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
|
|
||||||
// Every remote callback from renderer process would add a listener to the
|
// Every remote callback from renderer process would add a listener to the
|
||||||
// render-view-deleted event, so ignore the listeners warning.
|
// render-view-deleted event, so ignore the listeners warning.
|
||||||
@@ -545,8 +557,13 @@ WebContents.prototype._init = function () {
|
|||||||
app.emit('renderer-process-crashed', event, this, ...args);
|
app.emit('renderer-process-crashed', event, this, ...args);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('render-process-gone', (event, ...args) => {
|
this.on('render-process-gone', (event, details) => {
|
||||||
app.emit('render-process-gone', event, this, ...args);
|
app.emit('render-process-gone', event, this, details);
|
||||||
|
|
||||||
|
// Log out a hint to help users better debug renderer crashes.
|
||||||
|
if (loggingEnabled()) {
|
||||||
|
console.info(`Renderer process ${details.reason} - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// The devtools requests the webContents to reload.
|
// The devtools requests the webContents to reload.
|
||||||
@@ -606,6 +623,15 @@ WebContents.prototype._init = function () {
|
|||||||
app.emit('login', event, this, ...args);
|
app.emit('login', event, this, ...args);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.on('ready-to-show' as any, () => {
|
||||||
|
const owner = this.getOwnerBrowserWindow();
|
||||||
|
if (owner && !owner.isDestroyed()) {
|
||||||
|
process.nextTick(() => {
|
||||||
|
owner.emit('ready-to-show');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const event = process._linkedBinding('electron_browser_event').createEmpty();
|
const event = process._linkedBinding('electron_browser_event').createEmpty();
|
||||||
app.emit('web-contents-created', event, this);
|
app.emit('web-contents-created', event, this);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
const {
|
const { createDesktopCapturer } = process._linkedBinding('electron_browser_desktop_capturer');
|
||||||
createDesktopCapturer,
|
|
||||||
getMediaSourceIdForWebContents: getMediaSourceIdForWebContentsBinding
|
|
||||||
} = process._linkedBinding('electron_browser_desktop_capturer');
|
|
||||||
|
|
||||||
const deepEqual = (a: ElectronInternal.GetSourcesOptions, b: ElectronInternal.GetSourcesOptions) => JSON.stringify(a) === JSON.stringify(b);
|
const deepEqual = (a: ElectronInternal.GetSourcesOptions, b: ElectronInternal.GetSourcesOptions) => JSON.stringify(a) === JSON.stringify(b);
|
||||||
|
|
||||||
@@ -51,6 +48,9 @@ export const getSourcesImpl = (event: Electron.IpcMainEvent | null, args: Electr
|
|||||||
}
|
}
|
||||||
// Remove from currentlyRunning once we resolve or reject
|
// Remove from currentlyRunning once we resolve or reject
|
||||||
currentlyRunning = currentlyRunning.filter(running => running.options !== options);
|
currentlyRunning = currentlyRunning.filter(running => running.options !== options);
|
||||||
|
if (event) {
|
||||||
|
event.sender.removeListener('destroyed', stopRunning);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
capturer._onerror = (error: string) => {
|
capturer._onerror = (error: string) => {
|
||||||
@@ -69,7 +69,7 @@ export const getSourcesImpl = (event: Electron.IpcMainEvent | null, args: Electr
|
|||||||
// reference to emit and the capturer itself so that it never dispatches
|
// reference to emit and the capturer itself so that it never dispatches
|
||||||
// back to the renderer
|
// back to the renderer
|
||||||
if (event) {
|
if (event) {
|
||||||
event.sender.once('destroyed', () => stopRunning());
|
event.sender.once('destroyed', stopRunning);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,7 +80,3 @@ export const getSourcesImpl = (event: Electron.IpcMainEvent | null, args: Electr
|
|||||||
|
|
||||||
return getSources;
|
return getSources;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMediaSourceIdForWebContents = (event: Electron.IpcMainEvent, webContentsId: number) => {
|
|
||||||
return getMediaSourceIdForWebContentsBinding(event.sender.id, webContentsId);
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const FUNCTION_PROPERTIES = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
type RendererFunctionId = [string, number] // [contextId, funcId]
|
type RendererFunctionId = [string, number] // [contextId, funcId]
|
||||||
type FinalizerInfo = { id: RendererFunctionId, webContents: electron.WebContents, frameId: number };
|
type FinalizerInfo = { id: RendererFunctionId, webContents: electron.WebContents, frameId: [number, number] };
|
||||||
type WeakRef<T> = { deref(): T | undefined }
|
type WeakRef<T> = { deref(): T | undefined }
|
||||||
type CallIntoRenderer = (...args: any[]) => void
|
type CallIntoRenderer = (...args: any[]) => void
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ const finalizationRegistry = new (globalThis as any).FinalizationRegistry((fi: F
|
|||||||
const ref = rendererFunctionCache.get(mapKey);
|
const ref = rendererFunctionCache.get(mapKey);
|
||||||
if (ref !== undefined && ref.deref() === undefined) {
|
if (ref !== undefined && ref.deref() === undefined) {
|
||||||
rendererFunctionCache.delete(mapKey);
|
rendererFunctionCache.delete(mapKey);
|
||||||
if (!fi.webContents.isDestroyed()) { fi.webContents.sendToFrame(fi.frameId, 'ELECTRON_RENDERER_RELEASE_CALLBACK', fi.id[0], fi.id[1]); }
|
if (!fi.webContents.isDestroyed()) { fi.webContents._sendToFrameInternal(fi.frameId, 'ELECTRON_RENDERER_RELEASE_CALLBACK', fi.id[0], fi.id[1]); }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ function getCachedRendererFunction (id: RendererFunctionId): CallIntoRenderer |
|
|||||||
if (deref !== undefined) return deref;
|
if (deref !== undefined) return deref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setCachedRendererFunction (id: RendererFunctionId, wc: electron.WebContents, frameId: number, value: CallIntoRenderer) {
|
function setCachedRendererFunction (id: RendererFunctionId, wc: electron.WebContents, frameId: [number, number], value: CallIntoRenderer) {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const wr = new (globalThis as any).WeakRef(value) as WeakRef<CallIntoRenderer>;
|
const wr = new (globalThis as any).WeakRef(value) as WeakRef<CallIntoRenderer>;
|
||||||
const mapKey = id[0] + '~' + id[1];
|
const mapKey = id[0] + '~' + id[1];
|
||||||
@@ -218,7 +218,7 @@ const fakeConstructor = (constructor: Function, name: string) =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Convert array of meta data from renderer into array of real values.
|
// Convert array of meta data from renderer into array of real values.
|
||||||
const unwrapArgs = function (sender: electron.WebContents, frameId: number, contextId: string, args: any[]) {
|
const unwrapArgs = function (sender: electron.WebContents, frameId: [number, number], contextId: string, args: any[]) {
|
||||||
const metaToValue = function (meta: MetaTypeFromRenderer): any {
|
const metaToValue = function (meta: MetaTypeFromRenderer): any {
|
||||||
switch (meta.type) {
|
switch (meta.type) {
|
||||||
case 'nativeimage':
|
case 'nativeimage':
|
||||||
@@ -263,7 +263,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
|
|||||||
const callIntoRenderer = function (this: any, ...args: any[]) {
|
const callIntoRenderer = function (this: any, ...args: any[]) {
|
||||||
let succeed = false;
|
let succeed = false;
|
||||||
if (!sender.isDestroyed()) {
|
if (!sender.isDestroyed()) {
|
||||||
succeed = (sender as any)._sendToFrameInternal(frameId, 'ELECTRON_RENDERER_CALLBACK', contextId, meta.id, valueToMeta(sender, contextId, args));
|
succeed = sender._sendToFrameInternal(frameId, 'ELECTRON_RENDERER_CALLBACK', contextId, meta.id, valueToMeta(sender, contextId, args));
|
||||||
}
|
}
|
||||||
if (!succeed) {
|
if (!succeed) {
|
||||||
removeRemoteListenersAndLogWarning(this, callIntoRenderer);
|
removeRemoteListenersAndLogWarning(this, callIntoRenderer);
|
||||||
@@ -421,7 +421,7 @@ handleRemoteCommand('ELECTRON_BROWSER_CURRENT_WEB_CONTENTS', function (event, co
|
|||||||
});
|
});
|
||||||
|
|
||||||
handleRemoteCommand('ELECTRON_BROWSER_CONSTRUCTOR', function (event, contextId, id, args) {
|
handleRemoteCommand('ELECTRON_BROWSER_CONSTRUCTOR', function (event, contextId, id, args) {
|
||||||
args = unwrapArgs(event.sender, event.frameId, contextId, args);
|
args = unwrapArgs(event.sender, [event.processId, event.frameId], contextId, args);
|
||||||
const constructor = objectsRegistry.get(id);
|
const constructor = objectsRegistry.get(id);
|
||||||
|
|
||||||
if (constructor == null) {
|
if (constructor == null) {
|
||||||
@@ -432,7 +432,7 @@ handleRemoteCommand('ELECTRON_BROWSER_CONSTRUCTOR', function (event, contextId,
|
|||||||
});
|
});
|
||||||
|
|
||||||
handleRemoteCommand('ELECTRON_BROWSER_FUNCTION_CALL', function (event, contextId, id, args) {
|
handleRemoteCommand('ELECTRON_BROWSER_FUNCTION_CALL', function (event, contextId, id, args) {
|
||||||
args = unwrapArgs(event.sender, event.frameId, contextId, args);
|
args = unwrapArgs(event.sender, [event.processId, event.frameId], contextId, args);
|
||||||
const func = objectsRegistry.get(id);
|
const func = objectsRegistry.get(id);
|
||||||
|
|
||||||
if (func == null) {
|
if (func == null) {
|
||||||
@@ -449,7 +449,7 @@ handleRemoteCommand('ELECTRON_BROWSER_FUNCTION_CALL', function (event, contextId
|
|||||||
});
|
});
|
||||||
|
|
||||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CONSTRUCTOR', function (event, contextId, id, method, args) {
|
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CONSTRUCTOR', function (event, contextId, id, method, args) {
|
||||||
args = unwrapArgs(event.sender, event.frameId, contextId, args);
|
args = unwrapArgs(event.sender, [event.processId, event.frameId], contextId, args);
|
||||||
const object = objectsRegistry.get(id);
|
const object = objectsRegistry.get(id);
|
||||||
|
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
@@ -460,7 +460,7 @@ handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CONSTRUCTOR', function (event, cont
|
|||||||
});
|
});
|
||||||
|
|
||||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CALL', function (event, contextId, id, method, args) {
|
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CALL', function (event, contextId, id, method, args) {
|
||||||
args = unwrapArgs(event.sender, event.frameId, contextId, args);
|
args = unwrapArgs(event.sender, [event.processId, event.frameId], contextId, args);
|
||||||
const object = objectsRegistry.get(id);
|
const object = objectsRegistry.get(id);
|
||||||
|
|
||||||
if (object == null) {
|
if (object == null) {
|
||||||
@@ -477,7 +477,7 @@ handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CALL', function (event, contextId,
|
|||||||
});
|
});
|
||||||
|
|
||||||
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_SET', function (event, contextId, id, name, args) {
|
handleRemoteCommand('ELECTRON_BROWSER_MEMBER_SET', function (event, contextId, id, name, args) {
|
||||||
args = unwrapArgs(event.sender, event.frameId, contextId, args);
|
args = unwrapArgs(event.sender, [event.processId, event.frameId], contextId, args);
|
||||||
const obj = objectsRegistry.get(id);
|
const obj = objectsRegistry.get(id);
|
||||||
|
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
|
|||||||
@@ -71,10 +71,6 @@ if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
|
|||||||
|
|
||||||
return typeUtils.serialize(await desktopCapturer.getSourcesImpl(event, options));
|
return typeUtils.serialize(await desktopCapturer.getSourcesImpl(event, options));
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMainInternal.handle('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_MEDIA_SOURCE_ID_FOR_WEB_CONTENTS', function (event: IpcMainInvokeEvent, webContentsId: number) {
|
|
||||||
return desktopCapturer.getMediaSourceIdForWebContents(event, webContentsId);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRemoteModuleEnabled = BUILDFLAG(ENABLE_REMOTE_MODULE)
|
const isRemoteModuleEnabled = BUILDFLAG(ENABLE_REMOTE_MODULE)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const keysOfTypeNumber = ['top', 'left', ...Object.keys(keysOfTypeNumberCompileT
|
|||||||
type CoercedValue = string | number | boolean;
|
type CoercedValue = string | number | boolean;
|
||||||
function coerce (key: string, value: string): CoercedValue {
|
function coerce (key: string, value: string): CoercedValue {
|
||||||
if (keysOfTypeNumber.includes(key)) {
|
if (keysOfTypeNumber.includes(key)) {
|
||||||
return Number(value);
|
return parseInt(value, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (value) {
|
switch (value) {
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ if (process.type === 'renderer') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const originalResolveFilename = Module._resolveFilename;
|
const originalResolveFilename = Module._resolveFilename;
|
||||||
Module._resolveFilename = function (request: string, parent: NodeModule, isMain: boolean) {
|
Module._resolveFilename = function (request: string, parent: NodeModule, isMain: boolean, options?: { paths: Array<string>}) {
|
||||||
if (request === 'electron' || request.startsWith('electron/')) {
|
if (request === 'electron' || request.startsWith('electron/')) {
|
||||||
return 'electron';
|
return 'electron';
|
||||||
} else {
|
} else {
|
||||||
return originalResolveFilename(request, parent, isMain);
|
return originalResolveFilename(request, parent, isMain, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,3 @@ function getCurrentStack () {
|
|||||||
export async function getSources (options: Electron.SourcesOptions) {
|
export async function getSources (options: Electron.SourcesOptions) {
|
||||||
return deserialize(await ipcRendererInternal.invoke('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options, getCurrentStack()));
|
return deserialize(await ipcRendererInternal.invoke('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options, getCurrentStack()));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMediaSourceIdForWebContents (webContentsId: number) {
|
|
||||||
return ipcRendererInternal.invoke<string>('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_MEDIA_SOURCE_ID_FOR_WEB_CONTENTS', webContentsId, getCurrentStack());
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ function metaToError (meta: { type: 'error', value: any, members: ObjectMember[]
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMessage (channel: string, handler: Function) {
|
function handleMessage (channel: string, handler: Function) {
|
||||||
ipcRendererInternal.on(channel, (event, passedContextId, id, ...args) => {
|
ipcRendererInternal.onMessageFromMain(channel, (event, passedContextId, id, ...args) => {
|
||||||
if (passedContextId === contextId) {
|
if (passedContextId === contextId) {
|
||||||
handler(id, ...args);
|
handler(id, ...args);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
import { webFrame } from 'electron';
|
|
||||||
|
|
||||||
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
|
||||||
|
|
||||||
const v8Util = process._linkedBinding('electron_common_v8_util');
|
|
||||||
|
|
||||||
const IsolatedWorldIDs = {
|
|
||||||
/**
|
|
||||||
* Start of extension isolated world IDs, as defined in
|
|
||||||
* electron_render_frame_observer.h
|
|
||||||
*/
|
|
||||||
ISOLATED_WORLD_EXTENSIONS: 1 << 20
|
|
||||||
};
|
|
||||||
|
|
||||||
let isolatedWorldIds = IsolatedWorldIDs.ISOLATED_WORLD_EXTENSIONS;
|
|
||||||
const extensionWorldId: {[key: string]: number | undefined} = {};
|
|
||||||
|
|
||||||
// https://cs.chromium.org/chromium/src/extensions/renderer/script_injection.cc?type=cs&sq=package:chromium&g=0&l=52
|
|
||||||
const getIsolatedWorldIdForInstance = () => {
|
|
||||||
// TODO(samuelmaddock): allocate and cleanup IDs
|
|
||||||
return isolatedWorldIds++;
|
|
||||||
};
|
|
||||||
|
|
||||||
const escapePattern = function (pattern: string) {
|
|
||||||
return pattern.replace(/[\\^$+?.()|[\]{}]/g, '\\$&');
|
|
||||||
};
|
|
||||||
|
|
||||||
// Check whether pattern matches.
|
|
||||||
// https://developer.chrome.com/extensions/match_patterns
|
|
||||||
const matchesPattern = function (pattern: string) {
|
|
||||||
if (pattern === '<all_urls>') return true;
|
|
||||||
const regexp = new RegExp(`^${pattern.split('*').map(escapePattern).join('.*')}$`);
|
|
||||||
const url = `${location.protocol}//${location.host}${location.pathname}`;
|
|
||||||
return url.match(regexp);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Run the code with chrome API integrated.
|
|
||||||
const runContentScript = function (this: any, extensionId: string, url: string, code: string) {
|
|
||||||
// Assign unique world ID to each extension
|
|
||||||
const worldId = extensionWorldId[extensionId] ||
|
|
||||||
(extensionWorldId[extensionId] = getIsolatedWorldIdForInstance());
|
|
||||||
|
|
||||||
// store extension ID for content script to read in isolated world
|
|
||||||
v8Util.setHiddenValue(global, `extension-${worldId}`, extensionId);
|
|
||||||
|
|
||||||
webFrame.setIsolatedWorldInfo(worldId, {
|
|
||||||
name: `${extensionId} [${worldId}]`
|
|
||||||
// TODO(samuelmaddock): read `content_security_policy` from extension manifest
|
|
||||||
// csp: manifest.content_security_policy,
|
|
||||||
});
|
|
||||||
|
|
||||||
const sources = [{ code, url }];
|
|
||||||
return webFrame.executeJavaScriptInIsolatedWorld(worldId, sources);
|
|
||||||
};
|
|
||||||
|
|
||||||
const runAllContentScript = function (scripts: Array<Electron.InjectionBase>, extensionId: string) {
|
|
||||||
for (const { url, code } of scripts) {
|
|
||||||
runContentScript.call(window, extensionId, url, code);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const runStylesheet = function (this: any, url: string, code: string) {
|
|
||||||
webFrame.insertCSS(code);
|
|
||||||
};
|
|
||||||
|
|
||||||
const runAllStylesheet = function (css: Array<Electron.InjectionBase>) {
|
|
||||||
for (const { url, code } of css) {
|
|
||||||
runStylesheet.call(window, url, code);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Run injected scripts.
|
|
||||||
// https://developer.chrome.com/extensions/content_scripts
|
|
||||||
const injectContentScript = function (extensionId: string, script: Electron.ContentScript) {
|
|
||||||
if (!process.isMainFrame && !script.allFrames) return;
|
|
||||||
if (!script.matches.some(matchesPattern)) return;
|
|
||||||
|
|
||||||
if (script.js) {
|
|
||||||
const fire = runAllContentScript.bind(window, script.js, extensionId);
|
|
||||||
if (script.runAt === 'document_start') {
|
|
||||||
process.once('document-start', fire);
|
|
||||||
} else if (script.runAt === 'document_end') {
|
|
||||||
process.once('document-end', fire);
|
|
||||||
} else {
|
|
||||||
document.addEventListener('DOMContentLoaded', fire);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (script.css) {
|
|
||||||
const fire = runAllStylesheet.bind(window, script.css);
|
|
||||||
if (script.runAt === 'document_start') {
|
|
||||||
process.once('document-start', fire);
|
|
||||||
} else if (script.runAt === 'document_end') {
|
|
||||||
process.once('document-end', fire);
|
|
||||||
} else {
|
|
||||||
document.addEventListener('DOMContentLoaded', fire);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle the request of chrome.tabs.executeJavaScript.
|
|
||||||
ipcRendererUtils.handle('CHROME_TABS_EXECUTE_SCRIPT', function (
|
|
||||||
event: Electron.Event,
|
|
||||||
extensionId: string,
|
|
||||||
url: string,
|
|
||||||
code: string
|
|
||||||
) {
|
|
||||||
return runContentScript.call(window, extensionId, url, code);
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = (entries: Electron.ContentScriptEntry[]) => {
|
|
||||||
for (const entry of entries) {
|
|
||||||
if (entry.contentScripts) {
|
|
||||||
for (const script of entry.contentScripts) {
|
|
||||||
injectContentScript(entry.extensionId, script);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user