mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
91 Commits
v9.0.0-bet
...
v10.0.0-ni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2aa734385e | ||
|
|
7b7def7d1e | ||
|
|
7a91078cc7 | ||
|
|
f965b13d74 | ||
|
|
360c1cad1b | ||
|
|
fd46bc653f | ||
|
|
1848e3f658 | ||
|
|
8cc0435d9c | ||
|
|
68c6d53156 | ||
|
|
41931aa5fa | ||
|
|
1502ecf9f7 | ||
|
|
f1fb513040 | ||
|
|
50009f6608 | ||
|
|
a25d7fa440 | ||
|
|
8045152e59 | ||
|
|
e0c0875d6f | ||
|
|
e965703e62 | ||
|
|
686f53c9da | ||
|
|
e7b0a9ca8f | ||
|
|
2e6fff885d | ||
|
|
57943f4de3 | ||
|
|
a87e0f495d | ||
|
|
cdc13919b2 | ||
|
|
53b4fffff6 | ||
|
|
3d53a4766f | ||
|
|
bb95f6e7a8 | ||
|
|
360326ecad | ||
|
|
f8c4be7caa | ||
|
|
7a7754a3dd | ||
|
|
e6a8906052 | ||
|
|
647f086286 | ||
|
|
ed58168488 | ||
|
|
3d45f0a51a | ||
|
|
b7bb1cc4c3 | ||
|
|
602913cb4c | ||
|
|
b5e7df1cbf | ||
|
|
6ed396df17 | ||
|
|
f97ce86d08 | ||
|
|
2510607658 | ||
|
|
d40a2a8982 | ||
|
|
d590f2efe3 | ||
|
|
85f9c779a8 | ||
|
|
493dcf279b | ||
|
|
22d7b4049c | ||
|
|
592848ed3d | ||
|
|
5e7c594691 | ||
|
|
d1fd237e61 | ||
|
|
2edbff6e6c | ||
|
|
730b77189a | ||
|
|
fe5318d753 | ||
|
|
023a3ca722 | ||
|
|
8b89c3cade | ||
|
|
43ca62cad0 | ||
|
|
b66db2f268 | ||
|
|
c608d6d7fb | ||
|
|
80dd16aa78 | ||
|
|
2bfe66bcfd | ||
|
|
9ad6f06831 | ||
|
|
9942149f3c | ||
|
|
6fe7d65c9d | ||
|
|
17abeca8b7 | ||
|
|
8ca4e761fd | ||
|
|
b77f701aeb | ||
|
|
af631f8204 | ||
|
|
c2cd588e70 | ||
|
|
97cf24ac98 | ||
|
|
d5e7904610 | ||
|
|
099246f0e4 | ||
|
|
dafbf04b9a | ||
|
|
43592f8b71 | ||
|
|
058222a9f1 | ||
|
|
f989faab5c | ||
|
|
5e49aafe55 | ||
|
|
ea89120c9e | ||
|
|
c6cec97287 | ||
|
|
45591e31ce | ||
|
|
e2a5de9248 | ||
|
|
6a7d722c06 | ||
|
|
f1f185ee93 | ||
|
|
83124889e5 | ||
|
|
9107157073 | ||
|
|
eca1dd7f8b | ||
|
|
c8273e375c | ||
|
|
f4fd939409 | ||
|
|
e7982623ec | ||
|
|
3f880fb7c7 | ||
|
|
070e312e8b | ||
|
|
629c2121ba | ||
|
|
b664c824d2 | ||
|
|
42a9d72ce1 | ||
|
|
c8fe25e109 |
@@ -41,6 +41,14 @@ parameters:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-linux-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
run-macos-publish:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
# The config expects the following environment variables to be set:
|
||||
# - "SLACK_WEBHOOK" Slack hook URL to send notifications.
|
||||
#
|
||||
@@ -65,12 +73,12 @@ machine-linux-2xlarge: &machine-linux-2xlarge
|
||||
|
||||
machine-mac: &machine-mac
|
||||
macos:
|
||||
xcode: "10.3.0"
|
||||
xcode: "11.1.0"
|
||||
|
||||
machine-mac-large: &machine-mac-large
|
||||
resource_class: large
|
||||
macos:
|
||||
xcode: "10.3.0"
|
||||
xcode: "11.1.0"
|
||||
|
||||
# Build configurations options.
|
||||
env-testing-build: &env-testing-build
|
||||
@@ -228,15 +236,6 @@ step-setup-env-for-build: &step-setup-env-for-build
|
||||
command: |
|
||||
# To find `gn` executable.
|
||||
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
|
||||
# Setup Goma if applicable
|
||||
if [ ! -z "$RAW_GOMA_AUTH" ] && [ "`uname`" == "Linux" ]; then
|
||||
export USE_SCCACHE="false"
|
||||
echo 'export USE_SCCACHE=false' >> $BASH_ENV
|
||||
echo 'export USE_GOMA=true' >> $BASH_ENV
|
||||
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
|
||||
echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
|
||||
src/electron/external_binaries/goma/goma_ctl.py ensure_start
|
||||
fi
|
||||
|
||||
if [ "$USE_SCCACHE" == "true" ]; then
|
||||
# https://github.com/mozilla/sccache
|
||||
@@ -249,6 +248,29 @@ step-setup-env-for-build: &step-setup-env-for-build
|
||||
fi
|
||||
fi
|
||||
|
||||
step-setup-goma-for-build: &step-setup-goma-for-build
|
||||
run:
|
||||
name: Setup Goma
|
||||
command: |
|
||||
echo 'export USE_GOMA=true' >> $BASH_ENV
|
||||
if [ "`uname`" == "Linux" ]; then
|
||||
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
|
||||
else
|
||||
echo 'export NUMBER_OF_NINJA_PROCESSES=25' >> $BASH_ENV
|
||||
fi
|
||||
if [ ! -z "$RAW_GOMA_AUTH" ]; then
|
||||
echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
|
||||
fi
|
||||
git clone https://github.com/electron/build-tools.git
|
||||
cd build-tools
|
||||
npm install
|
||||
mkdir third_party
|
||||
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
|
||||
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 LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
||||
cd ..
|
||||
|
||||
step-restore-brew-cache: &step-restore-brew-cache
|
||||
restore_cache:
|
||||
paths:
|
||||
@@ -339,7 +361,7 @@ step-gn-gen-default: &step-gn-gen-default
|
||||
command: |
|
||||
cd src
|
||||
if [ "$USE_GOMA" == "true" ]; then
|
||||
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
else
|
||||
gn gen out/Default --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
fi
|
||||
@@ -432,15 +454,17 @@ step-electron-dist-store: &step-electron-dist-store
|
||||
path: src/out/Default/dist.zip
|
||||
destination: dist.zip
|
||||
|
||||
step-electron-chromedriver-gn-gen: &step-electron-chromedriver-gn-gen
|
||||
step-electron-maybe-chromedriver-gn-gen: &step-electron-maybe-chromedriver-gn-gen
|
||||
run:
|
||||
name: chromedriver GN gen
|
||||
command: |
|
||||
cd src
|
||||
if [ "$USE_GOMA" == "true" ]; then
|
||||
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
else
|
||||
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
|
||||
if [ "$USE_GOMA" == "true" ]; then
|
||||
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"//electron/build/args/goma.gn\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
else
|
||||
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") cc_wrapper=\"$SCCACHE_PATH\" is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
step-electron-chromedriver-build: &step-electron-chromedriver-build
|
||||
@@ -448,13 +472,23 @@ step-electron-chromedriver-build: &step-electron-chromedriver-build
|
||||
name: Build chromedriver.zip
|
||||
command: |
|
||||
cd src
|
||||
ninja -C out/chromedriver electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
|
||||
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/out/chromedriver/chromedriver
|
||||
ninja -C out/chromedriver electron:electron_chromedriver_zip
|
||||
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
|
||||
export CHROMEDRIVER_DIR="out/chromedriver"
|
||||
else
|
||||
export CHROMEDRIVER_DIR="out/Default"
|
||||
fi
|
||||
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
|
||||
if [ "`uname`" == "Linux" ]; then
|
||||
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/$CHROMEDRIVER_DIR/chromedriver
|
||||
fi
|
||||
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver_zip
|
||||
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
|
||||
cp out/chromedriver/chromedriver.zip out/Default
|
||||
fi
|
||||
|
||||
step-electron-chromedriver-store: &step-electron-chromedriver-store
|
||||
store_artifacts:
|
||||
path: src/out/chromedriver/chromedriver.zip
|
||||
path: src/out/Default/chromedriver.zip
|
||||
destination: chromedriver.zip
|
||||
|
||||
step-nodejs-headers-build: &step-nodejs-headers-build
|
||||
@@ -481,6 +515,7 @@ step-electron-publish: &step-electron-publish
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
rm -rf src/out/Default/obj
|
||||
fi
|
||||
|
||||
cd src/electron
|
||||
if [ "$UPLOAD_TO_S3" == "1" ]; then
|
||||
echo 'Uploading Electron release distribution to S3'
|
||||
@@ -497,7 +532,7 @@ step-persist-data-for-tests: &step-persist-data-for-tests
|
||||
# Build artifacts
|
||||
- src/out/Default/dist.zip
|
||||
- src/out/Default/mksnapshot.zip
|
||||
- src/out/chromedriver/chromedriver.zip
|
||||
- src/out/Default/chromedriver.zip
|
||||
- src/out/Default/shell_browser_ui_unittests
|
||||
- src/out/Default/gen/node_headers
|
||||
- src/out/ffmpeg/ffmpeg.zip
|
||||
@@ -532,7 +567,7 @@ step-chromedriver-unzip: &step-chromedriver-unzip
|
||||
run:
|
||||
name: Unzip chromedriver.zip
|
||||
command: |
|
||||
cd src/out/chromedriver
|
||||
cd src/out/Default
|
||||
unzip -o chromedriver.zip
|
||||
|
||||
step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
|
||||
@@ -577,7 +612,7 @@ step-verify-chromedriver: &step-verify-chromedriver
|
||||
name: Verify ChromeDriver
|
||||
command: |
|
||||
cd src
|
||||
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/chromedriver
|
||||
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
|
||||
|
||||
step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
|
||||
run:
|
||||
@@ -595,7 +630,7 @@ step-show-sccache-stats: &step-show-sccache-stats
|
||||
$SCCACHE_PATH -s
|
||||
fi
|
||||
if [ "$USE_GOMA" == "true" ]; then
|
||||
src/electron/external_binaries/goma/goma_ctl.py stat
|
||||
$LOCAL_GOMA_DIR/goma_ctl.py stat
|
||||
fi
|
||||
|
||||
step-mksnapshot-build: &step-mksnapshot-build
|
||||
@@ -833,7 +868,7 @@ step-check-for-doc-only-change: &step-check-for-doc-only-change
|
||||
command: |
|
||||
cd src/electron
|
||||
node script/yarn install --frozen-lockfile
|
||||
if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST; then
|
||||
if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST --prBranch=$CIRCLE_BRANCH; then
|
||||
#PR is doc only change; save file with value true to indicate doc only change
|
||||
echo "true" > .skip-ci-build
|
||||
else
|
||||
@@ -869,7 +904,7 @@ step-ts-compile: &step-ts-compile
|
||||
command: |
|
||||
cd src
|
||||
ninja -C out/Default electron:default_app_js -j $NUMBER_OF_NINJA_PROCESSES
|
||||
ninja -C out/Default electron:atom_js2c -j $NUMBER_OF_NINJA_PROCESSES
|
||||
ninja -C out/Default electron:electron_js2c -j $NUMBER_OF_NINJA_PROCESSES
|
||||
|
||||
# Lists of steps.
|
||||
steps-lint: &steps-lint
|
||||
@@ -953,7 +988,6 @@ steps-checkout-and-save-cache: &steps-checkout-and-save-cache
|
||||
sudo chown -R $(id -u):$(id -g) /portal
|
||||
mv ./src /portal
|
||||
- *step-save-src-cache
|
||||
- *step-save-brew-cache
|
||||
|
||||
steps-electron-gn-check: &steps-electron-gn-check
|
||||
steps:
|
||||
@@ -965,69 +999,6 @@ steps-electron-gn-check: &steps-electron-gn-check
|
||||
- *step-gn-gen-default
|
||||
- *step-gn-check
|
||||
|
||||
steps-electron-build: &steps-electron-build
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- *step-maybe-early-exit-doc-only-change
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-setup-env-for-build
|
||||
- *step-restore-brew-cache
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-install-npm-deps-on-mac
|
||||
- *step-fix-sync-on-mac
|
||||
- *step-delete-git-directories
|
||||
- *step-gn-gen-default
|
||||
|
||||
# Electron app
|
||||
- *step-electron-build
|
||||
- *step-maybe-electron-dist-strip
|
||||
- *step-electron-dist-build
|
||||
- *step-electron-dist-store
|
||||
- *step-ninja-summary
|
||||
|
||||
# Native test targets
|
||||
- *step-native-unittests-build
|
||||
- *step-native-unittests-store
|
||||
|
||||
# Node.js headers
|
||||
- *step-nodejs-headers-build
|
||||
- *step-nodejs-headers-store
|
||||
|
||||
- *step-show-sccache-stats
|
||||
|
||||
# mksnapshot
|
||||
- *step-mksnapshot-build
|
||||
- *step-mksnapshot-store
|
||||
- *step-maybe-cross-arch-snapshot
|
||||
- *step-maybe-cross-arch-snapshot-store
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
- *step-electron-chromedriver-store
|
||||
|
||||
# ffmpeg
|
||||
- *step-ffmpeg-gn-gen
|
||||
- *step-ffmpeg-build
|
||||
- *step-ffmpeg-store
|
||||
|
||||
# hunspell
|
||||
- *step-hunspell-build
|
||||
- *step-hunspell-store
|
||||
|
||||
# Save all data needed for a further tests run.
|
||||
- *step-persist-data-for-tests
|
||||
|
||||
- *step-maybe-generate-breakpad-symbols
|
||||
- *step-maybe-zip-symbols
|
||||
- *step-symbols-store
|
||||
|
||||
# Trigger tests on arm hardware if needed
|
||||
- *step-maybe-trigger-arm-test
|
||||
|
||||
- *step-maybe-notify-slack-failure
|
||||
|
||||
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
|
||||
steps:
|
||||
# Checkout - Copied ffrom steps-checkout
|
||||
@@ -1067,56 +1038,6 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
|
||||
#Compile ts/js to verify doc change didn't break anything
|
||||
- *step-ts-compile
|
||||
|
||||
steps-electron-build-for-publish: &steps-electron-build-for-publish
|
||||
steps:
|
||||
- *step-checkout-electron
|
||||
- *step-depot-tools-get
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-restore-brew-cache
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-gclient-sync
|
||||
- *step-setup-env-for-build
|
||||
- *step-delete-git-directories
|
||||
- *step-minimize-workspace-size-from-checkout
|
||||
- *step-gn-gen-default
|
||||
|
||||
# Electron app
|
||||
- *step-electron-build
|
||||
- *step-maybe-generate-breakpad-symbols
|
||||
- *step-maybe-electron-dist-strip
|
||||
- *step-electron-dist-build
|
||||
- *step-electron-dist-store
|
||||
- *step-maybe-zip-symbols
|
||||
- *step-symbols-store
|
||||
|
||||
# mksnapshot
|
||||
- *step-mksnapshot-build
|
||||
- *step-mksnapshot-store
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
- *step-electron-chromedriver-store
|
||||
|
||||
# Node.js headers
|
||||
- *step-nodejs-headers-build
|
||||
- *step-nodejs-headers-store
|
||||
|
||||
# ffmpeg
|
||||
- *step-ffmpeg-gn-gen
|
||||
- *step-ffmpeg-build
|
||||
- *step-ffmpeg-store
|
||||
|
||||
# hunspell
|
||||
- *step-hunspell-build
|
||||
- *step-hunspell-store
|
||||
|
||||
# typescript defs
|
||||
- *step-maybe-generate-typescript-defs
|
||||
|
||||
# Publish
|
||||
- *step-electron-publish
|
||||
|
||||
steps-chromedriver-build: &steps-chromedriver-build
|
||||
steps:
|
||||
- attach_workspace:
|
||||
@@ -1125,7 +1046,7 @@ steps-chromedriver-build: &steps-chromedriver-build
|
||||
- *step-setup-env-for-build
|
||||
- *step-fix-sync-on-mac
|
||||
|
||||
- *step-electron-chromedriver-gn-gen
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
- *step-electron-chromedriver-store
|
||||
|
||||
@@ -1272,7 +1193,7 @@ steps-test-node: &steps-test-node
|
||||
name: Run Node Tests
|
||||
command: |
|
||||
cd src
|
||||
node electron/script/node-spec-runner.js junit
|
||||
node electron/script/node-spec-runner.js --default --jUnitDir=junit
|
||||
- store_test_results:
|
||||
path: src/junit
|
||||
|
||||
@@ -1341,6 +1262,12 @@ commands:
|
||||
use-out-cache:
|
||||
type: boolean
|
||||
default: true
|
||||
restore-src-cache:
|
||||
type: boolean
|
||||
default: true
|
||||
preserve-vendor-dirs:
|
||||
type: boolean
|
||||
default: false
|
||||
steps:
|
||||
- when:
|
||||
condition: << parameters.attach >>
|
||||
@@ -1349,6 +1276,7 @@ commands:
|
||||
at: .
|
||||
- *step-restore-brew-cache
|
||||
- *step-install-gnutar-on-mac
|
||||
- *step-save-brew-cache
|
||||
- when:
|
||||
condition: << parameters.checkout-and-assume-cache >>
|
||||
steps:
|
||||
@@ -1366,17 +1294,38 @@ commands:
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-generate-deps-hash
|
||||
- *step-touch-sync-done
|
||||
- maybe-restore-portaled-src-cache
|
||||
- when:
|
||||
condition: << parameters.restore-src-cache >>
|
||||
steps:
|
||||
- maybe-restore-portaled-src-cache
|
||||
- *step-maybe-restore-git-cache
|
||||
- *step-set-git-cache-path
|
||||
# This sync call only runs if .circle-sync-done is an EMPTY file
|
||||
- *step-gclient-sync
|
||||
# These next few steps reset Electron to the correct commit regardless of which cache was restored
|
||||
- when:
|
||||
condition: << parameters.preserve-vendor-dirs >>
|
||||
steps:
|
||||
- run:
|
||||
name: Preserve vendor dirs for release
|
||||
command: |
|
||||
mv src/electron/vendor/boto .
|
||||
mv src/electron/vendor/requests .
|
||||
- run:
|
||||
name: Wipe Electron
|
||||
command: rm -rf src/electron
|
||||
- *step-checkout-electron
|
||||
- *step-run-electron-only-hooks
|
||||
- when:
|
||||
condition: << parameters.preserve-vendor-dirs >>
|
||||
steps:
|
||||
- run:
|
||||
name: Preserve vendor dirs for release
|
||||
command: |
|
||||
rm -rf src/electron/vendor/boto
|
||||
rm -rf src/electron/vendor/requests
|
||||
mv boto src/electron/vendor
|
||||
mv requests src/electron/vendor/requests
|
||||
- *step-generate-deps-hash-cleanly
|
||||
- *step-mark-sync-done
|
||||
- *step-minimize-workspace-size-from-checkout
|
||||
@@ -1394,10 +1343,10 @@ commands:
|
||||
steps:
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-setup-env-for-build
|
||||
- *step-setup-goma-for-build
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-fix-sync-on-mac
|
||||
- *step-delete-git-directories
|
||||
- *step-gn-gen-default
|
||||
|
||||
# Electron app
|
||||
- when:
|
||||
@@ -1429,7 +1378,7 @@ commands:
|
||||
- *step-maybe-cross-arch-snapshot-store
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-chromedriver-gn-gen
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
- *step-electron-chromedriver-store
|
||||
|
||||
@@ -1475,10 +1424,80 @@ commands:
|
||||
steps:
|
||||
- *step-save-out-cache
|
||||
|
||||
# Trigger tests on arm hardware if needed
|
||||
- *step-maybe-trigger-arm-test
|
||||
# Trigger tests on arm hardware if needed
|
||||
- *step-maybe-trigger-arm-test
|
||||
|
||||
- *step-maybe-notify-slack-failure
|
||||
- *step-maybe-notify-slack-failure
|
||||
|
||||
electron-publish:
|
||||
parameters:
|
||||
attach:
|
||||
type: boolean
|
||||
default: false
|
||||
checkout:
|
||||
type: boolean
|
||||
default: true
|
||||
steps:
|
||||
- when:
|
||||
condition: << parameters.attach >>
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- when:
|
||||
condition: << parameters.checkout >>
|
||||
steps:
|
||||
- *step-depot-tools-get
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-restore-brew-cache
|
||||
- *step-get-more-space-on-mac
|
||||
- when:
|
||||
condition: << parameters.checkout >>
|
||||
steps:
|
||||
- *step-checkout-electron
|
||||
- *step-gclient-sync
|
||||
- *step-delete-git-directories
|
||||
- *step-minimize-workspace-size-from-checkout
|
||||
- *step-fix-sync-on-mac
|
||||
- *step-setup-env-for-build
|
||||
- *step-gn-gen-default
|
||||
|
||||
# Electron app
|
||||
- *step-electron-build
|
||||
- *step-show-sccache-stats
|
||||
- *step-maybe-generate-breakpad-symbols
|
||||
- *step-maybe-electron-dist-strip
|
||||
- *step-electron-dist-build
|
||||
- *step-electron-dist-store
|
||||
- *step-maybe-zip-symbols
|
||||
- *step-symbols-store
|
||||
|
||||
# mksnapshot
|
||||
- *step-mksnapshot-build
|
||||
- *step-mksnapshot-store
|
||||
|
||||
# chromedriver
|
||||
- *step-electron-maybe-chromedriver-gn-gen
|
||||
- *step-electron-chromedriver-build
|
||||
- *step-electron-chromedriver-store
|
||||
|
||||
# Node.js headers
|
||||
- *step-nodejs-headers-build
|
||||
- *step-nodejs-headers-store
|
||||
|
||||
# ffmpeg
|
||||
- *step-ffmpeg-gn-gen
|
||||
- *step-ffmpeg-build
|
||||
- *step-ffmpeg-store
|
||||
|
||||
# hunspell
|
||||
- *step-hunspell-build
|
||||
- *step-hunspell-store
|
||||
|
||||
# typescript defs
|
||||
- *step-maybe-generate-typescript-defs
|
||||
|
||||
# Publish
|
||||
- *step-electron-publish
|
||||
|
||||
# List of all jobs.
|
||||
jobs:
|
||||
@@ -1497,6 +1516,20 @@ jobs:
|
||||
<<: *steps-electron-ts-compile-for-doc-change
|
||||
|
||||
# Layer 1: Checkout.
|
||||
linux-checkout:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: false
|
||||
build: false
|
||||
checkout: true
|
||||
persist-checkout: true
|
||||
restore-src-cache: false
|
||||
preserve-vendor-dirs: true
|
||||
|
||||
linux-checkout-fast:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
@@ -1540,6 +1573,22 @@ jobs:
|
||||
checkout: true
|
||||
persist-checkout: true
|
||||
|
||||
mac-checkout:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-testing-build
|
||||
<<: *env-macos-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: false
|
||||
build: false
|
||||
checkout: true
|
||||
persist-checkout: true
|
||||
restore-src-cache: false
|
||||
preserve-vendor-dirs: true
|
||||
|
||||
mac-checkout-fast:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
@@ -1569,7 +1618,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
@@ -1583,7 +1631,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *env-disable-run-as-node
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
@@ -1605,7 +1652,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-medium
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *steps-chromedriver-build
|
||||
|
||||
@@ -1614,10 +1660,13 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: true
|
||||
checkout: true
|
||||
|
||||
linux-x64-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1627,7 +1676,22 @@ jobs:
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-x64-publish-skip-checkout:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
linux-ia32-testing:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1635,7 +1699,6 @@ jobs:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-ia32
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
@@ -1650,7 +1713,6 @@ jobs:
|
||||
<<: *env-linux-medium
|
||||
<<: *env-ia32
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *steps-chromedriver-build
|
||||
|
||||
@@ -1660,10 +1722,13 @@ jobs:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-ia32
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: true
|
||||
checkout: true
|
||||
|
||||
linux-ia32-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1675,7 +1740,24 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-32bit-release
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-ia32-publish-skip-checkout:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-ia32
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-32bit-release
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
linux-arm-testing:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1683,7 +1765,6 @@ jobs:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-arm
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
TRIGGER_ARM_TEST: true
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
@@ -1699,7 +1780,6 @@ jobs:
|
||||
<<: *env-linux-medium
|
||||
<<: *env-arm
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *steps-chromedriver-build
|
||||
|
||||
@@ -1709,10 +1789,13 @@ jobs:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-arm
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: false
|
||||
checkout: true
|
||||
|
||||
linux-arm-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1724,7 +1807,24 @@ jobs:
|
||||
<<: *env-32bit-release
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-arm-publish-skip-checkout:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-arm
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-32bit-release
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
linux-arm64-testing:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1732,7 +1832,6 @@ jobs:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-arm64
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
TRIGGER_ARM_TEST: true
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
@@ -1756,7 +1855,6 @@ jobs:
|
||||
<<: *env-linux-medium
|
||||
<<: *env-arm64
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *steps-chromedriver-build
|
||||
|
||||
@@ -1766,10 +1864,13 @@ jobs:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-arm64
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: false
|
||||
checkout: true
|
||||
|
||||
linux-arm64-publish:
|
||||
<<: *machine-linux-2xlarge
|
||||
@@ -1780,14 +1881,29 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
linux-arm64-publish-skip-checkout:
|
||||
<<: *machine-linux-2xlarge
|
||||
environment:
|
||||
<<: *env-linux-2xlarge-release
|
||||
<<: *env-arm64
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
osx-testing:
|
||||
<<: *machine-mac-large
|
||||
environment:
|
||||
<<: *env-mac-large
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *env-macos-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
@@ -1810,7 +1926,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-machine-mac
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *steps-chromedriver-build
|
||||
|
||||
@@ -1819,9 +1934,14 @@ jobs:
|
||||
environment:
|
||||
<<: *env-mac-large
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: true
|
||||
checkout: false
|
||||
checkout-and-assume-cache: true
|
||||
attach: false
|
||||
|
||||
osx-publish:
|
||||
<<: *machine-mac-large
|
||||
@@ -1831,7 +1951,22 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
osx-publish-skip-checkout:
|
||||
<<: *machine-mac-large
|
||||
environment:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
mas-testing:
|
||||
<<: *machine-mac-large
|
||||
@@ -1839,7 +1974,6 @@ jobs:
|
||||
<<: *env-mac-large
|
||||
<<: *env-mas
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *env-macos-build
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
@@ -1863,7 +1997,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-machine-mac
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-send-slack-notifications
|
||||
<<: *steps-chromedriver-build
|
||||
|
||||
@@ -1873,10 +2006,15 @@ jobs:
|
||||
<<: *env-mac-large
|
||||
<<: *env-mas
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-ninja-status
|
||||
<<: *steps-electron-build
|
||||
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- electron-build:
|
||||
persist: true
|
||||
checkout: false
|
||||
checkout-and-assume-cache: true
|
||||
attach: false
|
||||
|
||||
mas-publish:
|
||||
<<: *machine-mac-large
|
||||
environment:
|
||||
@@ -1886,7 +2024,23 @@ jobs:
|
||||
<<: *env-enable-sccache
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
<<: *steps-electron-build-for-publish
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: false
|
||||
checkout: true
|
||||
|
||||
mas-publish-skip-checkout:
|
||||
<<: *machine-mac-large
|
||||
environment:
|
||||
<<: *env-mac-large-release
|
||||
<<: *env-mas
|
||||
<<: *env-release-build
|
||||
<<: *env-enable-sccache
|
||||
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
|
||||
steps:
|
||||
- electron-publish:
|
||||
attach: true
|
||||
checkout: false
|
||||
|
||||
# Layer 3: Tests.
|
||||
linux-x64-unittests:
|
||||
@@ -1894,7 +2048,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-unittests
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-headless-testing
|
||||
<<: *steps-native-tests
|
||||
|
||||
@@ -1903,7 +2056,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-unittests
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-headless-testing
|
||||
TESTS_ARGS: '--only-disabled-tests'
|
||||
<<: *steps-native-tests
|
||||
@@ -1913,7 +2065,6 @@ jobs:
|
||||
environment:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-unittests
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-headless-testing
|
||||
TESTS_ARGS: '--include-disabled-tests'
|
||||
<<: *steps-native-tests
|
||||
@@ -1924,7 +2075,6 @@ jobs:
|
||||
<<: *env-linux-2xlarge
|
||||
<<: *env-browsertests
|
||||
<<: *env-testing-build
|
||||
<<: *env-enable-sccache
|
||||
<<: *env-headless-testing
|
||||
<<: *steps-native-tests
|
||||
|
||||
@@ -2180,6 +2330,27 @@ workflows:
|
||||
# will need to be updated and there will most likely need to be changes to
|
||||
# sudowoodo
|
||||
|
||||
publish-linux:
|
||||
when: << pipeline.parameters.run-linux-publish >>
|
||||
jobs:
|
||||
- linux-checkout
|
||||
- linux-x64-publish-skip-checkout:
|
||||
requires:
|
||||
- linux-checkout
|
||||
context: release-env
|
||||
- linux-ia32-publish-skip-checkout:
|
||||
requires:
|
||||
- linux-checkout
|
||||
context: release-env
|
||||
- linux-arm-publish-skip-checkout:
|
||||
requires:
|
||||
- linux-checkout
|
||||
context: release-env
|
||||
- linux-arm64-publish-skip-checkout:
|
||||
requires:
|
||||
- linux-checkout
|
||||
context: release-env
|
||||
|
||||
publish-x64-linux:
|
||||
when: << pipeline.parameters.run-linux-x64-publish >>
|
||||
jobs:
|
||||
@@ -2216,6 +2387,17 @@ workflows:
|
||||
- mas-publish:
|
||||
context: release-env
|
||||
|
||||
publish-macos:
|
||||
when: << pipeline.parameters.run-macos-publish >>
|
||||
jobs:
|
||||
- mac-checkout
|
||||
- osx-publish-skip-checkout:
|
||||
requires:
|
||||
- mac-checkout
|
||||
- mas-publish-skip-checkout:
|
||||
requires:
|
||||
- mac-checkout
|
||||
|
||||
lint:
|
||||
when: << pipeline.parameters.run-lint >>
|
||||
jobs:
|
||||
@@ -2302,10 +2484,9 @@ workflows:
|
||||
- *chromium-upgrade-branches
|
||||
jobs:
|
||||
- linux-checkout-fast
|
||||
- linux-checkout-and-save-cache
|
||||
|
||||
- linux-x64-release:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-x64-release
|
||||
- linux-x64-release-tests:
|
||||
requires:
|
||||
- linux-x64-release
|
||||
@@ -2329,9 +2510,7 @@ workflows:
|
||||
- linux-x64-verify-ffmpeg
|
||||
- linux-x64-chromedriver
|
||||
|
||||
- linux-ia32-release:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-ia32-release
|
||||
- linux-ia32-release-tests:
|
||||
requires:
|
||||
- linux-ia32-release
|
||||
@@ -2355,9 +2534,7 @@ workflows:
|
||||
- linux-ia32-verify-ffmpeg
|
||||
- linux-ia32-chromedriver
|
||||
|
||||
- linux-arm-release:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm-release
|
||||
- linux-arm-chromedriver:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
@@ -2366,10 +2543,7 @@ workflows:
|
||||
- linux-arm-release
|
||||
- linux-arm-chromedriver
|
||||
|
||||
|
||||
- linux-arm64-release:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
- linux-arm64-release
|
||||
- linux-arm64-chromedriver:
|
||||
requires:
|
||||
- linux-checkout-fast
|
||||
@@ -2389,10 +2563,11 @@ workflows:
|
||||
- *chromium-upgrade-branches
|
||||
jobs:
|
||||
- mac-checkout-fast
|
||||
- mac-checkout-and-save-cache
|
||||
|
||||
- osx-release:
|
||||
requires:
|
||||
- mac-checkout-fast
|
||||
- mac-checkout-and-save-cache
|
||||
- osx-release-tests:
|
||||
requires:
|
||||
- osx-release
|
||||
@@ -2418,7 +2593,7 @@ workflows:
|
||||
|
||||
- mas-release:
|
||||
requires:
|
||||
- mac-checkout-fast
|
||||
- mac-checkout-and-save-cache
|
||||
- mas-release-tests:
|
||||
requires:
|
||||
- mas-release
|
||||
|
||||
12
.github/CODEOWNERS
vendored
12
.github/CODEOWNERS
vendored
@@ -3,20 +3,10 @@
|
||||
# https://help.github.com/articles/about-codeowners
|
||||
# https://git-scm.com/docs/gitignore
|
||||
|
||||
# Most stuff in here is owned by the Community & Safety WG...
|
||||
/.github/* @electron/wg-community
|
||||
|
||||
# ...except the Admin WG maintains this file.
|
||||
/.github/CODEOWNERS @electron/wg-admin
|
||||
|
||||
# Upgrades WG
|
||||
/patches/ @electron/wg-upgrades
|
||||
DEPS @electron/wg-upgrades
|
||||
|
||||
# Docs & Tooling WG
|
||||
/default_app/ @electron/wg-docs-tools
|
||||
/docs/ @electron/wg-docs-tools
|
||||
|
||||
# Releases WG
|
||||
/npm/ @electron/wg-releases
|
||||
/script/release @electron/wg-releases
|
||||
/script/release @electron/wg-releases
|
||||
|
||||
14
BUILD.gn
14
BUILD.gn
@@ -629,8 +629,6 @@ source_set("electron_lib") {
|
||||
deps += [ "//components/printing/common:mojo_interfaces" ]
|
||||
}
|
||||
|
||||
deps += [ "shell/common/extensions/api:extensions_features" ]
|
||||
deps += [ "shell/common/extensions/api" ]
|
||||
deps += [
|
||||
"//components/pref_registry",
|
||||
"//components/user_prefs",
|
||||
@@ -642,12 +640,22 @@ source_set("electron_lib") {
|
||||
]
|
||||
if (enable_electron_extensions) {
|
||||
sources += filenames.lib_sources_extensions
|
||||
deps += [
|
||||
"shell/browser/extensions/api:api_registration",
|
||||
"shell/common/extensions/api",
|
||||
"shell/common/extensions/api:extensions_features",
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
"//components/zoom",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_pdf) {
|
||||
# Printing depends on some //pdf code, so it needs to be built even if the
|
||||
# pdf viewer isn't enabled.
|
||||
deps += [ "//pdf" ]
|
||||
deps += [
|
||||
"//pdf",
|
||||
"//pdf:features",
|
||||
]
|
||||
}
|
||||
if (enable_pdf_viewer) {
|
||||
deps += [
|
||||
|
||||
4
DEPS
4
DEPS
@@ -12,9 +12,9 @@ gclient_gn_args = [
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'2102ff0fb03469ca5ff317a168e6ad99ca0f23f1',
|
||||
'ddac4c3cc1528254008f9e7a2aea5d4426906bfd',
|
||||
'node_version':
|
||||
'v12.14.1',
|
||||
'v12.16.1',
|
||||
'nan_version':
|
||||
'2ee313aaca52e2b478965ac50eb5082520380d1b',
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
9.0.0-nightly.20200205
|
||||
10.0.0-nightly.20200225
|
||||
24
appveyor.yml
24
appveyor.yml
@@ -118,19 +118,29 @@ build_script:
|
||||
}
|
||||
}
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||
.\src\electron\script\start-goma.ps1 -gomaDir "$pwd\src\electron\external_binaries\goma"
|
||||
if ($env:GN_CONFIG -ne 'release') {
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||
}
|
||||
git clone https://github.com/electron/build-tools.git
|
||||
cd build-tools
|
||||
npm install
|
||||
mkdir third_party
|
||||
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
|
||||
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||
cd ..
|
||||
.\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
||||
}
|
||||
- cd src
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- if DEFINED RAW_GOMA_AUTH (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"//electron/build/args/goma.gn\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
|
||||
- if DEFINED GN_GOMA_FILE (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
|
||||
- gn check out/Default //electron:electron_lib
|
||||
- gn check out/Default //electron:electron_app
|
||||
- gn check out/Default //electron:manifests
|
||||
- gn check out/Default //electron/shell/common/api:mojo
|
||||
- if DEFINED RAW_GOMA_AUTH (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
|
||||
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
|
||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
|
||||
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||
@@ -140,7 +150,7 @@ build_script:
|
||||
- ninja -C out/Default electron:hunspell_dictionaries_zip
|
||||
- ninja -C out/Default electron:electron_chromedriver_zip
|
||||
- ninja -C out/Default third_party/electron_node:headers
|
||||
- if DEFINED RAW_GOMA_AUTH (python electron\external_binaries\goma\goma_ctl.py stat)
|
||||
- if "%GN_CONFIG%"=="testing" ( python %LOCAL_GOMA_DIR%\goma_ctl.py stat )
|
||||
- python electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
||||
- appveyor PushArtifact out/Default/windows_toolchain_profile.json
|
||||
- appveyor PushArtifact out/Default/dist.zip
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
|
||||
node_module_version = 76
|
||||
node_module_version = 82
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_typed_array_max_size_in_heap = 0
|
||||
|
||||
@@ -14,7 +14,7 @@ declare_args() {
|
||||
|
||||
enable_view_api = false
|
||||
|
||||
enable_pdf_viewer = false
|
||||
enable_pdf_viewer = true
|
||||
|
||||
enable_tts = true
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ static_library("chrome") {
|
||||
]
|
||||
deps = [
|
||||
"//chrome/browser:resource_prefetch_predictor_proto",
|
||||
"//chrome/browser/ssl:proto",
|
||||
"//components/feature_engagement:buildflags",
|
||||
]
|
||||
|
||||
@@ -233,6 +232,12 @@ static_library("chrome") {
|
||||
|
||||
if (enable_electron_extensions) {
|
||||
sources += [
|
||||
"//chrome/browser/extensions/chrome_url_request_util.cc",
|
||||
"//chrome/browser/extensions/chrome_url_request_util.h",
|
||||
"//chrome/browser/pdf/pdf_extension_util.cc",
|
||||
"//chrome/browser/pdf/pdf_extension_util.h",
|
||||
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc",
|
||||
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h",
|
||||
"//chrome/renderer/extensions/extension_hooks_delegate.cc",
|
||||
"//chrome/renderer/extensions/extension_hooks_delegate.h",
|
||||
"//chrome/renderer/extensions/tabs_hooks_delegate.cc",
|
||||
|
||||
@@ -112,6 +112,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||
* [Process Object](api/process.md)
|
||||
* [Supported Command Line Switches](api/command-line-switches.md)
|
||||
* [Environment Variables](api/environment-variables.md)
|
||||
* [Chrome Extensions Support](api/extensions.md)
|
||||
* [Breaking API Changes](breaking-changes.md)
|
||||
|
||||
### Custom DOM Elements:
|
||||
|
||||
@@ -703,34 +703,34 @@ Clears the recent documents list.
|
||||
|
||||
### `app.setAsDefaultProtocolClient(protocol[, path, args])`
|
||||
|
||||
* `protocol` String - The name of your protocol, without `://`. If you want your
|
||||
app to handle `electron://` links, call this method with `electron` as the
|
||||
parameter.
|
||||
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
|
||||
* `args` String[] (optional) _Windows_ - Defaults to an empty array
|
||||
* `protocol` String - The name of your protocol, without `://`. For example,
|
||||
if you want your app to handle `electron://` links, call this method with
|
||||
`electron` as the parameter.
|
||||
* `path` String (optional) _Windows_ - The path to the Electron executable.
|
||||
Defaults to `process.execPath`
|
||||
* `args` String[] (optional) _Windows_ - Arguments passed to the executable.
|
||||
Defaults to an empty array
|
||||
|
||||
Returns `Boolean` - Whether the call succeeded.
|
||||
|
||||
This method sets the current executable as the default handler for a protocol
|
||||
(aka URI scheme). It allows you to integrate your app deeper into the operating
|
||||
system. Once registered, all links with `your-protocol://` will be opened with
|
||||
the current executable. The whole link, including protocol, will be passed to
|
||||
your application as a parameter.
|
||||
|
||||
On Windows, you can provide optional parameters path, the path to your executable,
|
||||
and args, an array of arguments to be passed to your executable when it launches.
|
||||
Sets the current executable as the default handler for a protocol (aka URI
|
||||
scheme). It allows you to integrate your app deeper into the operating system.
|
||||
Once registered, all links with `your-protocol://` will be opened with the
|
||||
current executable. The whole link, including protocol, will be passed to your
|
||||
application as a parameter.
|
||||
|
||||
**Note:** On macOS, you can only register protocols that have been added to
|
||||
your app's `info.plist`, which can not be modified at runtime. You can however
|
||||
change the file with a simple text editor or script during build time.
|
||||
Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
||||
your app's `info.plist`, which cannot be modified at runtime. However, you can
|
||||
change the file during build time via [Electron Forge][electron-forge],
|
||||
[Electron Packager][electron-packager], or by editing `info.plist` with a text
|
||||
editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
||||
|
||||
**Note:** In a Windows Store environment (when packaged as an `appx`) this API
|
||||
will return `true` for all calls but the registry key it sets won't be accessible
|
||||
by other applications. In order to register your Windows Store application
|
||||
as a default protocol handler you must [declare the protocol in your manifest](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
|
||||
|
||||
The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.
|
||||
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
|
||||
|
||||
### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
|
||||
|
||||
@@ -749,10 +749,8 @@ protocol (aka URI scheme). If so, it will remove the app as the default handler.
|
||||
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
|
||||
* `args` String[] (optional) _Windows_ - Defaults to an empty array
|
||||
|
||||
Returns `Boolean`
|
||||
|
||||
This method checks if the current executable is the default handler for a protocol
|
||||
(aka URI scheme). If so, it will return true. Otherwise, it will return false.
|
||||
Returns `Boolean` - Whether the current executable is the default handler for a
|
||||
protocol (aka URI scheme).
|
||||
|
||||
**Note:** On macOS, you can use this method to check if the app has been
|
||||
registered as the default protocol handler for a protocol. You can also verify
|
||||
@@ -760,7 +758,7 @@ this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
|
||||
macOS machine. Please refer to
|
||||
[Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
|
||||
|
||||
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
|
||||
The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.
|
||||
|
||||
### `app.getApplicationNameForProtocol(url)`
|
||||
|
||||
@@ -1327,6 +1325,8 @@ A `Boolean` property that returns `true` if the app is packaged, `false` otherw
|
||||
[dock-menu]:https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
|
||||
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
|
||||
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
|
||||
[electron-forge]: https://www.electronforge.io/
|
||||
[electron-packager]: https://github.com/electron/electron-packager
|
||||
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
|
||||
[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme
|
||||
[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html
|
||||
|
||||
@@ -289,7 +289,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
between the web pages even when you specified different values for them,
|
||||
including but not limited to `preload`, `sandbox` and `nodeIntegration`.
|
||||
So it is suggested to use exact same `webPreferences` for web pages with
|
||||
the same `affinity`. _This property is experimental_
|
||||
the same `affinity`. _Deprecated_
|
||||
* `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents
|
||||
`300%`. Default is `1.0`.
|
||||
* `javascript` Boolean (optional) - Enables JavaScript support. Default is `true`.
|
||||
|
||||
@@ -16,80 +16,66 @@ app.whenReady().then(() => {
|
||||
})
|
||||
```
|
||||
|
||||
## --ignore-connections-limit=`domains`
|
||||
## Electron CLI Flags
|
||||
|
||||
Ignore the connections limit for `domains` list separated by `,`.
|
||||
### --auth-server-whitelist=`url`
|
||||
|
||||
## --disable-http-cache
|
||||
|
||||
Disables the disk cache for HTTP requests.
|
||||
|
||||
## --disable-http2
|
||||
|
||||
Disable HTTP/2 and SPDY/3.1 protocols.
|
||||
|
||||
## --lang
|
||||
|
||||
Set a custom locale.
|
||||
|
||||
## --inspect=`port` and --inspect-brk=`port`
|
||||
|
||||
Debug-related flags, see the [Debugging the Main Process][debugging-main-process] guide for details.
|
||||
|
||||
## --remote-debugging-port=`port`
|
||||
|
||||
Enables remote debugging over HTTP on the specified `port`.
|
||||
|
||||
## --disk-cache-size=`size`
|
||||
|
||||
Forces the maximum disk space to be used by the disk cache, in bytes.
|
||||
|
||||
## --js-flags=`flags`
|
||||
|
||||
Specifies the flags passed to the Node.js engine. It has to be passed when starting
|
||||
Electron if you want to enable the `flags` in the main process.
|
||||
|
||||
```sh
|
||||
$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
|
||||
```
|
||||
|
||||
See the [Node.js documentation][node-cli] or run `node --help` in your terminal for a list of available flags. Additionally, run `node --v8-options` to see a list of flags that specifically refer to Node.js's V8 JavaScript engine.
|
||||
|
||||
## --proxy-server=`address:port`
|
||||
|
||||
Use a specified proxy server, which overrides the system setting. This switch
|
||||
only affects requests with HTTP protocol, including HTTPS and WebSocket
|
||||
requests. It is also noteworthy that not all proxy servers support HTTPS and
|
||||
WebSocket requests. The proxy URL does not support username and password
|
||||
authentication [per Chromium issue](https://bugs.chromium.org/p/chromium/issues/detail?id=615947).
|
||||
|
||||
## --proxy-bypass-list=`hosts`
|
||||
|
||||
Instructs Electron to bypass the proxy server for the given semi-colon-separated
|
||||
list of hosts. This flag has an effect only if used in tandem with
|
||||
`--proxy-server`.
|
||||
A comma-separated list of servers for which integrated authentication is enabled.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const { app } = require('electron')
|
||||
app.commandLine.appendSwitch('proxy-bypass-list', '<local>;*.google.com;*foo.com;1.2.3.4:5678')
|
||||
```sh
|
||||
--auth-server-whitelist='*example.com, *foobar.com, *baz'
|
||||
```
|
||||
|
||||
Will use the proxy server for all hosts except for local addresses (`localhost`,
|
||||
`127.0.0.1` etc.), `google.com` subdomains, hosts that contain the suffix
|
||||
`foo.com` and anything at `1.2.3.4:5678`.
|
||||
then any `url` ending with `example.com`, `foobar.com`, `baz` will be considered
|
||||
for integrated authentication. Without `*` prefix the URL has to match exactly.
|
||||
|
||||
## --proxy-pac-url=`url`
|
||||
### --auth-negotiate-delegate-whitelist=`url`
|
||||
|
||||
Uses the PAC script at the specified `url`.
|
||||
A comma-separated list of servers for which delegation of user credentials is required.
|
||||
Without `*` prefix the URL has to match exactly.
|
||||
|
||||
## --no-proxy-server
|
||||
### --disable-http-cache
|
||||
|
||||
Don't use a proxy server and always make direct connections. Overrides any other
|
||||
proxy server flags that are passed.
|
||||
Disables the disk cache for HTTP requests.
|
||||
|
||||
## --host-rules=`rules`
|
||||
### --disable-http2
|
||||
|
||||
Disable HTTP/2 and SPDY/3.1 protocols.
|
||||
|
||||
### --disable-renderer-backgrounding
|
||||
|
||||
Prevents Chromium from lowering the priority of invisible pages' renderer
|
||||
processes.
|
||||
|
||||
This flag is global to all renderer processes, if you only want to disable
|
||||
throttling in one window, you can take the hack of
|
||||
[playing silent audio][play-silent-audio].
|
||||
|
||||
### --disk-cache-size=`size`
|
||||
|
||||
Forces the maximum disk space to be used by the disk cache, in bytes.
|
||||
|
||||
### --enable-api-filtering-logging
|
||||
|
||||
Enables caller stack logging for the following APIs (filtering events):
|
||||
- `desktopCapturer.getSources()` / `desktop-capturer-get-sources`
|
||||
- `remote.require()` / `remote-require`
|
||||
- `remote.getGlobal()` / `remote-get-builtin`
|
||||
- `remote.getBuiltin()` / `remote-get-global`
|
||||
- `remote.getCurrentWindow()` / `remote-get-current-window`
|
||||
- `remote.getCurrentWebContents()` / `remote-get-current-web-contents`
|
||||
|
||||
### --enable-logging
|
||||
|
||||
Prints Chromium's logging into console.
|
||||
|
||||
This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
|
||||
earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
|
||||
environment variable to achieve the same effect.
|
||||
|
||||
### --host-rules=`rules`
|
||||
|
||||
A comma-separated list of `rules` that control how hostnames are mapped.
|
||||
|
||||
@@ -107,69 +93,96 @@ These mappings apply to the endpoint host in a net request (the TCP connect
|
||||
and host resolver in a direct connection, and the `CONNECT` in an HTTP proxy
|
||||
connection, and the endpoint host in a `SOCKS` proxy connection).
|
||||
|
||||
## --host-resolver-rules=`rules`
|
||||
### --host-resolver-rules=`rules`
|
||||
|
||||
Like `--host-rules` but these `rules` only apply to the host resolver.
|
||||
|
||||
## --auth-server-whitelist=`url`
|
||||
|
||||
A comma-separated list of servers for which integrated authentication is enabled.
|
||||
|
||||
For example:
|
||||
|
||||
```sh
|
||||
--auth-server-whitelist='*example.com, *foobar.com, *baz'
|
||||
```
|
||||
|
||||
then any `url` ending with `example.com`, `foobar.com`, `baz` will be considered
|
||||
for integrated authentication. Without `*` prefix the URL has to match exactly.
|
||||
|
||||
## --auth-negotiate-delegate-whitelist=`url`
|
||||
|
||||
A comma-separated list of servers for which delegation of user credentials is required.
|
||||
Without `*` prefix the URL has to match exactly.
|
||||
|
||||
## --ignore-certificate-errors
|
||||
### --ignore-certificate-errors
|
||||
|
||||
Ignores certificate related errors.
|
||||
|
||||
## --ppapi-flash-path=`path`
|
||||
### --ignore-connections-limit=`domains`
|
||||
|
||||
Sets the `path` of the pepper flash plugin.
|
||||
Ignore the connections limit for `domains` list separated by `,`.
|
||||
|
||||
## --ppapi-flash-version=`version`
|
||||
### --js-flags=`flags`
|
||||
|
||||
Sets the `version` of the pepper flash plugin.
|
||||
Specifies the flags passed to the Node.js engine. It has to be passed when starting
|
||||
Electron if you want to enable the `flags` in the main process.
|
||||
|
||||
## --log-net-log=`path`
|
||||
```sh
|
||||
$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
|
||||
```
|
||||
|
||||
See the [Node.js documentation][node-cli] or run `node --help` in your terminal for a list of available flags. Additionally, run `node --v8-options` to see a list of flags that specifically refer to Node.js's V8 JavaScript engine.
|
||||
|
||||
### --lang
|
||||
|
||||
Set a custom locale.
|
||||
|
||||
### --log-net-log=`path`
|
||||
|
||||
Enables net log events to be saved and writes them to `path`.
|
||||
|
||||
## --disable-renderer-backgrounding
|
||||
### --no-proxy-server
|
||||
|
||||
Prevents Chromium from lowering the priority of invisible pages' renderer
|
||||
processes.
|
||||
Don't use a proxy server and always make direct connections. Overrides any other
|
||||
proxy server flags that are passed.
|
||||
|
||||
This flag is global to all renderer processes, if you only want to disable
|
||||
throttling in one window, you can take the hack of
|
||||
[playing silent audio][play-silent-audio].
|
||||
### --no-sandbox
|
||||
|
||||
## --enable-logging
|
||||
Disables Chromium sandbox, which is now enabled by default.
|
||||
Should only be used for testing.
|
||||
|
||||
Prints Chromium's logging into console.
|
||||
### --proxy-bypass-list=`hosts`
|
||||
|
||||
This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
|
||||
earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
|
||||
environment variable to achieve the same effect.
|
||||
Instructs Electron to bypass the proxy server for the given semi-colon-separated
|
||||
list of hosts. This flag has an effect only if used in tandem with
|
||||
`--proxy-server`.
|
||||
|
||||
## --v=`log_level`
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const { app } = require('electron')
|
||||
app.commandLine.appendSwitch('proxy-bypass-list', '<local>;*.google.com;*foo.com;1.2.3.4:5678')
|
||||
```
|
||||
|
||||
Will use the proxy server for all hosts except for local addresses (`localhost`,
|
||||
`127.0.0.1` etc.), `google.com` subdomains, hosts that contain the suffix
|
||||
`foo.com` and anything at `1.2.3.4:5678`.
|
||||
|
||||
### --proxy-pac-url=`url`
|
||||
|
||||
Uses the PAC script at the specified `url`.
|
||||
|
||||
### --proxy-server=`address:port`
|
||||
|
||||
Use a specified proxy server, which overrides the system setting. This switch
|
||||
only affects requests with HTTP protocol, including HTTPS and WebSocket
|
||||
requests. It is also noteworthy that not all proxy servers support HTTPS and
|
||||
WebSocket requests. The proxy URL does not support username and password
|
||||
authentication [per Chromium issue](https://bugs.chromium.org/p/chromium/issues/detail?id=615947).
|
||||
|
||||
### --remote-debugging-port=`port`
|
||||
|
||||
Enables remote debugging over HTTP on the specified `port`.
|
||||
|
||||
### --ppapi-flash-path=`path`
|
||||
|
||||
Sets the `path` of the pepper flash plugin.
|
||||
|
||||
### --ppapi-flash-version=`version`
|
||||
|
||||
Sets the `version` of the pepper flash plugin.
|
||||
|
||||
### --v=`log_level`
|
||||
|
||||
Gives the default maximal active V-logging level; 0 is the default. Normally
|
||||
positive values are used for V-logging levels.
|
||||
|
||||
This switch only works when `--enable-logging` is also passed.
|
||||
|
||||
## --vmodule=`pattern`
|
||||
### --vmodule=`pattern`
|
||||
|
||||
Gives the per-module maximal V-logging levels to override the value given by
|
||||
`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in
|
||||
@@ -181,20 +194,38 @@ logging level for all code in the source files under a `foo/bar` directory.
|
||||
|
||||
This switch only works when `--enable-logging` is also passed.
|
||||
|
||||
## --enable-api-filtering-logging
|
||||
## Node.js Flags
|
||||
|
||||
Enables caller stack logging for the following APIs (filtering events):
|
||||
- `desktopCapturer.getSources()` / `desktop-capturer-get-sources`
|
||||
- `remote.require()` / `remote-require`
|
||||
- `remote.getGlobal()` / `remote-get-builtin`
|
||||
- `remote.getBuiltin()` / `remote-get-global`
|
||||
- `remote.getCurrentWindow()` / `remote-get-current-window`
|
||||
- `remote.getCurrentWebContents()` / `remote-get-current-web-contents`
|
||||
Electron supports some of the [CLI flags][node-cli] supported by Node.js.
|
||||
|
||||
## --no-sandbox
|
||||
**Note:** Passing unsupported command line switches to Electron when it is not running in `ELECTRON_RUN_AS_NODE` will have no effect.
|
||||
|
||||
Disables Chromium sandbox, which is now enabled by default.
|
||||
Should only be used for testing.
|
||||
### --inspect-brk[=[host:]port]
|
||||
|
||||
Activate inspector on host:port and break at start of user script. Default host:port is 127.0.0.1:9229.
|
||||
|
||||
Aliased to `--debug-brk=[host:]port`.
|
||||
|
||||
### --inspect-port=[host:]port
|
||||
|
||||
Set the `host:port` to be used when the inspector is activated. Useful when activating the inspector by sending the SIGUSR1 signal. Default host is `127.0.0.1`.
|
||||
|
||||
Aliased to `--debug-port=[host:]port`.
|
||||
|
||||
### --inspect[=[host:]port]
|
||||
|
||||
Activate inspector on `host:port`. Default is `127.0.0.1:9229`.
|
||||
|
||||
V8 inspector integration allows tools such as Chrome DevTools and IDEs to debug and profile Electron instances. The tools attach to Electron instances via a tcp port and communicate using the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/).
|
||||
|
||||
See the [Debugging the Main Process][debugging-main-process] guide for more details.
|
||||
|
||||
Aliased to `--debug[=[host:]port`.
|
||||
|
||||
### --inspect-publish-uid=stderr,http
|
||||
Specify ways of the inspector web socket url exposure.
|
||||
|
||||
By default inspector websocket url is available in stderr and under /json/list endpoint on http://host:port/json/list.
|
||||
|
||||
[app]: app.md
|
||||
[append-switch]: app.md#appcommandlineappendswitchswitch-value
|
||||
|
||||
@@ -53,16 +53,23 @@ Unsupported options are:
|
||||
|
||||
### `GOOGLE_API_KEY`
|
||||
|
||||
You can provide an API key for making requests to Google's geocoding webservice. To do this, place the following code in your main process
|
||||
file, before opening any browser windows that will make geocoding requests:
|
||||
Geolocation support in Electron requires the use of Google Cloud Platform's
|
||||
geolocation webservice. To enable this feature, acquire a
|
||||
[Google API key](https://developers.google.com/maps/documentation/geolocation/get-api-key)
|
||||
and place the following code in your main process file, before opening any
|
||||
browser windows that will make geolocation requests:
|
||||
|
||||
```javascript
|
||||
process.env.GOOGLE_API_KEY = 'YOUR_KEY_HERE'
|
||||
```
|
||||
|
||||
For instructions on how to acquire a Google API key, visit [this page](https://developers.google.com/maps/documentation/javascript/get-api-key).
|
||||
By default, a newly generated Google API key may not be allowed to make
|
||||
geocoding requests. To enable geocoding requests, visit [this page](https://developers.google.com/maps/documentation/geocoding/get-api-key).
|
||||
By default, a newly generated Google API key may not be allowed to make geolocation requests.
|
||||
To enable the geolocation webservice for your project, enable it through the
|
||||
[API library](https://console.cloud.google.com/apis/library).
|
||||
|
||||
N.B. You will need to add a
|
||||
[Billing Account](https://cloud.google.com/billing/docs/how-to/payment-methods#add_a_payment_method)
|
||||
to the project associated to the API key for the geolocation webservice to work.
|
||||
|
||||
### `ELECTRON_NO_ASAR`
|
||||
|
||||
@@ -73,6 +80,18 @@ and spawned child processes that set `ELECTRON_RUN_AS_NODE`.
|
||||
|
||||
Starts the process as a normal Node.js process.
|
||||
|
||||
In this mode, you will be able to pass [cli options](https://nodejs.org/api/cli.html) to Node.js as
|
||||
you would when running the normal Node.js executable, with the exception of the following flags:
|
||||
|
||||
* "--openssl-config"
|
||||
* "--use-bundled-ca"
|
||||
* "--use-openssl-ca",
|
||||
* "--force-fips"
|
||||
* "--enable-fips"
|
||||
|
||||
These flags are disabled owing to the fact that Electron uses BoringSSL instead of OpenSSL when building Node.js'
|
||||
`crypto` module, and so will not work as designed.
|
||||
|
||||
### `ELECTRON_NO_ATTACH_CONSOLE` _Windows_
|
||||
|
||||
Don't attach to the current console session.
|
||||
|
||||
104
docs/api/extensions.md
Normal file
104
docs/api/extensions.md
Normal file
@@ -0,0 +1,104 @@
|
||||
# Chrome Extension Support
|
||||
|
||||
Electron supports a subset of the [Chrome Extensions
|
||||
API][chrome-extensions-api-index], primarily to support DevTools extensions and
|
||||
Chromium-internal extensions, but it also happens to support some other
|
||||
extension capabilities.
|
||||
|
||||
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
|
||||
|
||||
> **Note:** Electron does not support arbitrary Chrome extensions from the
|
||||
> store, and it is a **non-goal** of the Electron project to be perfectly
|
||||
> compatible with Chrome's implementation of Extensions.
|
||||
|
||||
## Loading extensions
|
||||
|
||||
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
|
||||
work). Extensions are installed per-`session`. To load an extension, call
|
||||
[`ses.loadExtension`](session.md#sesloadextensionpath):
|
||||
|
||||
```js
|
||||
const { session } = require('electron')
|
||||
|
||||
session.loadExtension('path/to/unpacked/extension').then(({ id }) => {
|
||||
// ...
|
||||
})
|
||||
```
|
||||
|
||||
Loaded extensions will not be automatically remembered across exits; if you do
|
||||
not call `loadExtension` when the app runs, the extension will not be loaded.
|
||||
|
||||
Note that loading extensions is only supported in persistent sessions.
|
||||
Attempting to load an extension into an in-memory session will throw an error.
|
||||
|
||||
See the [`session`](session.md) documentation for more information about
|
||||
loading, unloading, and querying active extensions.
|
||||
|
||||
## Supported Extensions APIs
|
||||
|
||||
We support the following extensions APIs, with some caveats. Other APIs may
|
||||
additionally be supported, but support for any APIs not listed here is
|
||||
provisional and may be removed.
|
||||
|
||||
### `chrome.devtools.inspectedWindow`
|
||||
|
||||
All features of this API are supported.
|
||||
|
||||
### `chrome.devtools.network`
|
||||
|
||||
All features of this API are supported.
|
||||
|
||||
### `chrome.devtools.panels`
|
||||
|
||||
All features of this API are supported.
|
||||
|
||||
### `chrome.extension`
|
||||
|
||||
The following properties of `chrome.extension` are supported:
|
||||
|
||||
- `chrome.extension.lastError`
|
||||
|
||||
The following methods of `chrome.extension` are supported:
|
||||
|
||||
- `chrome.extension.getURL`
|
||||
- `chrome.extension.getBackgroundPage`
|
||||
|
||||
### `chrome.runtime`
|
||||
|
||||
The following properties of `chrome.runtime` are supported:
|
||||
|
||||
- `chrome.runtime.lastError`
|
||||
- `chrome.runtime.id`
|
||||
|
||||
The following methods of `chrome.runtime` are supported:
|
||||
|
||||
- `chrome.runtime.getBackgroundPage`
|
||||
- `chrome.runtime.getManifest`
|
||||
- `chrome.runtime.getURL`
|
||||
- `chrome.runtime.connect`
|
||||
- `chrome.runtime.sendMessage`
|
||||
|
||||
The following events of `chrome.runtime` are supported:
|
||||
|
||||
- `chrome.runtime.onStartup`
|
||||
- `chrome.runtime.onInstalled`
|
||||
- `chrome.runtime.onSuspend`
|
||||
- `chrome.runtime.onSuspendCanceled`
|
||||
- `chrome.runtime.onConnect`
|
||||
- `chrome.runtime.onMessage`
|
||||
|
||||
### `chrome.storage`
|
||||
|
||||
Only `chrome.storage.local` is supported; `chrome.storage.sync` and
|
||||
`chrome.storage.managed` are not.
|
||||
|
||||
### `chrome.tabs`
|
||||
|
||||
The following methods of `chrome.tabs` are supported:
|
||||
|
||||
- `chrome.tabs.sendMessage`
|
||||
- `chrome.tabs.executeScript`
|
||||
|
||||
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
|
||||
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
|
||||
> supported and will raise an error.
|
||||
62
docs/api/service-workers.md
Normal file
62
docs/api/service-workers.md
Normal file
@@ -0,0 +1,62 @@
|
||||
## Class: ServiceWorkers
|
||||
|
||||
> Query and receive events from a sessions active service workers.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Instances of the `ServiceWorkers` class are accessed by using `serviceWorkers` property of
|
||||
a `Session`.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const { session } = require('electron')
|
||||
|
||||
// Get all service workers.
|
||||
console.log(session.defaultSession.serviceWorkers.getAllRunning())
|
||||
|
||||
// Handle logs and get service worker info
|
||||
session.defaultSession.serviceWorkers.on('console-message', (event, messageDetails) => {
|
||||
console.log(
|
||||
'Got service worker message',
|
||||
messageDetails,
|
||||
'from',
|
||||
session.defaultSession.serviceWorkers.getFromVersionID(messageDetails.versionId)
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
### Instance Events
|
||||
|
||||
The following events are available on instances of `ServiceWorkers`:
|
||||
|
||||
#### Event: 'console-message'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `messageDetails` Object - Information about the console message
|
||||
* `message` String - The actual console message
|
||||
* `versionId` Number - The version ID of the service worker that sent the log message
|
||||
* `source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
|
||||
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
|
||||
* `sourceUrl` String - The URL the message came from
|
||||
* `lineNumber` Number - The line number of the source that triggered this console message
|
||||
|
||||
Emitted when a service worker logs something to the console.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
The following methods are available on instances of `ServiceWorkers`:
|
||||
|
||||
#### `serviceWorkers.getAllRunning()`
|
||||
|
||||
Returns `Record<Number, ServiceWorkerInfo>` - A [ServiceWorkerInfo](structures/service-worker-info.md) object where the keys are the service worker version ID and the values are the information about that service worker.
|
||||
|
||||
#### `serviceWorkers.getFromVersionID(versionId)`
|
||||
|
||||
* `versionId` Number
|
||||
|
||||
Returns [`ServiceWorkerInfo`](structures/service-worker-info.md) - Information about this service worker
|
||||
|
||||
If the service worker does not exist or is not running this method will throw an exception.
|
||||
@@ -440,9 +440,7 @@ event. The [DownloadItem](download-item.md) will not have any `WebContents` asso
|
||||
the initial state will be `interrupted`. The download will start only when the
|
||||
`resume` API is called on the [DownloadItem](download-item.md).
|
||||
|
||||
#### `ses.clearAuthCache(options)`
|
||||
|
||||
* `options` ([RemovePassword](structures/remove-password.md) | [RemoveClientCertificate](structures/remove-client-certificate.md))
|
||||
#### `ses.clearAuthCache()`
|
||||
|
||||
Returns `Promise<void>` - resolves when the session’s HTTP authentication cache has been cleared.
|
||||
|
||||
@@ -487,6 +485,11 @@ to host here.
|
||||
|
||||
**Note:** On macOS the OS spellchecker is used and therefore we do not download any dictionary files. This API is a no-op on macOS.
|
||||
|
||||
#### `ses.listWordsInSpellCheckerDictionary()`
|
||||
|
||||
Returns `Promise<String[]>` - An array of all words in app's custom dictionary.
|
||||
Resolves when the full dictionary is loaded from disk.
|
||||
|
||||
#### `ses.addWordToSpellCheckerDictionary(word)`
|
||||
|
||||
* `word` String - The word you want to add to the dictionary
|
||||
@@ -495,6 +498,14 @@ Returns `Boolean` - Whether the word was successfully written to the custom dict
|
||||
|
||||
**Note:** On macOS and Windows 10 this word will be written to the OS custom dictionary as well
|
||||
|
||||
#### `ses.removeWordFromSpellCheckerDictionary(word)`
|
||||
|
||||
* `word` String - The word you want to remove from the dictionary
|
||||
|
||||
Returns `Boolean` - Whether the word was successfully removed from the custom dictionary.
|
||||
|
||||
**Note:** On macOS and Windows 10 this word will be removed from the OS custom dictionary as well
|
||||
|
||||
#### `ses.loadExtension(path)`
|
||||
|
||||
* `path` String - Path to a directory containing an unpacked Chrome extension
|
||||
@@ -507,6 +518,8 @@ requests an API that Electron does not support) then they will be logged to the
|
||||
console.
|
||||
|
||||
Note that Electron does not support the full range of Chrome extensions APIs.
|
||||
See [Supported Extensions APIs](extensions.md#supported-extensions-apis) for
|
||||
more details on what is supported.
|
||||
|
||||
Note that in previous versions of Electron, extensions that were loaded would
|
||||
be remembered for future runs of the application. This is no longer the case:
|
||||
@@ -529,6 +542,9 @@ This API does not support loading packed (.crx) extensions.
|
||||
**Note:** This API cannot be called before the `ready` event of the `app` module
|
||||
is emitted.
|
||||
|
||||
**Note:** Loading extensions into in-memory (non-persistent) sessions is not
|
||||
supported and will throw an error.
|
||||
|
||||
#### `ses.removeExtension(extensionId)`
|
||||
|
||||
* `extensionId` String - ID of extension to remove
|
||||
@@ -567,6 +583,10 @@ code to the `setSpellCheckerLanaguages` API that isn't in this array will result
|
||||
|
||||
A [`Cookies`](cookies.md) object for this session.
|
||||
|
||||
#### `ses.serviceWorkers` _Readonly_
|
||||
|
||||
A [`ServiceWorkers`](service-workers.md) object for this session.
|
||||
|
||||
#### `ses.webRequest` _Readonly_
|
||||
|
||||
A [`WebRequest`](web-request.md) object for this session.
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
# Extension Object
|
||||
|
||||
* `id` String
|
||||
* `manifest` any - Copy of the [extension's manifest data](https://developer.chrome.com/extensions/manifest).
|
||||
* `name` String
|
||||
* `path` String - The extension's file path.
|
||||
* `version` String
|
||||
* `url` String - The extension's `chrome-extension://` URL.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# RemoveClientCertificate Object
|
||||
|
||||
* `type` String - `clientCertificate`.
|
||||
* `origin` String - Origin of the server whose associated client certificate
|
||||
must be removed from the cache.
|
||||
@@ -1,15 +0,0 @@
|
||||
# RemovePassword Object
|
||||
|
||||
* `type` String - `password`.
|
||||
* `origin` String (optional) - When provided, the authentication info
|
||||
related to the origin will only be removed otherwise the entire cache
|
||||
will be cleared.
|
||||
* `scheme` String (optional) - Scheme of the authentication.
|
||||
Can be `basic`, `digest`, `ntlm`, `negotiate`. Must be provided if
|
||||
removing by `origin`.
|
||||
* `realm` String (optional) - Realm of the authentication. Must be provided if
|
||||
removing by `origin`.
|
||||
* `username` String (optional) - Credentials of the authentication. Must be
|
||||
provided if removing by `origin`.
|
||||
* `password` String (optional) - Credentials of the authentication. Must be
|
||||
provided if removing by `origin`.
|
||||
5
docs/api/structures/service-worker-info.md
Normal file
5
docs/api/structures/service-worker-info.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# ServiceWorkerInfo Object
|
||||
|
||||
* `scriptUrl` String - The full URL to the script that this service worker runs
|
||||
* `scope` String - The base URL that this service worker is active for.
|
||||
* `renderProcessId` Number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`.
|
||||
@@ -404,8 +404,6 @@ Returns `Boolean` - whether or not this device has the ability to use Touch ID.
|
||||
|
||||
**NOTE:** This API will return `false` on macOS systems older than Sierra 10.12.2.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
### `systemPreferences.promptTouchID(reason)` _macOS_
|
||||
|
||||
* `reason` String - The reason you are asking for Touch ID authentication
|
||||
|
||||
12
docs/api/touch-bar-other-items-proxy.md
Normal file
12
docs/api/touch-bar-other-items-proxy.md
Normal file
@@ -0,0 +1,12 @@
|
||||
## Class: TouchBarOtherItemsProxy
|
||||
|
||||
> Instantiates a special "other items proxy", which nests TouchBar elements inherited
|
||||
> from Chromium at the space indicated by the proxy. By default, this proxy is added
|
||||
> to each TouchBar at the end of the input. For more information, see the AppKit docs on
|
||||
> [NSTouchBarItemIdentifierOtherItemsProxy](https://developer.apple.com/documentation/appkit/nstouchbaritemidentifierotheritemsproxy)
|
||||
>
|
||||
> Note: Only one instance of this class can be added per TouchBar.
|
||||
|
||||
Process: [Main](../tutorial/application-architecture.md#main-and-renderer-processes)
|
||||
|
||||
### `new TouchBarOtherItemsProxy()` _Experimental_
|
||||
@@ -58,6 +58,10 @@ A [`typeof TouchBarSlider`](./touch-bar-slider.md) reference to the `TouchBarSli
|
||||
|
||||
A [`typeof TouchBarSpacer`](./touch-bar-spacer.md) reference to the `TouchBarSpacer` class.
|
||||
|
||||
#### `TouchBarOtherItemsProxy`
|
||||
|
||||
A [`typeof TouchBarOtherItemsProxy`](./touch-bar-other-items-proxy.md) reference to the `TouchBarOtherItemsProxy` class.
|
||||
|
||||
### Instance Properties
|
||||
|
||||
The following properties are available on instances of `TouchBar`:
|
||||
|
||||
@@ -310,7 +310,7 @@ and allow the page to be unloaded.
|
||||
const { BrowserWindow, dialog } = require('electron')
|
||||
const win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.webContents.on('will-prevent-unload', (event) => {
|
||||
const choice = dialog.showMessageBox(win, {
|
||||
const choice = dialog.showMessageBoxSync(win, {
|
||||
type: 'question',
|
||||
buttons: ['Leave', 'Stay'],
|
||||
title: 'Do you want to leave this site?',
|
||||
|
||||
@@ -146,6 +146,7 @@ response are visible by the time this listener is fired.
|
||||
* `timestamp` Double
|
||||
* `statusLine` String
|
||||
* `statusCode` Integer
|
||||
* `requestHeaders` Record<string, string>
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `callback` Function
|
||||
* `headersReceivedResponse` Object
|
||||
@@ -228,6 +229,7 @@ redirect is about to occur.
|
||||
* `fromCache` Boolean
|
||||
* `statusCode` Integer
|
||||
* `statusLine` String
|
||||
* `error` String
|
||||
|
||||
The `listener` will be called with `listener(details)` when a request is
|
||||
completed.
|
||||
|
||||
@@ -6,8 +6,48 @@ Breaking changes will be documented here, and deprecation warnings added to JS c
|
||||
|
||||
The `FIXME` string is used in code comments to denote things that should be fixed for future releases. See https://github.com/electron/electron/search?q=fixme
|
||||
|
||||
## Planned Breaking API Changes (10.0)
|
||||
|
||||
### Browser Window Affinity
|
||||
|
||||
The `affinity` option when constructing a new `BrowserWindow` will be removed
|
||||
as part of our plan to more closely align with Chromiums process model for security,
|
||||
performance and maintainability.
|
||||
|
||||
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
|
||||
|
||||
### `enableRemoteModule` defaults to `false`
|
||||
|
||||
In Electron 9, using the remote module without explicitly enabling it via the
|
||||
`enableRemoteModule` WebPreferences option began emitting a warning. In
|
||||
Electron 10, the remote module is now disabled by default. To use the remote
|
||||
module, `enableRemoteModule: true` must be specified in WebPreferences:
|
||||
|
||||
```js
|
||||
const w = new BrowserWindow({
|
||||
webPreferences: {
|
||||
enableRemoteModule: true
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
We [recommend moving away from the remote
|
||||
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
||||
|
||||
## Planned Breaking API Changes (9.0)
|
||||
|
||||
### Loading non-context-aware native modules in the renderer process
|
||||
|
||||
As of Electron 9 we do not allow loading of non-context-aware native modules in
|
||||
the renderer process. This is to improve security, performance and maintainability
|
||||
of Electron as a project.
|
||||
|
||||
If this impacts you, you can temporarily set `app.allowRendererProcessReuse` to `false`
|
||||
to revert to the old behavior. This flag will only be an option until Electron 11 so
|
||||
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).
|
||||
|
||||
### `<webview>.getWebContents()`
|
||||
|
||||
This API, which was deprecated in Electron 8.0, is now removed.
|
||||
|
||||
@@ -48,7 +48,7 @@ still set breakpoints - Visual Studio will automatically figure out that the
|
||||
source code matches the code running in the attached process and break
|
||||
accordingly.
|
||||
|
||||
Relevant code files can be found in `./atom/`.
|
||||
Relevant code files can be found in `./shell/`.
|
||||
|
||||
### Attaching
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ this basic introduction, let's assume that you're calling a command from JavaScr
|
||||
that isn't behaving correctly - so you'd like to break on that command's C++
|
||||
counterpart inside the Electron source.
|
||||
|
||||
Relevant code files can be found in `./atom/`.
|
||||
Relevant code files can be found in `./shell/`.
|
||||
|
||||
Let's assume that you want to debug `app.setName()`, which is defined in `browser.cc`
|
||||
as `Browser::SetName()`. Set the breakpoint using the `breakpoint` command, specifying
|
||||
|
||||
@@ -55,7 +55,7 @@ $ git checkout -b my-branch -t upstream/master
|
||||
### Step 4: Code
|
||||
|
||||
Most pull requests opened against the `electron/electron` repository include
|
||||
changes to either the C/C++ code in the `atom/` folder,
|
||||
changes to either the C/C++ code in the `shell/` folder,
|
||||
the JavaScript code in the `lib/` folder, the documentation in `docs/api/`
|
||||
or tests in the `spec/` folder.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/menu"
|
||||
<a href="https://electronjs.org/docs/api/menu"
|
||||
>full API documentation<span
|
||||
>(opens in new window)</span
|
||||
></a
|
||||
@@ -111,7 +111,7 @@
|
||||
<p>
|
||||
See the full
|
||||
<a
|
||||
href="http://electron.atom.io/docs/api/web-contents/#event-context-menu"
|
||||
href="https://electronjs.org/docs/api/web-contents/#event-context-menu"
|
||||
>context-menu event documentation</a
|
||||
>
|
||||
for all the available properties.
|
||||
|
||||
@@ -159,7 +159,7 @@ const template = [
|
||||
{
|
||||
label: 'Learn More',
|
||||
click: () => {
|
||||
shell.openExternal('http://electron.atom.io')
|
||||
shell.openExternal('https://electronjs.org')
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
<p>
|
||||
Open the full documentation for the
|
||||
<a href="http://electron.atom.io/docs/api/menu">Menu</a>,
|
||||
<a href="http://electron.atom.io/docs/api/accelerator">Accelerator</a>,
|
||||
<a href="https://electronjs.org/docs/api/menu">Menu</a>,
|
||||
<a href="https://electronjs.org/docs/api/accelerator">Accelerator</a>,
|
||||
and
|
||||
<a href="http://electron.atom.io/docs/api/global-shortcut">globalShortcut</a>
|
||||
<a href="https://electronjs.org/docs/api/global-shortcut">globalShortcut</a>
|
||||
APIs in your browser.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/dialog/">
|
||||
<a href="https://electronjs.org/docs/api/dialog/">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/dialog/">
|
||||
<a href="https://electronjs.org/docs/api/dialog/">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/dialog/">
|
||||
<a href="https://electronjs.org/docs/api/dialog/">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/dialog/">
|
||||
<a href="https://electronjs.org/docs/api/dialog/">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
const { shell } = require('electron')
|
||||
const exLinksBtn = document.getElementById('open-ex-links')
|
||||
exLinksBtn.addEventListener('click', (event) => {
|
||||
shell.openExternal('http://electron.atom.io')
|
||||
shell.openExternal('https://electronjs.org')
|
||||
})
|
||||
</code></pre>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const { shell } = require('electron')
|
||||
const exLinksBtn = document.getElementById('open-ex-links')
|
||||
|
||||
exLinksBtn.addEventListener('click', (event) => {
|
||||
shell.openExternal('http://electron.atom.io')
|
||||
shell.openExternal('https://electronjs.org')
|
||||
})
|
||||
|
||||
const OpenAllOutboundLinks = () => {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<p>This module works in both the main and renderer process.</p>
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/shell">
|
||||
<a href="https://electronjs.org/docs/api/shell">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -9,5 +9,5 @@ fileManagerBtn.addEventListener('click', (event) => {
|
||||
})
|
||||
|
||||
exLinksBtn.addEventListener('click', (event) => {
|
||||
shell.openExternal('http://electron.atom.io')
|
||||
shell.openExternal('https://electronjs.org')
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="https://electron.atom.io/docs/all/#notifications-windows-linux-macos">
|
||||
<a href="https://electronjs.org/docs/all/#notifications-windows-linux-macos">
|
||||
full API documentation<span>(opens in new window)</span>
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/tray">
|
||||
<a href="https://electronjs.org/docs/api/tray">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
@@ -108,7 +108,7 @@ ipc.on('tray-removed', function () {
|
||||
On Linux distributions that only have app indicator support, users
|
||||
will need to install <code>libappindicator1</code> to make the
|
||||
tray icon work. See the
|
||||
<a href="http://electron.atom.io/docs/api/tray">
|
||||
<a href="https://electronjs.org/docs/api/tray">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
for more details about using Tray on Linux.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<h3>The <code>app</code> module provides methods for handling protocols.</h3>
|
||||
<p>These methods allow you to set and unset the protocols your app should be the default app for. Similar to when a browser asks to be your default for viewing web pages.</p>
|
||||
|
||||
<p>Open the <a href="http://electron.atom.io/docs/api/app">full app API documentation<span class="u-visible-to-screen-reader">(opens in new window)</span></a> in your browser.</p>
|
||||
<p>Open the <a href="https://electronjs.org/docs/api/app">full app API documentation<span class="u-visible-to-screen-reader">(opens in new window)</span></a> in your browser.</p>
|
||||
</header>
|
||||
|
||||
<div >
|
||||
@@ -89,4 +89,4 @@
|
||||
</html>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<p>The <code>process</code> module is built into Node.js (therefore you can use this in both the main and renderer processes) and in Electron apps this object has a few more useful properties on it.</p>
|
||||
<p>The example below gets the version of Electron in use by the app.</p>
|
||||
<p>See the <a href="http://electron.atom.io/docs/api/process">process documentation <span>(opens in new window)</span></a> for more.</p>
|
||||
<p>See the <a href="https://electronjs.org/docs/api/process">process documentation <span>(opens in new window)</span></a> for more.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/browser-window">
|
||||
<a href="https://electronjs.org/docs/api/browser-window">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
<p>
|
||||
For more details, see the
|
||||
<a href="http://electron.atom.io/docs/api/frameless-window/">
|
||||
<a href="https://electronjs.org/docs/api/frameless-window/">
|
||||
Frameless Window
|
||||
</a>
|
||||
documentation.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/browser-window">
|
||||
<a href="https://electronjs.org/docs/api/browser-window">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
@@ -47,7 +47,7 @@
|
||||
There are a lot of methods for controlling the state of the window
|
||||
such as the size, location, and focus status as well as events to
|
||||
listen to for window changes. Visit the
|
||||
<a href="http://electron.atom.io/docs/api/browser-window">
|
||||
<a href="https://electronjs.org/docs/api/browser-window">
|
||||
documentation (opens in new window)
|
||||
</a>
|
||||
for the full list.
|
||||
|
||||
@@ -15,5 +15,5 @@ newWindowBtn.addEventListener('click', (event) => {
|
||||
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal("http://electron.atom.io/docs/api/browser-window")
|
||||
shell.openExternal("https://electronjs.org/docs/api/browser-window")
|
||||
})
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<p>
|
||||
Open the
|
||||
<a href="http://electron.atom.io/docs/api/browser-window">
|
||||
<a href="https://electronjs.org/docs/api/browser-window">
|
||||
full API documentation (opens in new window)
|
||||
</a>
|
||||
in your browser.
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
| 6.0.0 | 2019-05-01 | 2019-07-30 | M76 | v12 |
|
||||
| 7.0.0 | 2019-08-01 | 2019-10-22 | M78 | v12 |
|
||||
| 8.0.0 | 2019-10-24 | 2020-02-04 | M80 | v12 |
|
||||
| 9.0.0 | 2020-02-06 | 2020-03-12 | M82 | v12 |
|
||||
| 9.0.0 | 2020-02-06 | 2020-04-28 | M82 | v12 |
|
||||
| 10.0.0 | TBD | TBD | TBD | TBD |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Testing on Headless CI Systems (Travis CI, Github Actions, Jenkins)
|
||||
# Testing on Headless CI Systems (Travis CI, Jenkins)
|
||||
|
||||
Being based on Chromium, Electron requires a display driver to function.
|
||||
If Chromium can't find a display driver, Electron will fail to launch -
|
||||
@@ -45,10 +45,6 @@ install:
|
||||
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
||||
```
|
||||
|
||||
### Github Actions
|
||||
|
||||
For Github Actions, a [Xvfb action is available](https://github.com/marketplace/actions/gabrielbb-xvfb-action).
|
||||
|
||||
### Jenkins
|
||||
|
||||
For Jenkins, a [Xvfb plugin is available](https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin).
|
||||
|
||||
@@ -92,10 +92,14 @@ template("electron_extra_paks") {
|
||||
}
|
||||
if (enable_electron_extensions) {
|
||||
sources += [
|
||||
"$root_gen_dir/chrome/component_extension_resources.pak",
|
||||
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
|
||||
"$root_gen_dir/extensions/extensions_resources.pak",
|
||||
]
|
||||
deps += [ "//extensions:extensions_resources" ]
|
||||
deps += [
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
"//extensions:extensions_resources",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<part file="electron_strings.grdp" />
|
||||
</messages>
|
||||
<includes>
|
||||
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}\shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}/shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_PDF_MANIFEST" file="../chrome/browser/resources/pdf/manifest.json" type="BINDATA" />
|
||||
</includes>
|
||||
</release>
|
||||
</grit>
|
||||
|
||||
@@ -21,6 +21,7 @@ auto_filenames = {
|
||||
"docs/api/dock.md",
|
||||
"docs/api/download-item.md",
|
||||
"docs/api/environment-variables.md",
|
||||
"docs/api/extensions.md",
|
||||
"docs/api/file-object.md",
|
||||
"docs/api/frameless-window.md",
|
||||
"docs/api/global-shortcut.md",
|
||||
@@ -45,6 +46,7 @@ auto_filenames = {
|
||||
"docs/api/remote.md",
|
||||
"docs/api/sandbox-option.md",
|
||||
"docs/api/screen.md",
|
||||
"docs/api/service-workers.md",
|
||||
"docs/api/session.md",
|
||||
"docs/api/shell.md",
|
||||
"docs/api/structures",
|
||||
@@ -54,6 +56,7 @@ auto_filenames = {
|
||||
"docs/api/touch-bar-color-picker.md",
|
||||
"docs/api/touch-bar-group.md",
|
||||
"docs/api/touch-bar-label.md",
|
||||
"docs/api/touch-bar-other-items-proxy.md",
|
||||
"docs/api/touch-bar-popover.md",
|
||||
"docs/api/touch-bar-scrubber.md",
|
||||
"docs/api/touch-bar-segmented-control.md",
|
||||
@@ -106,10 +109,9 @@ auto_filenames = {
|
||||
"docs/api/structures/protocol-response.md",
|
||||
"docs/api/structures/rectangle.md",
|
||||
"docs/api/structures/referrer.md",
|
||||
"docs/api/structures/remove-client-certificate.md",
|
||||
"docs/api/structures/remove-password.md",
|
||||
"docs/api/structures/scrubber-item.md",
|
||||
"docs/api/structures/segmented-control-segment.md",
|
||||
"docs/api/structures/service-worker-info.md",
|
||||
"docs/api/structures/shared-worker-info.md",
|
||||
"docs/api/structures/shortcut-details.md",
|
||||
"docs/api/structures/size.md",
|
||||
|
||||
@@ -88,6 +88,8 @@ filenames = {
|
||||
"shell/browser/api/electron_api_protocol.h",
|
||||
"shell/browser/api/electron_api_screen.cc",
|
||||
"shell/browser/api/electron_api_screen.h",
|
||||
"shell/browser/api/electron_api_service_worker_context.cc",
|
||||
"shell/browser/api/electron_api_service_worker_context.h",
|
||||
"shell/browser/api/electron_api_session.cc",
|
||||
"shell/browser/api/electron_api_session.h",
|
||||
"shell/browser/api/electron_api_system_preferences.cc",
|
||||
@@ -234,12 +236,15 @@ filenames = {
|
||||
"shell/browser/net/node_stream_loader.h",
|
||||
"shell/browser/net/proxying_url_loader_factory.cc",
|
||||
"shell/browser/net/proxying_url_loader_factory.h",
|
||||
"shell/browser/net/proxying_websocket.cc",
|
||||
"shell/browser/net/proxying_websocket.h",
|
||||
"shell/browser/net/resolve_proxy_helper.cc",
|
||||
"shell/browser/net/resolve_proxy_helper.h",
|
||||
"shell/browser/net/system_network_context_manager.cc",
|
||||
"shell/browser/net/system_network_context_manager.h",
|
||||
"shell/browser/net/url_pipe_loader.cc",
|
||||
"shell/browser/net/url_pipe_loader.h",
|
||||
"shell/browser/net/web_request_api_interface.h",
|
||||
"shell/browser/network_hints_handler_impl.cc",
|
||||
"shell/browser/network_hints_handler_impl.h",
|
||||
"shell/browser/node_debugger.cc",
|
||||
@@ -276,6 +281,8 @@ filenames = {
|
||||
"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.h",
|
||||
"shell/browser/pref_store_delegate.cc",
|
||||
"shell/browser/pref_store_delegate.h",
|
||||
"shell/browser/relauncher.cc",
|
||||
@@ -551,6 +558,7 @@ filenames = {
|
||||
"shell/common/skia_util.h",
|
||||
"shell/common/v8_value_converter.cc",
|
||||
"shell/common/v8_value_converter.h",
|
||||
"shell/common/world_ids.h",
|
||||
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
|
||||
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
|
||||
"shell/renderer/api/electron_api_context_bridge.cc",
|
||||
@@ -591,14 +599,18 @@ filenames = {
|
||||
]
|
||||
|
||||
lib_sources_extensions = [
|
||||
"shell/browser/extensions/api/resources_private/resources_private_api.cc",
|
||||
"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.h",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.cc",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.h",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.cc",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.h",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.h",
|
||||
"shell/browser/extensions/electron_browser_context_keyed_service_factories.cc",
|
||||
"shell/browser/extensions/electron_browser_context_keyed_service_factories.h",
|
||||
"shell/browser/extensions/electron_component_extension_resource_manager.cc",
|
||||
"shell/browser/extensions/electron_component_extension_resource_manager.h",
|
||||
"shell/browser/extensions/electron_display_info_provider.cc",
|
||||
"shell/browser/extensions/electron_display_info_provider.h",
|
||||
"shell/browser/extensions/electron_extension_host_delegate.cc",
|
||||
@@ -611,24 +623,26 @@ filenames = {
|
||||
"shell/browser/extensions/electron_extension_system_factory.h",
|
||||
"shell/browser/extensions/electron_extension_web_contents_observer.cc",
|
||||
"shell/browser/extensions/electron_extension_web_contents_observer.h",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.cc",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.h",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.cc",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.h",
|
||||
"shell/browser/extensions/electron_extensions_api_client.cc",
|
||||
"shell/browser/extensions/electron_extensions_api_client.h",
|
||||
"shell/browser/extensions/electron_extensions_browser_api_provider.cc",
|
||||
"shell/browser/extensions/electron_extensions_browser_api_provider.h",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.cc",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.h",
|
||||
"shell/browser/extensions/electron_messaging_delegate.cc",
|
||||
"shell/browser/extensions/electron_messaging_delegate.h",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.cc",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.h",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.cc",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.h",
|
||||
"shell/common/extensions/electron_extensions_api_provider.cc",
|
||||
"shell/common/extensions/electron_extensions_api_provider.h",
|
||||
"shell/common/extensions/electron_extensions_client.cc",
|
||||
"shell/common/extensions/electron_extensions_client.h",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.h",
|
||||
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.cc",
|
||||
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.h",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.h",
|
||||
]
|
||||
|
||||
app_sources = [
|
||||
|
||||
@@ -25,26 +25,6 @@ BrowserWindow.prototype._init = function () {
|
||||
nativeSetBounds.call(this, bounds, ...opts)
|
||||
}
|
||||
|
||||
// window.resizeTo(...)
|
||||
// window.moveTo(...)
|
||||
this.webContents.on('move', (event, size) => {
|
||||
this.setBounds(size)
|
||||
})
|
||||
|
||||
// Hide the auto-hide menu when webContents is focused.
|
||||
this.webContents.on('activate', () => {
|
||||
if (process.platform !== 'darwin' && this.autoHideMenuBar && this.isMenuBarVisible()) {
|
||||
this.setMenuBarVisibility(false)
|
||||
}
|
||||
})
|
||||
|
||||
// Change window title to page title.
|
||||
this.webContents.on('page-title-updated', (event, title, ...args) => {
|
||||
// Route the event to BrowserWindow.
|
||||
this.emit('page-title-updated', event, title, ...args)
|
||||
if (!this.isDestroyed() && !event.defaultPrevented) this.setTitle(title)
|
||||
})
|
||||
|
||||
// Sometimes the webContents doesn't get focus when window is shown, so we
|
||||
// have to force focusing on webContents in this case. The safest way is to
|
||||
// focus it when we first start to load URL, if we do it earlier it won't
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { app, deprecate } = require('electron')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.electronBinding('session')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol, ServiceWorkerContext } = process.electronBinding('session')
|
||||
|
||||
// Public API.
|
||||
Object.defineProperties(exports, {
|
||||
@@ -16,8 +16,9 @@ Object.defineProperties(exports, {
|
||||
}
|
||||
})
|
||||
|
||||
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
|
||||
Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
|
||||
Object.setPrototypeOf(ServiceWorkerContext.prototype, EventEmitter.prototype)
|
||||
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
|
||||
|
||||
Session.prototype._init = function () {
|
||||
app.emit('session-created', this)
|
||||
|
||||
@@ -51,13 +51,27 @@ class TouchBar extends EventEmitter {
|
||||
item.child.ordereredItems.forEach(registerItem)
|
||||
}
|
||||
}
|
||||
|
||||
let hasOtherItemsProxy = false
|
||||
items.forEach((item) => {
|
||||
if (!(item instanceof TouchBarItem)) {
|
||||
throw new Error('Each item must be an instance of TouchBarItem')
|
||||
}
|
||||
|
||||
if (item.type === 'other_items_proxy') {
|
||||
if (!hasOtherItemsProxy) {
|
||||
hasOtherItemsProxy = true
|
||||
} else {
|
||||
throw new Error('Must only have one OtherItemsProxy per TouchBar')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// register in separate loop after all items are validated
|
||||
for (const item of items) {
|
||||
this.ordereredItems.push(item)
|
||||
registerItem(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
set escapeItem (item) {
|
||||
@@ -334,4 +348,11 @@ TouchBar.TouchBarScrubber = class TouchBarScrubber extends TouchBarItem {
|
||||
}
|
||||
}
|
||||
|
||||
TouchBar.TouchBarOtherItemsProxy = class TouchBarOtherItemsProxy extends TouchBarItem {
|
||||
constructor (config) {
|
||||
super()
|
||||
this._addImmutableProperty('type', 'other_items_proxy')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TouchBar
|
||||
|
||||
@@ -18,8 +18,10 @@ require('@electron/internal/common/init')
|
||||
if (process.platform === 'win32') {
|
||||
// Redirect node's console to use our own implementations, since node can not
|
||||
// handle console output when running as GUI program.
|
||||
const consoleLog = (format: any, ...args: any[]) => {
|
||||
return process.log(util.format(format, ...args) + '\n')
|
||||
const consoleLog = (...args: any[]) => {
|
||||
// @ts-ignore this typing is incorrect; 'format' is an optional parameter
|
||||
// See https://nodejs.org/api/util.html#util_util_format_format_args
|
||||
return process.log(util.format(...args) + '\n')
|
||||
}
|
||||
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
|
||||
if (Buffer.isBuffer(chunk)) {
|
||||
|
||||
@@ -321,7 +321,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
|
||||
|
||||
const isRemoteModuleEnabledImpl = function (contents: electron.WebContents) {
|
||||
const webPreferences = (contents as any).getLastWebPreferences() || {}
|
||||
return webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true
|
||||
return webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : false
|
||||
}
|
||||
|
||||
const isRemoteModuleEnabledCache = new WeakMap()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
const asar = process._linkedBinding('atom_common_asar')
|
||||
const v8Util = process._linkedBinding('atom_common_v8_util')
|
||||
const asar = process._linkedBinding('electron_common_asar')
|
||||
const v8Util = process._linkedBinding('electron_common_v8_util')
|
||||
const { Buffer } = require('buffer')
|
||||
const Module = require('module')
|
||||
const path = require('path')
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
const binding = process.electronBinding('crash_reporter')
|
||||
|
||||
class CrashReporter {
|
||||
contructor () {
|
||||
constructor () {
|
||||
this.productName = null
|
||||
this.crashesDirectory = null
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
export function electronBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['electronBinding'] {
|
||||
return function electronBinding (name: string) {
|
||||
try {
|
||||
return binding(`atom_${processType}_${name}`)
|
||||
return binding(`electron_${processType}_${name}`)
|
||||
} catch (error) {
|
||||
if (/No such module/.test(error.message)) {
|
||||
return binding(`atom_common_${name}`)
|
||||
return binding(`electron_common_${name}`)
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ Object.setPrototypeOf(process, EventEmitter.prototype)
|
||||
const isolatedWorldArgs = v8Util.getHiddenValue(isolatedWorld, 'isolated-world-args')
|
||||
|
||||
if (isolatedWorldArgs) {
|
||||
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen } = isolatedWorldArgs
|
||||
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen, rendererProcessReuseEnabled } = isolatedWorldArgs
|
||||
const { windowSetup } = require('@electron/internal/renderer/window-setup')
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen, rendererProcessReuseEnabled)
|
||||
}
|
||||
|
||||
const extensionId = v8Util.getHiddenValue(isolatedWorld, `extension-${worldId}`)
|
||||
|
||||
@@ -21,7 +21,7 @@ if (webViewImpl) {
|
||||
const isolatedWorldArgs = v8Util.getHiddenValue(isolatedWorld, 'isolated-world-args')
|
||||
|
||||
if (isolatedWorldArgs) {
|
||||
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen } = isolatedWorldArgs
|
||||
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen, rendererProcessReuseEnabled } = isolatedWorldArgs
|
||||
const { windowSetup } = require('@electron/internal/renderer/window-setup')
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen, rendererProcessReuseEnabled)
|
||||
}
|
||||
|
||||
@@ -13,15 +13,6 @@ const remoteObjectCache = v8Util.createIDWeakMap()
|
||||
// An unique ID that can represent current context.
|
||||
const contextId = v8Util.getHiddenValue(global, 'contextId')
|
||||
|
||||
ipcRendererInternal.invoke('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES').then(preferences => {
|
||||
console.log(preferences)
|
||||
if (!preferences.enableRemoteModule) {
|
||||
console.warn('%cElectron Deprecation Warning', 'font-weight: bold', "The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.")
|
||||
}
|
||||
}, (err) => {
|
||||
console.error('Failed to get web preferences:', err)
|
||||
})
|
||||
|
||||
// Notify the main process when current context is going to be released.
|
||||
// Note that when the renderer process is destroyed, the message may not be
|
||||
// sent, we also listen to the "render-view-deleted" event in the main process
|
||||
|
||||
@@ -7,7 +7,7 @@ const v8Util = process.electronBinding('v8_util')
|
||||
const IsolatedWorldIDs = {
|
||||
/**
|
||||
* Start of extension isolated world IDs, as defined in
|
||||
* atom_render_frame_observer.h
|
||||
* electron_render_frame_observer.h
|
||||
*/
|
||||
ISOLATED_WORLD_EXTENSIONS: 1 << 20
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ const nodeIntegration = hasSwitch('node-integration')
|
||||
const webviewTag = hasSwitch('webview-tag')
|
||||
const isHiddenPage = hasSwitch('hidden-page')
|
||||
const usesNativeWindowOpen = hasSwitch('native-window-open')
|
||||
const rendererProcessReuseEnabled = hasSwitch('disable-electron-site-instance-overrides')
|
||||
|
||||
const preloadScript = parseOption('preload', null)
|
||||
const preloadScripts = parseOption('preload-scripts', [], value => value.split(path.delimiter)) as string[]
|
||||
@@ -85,7 +86,7 @@ const guestInstanceId = parseOption('guest-instance-id', null, value => parseInt
|
||||
const openerId = parseOption('opener-id', null, value => parseInt(value))
|
||||
|
||||
// The arguments to be passed to isolated world.
|
||||
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen }
|
||||
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen, rendererProcessReuseEnabled }
|
||||
|
||||
// The webContents preload script is loaded after the session preload scripts.
|
||||
if (preloadScript) {
|
||||
@@ -110,7 +111,7 @@ switch (window.location.protocol) {
|
||||
default: {
|
||||
// Override default web functions.
|
||||
const { windowSetup } = require('@electron/internal/renderer/window-setup')
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen, rendererProcessReuseEnabled)
|
||||
|
||||
// Inject content scripts.
|
||||
if (!process.electronBinding('features').isExtensionsEnabled()) {
|
||||
|
||||
@@ -175,7 +175,7 @@ class BrowserWindowProxy {
|
||||
}
|
||||
|
||||
export const windowSetup = (
|
||||
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean
|
||||
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean, rendererProcessReuseEnabled: boolean
|
||||
) => {
|
||||
if (!process.sandboxed && guestInstanceId == null) {
|
||||
// Override default window.close.
|
||||
@@ -229,7 +229,7 @@ export const windowSetup = (
|
||||
})
|
||||
}
|
||||
|
||||
if (!process.sandboxed) {
|
||||
if (!process.sandboxed && !rendererProcessReuseEnabled) {
|
||||
window.history.back = function () {
|
||||
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
|
||||
}
|
||||
|
||||
@@ -116,10 +116,11 @@ const { hasSwitch } = process.electronBinding('command_line')
|
||||
|
||||
const contextIsolation = hasSwitch('context-isolation')
|
||||
const isHiddenPage = hasSwitch('hidden-page')
|
||||
const rendererProcessReuseEnabled = hasSwitch('disable-electron-site-instance-overrides')
|
||||
const usesNativeWindowOpen = true
|
||||
|
||||
// The arguments to be passed to isolated world.
|
||||
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen }
|
||||
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen, rendererProcessReuseEnabled }
|
||||
|
||||
switch (window.location.protocol) {
|
||||
case 'devtools:': {
|
||||
@@ -140,7 +141,7 @@ switch (window.location.protocol) {
|
||||
default: {
|
||||
// Override default web functions.
|
||||
const { windowSetup } = require('@electron/internal/renderer/window-setup')
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen, rendererProcessReuseEnabled)
|
||||
|
||||
// Inject content scripts.
|
||||
if (!process.electronBinding('features').isExtensionsEnabled()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "9.0.0-nightly.20200205",
|
||||
"version": "10.0.0-nightly.20200225",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
@@ -19,6 +19,7 @@
|
||||
"@types/semver": "^6.0.1",
|
||||
"@types/send": "^0.14.5",
|
||||
"@types/split": "^1.0.0",
|
||||
"@types/uuid": "^3.4.6",
|
||||
"@types/webpack": "^4.4.32",
|
||||
"@types/webpack-env": "^1.13.9",
|
||||
"@typescript-eslint/eslint-plugin": "^2.6.0",
|
||||
|
||||
@@ -31,11 +31,12 @@ scroll_bounce_flag.patch
|
||||
mas-cfisobjc.patch
|
||||
mas-cgdisplayusesforcetogray.patch
|
||||
mas-audiodeviceduck.patch
|
||||
mas_disable_remote_layer.patch
|
||||
mas_disable_remote_accessibility.patch
|
||||
mas_disable_custom_window_frame.patch
|
||||
chrome_key_systems.patch
|
||||
allow_nested_error_trackers.patch
|
||||
blink_initialization_order.patch
|
||||
add_didinstallconditionalfeatures.patch
|
||||
ssl_security_state_tab_helper.patch
|
||||
desktop_media_list.patch
|
||||
proxy_config_monitor.patch
|
||||
@@ -81,3 +82,7 @@ feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
|
||||
accessible_pane_view.patch
|
||||
fixme_grit_conflicts.patch
|
||||
fix_use_the_new_mediaplaypause_key_listener_for_internal_chrome.patch
|
||||
fix_use_native_window_button_positions_when_macos_locale_is_rtl.patch
|
||||
use_electron_resources_in_pdf_util.patch
|
||||
hack_plugin_response_interceptor_to_point_to_electron.patch
|
||||
fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
|
||||
|
||||
137
patches/chromium/add_didinstallconditionalfeatures.patch
Normal file
137
patches/chromium/add_didinstallconditionalfeatures.patch
Normal file
@@ -0,0 +1,137 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 15 Jan 2020 16:35:18 -0800
|
||||
Subject: add DidInstallConditionalFeatures
|
||||
|
||||
This adds a hook on script context creation _after conditional features
|
||||
have been installed_. Electron uses this to run preload scripts and
|
||||
various other initialization. This is necessary because at the time
|
||||
DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 68654a3e7d5ec6caddccb667f9f8fa2feabfa71b..650ce53e112bd65e1901a09480452855a0c16dda 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -115,6 +115,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidHandleOnloadEvents() {}
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
|
||||
+ int32_t world_id) {}
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 6730d6f6eb8448452991ebf5968a8c5a398b6a88..b87f9c7ac0f31ec33f03c36131c3255c8a31c22c 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -5187,6 +5187,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
+void RenderFrameImpl::DidInstallConditionalFeatures(
|
||||
+ v8::Local<v8::Context> context, int world_id) {
|
||||
+ for (auto& observer : observers_)
|
||||
+ observer.DidInstallConditionalFeatures(context, world_id);
|
||||
+}
|
||||
+
|
||||
void RenderFrameImpl::WillReleaseScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index bc896201057832415b5d54dc8987bb74bf7aa778..5c96af71646722b1108a8d6eafba1adaddf0a05a 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -773,6 +773,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
+ void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
|
||||
+ int world_id) override;
|
||||
void WillReleaseScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index 30638c31e30d98bb23292115b25b528ff8e8f62c..e0f2f786b75f861851d1194f57b253a173053299 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -652,6 +652,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) {}
|
||||
+
|
||||
// WebKit is about to release its reference to a v8 context for a frame.
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index 8095edd988c171a8ad7382d1c2f9fa63ee9e5ffc..510dae593d2a0e2ce13a2879dde5c31e01d21c21 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -231,6 +231,7 @@ void LocalWindowProxy::Initialize() {
|
||||
}
|
||||
|
||||
InstallConditionalFeatures();
|
||||
+ GetFrame()->Client()->DidInstallConditionalFeatures(context, world_->GetWorldId());
|
||||
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
index f8c512c9db0b88904a562b7d4195790d4b0f86a6..d31ef9bd5b98f584a3296638662ae0d27aa37b65 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
@@ -267,6 +267,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
+void LocalFrameClientImpl::DidInstallConditionalFeatures(
|
||||
+ v8::Local<v8::Context> context,
|
||||
+ int32_t world_id) {
|
||||
+ if (web_frame_->Client())
|
||||
+ web_frame_->Client()->DidInstallConditionalFeatures(context, world_id);
|
||||
+}
|
||||
+
|
||||
void LocalFrameClientImpl::WillReleaseScriptContext(
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
index a055f4b0cc1ccc30752b65d6dc54e638e9b63001..0e6501adbf6f9696429c3fa95357de399ee30a9d 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
@@ -79,6 +79,8 @@ class LocalFrameClientImpl final : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override;
|
||||
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) override;
|
||||
void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index 1d6facb9ec63abebc5b79a57860765bc8b3f6638..0b58cb679ed34c54e39af661d4a432d482db8c3c 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -303,6 +303,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) = 0;
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index f3f00e7d6ac44d77dd75997abf8b93eb59476eb3..2010792697b3443dd6f5058bed5ccd0026c4a152 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -370,6 +370,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) override {}
|
||||
void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
bool AllowScriptExtensions() override { return false; }
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:24 -0700
|
||||
Subject: blink_initialization_order.patch
|
||||
|
||||
Backport of https://chromium-review.googlesource.com/c/chromium/src/+/1030530
|
||||
to fix the order of V8 and Blink initialization. Also fixes order
|
||||
of DidCreateScriptContext notification with initialization of window globals
|
||||
to fix electron/electron#13787. The backport landed in Chromium 67 but the
|
||||
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index c845acb8321e94c916798826a168e06df34ffff4..941ca9d3905c0c2f36606655bf60e9e9bd1f9196 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -211,11 +211,10 @@ void LocalWindowProxy::Initialize() {
|
||||
GetFrame()->IsMainFrame());
|
||||
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
|
||||
origin);
|
||||
+ InstallConditionalFeatures();
|
||||
GetFrame()->Client()->DidCreateScriptContext(context, world_->GetWorldId());
|
||||
}
|
||||
|
||||
- InstallConditionalFeatures();
|
||||
-
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
}
|
||||
@@ -6,6 +6,18 @@ Subject: chore: use electron resources not chrome for spellchecker
|
||||
spellchecker uses a few IDS_ resources. We need to load these from
|
||||
Electrons grit header instead of Chromes
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index d730660c086f..ba9b098d848e 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -5049,6 +5049,7 @@ jumbo_split_static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
+ "//electron:resources",
|
||||
]
|
||||
|
||||
if (!is_android) {
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fae4ee67ca 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
@@ -19,6 +31,18 @@ index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fa
|
||||
#include "components/keyed_service/content/browser_context_dependency_manager.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
diff --git a/components/language/core/browser/BUILD.gn b/components/language/core/browser/BUILD.gn
|
||||
index f28230ea94fe..c10eea103852 100644
|
||||
--- a/components/language/core/browser/BUILD.gn
|
||||
+++ b/components/language/core/browser/BUILD.gn
|
||||
@@ -31,6 +31,7 @@ static_library("browser") {
|
||||
"//components/pref_registry",
|
||||
"//components/prefs",
|
||||
"//components/strings",
|
||||
+ "//electron:resources",
|
||||
"//ui/base",
|
||||
]
|
||||
}
|
||||
diff --git a/components/language/core/browser/language_prefs.cc b/components/language/core/browser/language_prefs.cc
|
||||
index 7e06f689632ae67e3e17d7985c6e7b6ea0057f3c..0b4676f4c40b4a0eda927a51016ec91ec230291d 100644
|
||||
--- a/components/language/core/browser/language_prefs.cc
|
||||
|
||||
@@ -52,15 +52,6 @@ index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e487
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
@@ -151,6 +152,8 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) {
|
||||
modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0;
|
||||
modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0;
|
||||
modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0;
|
||||
+ // For Windows key
|
||||
+ modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0;
|
||||
|
||||
ui::Accelerator accelerator(
|
||||
ui::KeyboardCodeFromXKeyEvent(x_event), modifiers);
|
||||
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
|
||||
index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc7951d372 100644
|
||||
--- a/ui/base/accelerators/media_keys_listener.cc
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Fri, 14 Feb 2020 13:35:47 -0800
|
||||
Subject: fix: route mouse event navigations through the web_contents delegate
|
||||
|
||||
This ensures that embedders can handle browser-side mouse navigations
|
||||
themselves. We need this so that we can correctly ensure that processes
|
||||
are not restarted for in-document navigations.
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1769525
|
||||
|
||||
This patch can be removed once app.allowRendererProcessReuse is forced
|
||||
to true as then Chromiums assumptions around processes become correct.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 70d735dcc38734edaaf6221cd40c49beb6d2e37e..9cd7368966c20b9e9306c41e455c002d686d3013 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2347,11 +2347,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
WebContentsImpl* outermost = GetOutermostWebContents();
|
||||
if (event.button == blink::WebPointerProperties::Button::kBack &&
|
||||
outermost->controller_.CanGoBack()) {
|
||||
- outermost->controller_.GoBack();
|
||||
+ if (delegate_->OnGoToEntryOffset(-1))
|
||||
+ outermost->controller_.GoBack();
|
||||
return true;
|
||||
} else if (event.button == blink::WebPointerProperties::Button::kForward &&
|
||||
outermost->controller_.CanGoForward()) {
|
||||
- outermost->controller_.GoForward();
|
||||
+ if (delegate_->OnGoToEntryOffset(1))
|
||||
+ outermost->controller_.GoForward();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sesh Sadasivam <sesh@fb.com>
|
||||
Date: Fri, 31 Jan 2020 19:02:27 -0800
|
||||
Subject: fix: use native window button positions when MacOS locale is RTL
|
||||
|
||||
Classes that inherit from `NSThemeFrame` seem to show window buttons in the
|
||||
incorrect position when the primary MacOS language is set to an RTL
|
||||
(right-to-left) language like Arabic or Hebrew. The fix in this commit mirrors
|
||||
that of `tabbed_browser_window.mm`
|
||||
(https://chromium-review.googlesource.com/c/chromium/src/+/562603/10/chrome/browser/ui/cocoa/tabbed_browser_window.mm#88).
|
||||
|
||||
This change should be upstreamed, and then this patch can be removed.
|
||||
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
index 9905e1c8914f852e250480797f43d17bf9d7f794..0016cc129805726d6518036fb181a2a9715af8c5 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
@@ -69,6 +69,13 @@ - (void)mouseDown:(NSEvent*)event {
|
||||
- (BOOL)usesCustomDrawing {
|
||||
return NO;
|
||||
}
|
||||
+// AppKit's implementation only returns YES if [self class] == [NSThemeFrame
|
||||
+// class]. See:
|
||||
+// https://chromium-review.googlesource.com/c/chromium/src/+/562603/10/chrome/browser/ui/cocoa/tabbed_browser_window.mm#88
|
||||
+- (BOOL)_shouldFlipTrafficLightsForRTL API_AVAILABLE(macosx(10.13)) {
|
||||
+ return self.window.windowTitlebarLayoutDirection ==
|
||||
+ NSUserInterfaceLayoutDirectionRightToLeft;
|
||||
+}
|
||||
@end
|
||||
|
||||
@implementation NativeWidgetMacNSWindowBorderlessFrame
|
||||
@@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Mon, 10 Feb 2020 11:52:23 -0800
|
||||
Subject: hack plugin response interceptor to point to electron
|
||||
|
||||
chrome's streams_private_api does prerender and other things and would
|
||||
require a largeish patch to get working, so just redirect it to our
|
||||
implementation instead.
|
||||
|
||||
diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
|
||||
index 1c9aeb8fa71d054159c2ccccccbe57aa474d417e..0bd6412f2c79f77f936720b1a0795b50ecefd26c 100644
|
||||
--- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
|
||||
+++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/guid.h"
|
||||
#include "base/task/post_task.h"
|
||||
-#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
|
||||
-#include "chrome/browser/plugins/plugin_utils.h"
|
||||
+#include "electron/shell/browser/extensions/api/streams_private/streams_private_api.h"
|
||||
+#include "electron/shell/browser/plugins/plugin_utils.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/download_utils.h"
|
||||
137
patches/chromium/mas_disable_remote_layer.patch
Normal file
137
patches/chromium/mas_disable_remote_layer.patch
Normal file
@@ -0,0 +1,137 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:48:49 -0700
|
||||
Subject: mas_disable_remote_layer.patch
|
||||
|
||||
Disable remote layer APIs (CAContext and CALayerHost) for MAS build.
|
||||
|
||||
Accordin to ccameron:
|
||||
|
||||
For apps that spend a lot of time watching video (especially fullscreen video),
|
||||
the power/battery usage will likely increase 1.5x to 2x. For something that is,
|
||||
e.g, scrolling, it'll be smaller, more like 1.15x or 1.25x.
|
||||
|
||||
In terms of performance, the impact will likely be fairly small -- any app that
|
||||
could hit 60fps before will likely still be able to hit 60fps. There may even be
|
||||
cases where performance improves when disabling remote CoreAnimation (remote
|
||||
CoreAnimation is really only about battery usage).
|
||||
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
index c1af03a268dc..b883883ad52b 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -63,6 +63,7 @@
|
||||
template <typename BaseClass>
|
||||
bool ImageTransportSurfaceOverlayMacBase<BaseClass>::Initialize(
|
||||
gl::GLSurfaceFormat format) {
|
||||
+#ifndef MAS_BUILD
|
||||
// Create the CAContext to send this to the GPU process, and the layer for
|
||||
// the context.
|
||||
if (use_remote_layer_api_) {
|
||||
@@ -71,6 +72,7 @@
|
||||
[CAContext contextWithCGSConnection:connection_id options:@{}] retain]);
|
||||
[ca_context_ setLayer:ca_layer_tree_coordinator_->GetCALayerForDisplay()];
|
||||
}
|
||||
+#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -139,7 +141,9 @@
|
||||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
if (use_remote_layer_api_) {
|
||||
+#ifndef MAS_BUILD
|
||||
params.ca_layer_params.ca_context_id = [ca_context_ contextId];
|
||||
+#endif
|
||||
} else {
|
||||
IOSurfaceRef io_surface =
|
||||
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
index f65ad035e90c..9edb62e713e8 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "ui/gl/gl_surface_egl.h"
|
||||
#endif
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
@class CAContext;
|
||||
+#endif
|
||||
@class CALayer;
|
||||
|
||||
namespace ui {
|
||||
@@ -97,7 +99,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
|
||||
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
||||
|
||||
bool use_remote_layer_api_;
|
||||
+#ifndef MAS_BUILD
|
||||
base::scoped_nsobject<CAContext> ca_context_;
|
||||
+#endif
|
||||
std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_;
|
||||
|
||||
gfx::Size pixel_size_;
|
||||
diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
index 60abe639bd9c..c38eed5fbdef 100644
|
||||
--- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
+++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
@@ -98,6 +98,7 @@ - (void)setContentsChanged;
|
||||
}
|
||||
|
||||
void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) {
|
||||
+#ifndef MAS_BUILD
|
||||
// Early-out if the remote layer has not changed.
|
||||
if ([remote_layer_ contextId] == ca_context_id)
|
||||
return;
|
||||
@@ -122,6 +123,9 @@ - (void)setContentsChanged;
|
||||
[io_surface_layer_ removeFromSuperlayer];
|
||||
io_surface_layer_.reset();
|
||||
}
|
||||
+#else
|
||||
+ NOTREACHED() << "Remote layer is being used in MAS build";
|
||||
+#endif
|
||||
}
|
||||
|
||||
void DisplayCALayerTree::GotIOSurfaceFrame(
|
||||
diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h
|
||||
index 2057fe69d1bb..2aba330fc488 100644
|
||||
--- a/ui/base/cocoa/remote_layer_api.h
|
||||
+++ b/ui/base/cocoa/remote_layer_api.h
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "ui/base/ui_base_export.h"
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// The CGSConnectionID is used to create the CAContext in the process that is
|
||||
// going to share the CALayers that it is rendering to another process to
|
||||
// display.
|
||||
@@ -50,6 +51,8 @@ typedef uint32_t CAContextID;
|
||||
|
||||
#endif // __OBJC__
|
||||
|
||||
+#endif // MAS_BUILD
|
||||
+
|
||||
namespace ui {
|
||||
|
||||
// This function will check if all of the interfaces listed above are supported
|
||||
diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm
|
||||
index bbaf9f466f49..8c846ce9523a 100644
|
||||
--- a/ui/base/cocoa/remote_layer_api.mm
|
||||
+++ b/ui/base/cocoa/remote_layer_api.mm
|
||||
@@ -12,6 +12,7 @@
|
||||
namespace ui {
|
||||
|
||||
bool RemoteLayerAPISupported() {
|
||||
+#ifndef MAS_BUILD
|
||||
static bool disabled_at_command_line =
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kDisableRemoteCoreAnimation);
|
||||
@@ -46,6 +47,9 @@ bool RemoteLayerAPISupported() {
|
||||
|
||||
// If everything is there, we should be able to use the API.
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif // MAS_BUILD
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -1,18 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Wed, 23 Oct 2019 15:30:18 -0700
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 4 Feb 2020 08:59:32 -0700
|
||||
Subject: Revert "Remove ContentRendererClient::ShouldFork."
|
||||
|
||||
This reverts commit 6b068eb8ca4a3c7350bdafa22fc0cf0636ef8b74.
|
||||
This reverts the CL at https://chromium-review.googlesource.com/c/chromium/src/+/1812128.
|
||||
We use it to force a new renderer process for navigations, and need to start a new renderer process
|
||||
for every navigation to keep Node.js working properly. Once Native Modules in the renderer process
|
||||
are required to be NAPI or context aware (Electron v11), this patch can be removed.
|
||||
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
index e03ad3a5a115383143d1324164dfd37f87c6f2f2..1c179e0cca8b0b1fc19971d1c9e93d59af7b9383 100644
|
||||
index a9b2e3fa8067e0adc7430c5e566d7734c2f75681..c564b64b72a604ee7beee2e4d617ca7c18a00d6b 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -1291,6 +1291,17 @@ bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
|
||||
return true;
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
@@ -1269,6 +1269,25 @@ bool ChromeContentRendererClient::AllowPopup() {
|
||||
#endif
|
||||
}
|
||||
|
||||
+bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) {
|
||||
+ DCHECK(!frame->Parent());
|
||||
+
|
||||
+ // If |url| matches one of the prerendered URLs, stop this navigation and try
|
||||
@@ -24,84 +32,90 @@ index e03ad3a5a115383143d1324164dfd37f87c6f2f2..1c179e0cca8b0b1fc19971d1c9e93d59
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
|
||||
index b4895b8770bd58d400cc8ca55c74940b25b3a8d5..3c0d6bc9bb50abc5f02e07c24ed8ae424dcda1a5 100644
|
||||
--- a/content/renderer/render_view_browsertest.cc
|
||||
+++ b/content/renderer/render_view_browsertest.cc
|
||||
@@ -1004,6 +1004,73 @@ TEST_F(RenderViewImplTest, BeginNavigationForWebUI) {
|
||||
FrameHostMsg_OpenURL::ID));
|
||||
}
|
||||
|
||||
+class AlwaysForkingRenderViewTest : public RenderViewImplTest {
|
||||
+ public:
|
||||
+ ContentRendererClient* CreateContentRendererClient() override {
|
||||
+ return new TestContentRendererClient;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+ private:
|
||||
+ class TestContentRendererClient : public ContentRendererClient {
|
||||
+ public:
|
||||
+ bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) override {
|
||||
+ return true;
|
||||
void ChromeContentRendererClient::WillSendRequest(
|
||||
WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
|
||||
index b5d52afedb94475f05318bfc35f7e0b595047ee3..c40a6ec13f3ee366dcf9cc5b6440045c89c310b8 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.h
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.h
|
||||
@@ -131,6 +131,11 @@ class ChromeContentRendererClient
|
||||
base::SingleThreadTaskRunner* compositor_thread_task_runner) override;
|
||||
bool RunIdleHandlerWhenWidgetsHidden() override;
|
||||
bool AllowPopup() override;
|
||||
+ bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) override;
|
||||
void WillSendRequest(blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
const blink::WebURL& url,
|
||||
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
|
||||
index c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa200fb9773c 100644
|
||||
--- a/content/public/renderer/content_renderer_client.cc
|
||||
+++ b/content/public/renderer/content_renderer_client.cc
|
||||
@@ -104,6 +104,14 @@ bool ContentRendererClient::HandleNavigation(
|
||||
}
|
||||
#endif
|
||||
|
||||
+bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void ContentRendererClient::WillSendRequest(
|
||||
blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index 0a4ec619e96a840b4b4d5b51246de6c91e0f94f2..5dabb49f061b4e0643256cbf9162d128c1e0bacf 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -213,6 +213,13 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
bool is_redirect);
|
||||
#endif
|
||||
|
||||
+ // Returns true if we should fork a new process for the given navigation.
|
||||
+ virtual bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect);
|
||||
+
|
||||
// Notifies the embedder that the given frame is requesting the resource at
|
||||
// |url|. If the function returns a valid |new_url|, the request must be
|
||||
// updated to use it. The |attach_same_site_cookies| output parameter
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 3800b761af945bc1592eda7f054199da03183b05..6cabed55988cdfaab422b36a697fc8b0310870a8 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -5798,6 +5798,23 @@ void RenderFrameImpl::BeginNavigation(
|
||||
int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
|
||||
bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
|
||||
(cumulative_bindings & kWebUIBindingsPolicyMask);
|
||||
+
|
||||
+ if (!should_fork && url.SchemeIs(url::kFileScheme)) {
|
||||
+ // Fork non-file to file opens (see https://crbug.com/1031119). Note that
|
||||
+ // this may fork unnecessarily if another tab (hosting a file or not)
|
||||
+ // targeted this one before its initial navigation, but that shouldn't
|
||||
+ // cause a problem.
|
||||
+ should_fork = !old_url.SchemeIs(url::kFileScheme);
|
||||
+ }
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+TEST_F(AlwaysForkingRenderViewTest, BeginNavigationDoesNotForkEmptyUrl) {
|
||||
+ GURL example_url("http://example.com");
|
||||
+ GURL empty_url("");
|
||||
+ if (!should_fork) {
|
||||
+ // Give the embedder a chance.
|
||||
+ bool is_initial_navigation = render_view_->history_list_length_ == 0;
|
||||
+ should_fork = GetContentClient()->renderer()->ShouldFork(
|
||||
+ frame_, url, info->url_request.HttpMethod().Utf8(),
|
||||
+ is_initial_navigation, false /* is_redirect */);
|
||||
+ }
|
||||
+
|
||||
+ LoadHTMLWithUrlOverride("<body></body", example_url.spec().c_str());
|
||||
+ EXPECT_EQ(example_url,
|
||||
+ GURL(frame()->GetWebFrame()->GetDocumentLoader()->GetUrl()));
|
||||
+
|
||||
+ // Empty url should never fork.
|
||||
+ blink::WebURLRequest request(empty_url);
|
||||
+ request.SetMode(network::mojom::RequestMode::kNavigate);
|
||||
+ request.SetRedirectMode(network::mojom::RedirectMode::kManual);
|
||||
+ request.SetRequestContext(blink::mojom::RequestContextType::INTERNAL);
|
||||
+ request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(example_url));
|
||||
+ auto navigation_info = std::make_unique<blink::WebNavigationInfo>();
|
||||
+ navigation_info->url_request = request;
|
||||
+ navigation_info->frame_type =
|
||||
+ network::mojom::RequestContextFrameType::kTopLevel;
|
||||
+ navigation_info->navigation_policy = blink::kWebNavigationPolicyCurrentTab;
|
||||
+ frame()->BeginNavigation(std::move(navigation_info));
|
||||
+ EXPECT_FALSE(render_thread_->sink().GetUniqueMessageMatching(
|
||||
+ FrameHostMsg_OpenURL::ID));
|
||||
+}
|
||||
+
|
||||
+TEST_F(AlwaysForkingRenderViewTest, BeginNavigationDoesNotForkAboutBlank) {
|
||||
+ GURL example_url("http://example.com");
|
||||
+ GURL blank_url(url::kAboutBlankURL);
|
||||
+
|
||||
+ LoadHTMLWithUrlOverride("<body></body", example_url.spec().c_str());
|
||||
+ EXPECT_EQ(example_url,
|
||||
+ GURL(frame()->GetWebFrame()->GetDocumentLoader()->GetUrl()));
|
||||
+
|
||||
+ // about:blank should never fork.
|
||||
+ blink::WebURLRequest request(blank_url);
|
||||
+ request.SetMode(network::mojom::RequestMode::kNavigate);
|
||||
+ request.SetRedirectMode(network::mojom::RedirectMode::kManual);
|
||||
+ request.SetRequestContext(blink::mojom::RequestContextType::INTERNAL);
|
||||
+ request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(example_url));
|
||||
+ auto navigation_info = std::make_unique<blink::WebNavigationInfo>();
|
||||
+ navigation_info->url_request = request;
|
||||
+ navigation_info->frame_type =
|
||||
+ network::mojom::RequestContextFrameType::kTopLevel;
|
||||
+ navigation_info->navigation_policy = blink::kWebNavigationPolicyCurrentTab;
|
||||
+ frame()->BeginNavigation(std::move(navigation_info));
|
||||
+ EXPECT_FALSE(render_thread_->sink().GetUniqueMessageMatching(
|
||||
+ FrameHostMsg_OpenURL::ID));
|
||||
+}
|
||||
+
|
||||
// This test verifies that when device emulation is enabled, RenderFrameProxy
|
||||
// continues to receive the original ScreenInfo and not the emualted
|
||||
// ScreenInfo.
|
||||
if (should_fork) {
|
||||
OpenURL(std::move(info));
|
||||
return; // Suppress the load here.
|
||||
|
||||
22
patches/chromium/use_electron_resources_in_pdf_util.patch
Normal file
22
patches/chromium/use_electron_resources_in_pdf_util.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Mon, 10 Feb 2020 10:37:48 -0800
|
||||
Subject: use electron resources in pdf_util
|
||||
|
||||
Without this, the ID for IDR_PDF_MANIFEST will be wrong on linux
|
||||
and cause a DCHECK(), since the resource will be loaded as an empty
|
||||
string.
|
||||
|
||||
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
|
||||
index 877d0ba2f48359243527ddebf1d91132b3d5c455..cd69de498c4968ade0ffabf45b72d4d63b70b10f 100644
|
||||
--- a/chrome/browser/pdf/pdf_extension_util.cc
|
||||
+++ b/chrome/browser/pdf/pdf_extension_util.cc
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "base/strings/string_util.h"
|
||||
#include "chrome/common/chrome_content_client.h"
|
||||
-#include "chrome/grit/browser_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace pdf_extension_util {
|
||||
@@ -5,5 +5,7 @@
|
||||
|
||||
"src/electron/patches/v8": "src/v8",
|
||||
|
||||
"src/electron/patches/node": "src/third_party/electron_node"
|
||||
"src/electron/patches/node": "src/third_party/electron_node",
|
||||
|
||||
"src/electron/patches/devtools-frontend": "src/third_party/devtools-frontend/src"
|
||||
}
|
||||
|
||||
1
patches/devtools-frontend/.patches
Normal file
1
patches/devtools-frontend/.patches
Normal file
@@ -0,0 +1 @@
|
||||
fix_explicitly_specify_typeroots.patch
|
||||
@@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Dill <andy.dill@gmail.com>
|
||||
Date: Thu, 13 Feb 2020 20:06:42 -0800
|
||||
Subject: fix: explicitly specify `typeRoots`
|
||||
|
||||
fix: explicitly specify `typeRoots` to avoid crawling parent directories
|
||||
|
||||
Upstream CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2070561
|
||||
|
||||
diff --git a/third_party/typescript/ts_library.py b/third_party/typescript/ts_library.py
|
||||
index 10f07e63..2ac797d3 100644
|
||||
--- a/third_party/typescript/ts_library.py
|
||||
+++ b/third_party/typescript/ts_library.py
|
||||
@@ -41,6 +41,7 @@ def main():
|
||||
parser.add_argument('-deps', '--deps', nargs='*', help='List of Ninja build dependencies')
|
||||
parser.add_argument('-dir', '--front_end_directory', required=True, help='Folder that contains source files')
|
||||
parser.add_argument('-b', '--tsconfig_output_location', required=True)
|
||||
+ parser.add_argument('-r', '--tsconfig_type_root', required=True)
|
||||
opts = parser.parse_args()
|
||||
with open(ROOT_TS_CONFIG_LOCATION) as root_tsconfig:
|
||||
try:
|
||||
@@ -53,6 +54,7 @@ def main():
|
||||
tsconfig['files'] = [path.join(os.getcwd(), src) for src in opts.sources] + [path.abspath(GLOBAL_DEFS)]
|
||||
if (opts.deps is not None):
|
||||
tsconfig['references'] = [{'path': src} for src in opts.deps]
|
||||
+ tsconfig['compilerOptions']['typeRoots'] = [path.abspath(opts.tsconfig_type_root)]
|
||||
tsconfig['compilerOptions']['declaration'] = True
|
||||
tsconfig['compilerOptions']['composite'] = True
|
||||
tsconfig['compilerOptions']['rootDir'] = path.join(os.getcwd(), opts.front_end_directory)
|
||||
diff --git a/third_party/typescript/typescript.gni b/third_party/typescript/typescript.gni
|
||||
index 8a44f0e8..cc6fd295 100644
|
||||
--- a/third_party/typescript/typescript.gni
|
||||
+++ b/third_party/typescript/typescript.gni
|
||||
@@ -40,6 +40,11 @@ template("ts_library") {
|
||||
"/$target_name-tsconfig.json",
|
||||
]
|
||||
|
||||
+ args += [
|
||||
+ "--tsconfig_type_root",
|
||||
+ rebase_path("//third_party/devtools-frontend/src/node_modules/@types"),
|
||||
+ ]
|
||||
+
|
||||
assert(defined(sources), "You must specify TypeScript sources")
|
||||
|
||||
args += [ "--sources" ] + rebase_path(sources, root_build_dir)
|
||||
@@ -7,7 +7,6 @@ expose_get_builtin_module_function.patch
|
||||
fix_build_and_expose_inspector_agent.patch
|
||||
fix_expose_internalcallbackscope.patch
|
||||
build_add_gn_build_files.patch
|
||||
fix_export_debugoptions.patch
|
||||
fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
|
||||
feat_add_new_built_with_electron_variable_to_config_gypi.patch
|
||||
feat_add_flags_for_low-level_hooks_and_exceptions.patch
|
||||
@@ -18,7 +17,6 @@ fixme_use_redefined_version_of_internalmodulestat.patch
|
||||
fixme_remove_async_id_assertion_check.patch
|
||||
fixme_comment_trace_event_macro.patch
|
||||
fix_key_gen_apis_are_not_available_in_boringssl.patch
|
||||
fix_do_not_define_debugoptions_s_constructors_in_header.patch
|
||||
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
|
||||
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
|
||||
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
|
||||
@@ -29,10 +27,15 @@ build_bring_back_node_with_ltcg_configuration.patch
|
||||
revert_crypto_add_oaeplabel_option.patch
|
||||
refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
|
||||
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
|
||||
fix_remove_unused_llhttp_variables.patch
|
||||
fix_include_libuv_header_in_node_binding.patch
|
||||
remove_deprecated_task_api_override_removed_in_latest_v8.patch
|
||||
remove_serialization_deserialization_of_wasmmoduleobject.patch
|
||||
64bit_bump_typedarray_max_length_to_2_32-1_elements.patch
|
||||
test_use_tmpdir_refresh_in_test-esm-windows_js.patch
|
||||
override_existing_v8_reallocate.patch
|
||||
fix_use_hex_not_decimal_for_clarity.patch
|
||||
fix_use_crypto_impls_for_compat.patch
|
||||
fix_ensure_clocks_header_included_in_impl.patch
|
||||
fix_remove_implicit_type_conversions.patch
|
||||
fix_include_io_h_in_uvwasi_for_win.patch
|
||||
fix_--perf-prof_only_works_on_linux.patch
|
||||
fix_we_need_to_eager-load_cjs_modules.patch
|
||||
|
||||
@@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ec06e14dd327cdf89dc6fd584b6972ae64311ea0
|
||||
index 0000000000000000000000000000000000000000..e4aab62b85e6ea1eac68cc21056081b4ff4bd1d6
|
||||
--- /dev/null
|
||||
+++ b/BUILD.gn
|
||||
@@ -0,0 +1,370 @@
|
||||
@@ -0,0 +1,358 @@
|
||||
+import("//electron/build/asar.gni")
|
||||
+import("//v8/gni/v8.gni")
|
||||
+
|
||||
@@ -88,28 +88,15 @@ index 0000000000000000000000000000000000000000..ec06e14dd327cdf89dc6fd584b6972ae
|
||||
+ ":generate_config_gypi",
|
||||
+ ":node_js2c_inputs",
|
||||
+ ]
|
||||
+
|
||||
+ macro_inputs = []
|
||||
+ if (!node_use_dtrace && !node_use_etw) {
|
||||
+ macro_inputs += [ "tools/js2c_macros/notrace_macros.py" ]
|
||||
+ }
|
||||
+ if (node_debug_lib) {
|
||||
+ macro_inputs += [ "tools/js2c_macros/nodcheck_macros.py" ]
|
||||
+ } else {
|
||||
+ macro_inputs += [ "tools/js2c_macros/dcheck_macros.py" ]
|
||||
+ }
|
||||
+ macro_inputs += [ "tools/js2c_macros/check_macros.py" ]
|
||||
+
|
||||
+ config_gypi = [ "$target_gen_dir/config.gypi" ]
|
||||
+
|
||||
+ inputs = library_files + macro_inputs + config_gypi
|
||||
+ inputs = library_files + config_gypi
|
||||
+ outputs = [
|
||||
+ "$target_gen_dir/node_javascript.cc",
|
||||
+ ]
|
||||
+
|
||||
+ cwd = "$target_gen_dir/js2c_inputs"
|
||||
+ script = "tools/js2c.py"
|
||||
+ args = library_files + rebase_path(macro_inputs + config_gypi) + ["--target"] + rebase_path(outputs)
|
||||
+ args = library_files + rebase_path(config_gypi) + ["--target"] + rebase_path(outputs)
|
||||
+}
|
||||
+
|
||||
+config("node_features") {
|
||||
@@ -221,6 +208,7 @@ index 0000000000000000000000000000000000000000..ec06e14dd327cdf89dc6fd584b6972ae
|
||||
+ "deps/http_parser",
|
||||
+ "deps/llhttp",
|
||||
+ "deps/nghttp2",
|
||||
+ "deps/uvwasi",
|
||||
+ "deps/zlib",
|
||||
+ "//third_party/brotli:dec",
|
||||
+ "//third_party/brotli:enc",
|
||||
@@ -628,10 +616,10 @@ index 0000000000000000000000000000000000000000..66af819990b338caa49ca59d1fe6c5ad
|
||||
+}
|
||||
diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4674bdd48b4bfc9b7152377b8cd0984d1cf42562
|
||||
index 0000000000000000000000000000000000000000..510d86194ed71d78b2c89c7a77422afc0ef614ad
|
||||
--- /dev/null
|
||||
+++ b/deps/uv/BUILD.gn
|
||||
@@ -0,0 +1,185 @@
|
||||
@@ -0,0 +1,190 @@
|
||||
+config("libuv_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+
|
||||
@@ -691,6 +679,7 @@ index 0000000000000000000000000000000000000000..4674bdd48b4bfc9b7152377b8cd0984d
|
||||
+ "src/idna.c",
|
||||
+ "src/idna.h",
|
||||
+ "src/inet.c",
|
||||
+ "src/random.c",
|
||||
+ "src/queue.h",
|
||||
+ "src/strscpy.c",
|
||||
+ "src/strscpy.h",
|
||||
@@ -769,6 +758,7 @@ index 0000000000000000000000000000000000000000..4674bdd48b4bfc9b7152377b8cd0984d
|
||||
+ "src/unix/pipe.c",
|
||||
+ "src/unix/poll.c",
|
||||
+ "src/unix/process.c",
|
||||
+ "src/unix/random-devurandom.c",
|
||||
+ "src/unix/pthread-fixes.c",
|
||||
+ "src/unix/signal.c",
|
||||
+ "src/unix/spinlock.h",
|
||||
@@ -787,6 +777,7 @@ index 0000000000000000000000000000000000000000..4674bdd48b4bfc9b7152377b8cd0984d
|
||||
+ if (is_mac) {
|
||||
+ sources += [
|
||||
+ "src/unix/darwin-proctitle.c",
|
||||
+ "src/unix/random-getentropy.c",
|
||||
+ "src/unix/darwin.c",
|
||||
+ "src/unix/fsevents.c",
|
||||
+ ]
|
||||
@@ -803,6 +794,8 @@ index 0000000000000000000000000000000000000000..4674bdd48b4bfc9b7152377b8cd0984d
|
||||
+ "src/unix/linux-syscalls.c",
|
||||
+ "src/unix/linux-syscalls.h",
|
||||
+ "src/unix/procfs-exepath.c",
|
||||
+ "src/unix/random-getrandom.c",
|
||||
+ "src/unix/random-sysctl-linux.c",
|
||||
+ "src/unix/sysinfo-loadavg.c",
|
||||
+ ]
|
||||
+ libs += [
|
||||
@@ -817,6 +810,46 @@ index 0000000000000000000000000000000000000000..4674bdd48b4bfc9b7152377b8cd0984d
|
||||
+ ]
|
||||
+ }
|
||||
+}
|
||||
diff --git a/deps/uvwasi/BUILD.gn b/deps/uvwasi/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..52d0c08bd9818b9436175ea8157e462e4d0fbafe
|
||||
--- /dev/null
|
||||
+++ b/deps/uvwasi/BUILD.gn
|
||||
@@ -0,0 +1,34 @@
|
||||
+config("uvwasi_config") {
|
||||
+ include_dirs = [ "include" ]
|
||||
+}
|
||||
+
|
||||
+static_library("uvwasi") {
|
||||
+ include_dirs = [
|
||||
+ "include",
|
||||
+ "src",
|
||||
+ ]
|
||||
+
|
||||
+ defines = []
|
||||
+ if (is_linux) {
|
||||
+ defines += [
|
||||
+ "_GNU_SOURCE",
|
||||
+ "_POSIX_C_SOURCE=200112"
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
+ deps = [ "../../deps/uv" ]
|
||||
+
|
||||
+ public_configs = [ ":uvwasi_config" ]
|
||||
+
|
||||
+ cflags_c = []
|
||||
+ if (!is_win) {
|
||||
+ cflags_c += [ "-fvisibility=hidden" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [
|
||||
+ "src/clocks.c",
|
||||
+ "src/fd_table.c",
|
||||
+ "src/uv_mapping.c",
|
||||
+ "src/uvwasi.c",
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2eaaea76280
|
||||
@@ -883,10 +916,10 @@ index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2ea
|
||||
+}
|
||||
diff --git a/filenames.json b/filenames.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1fad1cc946
|
||||
index 0000000000000000000000000000000000000000..147561938788aac7021fe340f64fd8b4303603e6
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,448 @@
|
||||
@@ -0,0 +1,461 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
@@ -959,6 +992,10 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "lib/internal/bootstrap/loaders.js",
|
||||
+ "lib/internal/bootstrap/node.js",
|
||||
+ "lib/internal/bootstrap/pre_execution.js",
|
||||
+ "lib/internal/bootstrap/switches/does_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/does_not_own_process_state.js",
|
||||
+ "lib/internal/bootstrap/switches/is_main_thread.js",
|
||||
+ "lib/internal/bootstrap/switches/is_not_main_thread.js",
|
||||
+ "lib/internal/per_context/primordials.js",
|
||||
+ "lib/internal/per_context/domexception.js",
|
||||
+ "lib/async_hooks.js",
|
||||
@@ -1013,6 +1050,7 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "lib/util.js",
|
||||
+ "lib/v8.js",
|
||||
+ "lib/vm.js",
|
||||
+ "lib/wasi.js",
|
||||
+ "lib/worker_threads.js",
|
||||
+ "lib/zlib.js",
|
||||
+ "lib/internal/assert.js",
|
||||
@@ -1021,6 +1059,7 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "lib/internal/buffer.js",
|
||||
+ "lib/internal/cli_table.js",
|
||||
+ "lib/internal/child_process.js",
|
||||
+ "lib/internal/child_process/serialization.js",
|
||||
+ "lib/internal/cluster/child.js",
|
||||
+ "lib/internal/cluster/master.js",
|
||||
+ "lib/internal/cluster/round_robin_handle.js",
|
||||
@@ -1068,20 +1107,23 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "lib/internal/main/eval_string.js",
|
||||
+ "lib/internal/main/eval_stdin.js",
|
||||
+ "lib/internal/main/inspect.js",
|
||||
+ "lib/internal/main/print_bash_completion.js",
|
||||
+ "lib/internal/main/print_help.js",
|
||||
+ "lib/internal/main/prof_process.js",
|
||||
+ "lib/internal/main/repl.js",
|
||||
+ "lib/internal/main/run_main_module.js",
|
||||
+ "lib/internal/main/run_third_party_main.js",
|
||||
+ "lib/internal/main/worker_thread.js",
|
||||
+ "lib/internal/modules/run_main.js",
|
||||
+ "lib/internal/modules/cjs/helpers.js",
|
||||
+ "lib/internal/modules/cjs/loader.js",
|
||||
+ "lib/internal/modules/esm/loader.js",
|
||||
+ "lib/internal/modules/esm/create_dynamic_module.js",
|
||||
+ "lib/internal/modules/esm/default_resolve.js",
|
||||
+ "lib/internal/modules/esm/get_format.js",
|
||||
+ "lib/internal/modules/esm/get_source.js",
|
||||
+ "lib/internal/modules/esm/module_job.js",
|
||||
+ "lib/internal/modules/esm/module_map.js",
|
||||
+ "lib/internal/modules/esm/resolve.js",
|
||||
+ "lib/internal/modules/esm/transform_source.js",
|
||||
+ "lib/internal/modules/esm/translators.js",
|
||||
+ "lib/internal/net.js",
|
||||
+ "lib/internal/options.js",
|
||||
@@ -1090,14 +1132,13 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "lib/internal/priority_queue.js",
|
||||
+ "lib/internal/process/esm_loader.js",
|
||||
+ "lib/internal/process/execution.js",
|
||||
+ "lib/internal/process/main_thread_only.js",
|
||||
+ "lib/internal/process/per_thread.js",
|
||||
+ "lib/internal/process/policy.js",
|
||||
+ "lib/internal/process/promises.js",
|
||||
+ "lib/internal/process/stdio.js",
|
||||
+ "lib/internal/process/warning.js",
|
||||
+ "lib/internal/process/worker_thread_only.js",
|
||||
+ "lib/internal/process/report.js",
|
||||
+ "lib/internal/process/signal.js",
|
||||
+ "lib/internal/process/task_queues.js",
|
||||
+ "lib/internal/querystring.js",
|
||||
+ "lib/internal/readline/utils.js",
|
||||
@@ -1128,19 +1169,19 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "lib/internal/v8_prof_processor.js",
|
||||
+ "lib/internal/validators.js",
|
||||
+ "lib/internal/stream_base_commons.js",
|
||||
+ "lib/internal/vm/source_text_module.js",
|
||||
+ "lib/internal/vm/module.js",
|
||||
+ "lib/internal/worker.js",
|
||||
+ "lib/internal/worker/io.js",
|
||||
+ "lib/internal/streams/lazy_transform.js",
|
||||
+ "lib/internal/streams/async_iterator.js",
|
||||
+ "lib/internal/streams/buffer_list.js",
|
||||
+ "lib/internal/streams/duplexpair.js",
|
||||
+ "lib/internal/streams/from.js",
|
||||
+ "lib/internal/streams/legacy.js",
|
||||
+ "lib/internal/streams/destroy.js",
|
||||
+ "lib/internal/streams/state.js",
|
||||
+ "lib/internal/streams/pipeline.js",
|
||||
+ "lib/internal/streams/end-of-stream.js",
|
||||
+ "lib/internal/streams/from.js",
|
||||
+ "deps/v8/tools/splaytree.js",
|
||||
+ "deps/v8/tools/codemap.js",
|
||||
+ "deps/v8/tools/consarray.js",
|
||||
@@ -1226,6 +1267,7 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "src/node_url.cc",
|
||||
+ "src/node_util.cc",
|
||||
+ "src/node_v8.cc",
|
||||
+ "src/node_wasi.cc",
|
||||
+ "src/node_watchdog.cc",
|
||||
+ "src/node_worker.cc",
|
||||
+ "src/node_zlib.cc",
|
||||
@@ -1280,12 +1322,15 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "src/node_dir.h",
|
||||
+ "src/node_errors.h",
|
||||
+ "src/node_file.h",
|
||||
+ "src/node_file-inl.h",
|
||||
+ "src/node_http_parser_impl.h",
|
||||
+ "src/node_http2.h",
|
||||
+ "src/node_http2_state.h",
|
||||
+ "src/node_i18n.h",
|
||||
+ "src/node_internals.h",
|
||||
+ "src/node_main_instance.h",
|
||||
+ "src/node_mem.h",
|
||||
+ "src/node_mem-inl.h",
|
||||
+ "src/node_messaging.h",
|
||||
+ "src/node_metadata.h",
|
||||
+ "src/node_mutex.h",
|
||||
@@ -1305,6 +1350,7 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
|
||||
+ "src/node_url.h",
|
||||
+ "src/node_version.h",
|
||||
+ "src/node_v8_platform-inl.h",
|
||||
+ "src/node_wasi.h",
|
||||
+ "src/node_watchdog.h",
|
||||
+ "src/node_worker.h",
|
||||
+ "src/pipe_wrap.h",
|
||||
@@ -1541,7 +1587,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
|
||||
+ args = rebase_path(inputs + outputs, root_build_dir)
|
||||
+}
|
||||
diff --git a/src/node_version.h b/src/node_version.h
|
||||
index 8a6fb55a5a3824b40d2c744a0ed1e8d84e6bbc4a..c68a60d7b0a818b25ce3bd44037d52abe57769f2 100644
|
||||
index 489dff631e51d1e93ed79acc48e52d33cd9c66d1..3f7349a4fa77aaae258ed32f378384165260c5b0 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
@@ -1697,18 +1743,14 @@ index 655802980a6ea94d1d4ca1dc63c8c8e905fbb83a..ab1a18a215cb7393310324c6dbcacc66
|
||||
if 'false' == variables.get('node_shared_libuv'):
|
||||
subdir_files('deps/uv/include', 'include/node/', action)
|
||||
diff --git a/tools/js2c.py b/tools/js2c.py
|
||||
index 1346b2a87046d3472577875c887b3b44a63280ed..752344d68c3f63b4c5e491b33d4576ed48f8b74f 100755
|
||||
index 4594694a2cab0d878d86127a72714ed60c251b6e..9e9883129bed62c591d23f71d139514c5034ac8d 100755
|
||||
--- a/tools/js2c.py
|
||||
+++ b/tools/js2c.py
|
||||
@@ -261,10 +261,18 @@ def NormalizeFileName(filename):
|
||||
split = ['internal'] + split
|
||||
else: # `lib/**/*.js` so drop the 'lib' part
|
||||
@@ -130,6 +130,14 @@ def NormalizeFileName(filename):
|
||||
split = split[1:]
|
||||
+
|
||||
if len(split):
|
||||
filename = '/'.join(split)
|
||||
- return os.path.splitext(filename)[0]
|
||||
|
||||
+
|
||||
+ # Electron-specific: when driving the node build from Electron, we generate
|
||||
+ # config.gypi in a separate directory and pass the absolute path to js2c.
|
||||
+ # This overrides the absolute path so that the variable names in the
|
||||
@@ -1716,10 +1758,9 @@ index 1346b2a87046d3472577875c887b3b44a63280ed..752344d68c3f63b4c5e491b33d4576ed
|
||||
+ if filename.endswith("/config.gypi"):
|
||||
+ filename = "config.gypi"
|
||||
+
|
||||
+ return os.path.splitext(filename)[0]
|
||||
return os.path.splitext(filename)[0]
|
||||
|
||||
|
||||
def JS2C(source_files, target):
|
||||
# Process input from all *macro.py files
|
||||
diff --git a/tools/tar.py b/tools/tar.py
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..eb697be25779db62c829aac45a509804e9fff331
|
||||
|
||||
@@ -23,8 +23,8 @@ index f07e65f719a1a5939997dfcae7bc787ee6391f4d..f4d03a2fdfd47a4e6a71c7146d92ce7c
|
||||
|
||||
'node_tag%': '',
|
||||
@@ -240,6 +240,26 @@
|
||||
'cflags': [ '-fPIE' ],
|
||||
'ldflags': [ '-fPIE', '-pie' ]
|
||||
'cflags': [ '-fPIC' ],
|
||||
'ldflags': [ '-fPIC' ]
|
||||
}],
|
||||
+ ['node_with_ltcg=="true"', {
|
||||
+ 'msvs_settings': {
|
||||
|
||||
@@ -59,18 +59,7 @@ index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c4
|
||||
|
||||
}} // namespace native_module
|
||||
|
||||
@@ -243,8 +245,8 @@ def GetDefinition(var, source, step=30):
|
||||
return definition, len(code_points)
|
||||
|
||||
|
||||
-def AddModule(filename, consts, macros, definitions, initializers):
|
||||
- code = ReadFile(filename)
|
||||
+def AddModule(filename, consts, macros, definitions, initializers, FileReadFn=ReadFile):
|
||||
+ code = FileReadFn(filename)
|
||||
code = ExpandConstants(code, consts)
|
||||
code = ExpandMacros(code, macros)
|
||||
name = NormalizeFileName(filename)
|
||||
@@ -256,7 +258,7 @@ def AddModule(filename, consts, macros, definitions, initializers):
|
||||
@@ -256,7 +258,7 @@ def AddModule(filename, definitions, initializers):
|
||||
initializers.append(initializer)
|
||||
|
||||
def NormalizeFileName(filename):
|
||||
@@ -79,23 +68,30 @@ index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c4
|
||||
if split[0] == 'deps':
|
||||
split = ['internal'] + split
|
||||
else: # `lib/**/*.js` so drop the 'lib' part
|
||||
@@ -274,9 +276,9 @@ def NormalizeFileName(filename):
|
||||
@@ -114,8 +114,8 @@ def GetDefinition(var, source, step=30):
|
||||
return definition, len(code_points)
|
||||
|
||||
|
||||
-def AddModule(filename, definitions, initializers):
|
||||
- code = ReadFile(filename)
|
||||
+def AddModule(filename, definitions, initializers, ReadFileFn=ReadFile):
|
||||
+ code = ReadFileFn(filename)
|
||||
name = NormalizeFileName(filename)
|
||||
slug = SLUGGER_RE.sub('_', name)
|
||||
var = slug + '_raw'
|
||||
@@ -141,7 +141,7 @@ def NormalizeFileName(filename):
|
||||
return os.path.splitext(filename)[0]
|
||||
|
||||
|
||||
-def JS2C(source_files, target):
|
||||
+def JS2C(source_files, target, only_js):
|
||||
# Process input from all *macro.py files
|
||||
- consts, macros = ReadMacros(source_files['.py'])
|
||||
+ consts, macros = ReadMacros([] if only_js else source_files['.py'])
|
||||
|
||||
# Build source code lines
|
||||
definitions = []
|
||||
@@ -284,14 +286,26 @@ def JS2C(source_files, target):
|
||||
|
||||
initializers = []
|
||||
@@ -149,13 +149,26 @@ def JS2C(source_files, target):
|
||||
for filename in source_files['.js']:
|
||||
AddModule(filename, consts, macros, definitions, initializers)
|
||||
-
|
||||
AddModule(filename, definitions, initializers)
|
||||
|
||||
- config_def, config_size = handle_config_gypi(source_files['config.gypi'])
|
||||
- definitions.append(config_def)
|
||||
+ # Electron: Expose fs module without asar support.
|
||||
@@ -105,9 +101,9 @@ index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c4
|
||||
+ # we have to copy both 'fs' *and* 'internal/fs/streams' and modify the
|
||||
+ # copies to depend on each other instead of on our asarified 'fs' code.
|
||||
+ # See https://github.com/electron/electron/pull/16028 for more.
|
||||
+ AddModule('lib/original-fs.js', consts, macros, definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/streams')", "require('internal/original-fs/streams')"))
|
||||
+ AddModule('lib/original-fs.js', definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/streams')", "require('internal/original-fs/streams')"))
|
||||
+ elif filename == 'lib/internal/fs/streams.js':
|
||||
+ AddModule('lib/internal/original-fs/streams.js', consts, macros, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
|
||||
+ AddModule('lib/internal/original-fs/streams.js', definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
|
||||
+
|
||||
+ config_size = 0
|
||||
+ if not only_js:
|
||||
@@ -132,8 +128,8 @@ index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c4
|
||||
global is_verbose
|
||||
is_verbose = options.verbose
|
||||
source_files = functools.reduce(SourceFileByExt, options.sources, {})
|
||||
# Should have exactly 3 types: `.js`, `.py`, and `.gypi`
|
||||
- assert len(source_files) == 3
|
||||
# Should have exactly 2 types: `.js`, and `.gypi`
|
||||
- assert len(source_files) == 2
|
||||
- # Currently config.gypi is the only `.gypi` file allowed
|
||||
- assert source_files['.gypi'] == ['config.gypi']
|
||||
- source_files['config.gypi'] = source_files.pop('.gypi')[0]
|
||||
@@ -141,7 +137,7 @@ index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c4
|
||||
+ if options.only_js:
|
||||
+ assert len(source_files) == 1
|
||||
+ else:
|
||||
+ assert len(source_files) == 3
|
||||
+ assert len(source_files) == 2
|
||||
+ # Currently config.gypi is the only `.gypi` file allowed
|
||||
+ assert source_files['.gypi'][0].endswith('config.gypi')
|
||||
+ source_files['config.gypi'] = source_files.pop('.gypi')[0]
|
||||
|
||||
@@ -5,11 +5,11 @@ Subject: Call process.log from fallback stream on Windows
|
||||
|
||||
(cherry picked from commit d31e629b4f2daf3500a485caab2b2990a41e3ad4)
|
||||
|
||||
diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js
|
||||
index 2491f14cdf01409e4625d6793279ef87dbcc6942..54d3fb23dc1b51fec206e8989e4873d95884583f 100644
|
||||
--- a/lib/internal/process/stdio.js
|
||||
+++ b/lib/internal/process/stdio.js
|
||||
@@ -192,6 +192,11 @@ function createWritableStdioStream(fd) {
|
||||
diff --git a/lib/internal/bootstrap/switches/is_main_thread.js b/lib/internal/bootstrap/switches/is_main_thread.js
|
||||
index ac8336fb6229e7f44eb00f43abb07bea83a9463c..2005e8ef9ebd090c1be19ff320f48b9cd365239e 100644
|
||||
--- a/lib/internal/bootstrap/switches/is_main_thread.js
|
||||
+++ b/lib/internal/bootstrap/switches/is_main_thread.js
|
||||
@@ -80,6 +80,11 @@ function createWritableStdioStream(fd) {
|
||||
const { Writable } = require('stream');
|
||||
stream = new Writable({
|
||||
write(buf, enc, cb) {
|
||||
|
||||
@@ -23,10 +23,10 @@ index e7bd18855fb98a822833b4366bfb595dccfc1b6f..a96f891f675cc598e912a5e010c24938
|
||||
|
||||
// TODO(joyeecheung): most of these should be deprecated and removed,
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index 2fddd3766ffb28dc9176ed1b7a4b01361dd72fcd..c14cbe0279bbce98ea875bc3487996da679b4f40 100644
|
||||
index 38f4d277a51e3c3ff6d1fe37128e975b888207f0..b21a3e12e7b9dd49e0ffb7ef6495443ecb1d156f 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -932,6 +932,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
@@ -1128,6 +1128,13 @@ Module.prototype._compile = function(content, filename) {
|
||||
if (getOptionValue('--inspect-brk') && process._eval == null) {
|
||||
if (!resolvedArgv) {
|
||||
// We enter the repl if we're not given a filename argument.
|
||||
@@ -38,8 +38,8 @@ index 2fddd3766ffb28dc9176ed1b7a4b01361dd72fcd..c14cbe0279bbce98ea875bc3487996da
|
||||
+ delete process._firstFileName
|
||||
+ } else
|
||||
if (process.argv[1]) {
|
||||
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
|
||||
} else {
|
||||
try {
|
||||
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 60cb1b6d113e7e0687d96806f8940b5a715144cf..eef7b7bc244b4231419b4ec3013fa1cf700c97ef 100644
|
||||
--- a/src/env.h
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thiago de Arruda <tpadilha84@gmail.com>
|
||||
Date: Mon, 6 Mar 2017 10:42:34 -0300
|
||||
Subject: Expose `get_builtin_module` function
|
||||
Subject: Expose `get_linked_module` function
|
||||
|
||||
This is a requirement for electron/electron#8815, which exposes some builtin
|
||||
modules to sandboxed renderers.
|
||||
This is a requirement for electron/electron#8815, which exposes some linked
|
||||
modules to sandboxed renderers.
|
||||
|
||||
(cherry picked from commit 4c058a6cb5331eef1c7f51c042dd074a2d4f9234)
|
||||
TODO(codebytere): remove and replace with a public facing API.
|
||||
|
||||
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
||||
index 0facfc36cbcb784cd0a1802a7748dff3366710fd..db60617cebee83ac09371aa1e2200280e29bd772 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -611,6 +611,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
args.GetReturnValue().Set(exports);
|
||||
}
|
||||
|
||||
+node_module* get_linked_module(const char* name) {
|
||||
+ return FindModule(modlist_linked, name, NM_F_LINKED);
|
||||
+}
|
||||
+
|
||||
void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
|
||||
diff --git a/src/node_binding.h b/src/node_binding.h
|
||||
index 42f3c5b8d00880588f442a4e724e080128c56dfe..cefb6419ebb7f5c5c79927d179eef0a790e234ad 100644
|
||||
--- a/src/node_binding.h
|
||||
|
||||
@@ -87,25 +87,23 @@ index 9d182d2aeb48c8b600bace036df868fb695dfa7c..38c467c7d49589ef5d985ad999fe22d9
|
||||
|
||||
#ifdef NODE_REPORT
|
||||
// Cache the original command line to be
|
||||
@@ -811,6 +824,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -849,6 +849,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
if (exit_code != 0) return exit_code;
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (g_upstream_node_mode) {
|
||||
+ // NOTE(jeremy): indentation is intentionally wrong here, to ease rebasing.
|
||||
+
|
||||
const int exit_code = ProcessGlobalArgs(argv, exec_argv, errors, false);
|
||||
if (exit_code != 0) return exit_code;
|
||||
|
||||
@@ -833,6 +849,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
const int exit_code = ProcessGlobalArgs(argv,
|
||||
exec_argv,
|
||||
@@ -893,6 +895,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
}
|
||||
per_process::metadata.versions.InitializeIntlVersions();
|
||||
#endif
|
||||
|
||||
+ } // g_upstream_node_mode
|
||||
+
|
||||
|
||||
NativeModuleEnv::InitializeCodeCache();
|
||||
|
||||
// We should set node_is_initialized here instead of in node::Start,
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 025c6b949dc438a98a960d3630c723376f731ca7..892dafd8031533d23a88298406356107409cbd0a 100644
|
||||
--- a/src/node.h
|
||||
|
||||
@@ -3,39 +3,26 @@ From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 13 Sep 2018 08:56:07 -0700
|
||||
Subject: feat: initialize asar support
|
||||
|
||||
This patch initializies asar support in Node.js.
|
||||
This patch initializes asar support in Node.js.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
|
||||
index 0cad5209c4ff4e68d7c400af1d2b4c234210ddb4..918bc8c0c4e78bad5a3372e8a5522da00aa9073e 100644
|
||||
--- a/lib/internal/bootstrap/loaders.js
|
||||
+++ b/lib/internal/bootstrap/loaders.js
|
||||
@@ -192,6 +192,8 @@ function nativeModuleRequire(id) {
|
||||
return mod.compile();
|
||||
}
|
||||
|
||||
+NativeModule.require = nativeModuleRequire
|
||||
+
|
||||
NativeModule.exists = function(id) {
|
||||
return NativeModule.map.has(id);
|
||||
};
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index 2aa2a3b46c5fc12d22e0e74e304d2d55ca02c3b5..e7bd18855fb98a822833b4366bfb595dccfc1b6f 100644
|
||||
index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..2fc1151251571db91e01725353af2c8ff41af018 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -61,6 +61,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
initializeESMLoader();
|
||||
@@ -67,6 +67,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
|
||||
loadPreloadModules();
|
||||
initializeFrozenIntrinsics();
|
||||
+ setupAsarSupport();
|
||||
}
|
||||
|
||||
function patchProcessObject(expandArgv1) {
|
||||
@@ -444,6 +445,10 @@ function loadPreloadModules() {
|
||||
@@ -445,6 +446,10 @@ function loadPreloadModules() {
|
||||
}
|
||||
}
|
||||
|
||||
+function setupAsarSupport() {
|
||||
+ process._linkedBinding('atom_common_asar').initAsarSupport(require);
|
||||
+ process._linkedBinding('electron_common_asar').initAsarSupport(require);
|
||||
+}
|
||||
+
|
||||
module.exports = {
|
||||
|
||||
38
patches/node/fix_--perf-prof_only_works_on_linux.patch
Normal file
38
patches/node/fix_--perf-prof_only_works_on_linux.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 20 Feb 2020 17:22:58 -0800
|
||||
Subject: fix: --perf-prof only works on Linux
|
||||
|
||||
`--perf-prof`-related flags have been removed in V8 on non-linux devices.
|
||||
|
||||
See:
|
||||
* https://chromium-review.googlesource.com/c/v8/v8/+/1993969
|
||||
* https://chromium-review.googlesource.com/c/v8/v8/+/1993978
|
||||
|
||||
Upstreamed in https://github.com/nodejs/node/pull/31892.
|
||||
|
||||
diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js
|
||||
index 698f463b627644a85db0fcddfcd471ebd91934e5..63cb22c8693447da94f4ba2f8c4082ea6bf49d6a 100644
|
||||
--- a/test/parallel/test-cli-node-options.js
|
||||
+++ b/test/parallel/test-cli-node-options.js
|
||||
@@ -41,15 +41,14 @@ expect('--trace-event-file-pattern {pid}-${rotation}.trace_events ' +
|
||||
'--trace-event-categories node.async_hooks', 'B\n');
|
||||
expect('--unhandled-rejections=none', 'B\n');
|
||||
|
||||
-if (!common.isWindows) {
|
||||
+if (common.isLinux) {
|
||||
expect('--perf-basic-prof', 'B\n');
|
||||
expect('--perf-basic-prof-only-functions', 'B\n');
|
||||
-}
|
||||
|
||||
-if (common.isLinux && ['arm', 'x64'].includes(process.arch)) {
|
||||
- // PerfJitLogger is only implemented in Linux.
|
||||
- expect('--perf-prof', 'B\n');
|
||||
- expect('--perf-prof-unwinding-info', 'B\n');
|
||||
+ if (['arm', 'x64'].includes(process.arch)) {
|
||||
+ expect('--perf-prof', 'B\n');
|
||||
+ expect('--perf-prof-unwinding-info', 'B\n');
|
||||
+ }
|
||||
}
|
||||
|
||||
if (common.hasCrypto) {
|
||||
@@ -1,54 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Fri, 29 Mar 2019 17:17:30 +0900
|
||||
Subject: fix: do not define DebugOptions's constructors in header
|
||||
|
||||
The e3ca89ef49 changed NODE_EXTERN to always expose symbols for
|
||||
DebugOptions, and since the constructors of DebugOptions are defined in
|
||||
header, the compiler would end up generating no constructor
|
||||
implementations for DebugOptions.
|
||||
|
||||
Which means we would encounter crash when constructors of DebugOptions
|
||||
is called.
|
||||
|
||||
By putting the definitions of constructors into the implementation file,
|
||||
we can avoid this problem.
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 2dd90e9a8cf9381c8608b73ead247bcf86b72ab9..051e7b084b6770215bd009b0e37feabbb7df7389 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -26,6 +26,12 @@ Mutex cli_options_mutex;
|
||||
std::shared_ptr<PerProcessOptions> cli_options{new PerProcessOptions()};
|
||||
} // namespace per_process
|
||||
|
||||
+DebugOptions::DebugOptions() = default;
|
||||
+DebugOptions::DebugOptions(const DebugOptions&) = default;
|
||||
+DebugOptions::DebugOptions(DebugOptions&&) = default;
|
||||
+DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
|
||||
+DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
|
||||
+
|
||||
void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
|
||||
#if !NODE_USE_V8_PLATFORM && !HAVE_INSPECTOR
|
||||
if (inspector_enabled) {
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 40c19ea6ff4d98a1a1da59bca76087209445af81..4ce5551284bb5b1b4194905a9fe619f852933405 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -61,11 +61,11 @@ struct InspectPublishUid {
|
||||
// per-Isolate, rather than per-Environment.
|
||||
class NODE_EXTERN DebugOptions : public Options {
|
||||
public:
|
||||
- DebugOptions() = default;
|
||||
- DebugOptions(const DebugOptions&) = default;
|
||||
- DebugOptions& operator=(const DebugOptions&) = default;
|
||||
- DebugOptions(DebugOptions&&) = default;
|
||||
- DebugOptions& operator=(DebugOptions&&) = default;
|
||||
+ DebugOptions();
|
||||
+ DebugOptions(const DebugOptions&);
|
||||
+ DebugOptions& operator=(const DebugOptions&);
|
||||
+ DebugOptions(DebugOptions&&);
|
||||
+ DebugOptions& operator=(DebugOptions&&);
|
||||
|
||||
// --inspect
|
||||
bool inspector_enabled = false;
|
||||
20
patches/node/fix_ensure_clocks_header_included_in_impl.patch
Normal file
20
patches/node/fix_ensure_clocks_header_included_in_impl.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Fri, 14 Feb 2020 14:05:33 -0800
|
||||
Subject: fix: ensure clocks header included in impl
|
||||
|
||||
Fixes some build errors in uvwasi like: `error: no previous prototype for function 'uvwasi__clock_gettime_realtime'`
|
||||
This fix will be upstreamed to uvwasi if possible.
|
||||
|
||||
diff --git a/deps/uvwasi/src/clocks.c b/deps/uvwasi/src/clocks.c
|
||||
index e1fbc696b62f058cb0007e77bdd2e52a3c26d765..d2ca006530f50a0e8d77e8223b8191fb8e35ff2b 100644
|
||||
--- a/deps/uvwasi/src/clocks.c
|
||||
+++ b/deps/uvwasi/src/clocks.c
|
||||
@@ -1,3 +1,7 @@
|
||||
+#ifdef _WIN32
|
||||
+#include "clocks.h"
|
||||
+#endif /* _WIN32 */
|
||||
+
|
||||
#ifndef _WIN32
|
||||
# include <errno.h>
|
||||
# include <sys/time.h>
|
||||
@@ -1,57 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nitish Sakhawalkar <nitsakh@icloud.com>
|
||||
Date: Thu, 11 Apr 2019 11:50:49 -0700
|
||||
Subject: fix: export DebugOptions
|
||||
|
||||
This exports DebugOptions so we can parse args like `--inspect-brk`.
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 35cac18a916c2ce104a3e7b6760d0280b33c2892..2dd90e9a8cf9381c8608b73ead247bcf86b72ab9 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -210,11 +210,6 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
|
||||
|
||||
namespace options_parser {
|
||||
|
||||
-class DebugOptionsParser : public OptionsParser<DebugOptions> {
|
||||
- public:
|
||||
- DebugOptionsParser();
|
||||
-};
|
||||
-
|
||||
class EnvironmentOptionsParser : public OptionsParser<EnvironmentOptions> {
|
||||
public:
|
||||
EnvironmentOptionsParser();
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 8937bfd9011e4795d22e232886e18183d698b8d4..40c19ea6ff4d98a1a1da59bca76087209445af81 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -59,7 +59,7 @@ struct InspectPublishUid {
|
||||
// to keep them separate since they are a group of options applying to a very
|
||||
// specific part of Node. It might also make more sense for them to be
|
||||
// per-Isolate, rather than per-Environment.
|
||||
-class DebugOptions : public Options {
|
||||
+class NODE_EXTERN DebugOptions : public Options {
|
||||
public:
|
||||
DebugOptions() = default;
|
||||
DebugOptions(const DebugOptions&) = default;
|
||||
@@ -244,7 +244,7 @@ class PerProcessOptions : public Options {
|
||||
|
||||
namespace options_parser {
|
||||
|
||||
-HostPort SplitHostPort(const std::string& arg,
|
||||
+HostPort NODE_EXTERN SplitHostPort(const std::string& arg,
|
||||
std::vector<std::string>* errors);
|
||||
void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
@@ -437,6 +437,11 @@ class OptionsParser {
|
||||
friend void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
};
|
||||
|
||||
+class NODE_EXTERN DebugOptionsParser : public OptionsParser<DebugOptions> {
|
||||
+ public:
|
||||
+ DebugOptionsParser();
|
||||
+};
|
||||
+
|
||||
using StringVector = std::vector<std::string>;
|
||||
template <class OptionsType, class = Options>
|
||||
void Parse(
|
||||
@@ -6,7 +6,7 @@ Subject: fix: expose InternalCallbackScope
|
||||
This commit exposes InternalCallbackScope in order to allow us access to kAllowEmptyResource for usage https://github.com/electron/electron/blob/master/atom/common/api/atom_bindings.cc\#L108. We should look to accomplish this another way so we no longer need to do this, as in verbose mode the regular CallBack Scope doesn't swallow errors and so we can otherwise use it.
|
||||
|
||||
diff --git a/src/node_internals.h b/src/node_internals.h
|
||||
index 0fff2e6111e53f99ca8e92d6966d9847570d01bd..e8d6705e0197aad55b931910bb5221dd33b37fb0 100644
|
||||
index 114498458a9fd69e636a8e68c30e4b93937406d7..c5b4a084e85b48d5e2121a1ebcfd0c4e4b081852 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -203,7 +203,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
|
||||
@@ -16,5 +16,5 @@ index 0fff2e6111e53f99ca8e92d6966d9847570d01bd..e8d6705e0197aad55b931910bb5221dd
|
||||
-class InternalCallbackScope {
|
||||
+class NODE_EXTERN InternalCallbackScope {
|
||||
public:
|
||||
// Tell the constructor whether its `object` parameter may be empty or not.
|
||||
enum ResourceExpectation { kRequireResource, kAllowEmptyResource };
|
||||
enum Flags {
|
||||
kNoFlags = 0,
|
||||
|
||||
30
patches/node/fix_include_io_h_in_uvwasi_for_win.patch
Normal file
30
patches/node/fix_include_io_h_in_uvwasi_for_win.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 18 Feb 2020 16:42:14 -0800
|
||||
Subject: fix: include io.h in uvwasi for win
|
||||
|
||||
io.h must be explicitly included, or '_lseeki64' will error
|
||||
as undefined.
|
||||
|
||||
Already fixed upstream in https://github.com/cjihrig/uvwasi/pull/81.
|
||||
|
||||
diff --git a/deps/uvwasi/src/uvwasi.c b/deps/uvwasi/src/uvwasi.c
|
||||
index 28c6dcc26104c928f132117b790ee63d17bad805..44b353caaf3966fa5cc1d5b7ae8ba9f47c6ea057 100644
|
||||
--- a/deps/uvwasi/src/uvwasi.c
|
||||
+++ b/deps/uvwasi/src/uvwasi.c
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
# include <sched.h>
|
||||
+# include <stdio.h>
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
# include <dirent.h>
|
||||
@@ -11,6 +12,7 @@
|
||||
# define SLASH_STR "/"
|
||||
# define IS_SLASH(c) ((c) == '/')
|
||||
#else
|
||||
+# include <io.h>
|
||||
# define SLASH '\\'
|
||||
# define SLASH_STR "\\"
|
||||
# define IS_SLASH(c) ((c) == '/' || (c) == '\\')
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user