mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
220 Commits
refactor/a
...
v13.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5c79632ef | ||
|
|
0dcc660794 | ||
|
|
0753e4911c | ||
|
|
ff2a0a4bd3 | ||
|
|
5860b70189 | ||
|
|
d84b7fc4d4 | ||
|
|
1873d8ec81 | ||
|
|
0c19db01d9 | ||
|
|
2156a9064f | ||
|
|
6e169089f0 | ||
|
|
6855004aa5 | ||
|
|
93d9aaa99c | ||
|
|
e4a3f064de | ||
|
|
9265390164 | ||
|
|
8e6819ae71 | ||
|
|
f95d2bdfd1 | ||
|
|
737b08d130 | ||
|
|
b44024d660 | ||
|
|
d0d6e88e5a | ||
|
|
c647007ccc | ||
|
|
134c8b7ed3 | ||
|
|
4f203eee4a | ||
|
|
bb065beaa6 | ||
|
|
8481e5c08a | ||
|
|
7276a1fd8c | ||
|
|
7d18988317 | ||
|
|
68afcd16e4 | ||
|
|
72e336445a | ||
|
|
3e658c4782 | ||
|
|
e7d3b43db0 | ||
|
|
6683606449 | ||
|
|
7bcc2a2762 | ||
|
|
c04fa30944 | ||
|
|
51213f656b | ||
|
|
aba7834a17 | ||
|
|
3651c0411f | ||
|
|
cb798f26b8 | ||
|
|
215c2d3ec7 | ||
|
|
9df6131352 | ||
|
|
4d7188fd2e | ||
|
|
c69d0eea2e | ||
|
|
1e54d19e8a | ||
|
|
a660598e4c | ||
|
|
1ec2840da0 | ||
|
|
1d3cd106d1 | ||
|
|
5c5f041731 | ||
|
|
325df5afcf | ||
|
|
e261519469 | ||
|
|
042c04f95f | ||
|
|
7a78506a7d | ||
|
|
75b4db49df | ||
|
|
0f8ac92b09 | ||
|
|
119ce7d6da | ||
|
|
daa075d020 | ||
|
|
8d6b9155fb | ||
|
|
cec2bfb9ec | ||
|
|
ff1cc3c60b | ||
|
|
b4bba38862 | ||
|
|
278ff8566c | ||
|
|
323de2fbe7 | ||
|
|
cd673a3697 | ||
|
|
0097a370e3 | ||
|
|
692c510867 | ||
|
|
e6f15c4380 | ||
|
|
cce8dda92f | ||
|
|
034f750c46 | ||
|
|
120a8acfd0 | ||
|
|
01992fd65c | ||
|
|
af6a5e6c30 | ||
|
|
caac2e8fc7 | ||
|
|
9a4a049498 | ||
|
|
68059d69a5 | ||
|
|
0f7334a77e | ||
|
|
eee8bee71b | ||
|
|
2795185d46 | ||
|
|
877f096d6b | ||
|
|
b33bb3a860 | ||
|
|
86f4126051 | ||
|
|
f895162234 | ||
|
|
05e41f89b4 | ||
|
|
d7378f953a | ||
|
|
ed0b654fee | ||
|
|
c1c8cbf995 | ||
|
|
ab3aa3581a | ||
|
|
20a43d9a72 | ||
|
|
27d04084c2 | ||
|
|
46649965c9 | ||
|
|
bea84969d6 | ||
|
|
ae67ec24f3 | ||
|
|
d379693967 | ||
|
|
2fe16c60ea | ||
|
|
0853536e04 | ||
|
|
4e48867af8 | ||
|
|
6bb1d1c5b0 | ||
|
|
696cc7c414 | ||
|
|
c0c8116a29 | ||
|
|
a98ed69874 | ||
|
|
3c230ad272 | ||
|
|
f93a9607b5 | ||
|
|
e7a944e356 | ||
|
|
9131a3216a | ||
|
|
288985f032 | ||
|
|
9c1c8787e9 | ||
|
|
c55cfa7a9c | ||
|
|
f72597be06 | ||
|
|
5c12606b13 | ||
|
|
f9bf319e66 | ||
|
|
b5c3ac3e7b | ||
|
|
824028a367 | ||
|
|
2b23b145d9 | ||
|
|
128106520a | ||
|
|
7e4a9ebc27 | ||
|
|
87d3530d1b | ||
|
|
bf9dfa8247 | ||
|
|
300e902066 | ||
|
|
fa0f9e83f5 | ||
|
|
d32aa032cd | ||
|
|
3fe41bb852 | ||
|
|
58b80c2c06 | ||
|
|
2ec3da29d3 | ||
|
|
499c1a5067 | ||
|
|
544ea7a0c8 | ||
|
|
eca4a5cf4c | ||
|
|
56fc2bce30 | ||
|
|
4eea01e9b0 | ||
|
|
232392ffa0 | ||
|
|
7816fd240f | ||
|
|
bcf2d0969c | ||
|
|
ed7f5f3a0b | ||
|
|
1937aff793 | ||
|
|
cf493b995c | ||
|
|
5bbc64b416 | ||
|
|
287c9eb8c0 | ||
|
|
f4d77d97e3 | ||
|
|
593af18528 | ||
|
|
df47f85646 | ||
|
|
bd3b70a6b5 | ||
|
|
9578943848 | ||
|
|
91de226a62 | ||
|
|
7044cb69a8 | ||
|
|
66a2218723 | ||
|
|
1f95fdd5ca | ||
|
|
b4e70c72a6 | ||
|
|
61bd57f851 | ||
|
|
5ab8cb7482 | ||
|
|
d1bb54d175 | ||
|
|
c104b510b0 | ||
|
|
02a2d33edc | ||
|
|
ad8f93517e | ||
|
|
a58b5ec3f0 | ||
|
|
32e321cec1 | ||
|
|
aae1bfde05 | ||
|
|
5be9028c51 | ||
|
|
fa5bc2206c | ||
|
|
e3cbd70191 | ||
|
|
7ce5af334e | ||
|
|
5605358f99 | ||
|
|
6f44fa6dbd | ||
|
|
6e66699822 | ||
|
|
71fda62839 | ||
|
|
2b354894b2 | ||
|
|
114643a624 | ||
|
|
d32f37f549 | ||
|
|
0cba5d7a71 | ||
|
|
d76937f2b9 | ||
|
|
2cf6909f48 | ||
|
|
fb1a41926a | ||
|
|
c87ecabf19 | ||
|
|
798ef785b4 | ||
|
|
89e2fe2079 | ||
|
|
250438c2d9 | ||
|
|
1176449cc9 | ||
|
|
a06af22b99 | ||
|
|
bda746f2e6 | ||
|
|
1f7f60d505 | ||
|
|
50cc80c44e | ||
|
|
00367f0b13 | ||
|
|
5d1ada085d | ||
|
|
5b414b6f93 | ||
|
|
831bbc4b55 | ||
|
|
b89b463a63 | ||
|
|
32d3e82d88 | ||
|
|
38de02c50a | ||
|
|
b8ef450cf6 | ||
|
|
168bcaf8f3 | ||
|
|
19d26c4a0c | ||
|
|
20bf768517 | ||
|
|
71f631641e | ||
|
|
5b3c90e6c6 | ||
|
|
fb298ca3db | ||
|
|
5f07df4a3d | ||
|
|
3ecccf2ad3 | ||
|
|
4cafba5e46 | ||
|
|
3b049c9074 | ||
|
|
0c1ee8ae8b | ||
|
|
4cb842d5e3 | ||
|
|
0ab21dfc98 | ||
|
|
e3ef14e784 | ||
|
|
010c6fd5be | ||
|
|
a12d66d25e | ||
|
|
faa5d18389 | ||
|
|
042e81aecb | ||
|
|
a1b46ef8a2 | ||
|
|
7f4ab06f11 | ||
|
|
c11d6813e4 | ||
|
|
c10274663c | ||
|
|
839137c3f4 | ||
|
|
529e7e7797 | ||
|
|
2ce64944ab | ||
|
|
e6e1372ea7 | ||
|
|
9e723746e9 | ||
|
|
9a2ea12d71 | ||
|
|
877013efe4 | ||
|
|
4c9317aea0 | ||
|
|
cc9b4dd968 | ||
|
|
747842c930 | ||
|
|
174e939b26 | ||
|
|
f8df8ea9d5 | ||
|
|
da5e0e5ac2 | ||
|
|
b136c51747 |
@@ -85,17 +85,17 @@ machine-linux-2xlarge: &machine-linux-2xlarge
|
|||||||
|
|
||||||
machine-mac: &machine-mac
|
machine-mac: &machine-mac
|
||||||
macos:
|
macos:
|
||||||
xcode: "12.2.0"
|
xcode: "12.4.0"
|
||||||
|
|
||||||
machine-mac-large: &machine-mac-large
|
machine-mac-large: &machine-mac-large
|
||||||
resource_class: large
|
resource_class: large
|
||||||
macos:
|
macos:
|
||||||
xcode: "12.2.0"
|
xcode: "12.4.0"
|
||||||
|
|
||||||
machine-mac-large-arm: &machine-mac-large-arm
|
machine-mac-large-arm: &machine-mac-large-arm
|
||||||
resource_class: large
|
resource_class: large
|
||||||
macos:
|
macos:
|
||||||
xcode: "12.2.0"
|
xcode: "12.4.0"
|
||||||
|
|
||||||
machine-mac-arm64: &machine-mac-arm64
|
machine-mac-arm64: &machine-mac-arm64
|
||||||
resource_class: electronjs/macos-arm64
|
resource_class: electronjs/macos-arm64
|
||||||
@@ -230,6 +230,18 @@ step-maybe-notify-slack-success: &step-maybe-notify-slack-success
|
|||||||
fi
|
fi
|
||||||
when: on_success
|
when: on_success
|
||||||
|
|
||||||
|
step-maybe-cleanup-arm64-mac: &step-maybe-cleanup-arm64-mac
|
||||||
|
run:
|
||||||
|
name: Cleanup after testing
|
||||||
|
command: |
|
||||||
|
if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
|
||||||
|
killall Electron || echo "No Electron processes left running"
|
||||||
|
killall Safari || echo "No Safari processes left running"
|
||||||
|
rm -rf ~/Library/Application\ Support/Electron*
|
||||||
|
rm -rf ~/Library/Application\ Support/electron*
|
||||||
|
fi
|
||||||
|
when: always
|
||||||
|
|
||||||
step-checkout-electron: &step-checkout-electron
|
step-checkout-electron: &step-checkout-electron
|
||||||
checkout:
|
checkout:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
@@ -266,7 +278,7 @@ step-gclient-sync: &step-gclient-sync
|
|||||||
if ! git diff-index --quiet HEAD --; then
|
if ! git diff-index --quiet HEAD --; then
|
||||||
# There are changes to the patches. Make a git commit with the updated patches
|
# There are changes to the patches. Make a git commit with the updated patches
|
||||||
git add patches
|
git add patches
|
||||||
GIT_COMMITTER_NAME="Electron Bot" GIT_COMMITTER_EMAIL="electron@github.com" git commit -m "update patches" --author="Electron Bot <electron@github.com>"
|
GIT_COMMITTER_NAME="PatchUp" GIT_COMMITTER_EMAIL="73610968+patchup[bot]@users.noreply.github.com" git commit -m "chore: update patches" --author="PatchUp <73610968+patchup[bot]@users.noreply.github.com>"
|
||||||
# Export it
|
# Export it
|
||||||
mkdir -p ../../patches
|
mkdir -p ../../patches
|
||||||
git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
|
git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
|
||||||
@@ -313,9 +325,10 @@ step-setup-goma-for-build: &step-setup-goma-for-build
|
|||||||
npm install
|
npm install
|
||||||
mkdir third_party
|
mkdir third_party
|
||||||
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||||
node -e "require('./src/utils/goma.js').ensure()"
|
third_party/goma/goma_ctl.py ensure_start
|
||||||
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
|
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
|
||||||
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
echo 'export LOCAL_GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
|
||||||
|
echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
step-restore-brew-cache: &step-restore-brew-cache
|
step-restore-brew-cache: &step-restore-brew-cache
|
||||||
@@ -492,6 +505,7 @@ step-gn-check: &step-gn-check
|
|||||||
gn check out/Default //electron/shell/common/api:mojo
|
gn check out/Default //electron/shell/common/api:mojo
|
||||||
# Check the hunspell filenames
|
# Check the hunspell filenames
|
||||||
node electron/script/gen-hunspell-filenames.js --check
|
node electron/script/gen-hunspell-filenames.js --check
|
||||||
|
node electron/script/gen-libc++-filenames.js --check
|
||||||
|
|
||||||
step-electron-build: &step-electron-build
|
step-electron-build: &step-electron-build
|
||||||
run:
|
run:
|
||||||
@@ -517,7 +531,10 @@ step-electron-build: &step-electron-build
|
|||||||
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
|
ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||||
|
(cd out/Default; zip mksnapshot.zip mksnapshot_args clang_x64_v8_arm64/gen/v8/embedded.S)
|
||||||
|
rm -rf out/Default/clang_x64_v8_arm64/gen
|
||||||
rm -rf out/Default/clang_x64_v8_arm64/obj
|
rm -rf out/Default/clang_x64_v8_arm64/obj
|
||||||
|
rm -rf out/Default/clang_x64/obj
|
||||||
|
|
||||||
# Regenerate because we just deleted some ninja files
|
# Regenerate because we just deleted some ninja files
|
||||||
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
|
||||||
@@ -672,6 +689,11 @@ step-persist-data-for-tests: &step-persist-data-for-tests
|
|||||||
- src/third_party/electron_node
|
- src/third_party/electron_node
|
||||||
- src/third_party/nan
|
- src/third_party/nan
|
||||||
- src/cross-arch-snapshots
|
- src/cross-arch-snapshots
|
||||||
|
- src/third_party/llvm-build
|
||||||
|
- src/build/linux
|
||||||
|
- src/buildtools/third_party/libc++
|
||||||
|
- src/buildtools/third_party/libc++abi
|
||||||
|
- src/out/Default/obj/buildtools/third_party
|
||||||
|
|
||||||
step-electron-dist-unzip: &step-electron-dist-unzip
|
step-electron-dist-unzip: &step-electron-dist-unzip
|
||||||
run:
|
run:
|
||||||
@@ -822,6 +844,17 @@ step-hunspell-store: &step-hunspell-store
|
|||||||
path: src/out/Default/hunspell_dictionaries.zip
|
path: src/out/Default/hunspell_dictionaries.zip
|
||||||
destination: hunspell_dictionaries.zip
|
destination: hunspell_dictionaries.zip
|
||||||
|
|
||||||
|
step-maybe-generate-libcxx: &step-maybe-generate-libcxx
|
||||||
|
run:
|
||||||
|
name: maybe generate libcxx
|
||||||
|
command: |
|
||||||
|
cd src
|
||||||
|
if [ "`uname`" == "Linux" ]; then
|
||||||
|
ninja -C out/Default electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
ninja -C out/Default electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
ninja -C out/Default electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
fi
|
||||||
|
|
||||||
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
|
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
|
||||||
run:
|
run:
|
||||||
name: Generate breakpad symbols
|
name: Generate breakpad symbols
|
||||||
@@ -840,7 +873,7 @@ step-maybe-zip-symbols: &step-maybe-zip-symbols
|
|||||||
export BUILD_PATH="$PWD/out/Default"
|
export BUILD_PATH="$PWD/out/Default"
|
||||||
ninja -C out/Default electron:licenses
|
ninja -C out/Default electron:licenses
|
||||||
ninja -C out/Default electron:electron_version
|
ninja -C out/Default electron:electron_version
|
||||||
electron/script/zip-symbols.py -b $BUILD_PATH
|
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
|
||||||
|
|
||||||
step-symbols-store: &step-symbols-store
|
step-symbols-store: &step-symbols-store
|
||||||
store_artifacts:
|
store_artifacts:
|
||||||
@@ -1018,7 +1051,7 @@ step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-c
|
|||||||
name: Remove some unused data to avoid storing it in the workspace/cache
|
name: Remove some unused data to avoid storing it in the workspace/cache
|
||||||
command: |
|
command: |
|
||||||
rm -rf src/android_webview
|
rm -rf src/android_webview
|
||||||
rm -rf src/ios
|
rm -rf src/ios/chrome
|
||||||
rm -rf src/third_party/blink/web_tests
|
rm -rf src/third_party/blink/web_tests
|
||||||
rm -rf src/third_party/blink/perf_tests
|
rm -rf src/third_party/blink/perf_tests
|
||||||
rm -rf src/third_party/WebKit/LayoutTests
|
rm -rf src/third_party/WebKit/LayoutTests
|
||||||
@@ -1340,6 +1373,8 @@ steps-tests: &steps-tests
|
|||||||
|
|
||||||
- *step-maybe-notify-slack-failure
|
- *step-maybe-notify-slack-failure
|
||||||
|
|
||||||
|
- *step-maybe-cleanup-arm64-mac
|
||||||
|
|
||||||
steps-test-nan: &steps-test-nan
|
steps-test-nan: &steps-test-nan
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -1670,6 +1705,9 @@ commands:
|
|||||||
- *step-hunspell-build
|
- *step-hunspell-build
|
||||||
- *step-hunspell-store
|
- *step-hunspell-store
|
||||||
|
|
||||||
|
# libcxx
|
||||||
|
- *step-maybe-generate-libcxx
|
||||||
|
|
||||||
# typescript defs
|
# typescript defs
|
||||||
- *step-maybe-generate-typescript-defs
|
- *step-maybe-generate-typescript-defs
|
||||||
|
|
||||||
@@ -2311,7 +2349,7 @@ jobs:
|
|||||||
<<: *steps-tests
|
<<: *steps-tests
|
||||||
|
|
||||||
linux-x64-testing-asan-tests:
|
linux-x64-testing-asan-tests:
|
||||||
<<: *machine-linux-medium
|
<<: *machine-linux-xlarge
|
||||||
environment:
|
environment:
|
||||||
<<: *env-linux-medium
|
<<: *env-linux-medium
|
||||||
<<: *env-headless-testing
|
<<: *env-headless-testing
|
||||||
@@ -2595,15 +2633,19 @@ workflows:
|
|||||||
- osx-publish-x64-skip-checkout:
|
- osx-publish-x64-skip-checkout:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout
|
- mac-checkout
|
||||||
|
context: release-env
|
||||||
- mas-publish-x64-skip-checkout:
|
- mas-publish-x64-skip-checkout:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout
|
- mac-checkout
|
||||||
|
context: release-env
|
||||||
- osx-publish-arm64-skip-checkout:
|
- osx-publish-arm64-skip-checkout:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout
|
- mac-checkout
|
||||||
|
context: release-env
|
||||||
- mas-publish-arm64-skip-checkout:
|
- mas-publish-arm64-skip-checkout:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout
|
- mac-checkout
|
||||||
|
context: release-env
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
when: << pipeline.parameters.run-lint >>
|
when: << pipeline.parameters.run-lint >>
|
||||||
|
|||||||
@@ -4,4 +4,3 @@
|
|||||||
APPVEYOR_CLOUD_TOKEN=
|
APPVEYOR_CLOUD_TOKEN=
|
||||||
CIRCLE_TOKEN=
|
CIRCLE_TOKEN=
|
||||||
ELECTRON_GITHUB_TOKEN=
|
ELECTRON_GITHUB_TOKEN=
|
||||||
VSTS_TOKEN=
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -68,4 +68,6 @@ ts-gen
|
|||||||
.depshash-target
|
.depshash-target
|
||||||
|
|
||||||
# Used to accelerate builds after sync
|
# Used to accelerate builds after sync
|
||||||
patches/mtime-cache.json
|
patches/mtime-cache.json
|
||||||
|
|
||||||
|
spec/fixtures/logo.png
|
||||||
62
BUILD.gn
62
BUILD.gn
@@ -1,6 +1,7 @@
|
|||||||
import("//build/config/locales.gni")
|
import("//build/config/locales.gni")
|
||||||
import("//build/config/ui.gni")
|
import("//build/config/ui.gni")
|
||||||
import("//build/config/win/manifest.gni")
|
import("//build/config/win/manifest.gni")
|
||||||
|
import("//components/os_crypt/features.gni")
|
||||||
import("//components/spellcheck/spellcheck_build_features.gni")
|
import("//components/spellcheck/spellcheck_build_features.gni")
|
||||||
import("//content/public/app/mac_helpers.gni")
|
import("//content/public/app/mac_helpers.gni")
|
||||||
import("//extensions/buildflags/buildflags.gni")
|
import("//extensions/buildflags/buildflags.gni")
|
||||||
@@ -25,6 +26,8 @@ import("electron_paks.gni")
|
|||||||
import("filenames.auto.gni")
|
import("filenames.auto.gni")
|
||||||
import("filenames.gni")
|
import("filenames.gni")
|
||||||
import("filenames.hunspell.gni")
|
import("filenames.hunspell.gni")
|
||||||
|
import("filenames.libcxx.gni")
|
||||||
|
import("filenames.libcxxabi.gni")
|
||||||
|
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
import("//build/config/mac/rules.gni")
|
import("//build/config/mac/rules.gni")
|
||||||
@@ -290,7 +293,7 @@ templated_file("electron_version_header") {
|
|||||||
action("electron_fuses") {
|
action("electron_fuses") {
|
||||||
script = "build/fuses/build.py"
|
script = "build/fuses/build.py"
|
||||||
|
|
||||||
inputs = [ "build/fuses/fuses.json" ]
|
inputs = [ "build/fuses/fuses.json5" ]
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
"$target_gen_dir/fuses.h",
|
"$target_gen_dir/fuses.h",
|
||||||
@@ -329,6 +332,7 @@ source_set("electron_lib") {
|
|||||||
"//components/network_hints/common:mojo_bindings",
|
"//components/network_hints/common:mojo_bindings",
|
||||||
"//components/network_hints/renderer",
|
"//components/network_hints/renderer",
|
||||||
"//components/network_session_configurator/common",
|
"//components/network_session_configurator/common",
|
||||||
|
"//components/os_crypt",
|
||||||
"//components/pref_registry",
|
"//components/pref_registry",
|
||||||
"//components/prefs",
|
"//components/prefs",
|
||||||
"//components/upload_list",
|
"//components/upload_list",
|
||||||
@@ -402,7 +406,10 @@ source_set("electron_lib") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!is_mas_build) {
|
if (!is_mas_build) {
|
||||||
deps += [ "//components/crash/core/app" ]
|
deps += [
|
||||||
|
"//components/crash/core/app",
|
||||||
|
"//components/crash/core/browser",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
sources = filenames.lib_sources
|
sources = filenames.lib_sources
|
||||||
@@ -440,6 +447,7 @@ source_set("electron_lib") {
|
|||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
deps += [
|
deps += [
|
||||||
"//components/remote_cocoa/app_shim",
|
"//components/remote_cocoa/app_shim",
|
||||||
|
"//components/remote_cocoa/browser",
|
||||||
"//content/common:mac_helpers",
|
"//content/common:mac_helpers",
|
||||||
"//ui/accelerated_widget_mac",
|
"//ui/accelerated_widget_mac",
|
||||||
]
|
]
|
||||||
@@ -619,6 +627,9 @@ source_set("electron_lib") {
|
|||||||
"//chrome/services/printing/public/mojom",
|
"//chrome/services/printing/public/mojom",
|
||||||
"//components/printing/common:mojo_interfaces",
|
"//components/printing/common:mojo_interfaces",
|
||||||
]
|
]
|
||||||
|
if (is_mac) {
|
||||||
|
deps += [ "//chrome/services/mac_notifications/public/mojom" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable_electron_extensions) {
|
if (enable_electron_extensions) {
|
||||||
@@ -632,6 +643,7 @@ source_set("electron_lib") {
|
|||||||
"//components/zoom",
|
"//components/zoom",
|
||||||
"//extensions/browser",
|
"//extensions/browser",
|
||||||
"//extensions/browser:core_api_provider",
|
"//extensions/browser:core_api_provider",
|
||||||
|
"//extensions/browser/updater",
|
||||||
"//extensions/common",
|
"//extensions/common",
|
||||||
"//extensions/common:core_api_provider",
|
"//extensions/common:core_api_provider",
|
||||||
"//extensions/renderer",
|
"//extensions/renderer",
|
||||||
@@ -668,6 +680,10 @@ source_set("electron_lib") {
|
|||||||
]
|
]
|
||||||
libs += [ "uxtheme.lib" ]
|
libs += [ "uxtheme.lib" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allow_runtime_configurable_key_storage) {
|
||||||
|
defines += [ "ALLOW_RUNTIME_CONFIGURABLE_KEY_STORAGE" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
electron_paks("packed_resources") {
|
electron_paks("packed_resources") {
|
||||||
@@ -1284,13 +1300,18 @@ template("dist_zip") {
|
|||||||
"testonly",
|
"testonly",
|
||||||
])
|
])
|
||||||
flatten = false
|
flatten = false
|
||||||
|
flatten_relative_to = false
|
||||||
if (defined(invoker.flatten)) {
|
if (defined(invoker.flatten)) {
|
||||||
flatten = invoker.flatten
|
flatten = invoker.flatten
|
||||||
|
if (defined(invoker.flatten_relative_to)) {
|
||||||
|
flatten_relative_to = invoker.flatten_relative_to
|
||||||
|
}
|
||||||
}
|
}
|
||||||
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
|
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
|
||||||
target_cpu,
|
target_cpu,
|
||||||
target_os,
|
target_os,
|
||||||
"$flatten",
|
"$flatten",
|
||||||
|
"$flatten_relative_to",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1381,6 +1402,43 @@ dist_zip("hunspell_dictionaries_zip") {
|
|||||||
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
|
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copy("libcxx_headers") {
|
||||||
|
sources = libcxx_headers + libcxx_licenses
|
||||||
|
outputs = [ "$target_gen_dir/electron_libcxx_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
dist_zip("libcxx_headers_zip") {
|
||||||
|
data_deps = [ ":libcxx_headers" ]
|
||||||
|
flatten = true
|
||||||
|
flatten_relative_to = rebase_path(
|
||||||
|
"$target_gen_dir/electron_libcxx_include/buildtools/third_party/libc++/trunk",
|
||||||
|
"$root_out_dir")
|
||||||
|
|
||||||
|
outputs = [ "$root_build_dir/libcxx_headers.zip" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
copy("libcxxabi_headers") {
|
||||||
|
sources = libcxxabi_headers + libcxxabi_licenses
|
||||||
|
outputs = [ "$target_gen_dir/electron_libcxxabi_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
dist_zip("libcxxabi_headers_zip") {
|
||||||
|
data_deps = [ ":libcxxabi_headers" ]
|
||||||
|
flatten = true
|
||||||
|
flatten_relative_to = rebase_path(
|
||||||
|
"$target_gen_dir/electron_libcxxabi_include/buildtools/third_party/libc++abi/trunk",
|
||||||
|
"$root_out_dir")
|
||||||
|
|
||||||
|
outputs = [ "$root_build_dir/libcxxabi_headers.zip" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
action("libcxx_objects_zip") {
|
||||||
|
deps = [ "//buildtools/third_party/libc++" ]
|
||||||
|
script = "build/zip_libcxx.py"
|
||||||
|
outputs = [ "$root_build_dir/libcxx_objects.zip" ]
|
||||||
|
args = rebase_path(outputs)
|
||||||
|
}
|
||||||
|
|
||||||
group("electron") {
|
group("electron") {
|
||||||
public_deps = [ ":electron_app" ]
|
public_deps = [ ":electron_app" ]
|
||||||
}
|
}
|
||||||
|
|||||||
6
DEPS
6
DEPS
@@ -14,11 +14,11 @@ gclient_gn_args = [
|
|||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
'chromium_version':
|
'chromium_version':
|
||||||
'1f252b391a40e2681b0d9aff6497b7401863d1fc',
|
'91.0.4472.77',
|
||||||
'node_version':
|
'node_version':
|
||||||
'v14.16.0',
|
'v14.16.0',
|
||||||
'nan_version':
|
'nan_version':
|
||||||
'2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
|
'v2.14.2',
|
||||||
'squirrel.mac_version':
|
'squirrel.mac_version':
|
||||||
'cdc0729c8bf8576bfef18629186e1e9ecf1b0d9f',
|
'cdc0729c8bf8576bfef18629186e1e9ecf1b0d9f',
|
||||||
|
|
||||||
@@ -48,6 +48,8 @@ vars = {
|
|||||||
# It's only needed to parse the native tests configurations.
|
# It's only needed to parse the native tests configurations.
|
||||||
'checkout_pyyaml': False,
|
'checkout_pyyaml': False,
|
||||||
|
|
||||||
|
'use_rts': False,
|
||||||
|
|
||||||
'mac_xcode_version': 'default',
|
'mac_xcode_version': 'default',
|
||||||
|
|
||||||
# To allow running hooks without parsing the DEPS tree
|
# To allow running hooks without parsing the DEPS tree
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
13.0.0-nightly.20210303
|
13.1.1
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
[](https://david-dm.org/electron/electron?type=dev)
|
[](https://david-dm.org/electron/electron?type=dev)
|
||||||
[](https://discord.com/invite/electron)
|
[](https://discord.com/invite/electron)
|
||||||
|
|
||||||
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹 🇵🇱.
|
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
||||||
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
|
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
|
||||||
|
|
||||||
The Electron framework lets you write cross-platform desktop applications
|
The Electron framework lets you write cross-platform desktop applications
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ environment:
|
|||||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
ELECTRON_ENABLE_STACK_DUMPING: 1
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
MOCHA_REPORTER: mocha-multi-reporters
|
||||||
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
|
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
|
||||||
|
GOMA_FALLBACK_ON_AUTH_FAILURE: true
|
||||||
notifications:
|
notifications:
|
||||||
- provider: Webhook
|
- provider: Webhook
|
||||||
url: https://electron-mission-control.herokuapp.com/rest/appveyor-hook
|
url: https://electron-mission-control.herokuapp.com/rest/appveyor-hook
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ steps:
|
|||||||
set npm_config_arch=arm64
|
set npm_config_arch=arm64
|
||||||
cd electron
|
cd electron
|
||||||
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
||||||
node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion
|
node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion --disable-gpu
|
||||||
displayName: 'Run Electron tests'
|
displayName: 'Run Electron tests'
|
||||||
env:
|
env:
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
|
|||||||
@@ -19,4 +19,17 @@ enable_basic_printing = true
|
|||||||
angle_enable_vulkan_validation_layers = false
|
angle_enable_vulkan_validation_layers = false
|
||||||
dawn_enable_vulkan_validation_layers = false
|
dawn_enable_vulkan_validation_layers = false
|
||||||
|
|
||||||
|
# This breaks native node modules
|
||||||
|
libcxx_abi_unstable = false
|
||||||
|
|
||||||
|
# These are disabled because they cause the zip manifest to differ between
|
||||||
|
# testing and release builds.
|
||||||
|
# See https://chromium-review.googlesource.com/c/chromium/src/+/2774898.
|
||||||
|
enable_pseudolocales = false
|
||||||
|
|
||||||
is_cfi = false
|
is_cfi = false
|
||||||
|
|
||||||
|
# Make application name configurable at runtime for cookie crypto
|
||||||
|
allow_runtime_configurable_key_storage = true
|
||||||
|
|
||||||
|
enable_cet_shadow_stack = false
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version *
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
with open(os.path.join(dir_path, "fuses.json"), 'r') as f:
|
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:
|
||||||
fuse_defaults = json.load(f)
|
fuse_defaults = json.loads(''.join(line for line in f.readlines() if not line.strip()[0] == "/"))
|
||||||
|
|
||||||
fuse_version = fuse_defaults['_version']
|
fuse_version = fuse_defaults['_version']
|
||||||
del fuse_defaults['_version']
|
del fuse_defaults['_version']
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
"_comment": "Modifying the fuse schema in any breaking way should result in the _version prop being incremented. NEVER remove a fuse or change its meaning, instead mark it as removed with 'r'",
|
"_comment": "Modifying the fuse schema in any breaking way should result in the _version prop being incremented. NEVER remove a fuse or change its meaning, instead mark it as removed with 'r'",
|
||||||
"_schema": "0 == off, 1 == on, r == removed fuse",
|
"_schema": "0 == off, 1 == on, r == removed fuse",
|
||||||
"_version": 1,
|
"_version": 1,
|
||||||
"run_as_node": "1"
|
"run_as_node": "1",
|
||||||
|
"cookie_encryption": "0"
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
# require any direct Cocoa locale support.
|
# require any direct Cocoa locale support.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import errno
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@ def main(args):
|
|||||||
try:
|
try:
|
||||||
os.makedirs(dirname)
|
os.makedirs(dirname)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == os.errno.EEXIST:
|
if e.errno == errno.EEXIST:
|
||||||
# It's OK if it already exists
|
# It's OK if it already exists
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ args = [cmd, "run",
|
|||||||
try:
|
try:
|
||||||
subprocess.check_output(args, stderr=subprocess.STDOUT)
|
subprocess.check_output(args, stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(
|
error_msg = "NPM script '{}' failed with code '{}':\n".format(sys.argv[2], e.returncode)
|
||||||
"NPM script '"
|
print(error_msg + e.output.decode('ascii'))
|
||||||
+ sys.argv[2]
|
|
||||||
+ "' failed with code '"
|
|
||||||
+ str(e.returncode)
|
|
||||||
+ "':\n"
|
|
||||||
+ e.output
|
|
||||||
)
|
|
||||||
sys.exit(e.returncode)
|
sys.exit(e.returncode)
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ if ((globalThis.process || binding.process).argv.includes("--profile-electron-in
|
|||||||
setImmediate: false
|
setImmediate: false
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: env.mode === 'production',
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ template("webpack_build") {
|
|||||||
"//electron/typings/internal-electron.d.ts",
|
"//electron/typings/internal-electron.d.ts",
|
||||||
] + invoker.inputs
|
] + invoker.inputs
|
||||||
|
|
||||||
|
mode = "development"
|
||||||
|
if (is_official_build) {
|
||||||
|
mode = "production"
|
||||||
|
}
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
"--config",
|
"--config",
|
||||||
rebase_path(invoker.config_file),
|
rebase_path(invoker.config_file),
|
||||||
@@ -29,6 +34,7 @@ template("webpack_build") {
|
|||||||
"--output-path=" + rebase_path(get_path_info(invoker.out_file, "dir")),
|
"--output-path=" + rebase_path(get_path_info(invoker.out_file, "dir")),
|
||||||
"--env.buildflags=" +
|
"--env.buildflags=" +
|
||||||
rebase_path("$target_gen_dir/buildflags/buildflags.h"),
|
rebase_path("$target_gen_dir/buildflags/buildflags.h"),
|
||||||
|
"--env.mode=" + mode,
|
||||||
]
|
]
|
||||||
deps += [ "buildflags" ]
|
deps += [ "buildflags" ]
|
||||||
|
|
||||||
|
|||||||
16
build/zip.py
16
build/zip.py
@@ -39,6 +39,7 @@ PATHS_TO_SKIP = [
|
|||||||
'./crashpad_handler',
|
'./crashpad_handler',
|
||||||
# Skip because these are outputs that we don't need.
|
# Skip because these are outputs that we don't need.
|
||||||
'resources/inspector',
|
'resources/inspector',
|
||||||
|
'gen/third_party/devtools-frontend/src'
|
||||||
]
|
]
|
||||||
|
|
||||||
def skip_path(dep, dist_zip, target_cpu):
|
def skip_path(dep, dist_zip, target_cpu):
|
||||||
@@ -70,7 +71,7 @@ def execute(argv):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
dist_zip, runtime_deps, target_cpu, _, flatten_val = argv
|
dist_zip, runtime_deps, target_cpu, _, flatten_val, flatten_relative_to = argv
|
||||||
should_flatten = flatten_val == "true"
|
should_flatten = flatten_val == "true"
|
||||||
dist_files = set()
|
dist_files = set()
|
||||||
with open(runtime_deps) as f:
|
with open(runtime_deps) as f:
|
||||||
@@ -97,11 +98,18 @@ def main(argv):
|
|||||||
if basename == 'chrome_sandbox'
|
if basename == 'chrome_sandbox'
|
||||||
else dep
|
else dep
|
||||||
)
|
)
|
||||||
|
name_to_write = arcname
|
||||||
|
if should_flatten:
|
||||||
|
if flatten_relative_to:
|
||||||
|
if name_to_write.startswith(flatten_relative_to):
|
||||||
|
name_to_write = name_to_write[len(flatten_relative_to):]
|
||||||
|
else:
|
||||||
|
name_to_write = os.path.basename(arcname)
|
||||||
|
else:
|
||||||
|
name_to_write = os.path.basename(arcname)
|
||||||
z.write(
|
z.write(
|
||||||
dep,
|
dep,
|
||||||
os.path.basename(arcname)
|
name_to_write,
|
||||||
if should_flatten
|
|
||||||
else arcname,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
47
build/zip_libcxx.py
Normal file
47
build/zip_libcxx.py
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
from __future__ import print_function
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import zipfile
|
||||||
|
|
||||||
|
def execute(argv):
|
||||||
|
try:
|
||||||
|
output = subprocess.check_output(argv, stderr=subprocess.STDOUT)
|
||||||
|
return output
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(e.output)
|
||||||
|
raise e
|
||||||
|
|
||||||
|
def get_object_files(base_path, archive_name):
|
||||||
|
archive_file = os.path.join(base_path, archive_name)
|
||||||
|
output = execute(['nm', '-g', archive_file]).decode('ascii')
|
||||||
|
object_files = set()
|
||||||
|
lines = output.split("\n")
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith(base_path):
|
||||||
|
object_file = line.split(":")[0]
|
||||||
|
object_files.add(object_file)
|
||||||
|
if line.startswith('nm: '):
|
||||||
|
object_file = line.split(":")[1].lstrip()
|
||||||
|
object_files.add(object_file)
|
||||||
|
return list(object_files) + [archive_file]
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
dist_zip, = argv
|
||||||
|
out_dir = os.path.dirname(dist_zip)
|
||||||
|
base_path_libcxx = os.path.join(out_dir, 'obj/buildtools/third_party/libc++')
|
||||||
|
base_path_libcxxabi = os.path.join(out_dir, 'obj/buildtools/third_party/libc++abi')
|
||||||
|
object_files_libcxx = get_object_files(base_path_libcxx, 'libc++.a')
|
||||||
|
object_files_libcxxabi = get_object_files(base_path_libcxxabi, 'libc++abi.a')
|
||||||
|
with zipfile.ZipFile(
|
||||||
|
dist_zip, 'w', zipfile.ZIP_DEFLATED, allowZip64=True
|
||||||
|
) as z:
|
||||||
|
object_files_libcxx.sort()
|
||||||
|
for object_file in object_files_libcxx:
|
||||||
|
z.write(object_file, os.path.relpath(object_file, base_path_libcxx))
|
||||||
|
for object_file in object_files_libcxxabi:
|
||||||
|
z.write(object_file, os.path.relpath(object_file, base_path_libcxxabi))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main(sys.argv[1:]))
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
# Use of this source code is governed by the MIT license that can be
|
# Use of this source code is governed by the MIT license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//build/config/ozone.gni")
|
||||||
import("//build/config/ui.gni")
|
import("//build/config/ui.gni")
|
||||||
import("//components/spellcheck/spellcheck_build_features.gni")
|
import("//components/spellcheck/spellcheck_build_features.gni")
|
||||||
import("//electron/buildflags/buildflags.gni")
|
import("//electron/buildflags/buildflags.gni")
|
||||||
@@ -16,8 +17,6 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/accessibility/accessibility_ui.h",
|
"//chrome/browser/accessibility/accessibility_ui.h",
|
||||||
"//chrome/browser/browser_process.cc",
|
"//chrome/browser/browser_process.cc",
|
||||||
"//chrome/browser/browser_process.h",
|
"//chrome/browser/browser_process.h",
|
||||||
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc",
|
|
||||||
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.h",
|
|
||||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
|
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
|
||||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
|
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
|
||||||
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
|
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
|
||||||
@@ -46,7 +45,6 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/predictors/resolve_host_client_impl.h",
|
"//chrome/browser/predictors/resolve_host_client_impl.h",
|
||||||
"//chrome/browser/ssl/security_state_tab_helper.cc",
|
"//chrome/browser/ssl/security_state_tab_helper.cc",
|
||||||
"//chrome/browser/ssl/security_state_tab_helper.h",
|
"//chrome/browser/ssl/security_state_tab_helper.h",
|
||||||
"//chrome/browser/ssl/tls_deprecation_config.cc",
|
|
||||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
|
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
|
||||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
|
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
|
||||||
"//extensions/browser/app_window/size_constraints.cc",
|
"//extensions/browser/app_window/size_constraints.cc",
|
||||||
@@ -95,12 +93,18 @@ static_library("chrome") {
|
|||||||
|
|
||||||
if (is_linux) {
|
if (is_linux) {
|
||||||
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
|
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
|
||||||
|
if (use_x11 || use_ozone) {
|
||||||
|
sources +=
|
||||||
|
[ "//chrome/browser/extensions/global_shortcut_listener_linux.cc" ]
|
||||||
|
}
|
||||||
if (use_x11) {
|
if (use_x11) {
|
||||||
sources += [
|
sources += [
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_x11.cc",
|
"//chrome/browser/extensions/global_shortcut_listener_x11.cc",
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_x11.h",
|
"//chrome/browser/extensions/global_shortcut_listener_x11.h",
|
||||||
]
|
]
|
||||||
} else if (use_ozone) {
|
}
|
||||||
|
if (use_ozone) {
|
||||||
|
deps += [ "//ui/ozone" ]
|
||||||
sources += [
|
sources += [
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_ozone.cc",
|
"//chrome/browser/extensions/global_shortcut_listener_ozone.cc",
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_ozone.h",
|
"//chrome/browser/extensions/global_shortcut_listener_ozone.h",
|
||||||
@@ -191,7 +195,7 @@ static_library("chrome") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_linux) {
|
if (is_linux) {
|
||||||
sources += [ "//chrome/browser/media/webrtc/window_icon_util_x11.cc" ]
|
sources += [ "//chrome/browser/media/webrtc/window_icon_util_linux.cc" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,8 +257,12 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
|
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
|
||||||
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.cc",
|
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.cc",
|
||||||
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.h",
|
"//chrome/browser/ui/views/overlay/back_to_tab_image_button.h",
|
||||||
|
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
|
||||||
"//chrome/browser/ui/views/overlay/close_image_button.cc",
|
"//chrome/browser/ui/views/overlay/close_image_button.cc",
|
||||||
"//chrome/browser/ui/views/overlay/close_image_button.h",
|
"//chrome/browser/ui/views/overlay/close_image_button.h",
|
||||||
|
"//chrome/browser/ui/views/overlay/constants.h",
|
||||||
|
"//chrome/browser/ui/views/overlay/hang_up_button.cc",
|
||||||
|
"//chrome/browser/ui/views/overlay/hang_up_button.h",
|
||||||
"//chrome/browser/ui/views/overlay/overlay_window_views.cc",
|
"//chrome/browser/ui/views/overlay/overlay_window_views.cc",
|
||||||
"//chrome/browser/ui/views/overlay/overlay_window_views.h",
|
"//chrome/browser/ui/views/overlay/overlay_window_views.h",
|
||||||
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
|
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
|
||||||
@@ -263,6 +271,10 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/ui/views/overlay/resize_handle_button.h",
|
"//chrome/browser/ui/views/overlay/resize_handle_button.h",
|
||||||
"//chrome/browser/ui/views/overlay/skip_ad_label_button.cc",
|
"//chrome/browser/ui/views/overlay/skip_ad_label_button.cc",
|
||||||
"//chrome/browser/ui/views/overlay/skip_ad_label_button.h",
|
"//chrome/browser/ui/views/overlay/skip_ad_label_button.h",
|
||||||
|
"//chrome/browser/ui/views/overlay/toggle_camera_button.cc",
|
||||||
|
"//chrome/browser/ui/views/overlay/toggle_camera_button.h",
|
||||||
|
"//chrome/browser/ui/views/overlay/toggle_microphone_button.cc",
|
||||||
|
"//chrome/browser/ui/views/overlay/toggle_microphone_button.h",
|
||||||
"//chrome/browser/ui/views/overlay/track_image_button.cc",
|
"//chrome/browser/ui/views/overlay/track_image_button.cc",
|
||||||
"//chrome/browser/ui/views/overlay/track_image_button.h",
|
"//chrome/browser/ui/views/overlay/track_image_button.h",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ CertificateManagerModel::~CertificateManagerModel() = default;
|
|||||||
int CertificateManagerModel::ImportFromPKCS12(
|
int CertificateManagerModel::ImportFromPKCS12(
|
||||||
PK11SlotInfo* slot_info,
|
PK11SlotInfo* slot_info,
|
||||||
const std::string& data,
|
const std::string& data,
|
||||||
const base::string16& password,
|
const std::u16string& password,
|
||||||
bool is_extractable,
|
bool is_extractable,
|
||||||
net::ScopedCERTCertificateList* imported_certs) {
|
net::ScopedCERTCertificateList* imported_certs) {
|
||||||
return cert_db_->ImportFromPKCS12(slot_info, data, password, is_extractable,
|
return cert_db_->ImportFromPKCS12(slot_info, data, password, is_extractable,
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/strings/string16.h"
|
|
||||||
#include "net/cert/nss_cert_database.h"
|
#include "net/cert/nss_cert_database.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
@@ -46,7 +45,7 @@ class CertificateManagerModel {
|
|||||||
// Returns a net error code on failure.
|
// Returns a net error code on failure.
|
||||||
int ImportFromPKCS12(PK11SlotInfo* slot_info,
|
int ImportFromPKCS12(PK11SlotInfo* slot_info,
|
||||||
const std::string& data,
|
const std::string& data,
|
||||||
const base::string16& password,
|
const std::u16string& password,
|
||||||
bool is_extractable,
|
bool is_extractable,
|
||||||
net::ScopedCERTCertificateList* imported_certs);
|
net::ScopedCERTCertificateList* imported_certs);
|
||||||
|
|
||||||
|
|||||||
@@ -41,14 +41,14 @@ ipcMain.handle('bootstrap', (event) => {
|
|||||||
return isTrustedSender(event.sender) ? electronPath : null;
|
return isTrustedSender(event.sender) ? electronPath : null;
|
||||||
});
|
});
|
||||||
|
|
||||||
async function createWindow () {
|
async function createWindow (backgroundColor?: string) {
|
||||||
await app.whenReady();
|
await app.whenReady();
|
||||||
|
|
||||||
const options: Electron.BrowserWindowConstructorOptions = {
|
const options: Electron.BrowserWindowConstructorOptions = {
|
||||||
width: 960,
|
width: 960,
|
||||||
height: 620,
|
height: 620,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
backgroundColor: '#2f3241',
|
backgroundColor,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.resolve(__dirname, 'preload.js'),
|
preload: path.resolve(__dirname, 'preload.js'),
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
@@ -96,7 +96,7 @@ export const loadURL = async (appUrl: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const loadFile = async (appPath: string) => {
|
export const loadFile = async (appPath: string) => {
|
||||||
mainWindow = await createWindow();
|
mainWindow = await createWindow(appPath === 'index.html' ? '#2f3241' : undefined);
|
||||||
mainWindow.loadFile(appPath);
|
mainWindow.loadFile(appPath);
|
||||||
mainWindow.focus();
|
mainWindow.focus();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,20 +18,14 @@ an issue:
|
|||||||
|
|
||||||
## Guides and Tutorials
|
## Guides and Tutorials
|
||||||
|
|
||||||
### Quickstart
|
### Getting started
|
||||||
|
|
||||||
* [Quick Start Guide](tutorial/quick-start.md)
|
* [Introduction](tutorial/introduction.md)
|
||||||
* [Prerequisites](tutorial/quick-start.md#prerequisites)
|
* [Quick Start](tutorial/quick-start.md)
|
||||||
* [Create a basic application](tutorial/quick-start.md#create-a-basic-application)
|
* [Process Model](tutorial/process-model.md)
|
||||||
* [Run your application](tutorial/quick-start.md#run-your-application)
|
|
||||||
* [Package and distribute the application](tutorial/quick-start.md#package-and-distribute-the-application)
|
|
||||||
|
|
||||||
### Learning the basics
|
### Learning the basics
|
||||||
|
|
||||||
* [Electron's Process Model](tutorial/quick-start.md#application-architecture)
|
|
||||||
* [Main and Renderer Processes](tutorial/quick-start.md#main-and-renderer-processes)
|
|
||||||
* [Electron API](tutorial/quick-start.md#electron-api)
|
|
||||||
* [Node.js API](tutorial/quick-start.md#nodejs-api)
|
|
||||||
* Adding Features to Your App
|
* Adding Features to Your App
|
||||||
* [Notifications](tutorial/notifications.md)
|
* [Notifications](tutorial/notifications.md)
|
||||||
* [Recent Documents](tutorial/recent-documents.md)
|
* [Recent Documents](tutorial/recent-documents.md)
|
||||||
@@ -59,6 +53,7 @@ an issue:
|
|||||||
* [Using Native Node.js Modules](tutorial/using-native-node-modules.md)
|
* [Using Native Node.js Modules](tutorial/using-native-node-modules.md)
|
||||||
* [Performance Strategies](tutorial/performance.md)
|
* [Performance Strategies](tutorial/performance.md)
|
||||||
* [Security Strategies](tutorial/security.md)
|
* [Security Strategies](tutorial/security.md)
|
||||||
|
* [Process Sandboxing](tutorial/sandbox.md)
|
||||||
* [Accessibility](tutorial/accessibility.md)
|
* [Accessibility](tutorial/accessibility.md)
|
||||||
* [Manually Enabling Accessibility Features](tutorial/accessibility.md#manually-enabling-accessibility-features)
|
* [Manually Enabling Accessibility Features](tutorial/accessibility.md#manually-enabling-accessibility-features)
|
||||||
* [Testing and Debugging](tutorial/application-debugging.md)
|
* [Testing and Debugging](tutorial/application-debugging.md)
|
||||||
@@ -68,6 +63,7 @@ an issue:
|
|||||||
* [Testing on Headless CI Systems (Travis, Jenkins)](tutorial/testing-on-headless-ci.md)
|
* [Testing on Headless CI Systems (Travis, Jenkins)](tutorial/testing-on-headless-ci.md)
|
||||||
* [DevTools Extension](tutorial/devtools-extension.md)
|
* [DevTools Extension](tutorial/devtools-extension.md)
|
||||||
* [Automated Testing with a Custom Driver](tutorial/automated-testing-with-a-custom-driver.md)
|
* [Automated Testing with a Custom Driver](tutorial/automated-testing-with-a-custom-driver.md)
|
||||||
|
* [REPL](tutorial/repl.md)
|
||||||
* [Distribution](tutorial/application-distribution.md)
|
* [Distribution](tutorial/application-distribution.md)
|
||||||
* [Supported Platforms](tutorial/support.md#supported-platforms)
|
* [Supported Platforms](tutorial/support.md#supported-platforms)
|
||||||
* [Code Signing](tutorial/code-signing.md)
|
* [Code Signing](tutorial/code-signing.md)
|
||||||
@@ -126,6 +122,8 @@ These individual tutorials expand on topics discussed in the guide above.
|
|||||||
* [ipcMain](api/ipc-main.md)
|
* [ipcMain](api/ipc-main.md)
|
||||||
* [Menu](api/menu.md)
|
* [Menu](api/menu.md)
|
||||||
* [MenuItem](api/menu-item.md)
|
* [MenuItem](api/menu-item.md)
|
||||||
|
* [MessageChannelMain](api/message-channel-main.md)
|
||||||
|
* [MessagePortMain](api/message-port-main.md)
|
||||||
* [net](api/net.md)
|
* [net](api/net.md)
|
||||||
* [netLog](api/net-log.md)
|
* [netLog](api/net-log.md)
|
||||||
* [nativeTheme](api/native-theme.md)
|
* [nativeTheme](api/native-theme.md)
|
||||||
@@ -135,6 +133,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
|||||||
* [protocol](api/protocol.md)
|
* [protocol](api/protocol.md)
|
||||||
* [screen](api/screen.md)
|
* [screen](api/screen.md)
|
||||||
* [session](api/session.md)
|
* [session](api/session.md)
|
||||||
|
* [ShareMenu](api/share-menu.md)
|
||||||
* [systemPreferences](api/system-preferences.md)
|
* [systemPreferences](api/system-preferences.md)
|
||||||
* [TouchBar](api/touch-bar.md)
|
* [TouchBar](api/touch-bar.md)
|
||||||
* [Tray](api/tray.md)
|
* [Tray](api/tray.md)
|
||||||
@@ -144,15 +143,14 @@ These individual tutorials expand on topics discussed in the guide above.
|
|||||||
### Modules for the Renderer Process (Web Page):
|
### Modules for the Renderer Process (Web Page):
|
||||||
|
|
||||||
* [contextBridge](api/context-bridge.md)
|
* [contextBridge](api/context-bridge.md)
|
||||||
* [desktopCapturer](api/desktop-capturer.md)
|
|
||||||
* [ipcRenderer](api/ipc-renderer.md)
|
* [ipcRenderer](api/ipc-renderer.md)
|
||||||
* [remote](api/remote.md)
|
|
||||||
* [webFrame](api/web-frame.md)
|
* [webFrame](api/web-frame.md)
|
||||||
|
|
||||||
### Modules for Both Processes:
|
### Modules for Both Processes:
|
||||||
|
|
||||||
* [clipboard](api/clipboard.md)
|
* [clipboard](api/clipboard.md)
|
||||||
* [crashReporter](api/crash-reporter.md)
|
* [crashReporter](api/crash-reporter.md)
|
||||||
|
* [desktopCapturer](api/desktop-capturer.md)
|
||||||
* [nativeImage](api/native-image.md)
|
* [nativeImage](api/native-image.md)
|
||||||
* [shell](api/shell.md)
|
* [shell](api/shell.md)
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Linux and Windows to define some accelerators.
|
|||||||
Use `Alt` instead of `Option`. The `Option` key only exists on macOS, whereas
|
Use `Alt` instead of `Option`. The `Option` key only exists on macOS, whereas
|
||||||
the `Alt` key is available on all platforms.
|
the `Alt` key is available on all platforms.
|
||||||
|
|
||||||
The `Super` key is mapped to the `Windows` key on Windows and Linux and
|
The `Super` (or `Meta`) key is mapped to the `Windows` key on Windows and Linux and
|
||||||
`Cmd` on macOS.
|
`Cmd` on macOS.
|
||||||
|
|
||||||
## Available modifiers
|
## Available modifiers
|
||||||
@@ -48,6 +48,7 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and
|
|||||||
* `AltGr`
|
* `AltGr`
|
||||||
* `Shift`
|
* `Shift`
|
||||||
* `Super`
|
* `Super`
|
||||||
|
* `Meta`
|
||||||
|
|
||||||
## Available key codes
|
## Available key codes
|
||||||
|
|
||||||
|
|||||||
@@ -753,7 +753,8 @@ Overrides the current application's name.
|
|||||||
|
|
||||||
### `app.getLocale()`
|
### `app.getLocale()`
|
||||||
|
|
||||||
Returns `String` - The current application locale. Possible return values are documented [here](locales.md).
|
Returns `String` - The current application locale, fetched using Chromium's `l10n_util` library.
|
||||||
|
Possible return values are documented [here](https://source.chromium.org/chromium/chromium/src/+/master:ui/base/l10n/l10n_util.cc).
|
||||||
|
|
||||||
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](https://github.com/electron/electron/blob/master/docs/api/command-line-switches.md).
|
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](https://github.com/electron/electron/blob/master/docs/api/command-line-switches.md).
|
||||||
|
|
||||||
@@ -929,6 +930,10 @@ re-add a removed item to a custom category earlier than that will result in the
|
|||||||
entire custom category being omitted from the Jump List. The list of removed
|
entire custom category being omitted from the Jump List. The list of removed
|
||||||
items can be obtained using `app.getJumpListSettings()`.
|
items can be obtained using `app.getJumpListSettings()`.
|
||||||
|
|
||||||
|
**Note:** The maximum length of a Jump List item's `description` property is
|
||||||
|
260 characters. Beyond this limit, the item will not be added to the Jump
|
||||||
|
List, nor will it be displayed.
|
||||||
|
|
||||||
Here's a very simple example of creating a custom Jump List:
|
Here's a very simple example of creating a custom Jump List:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
## Class: BrowserView
|
# BrowserView
|
||||||
|
|
||||||
> Create and control views.
|
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
|
||||||
|
|
||||||
A `BrowserView` can be used to embed additional web content into a
|
A `BrowserView` can be used to embed additional web content into a
|
||||||
[`BrowserWindow`](browser-window.md). It is like a child window, except that it is positioned
|
[`BrowserWindow`](browser-window.md). It is like a child window, except that it is positioned
|
||||||
relative to its owning window. It is meant to be an alternative to the
|
relative to its owning window. It is meant to be an alternative to the
|
||||||
`webview` tag.
|
`webview` tag.
|
||||||
|
|
||||||
|
## Class: BrowserView
|
||||||
|
|
||||||
|
> Create and control views.
|
||||||
|
|
||||||
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||||||
window shadow and window animations. Default is `true`.
|
window shadow and window animations. Default is `true`.
|
||||||
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
|
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
|
||||||
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
|
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
|
||||||
`menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that using `frame: false` in combination with a vibrancy value requires that you use a non-default `titleBarStyle` as well. Also note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
|
`menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
|
||||||
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
|
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
|
||||||
option-clicking the green stoplight button on the toolbar or by clicking the
|
option-clicking the green stoplight button on the toolbar or by clicking the
|
||||||
Window > Zoom menu item. If `true`, the window will grow to the preferred
|
Window > Zoom menu item. If `true`, the window will grow to the preferred
|
||||||
@@ -267,12 +267,12 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||||||
be the absolute file path to the script.
|
be the absolute file path to the script.
|
||||||
When node integration is turned off, the preload script can reintroduce
|
When node integration is turned off, the preload script can reintroduce
|
||||||
Node global symbols back to the global scope. See example
|
Node global symbols back to the global scope. See example
|
||||||
[here](process.md#event-loaded).
|
[here](context-bridge.md#exposing-node-global-symbols).
|
||||||
* `sandbox` Boolean (optional) - If set, this will sandbox the renderer
|
* `sandbox` Boolean (optional) - If set, this will sandbox the renderer
|
||||||
associated with the window, making it compatible with the Chromium
|
associated with the window, making it compatible with the Chromium
|
||||||
OS-level sandbox and disabling the Node.js engine. This is not the same as
|
OS-level sandbox and disabling the Node.js engine. This is not the same as
|
||||||
the `nodeIntegration` option and the APIs available to the preload script
|
the `nodeIntegration` option and the APIs available to the preload script
|
||||||
are more limited. Read more about the option [here](sandbox-option.md).
|
are more limited. Read more about the option [here](../tutorial/sandbox.md).
|
||||||
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
|
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
|
||||||
Default is `false`.
|
Default is `false`.
|
||||||
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
|
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
|
||||||
@@ -1301,7 +1301,7 @@ can be be used to listen to changes to tablet mode.
|
|||||||
|
|
||||||
#### `win.getMediaSourceId()`
|
#### `win.getMediaSourceId()`
|
||||||
|
|
||||||
Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1234:0".
|
Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1324:0".
|
||||||
|
|
||||||
More precisely the format is `window:id:other_id` where `id` is `HWND` on
|
More precisely the format is `window:id:other_id` where `id` is `HWND` on
|
||||||
Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
|
Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
|
||||||
@@ -1319,6 +1319,8 @@ The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
|
|||||||
|
|
||||||
* `message` Integer
|
* `message` Integer
|
||||||
* `callback` Function
|
* `callback` Function
|
||||||
|
* `wParam` any - The `wParam` provided to the WndProc
|
||||||
|
* `lParam` any - The `lParam` provided to the WndProc
|
||||||
|
|
||||||
Hooks a windows message. The `callback` is called when
|
Hooks a windows message. The `callback` is called when
|
||||||
the message is received in the WndProc.
|
the message is received in the WndProc.
|
||||||
@@ -1371,7 +1373,7 @@ Returns `Boolean` - Whether the window's document has been edited.
|
|||||||
|
|
||||||
Returns `Promise<NativeImage>` - Resolves with a [NativeImage](native-image.md)
|
Returns `Promise<NativeImage>` - Resolves with a [NativeImage](native-image.md)
|
||||||
|
|
||||||
Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page.
|
Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty.
|
||||||
|
|
||||||
#### `win.loadURL(url[, options])`
|
#### `win.loadURL(url[, options])`
|
||||||
|
|
||||||
@@ -1380,7 +1382,7 @@ Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
|||||||
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL.
|
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL.
|
||||||
* `userAgent` String (optional) - A user agent originating the request.
|
* `userAgent` String (optional) - A user agent originating the request.
|
||||||
* `extraHeaders` String (optional) - Extra headers separated by "\n"
|
* `extraHeaders` String (optional) - Extra headers separated by "\n"
|
||||||
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md)) (optional)
|
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional)
|
||||||
* `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files.
|
* `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files.
|
||||||
|
|
||||||
Returns `Promise<void>` - the promise will resolve when the page has finished loading
|
Returns `Promise<void>` - the promise will resolve when the page has finished loading
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const request = net.request({
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `response` IncomingMessage - An object representing the HTTP response message.
|
* `response` [IncomingMessage](incoming-message.md) - An object representing the HTTP response message.
|
||||||
|
|
||||||
#### Event: 'login'
|
#### Event: 'login'
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
|
|||||||
earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
|
earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
|
||||||
environment variable to achieve the same effect.
|
environment variable to achieve the same effect.
|
||||||
|
|
||||||
|
### --force-fieldtrials=`trials`
|
||||||
|
|
||||||
|
Field trials to be forcefully enabled or disabled.
|
||||||
|
|
||||||
|
For example: `WebRTC-Audio-Red-For-Opus/Enabled/`
|
||||||
|
|
||||||
### --host-rules=`rules`
|
### --host-rules=`rules`
|
||||||
|
|
||||||
A comma-separated list of `rules` that control how hostnames are mapped.
|
A comma-separated list of `rules` that control how hostnames are mapped.
|
||||||
@@ -136,7 +142,8 @@ proxy server flags that are passed.
|
|||||||
|
|
||||||
### --no-sandbox
|
### --no-sandbox
|
||||||
|
|
||||||
Disables Chromium sandbox, which is now enabled by default.
|
Disables the Chromium [sandbox](https://www.chromium.org/developers/design-documents/sandbox).
|
||||||
|
Forces renderer process and Chromium helper processes to run un-sandboxed.
|
||||||
Should only be used for testing.
|
Should only be used for testing.
|
||||||
|
|
||||||
### --proxy-bypass-list=`hosts`
|
### --proxy-bypass-list=`hosts`
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ page you load in your renderer executes code in this world.
|
|||||||
|
|
||||||
### Isolated World
|
### Isolated World
|
||||||
|
|
||||||
When `contextIsolation` is enabled in your `webPreferences`, your `preload` scripts run in an
|
When `contextIsolation` is enabled in your `webPreferences` (this is the default behavior since Electron 12.0.0), your `preload` scripts run in an
|
||||||
"Isolated World". You can read more about context isolation and what it affects in the
|
"Isolated World". You can read more about context isolation and what it affects in the
|
||||||
[security](../tutorial/security.md#3-enable-context-isolation-for-remote-content) docs.
|
[security](../tutorial/security.md#3-enable-context-isolation-for-remote-content) docs.
|
||||||
|
|
||||||
@@ -110,3 +110,22 @@ has been included below for completeness:
|
|||||||
| `Symbol` | N/A | ❌ | ❌ | Symbols cannot be copied across contexts so they are dropped |
|
| `Symbol` | N/A | ❌ | ❌ | Symbols cannot be copied across contexts so they are dropped |
|
||||||
|
|
||||||
If the type you care about is not in the above table, it is probably not supported.
|
If the type you care about is not in the above table, it is probably not supported.
|
||||||
|
|
||||||
|
### Exposing Node Global Symbols
|
||||||
|
|
||||||
|
The `contextBridge` can be used by the preload script to give your renderer access to Node APIs.
|
||||||
|
The table of supported types described above also applies to Node APIs that you expose through `contextBridge`.
|
||||||
|
Please note that many Node APIs grant access to local system resources.
|
||||||
|
Be very cautious about which globals and APIs you expose to untrusted remote content.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const { contextBridge } = require('electron')
|
||||||
|
const crypto = require('crypto')
|
||||||
|
contextBridge.exposeInMainWorld('nodeCrypto', {
|
||||||
|
sha256sum (data) {
|
||||||
|
const hash = crypto.createHash('sha256')
|
||||||
|
hash.update(data)
|
||||||
|
return hash.digest('hex')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ The following events are available on instances of `Cookies`:
|
|||||||
|
|
||||||
#### Event: 'changed'
|
#### Event: 'changed'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
* `event` Event
|
* `event` Event
|
||||||
* `cookie` [Cookie](structures/cookie.md) - The cookie that was changed.
|
* `cookie` [Cookie](structures/cookie.md) - The cookie that was changed.
|
||||||
* `cause` String - The cause of the change with one of the following values:
|
* `cause` String - The cause of the change with one of the following values:
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ The `crashReporter` module has the following methods:
|
|||||||
### `crashReporter.start(options)`
|
### `crashReporter.start(options)`
|
||||||
|
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `submitURL` String - URL that crash reports will be sent to as POST.
|
* `submitURL` String (optional) - URL that crash reports will be sent to as
|
||||||
|
POST. Required unless `uploadToServer` is `false`.
|
||||||
* `productName` String (optional) - Defaults to `app.name`.
|
* `productName` String (optional) - Defaults to `app.name`.
|
||||||
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
|
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
|
||||||
`{ globalExtra: { _companyName: ... } }`.
|
`{ globalExtra: { _companyName: ... } }`.
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ dialog.showOpenDialog(mainWindow, {
|
|||||||
|
|
||||||
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
|
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `title` String (optional)
|
* `title` String (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
|
||||||
* `defaultPath` String (optional) - Absolute directory path, absolute file
|
* `defaultPath` String (optional) - Absolute directory path, absolute file
|
||||||
path, or file name to use by default.
|
path, or file name to use by default.
|
||||||
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
|
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
|
||||||
@@ -185,7 +185,7 @@ The `filters` specifies an array of file types that can be displayed, see
|
|||||||
|
|
||||||
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
|
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `title` String (optional)
|
* `title` String (optional) - The dialog title. Cannot be displayed on some _Linux_ desktop environments.
|
||||||
* `defaultPath` String (optional) - Absolute directory path, absolute file
|
* `defaultPath` String (optional) - Absolute directory path, absolute file
|
||||||
path, or file name to use by default.
|
path, or file name to use by default.
|
||||||
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
|
* `buttonLabel` String (optional) - Custom label for the confirmation button, when
|
||||||
|
|||||||
@@ -83,8 +83,10 @@ win.show()
|
|||||||
blur effect to the content below the window (i.e. other applications open on
|
blur effect to the content below the window (i.e. other applications open on
|
||||||
the user's system).
|
the user's system).
|
||||||
* The window will not be transparent when DevTools is opened.
|
* The window will not be transparent when DevTools is opened.
|
||||||
* On Windows operating systems, transparent windows will not work when DWM is
|
* On Windows operating systems,
|
||||||
|
* transparent windows will not work when DWM is
|
||||||
disabled.
|
disabled.
|
||||||
|
* transparent windows can not be maximized using the Windows system menu or by double clicking the title bar. The reasoning behind this can be seen on [this pull request](https://github.com/electron/electron/pull/28207).
|
||||||
* On Linux, users have to put `--enable-transparent-visuals --disable-gpu` in
|
* On Linux, users have to put `--enable-transparent-visuals --disable-gpu` in
|
||||||
the command line to disable GPU and allow ARGB to make transparent window,
|
the command line to disable GPU and allow ARGB to make transparent window,
|
||||||
this is caused by an upstream bug that [alpha channel doesn't work on some
|
this is caused by an upstream bug that [alpha channel doesn't work on some
|
||||||
|
|||||||
@@ -1,142 +0,0 @@
|
|||||||
# Locales
|
|
||||||
|
|
||||||
> Locale values returned by `app.getLocale()`.
|
|
||||||
|
|
||||||
Electron uses Chromium's `l10n_util` library to fetch the locale. Possible
|
|
||||||
values are listed below:
|
|
||||||
|
|
||||||
| Language Code | Language Name |
|
|
||||||
|---------------|---------------|
|
|
||||||
| af | Afrikaans |
|
|
||||||
| am | Amharic |
|
|
||||||
| ar | Arabic |
|
|
||||||
| az | Azerbaijani |
|
|
||||||
| be | Belarusian |
|
|
||||||
| bg | Bulgarian |
|
|
||||||
| bh | Bihari |
|
|
||||||
| bn | Bengali |
|
|
||||||
| br | Breton |
|
|
||||||
| bs | Bosnian |
|
|
||||||
| ca | Catalan |
|
|
||||||
| co | Corsican |
|
|
||||||
| cs | Czech |
|
|
||||||
| cy | Welsh |
|
|
||||||
| da | Danish |
|
|
||||||
| de | German |
|
|
||||||
| de-AT | German (Austria) |
|
|
||||||
| de-CH | German (Switzerland) |
|
|
||||||
| de-DE | German (Germany) |
|
|
||||||
| el | Greek |
|
|
||||||
| en | English |
|
|
||||||
| en-AU | English (Australia) |
|
|
||||||
| en-CA | English (Canada) |
|
|
||||||
| en-GB | English (UK) |
|
|
||||||
| en-NZ | English (New Zealand) |
|
|
||||||
| en-US | English (US) |
|
|
||||||
| en-ZA | English (South Africa) |
|
|
||||||
| eo | Esperanto |
|
|
||||||
| es | Spanish |
|
|
||||||
| es-419 | Spanish (Latin America) |
|
|
||||||
| et | Estonian |
|
|
||||||
| eu | Basque |
|
|
||||||
| fa | Persian |
|
|
||||||
| fi | Finnish |
|
|
||||||
| fil | Filipino |
|
|
||||||
| fo | Faroese |
|
|
||||||
| fr | French |
|
|
||||||
| fr-CA | French (Canada) |
|
|
||||||
| fr-CH | French (Switzerland) |
|
|
||||||
| fr-FR | French (France) |
|
|
||||||
| fy | Frisian |
|
|
||||||
| ga | Irish |
|
|
||||||
| gd | Scots Gaelic |
|
|
||||||
| gl | Galician |
|
|
||||||
| gn | Guarani |
|
|
||||||
| gu | Gujarati |
|
|
||||||
| ha | Hausa |
|
|
||||||
| haw | Hawaiian |
|
|
||||||
| he | Hebrew |
|
|
||||||
| hi | Hindi |
|
|
||||||
| hr | Croatian |
|
|
||||||
| hu | Hungarian |
|
|
||||||
| hy | Armenian |
|
|
||||||
| ia | Interlingua |
|
|
||||||
| id | Indonesian |
|
|
||||||
| is | Icelandic |
|
|
||||||
| it | Italian |
|
|
||||||
| it-CH | Italian (Switzerland) |
|
|
||||||
| it-IT | Italian (Italy) |
|
|
||||||
| ja | Japanese |
|
|
||||||
| jw | Javanese |
|
|
||||||
| ka | Georgian |
|
|
||||||
| kk | Kazakh |
|
|
||||||
| km | Cambodian |
|
|
||||||
| kn | Kannada |
|
|
||||||
| ko | Korean |
|
|
||||||
| ku | Kurdish |
|
|
||||||
| ky | Kyrgyz |
|
|
||||||
| la | Latin |
|
|
||||||
| ln | Lingala |
|
|
||||||
| lo | Laothian |
|
|
||||||
| lt | Lithuanian |
|
|
||||||
| lv | Latvian |
|
|
||||||
| mk | Macedonian |
|
|
||||||
| ml | Malayalam |
|
|
||||||
| mn | Mongolian |
|
|
||||||
| mo | Moldavian |
|
|
||||||
| mr | Marathi |
|
|
||||||
| ms | Malay |
|
|
||||||
| mt | Maltese |
|
|
||||||
| nb | Norwegian (Bokmal) |
|
|
||||||
| ne | Nepali |
|
|
||||||
| nl | Dutch |
|
|
||||||
| nn | Norwegian (Nynorsk) |
|
|
||||||
| no | Norwegian |
|
|
||||||
| oc | Occitan |
|
|
||||||
| om | Oromo |
|
|
||||||
| or | Oriya |
|
|
||||||
| pa | Punjabi |
|
|
||||||
| pl | Polish |
|
|
||||||
| ps | Pashto |
|
|
||||||
| pt | Portuguese |
|
|
||||||
| pt-BR | Portuguese (Brazil) |
|
|
||||||
| pt-PT | Portuguese (Portugal) |
|
|
||||||
| qu | Quechua |
|
|
||||||
| rm | Romansh |
|
|
||||||
| ro | Romanian |
|
|
||||||
| ru | Russian |
|
|
||||||
| sd | Sindhi |
|
|
||||||
| sh | Serbo-Croatian |
|
|
||||||
| si | Sinhalese |
|
|
||||||
| sk | Slovak |
|
|
||||||
| sl | Slovenian |
|
|
||||||
| sn | Shona |
|
|
||||||
| so | Somali |
|
|
||||||
| sq | Albanian |
|
|
||||||
| sr | Serbian |
|
|
||||||
| st | Sesotho |
|
|
||||||
| su | Sundanese |
|
|
||||||
| sv | Swedish |
|
|
||||||
| sw | Swahili |
|
|
||||||
| ta | Tamil |
|
|
||||||
| te | Telugu |
|
|
||||||
| tg | Tajik |
|
|
||||||
| th | Thai |
|
|
||||||
| ti | Tigrinya |
|
|
||||||
| tk | Turkmen |
|
|
||||||
| to | Tonga |
|
|
||||||
| tr | Turkish |
|
|
||||||
| tt | Tatar |
|
|
||||||
| tw | Twi |
|
|
||||||
| ug | Uighur |
|
|
||||||
| uk | Ukrainian |
|
|
||||||
| ur | Urdu |
|
|
||||||
| uz | Uzbek |
|
|
||||||
| vi | Vietnamese |
|
|
||||||
| xh | Xhosa |
|
|
||||||
| yi | Yiddish |
|
|
||||||
| yo | Yoruba |
|
|
||||||
| zh | Chinese |
|
|
||||||
| zh-CN | Chinese (Simplified) |
|
|
||||||
| zh-TW | Chinese (Traditional) |
|
|
||||||
| zu | Zulu |
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Menu
|
||||||
|
|
||||||
## Class: Menu
|
## Class: Menu
|
||||||
|
|
||||||
> Create native application menus and context menus.
|
> Create native application menus and context menus.
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ channel messaging.
|
|||||||
|
|
||||||
## Class: MessageChannelMain
|
## Class: MessageChannelMain
|
||||||
|
|
||||||
|
> Channel interface for channel messaging in the main process.
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Main process
|
// Main process
|
||||||
|
const { MessageChannelMain } = require('electron')
|
||||||
const { port1, port2 } = new MessageChannelMain()
|
const { port1, port2 } = new MessageChannelMain()
|
||||||
w.webContents.postMessage('port', null, [port2])
|
w.webContents.postMessage('port', null, [port2])
|
||||||
port1.postMessage({ some: 'message' })
|
port1.postMessage({ some: 'message' })
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ channel messaging.
|
|||||||
|
|
||||||
## Class: MessagePortMain
|
## Class: MessagePortMain
|
||||||
|
|
||||||
|
> Port interface for channel messaging in the main process.
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|||||||
@@ -30,11 +30,13 @@ In sandboxed renderers the `process` object contains only a subset of the APIs:
|
|||||||
* `arch`
|
* `arch`
|
||||||
* `platform`
|
* `platform`
|
||||||
* `sandboxed`
|
* `sandboxed`
|
||||||
|
* `contextIsolated`
|
||||||
* `type`
|
* `type`
|
||||||
* `version`
|
* `version`
|
||||||
* `versions`
|
* `versions`
|
||||||
* `mas`
|
* `mas`
|
||||||
* `windowsStore`
|
* `windowsStore`
|
||||||
|
* `contextId`
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
@@ -43,19 +45,6 @@ In sandboxed renderers the `process` object contains only a subset of the APIs:
|
|||||||
Emitted when Electron has loaded its internal initialization script and is
|
Emitted when Electron has loaded its internal initialization script and is
|
||||||
beginning to load the web page or the main script.
|
beginning to load the web page or the main script.
|
||||||
|
|
||||||
It can be used by the preload script to add removed Node global symbols back to
|
|
||||||
the global scope when node integration is turned off:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// preload.js
|
|
||||||
const _setImmediate = setImmediate
|
|
||||||
const _clearImmediate = clearImmediate
|
|
||||||
process.once('loaded', () => {
|
|
||||||
global.setImmediate = _setImmediate
|
|
||||||
global.clearImmediate = _clearImmediate
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
### `process.defaultApp` _Readonly_
|
### `process.defaultApp` _Readonly_
|
||||||
@@ -93,6 +82,11 @@ A `String` representing the path to the resources directory.
|
|||||||
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
|
A `Boolean`. When the renderer process is sandboxed, this property is `true`,
|
||||||
otherwise it is `undefined`.
|
otherwise it is `undefined`.
|
||||||
|
|
||||||
|
### `process.contextIsolated` _Readonly_
|
||||||
|
|
||||||
|
A `Boolean` that indicates whether the current renderer context has `contextIsolation` enabled.
|
||||||
|
It is `undefined` in the main process.
|
||||||
|
|
||||||
### `process.throwDeprecation`
|
### `process.throwDeprecation`
|
||||||
|
|
||||||
A `Boolean` that controls whether or not deprecation warnings will be thrown as
|
A `Boolean` that controls whether or not deprecation warnings will be thrown as
|
||||||
@@ -133,6 +127,13 @@ A `String` representing Electron's version string.
|
|||||||
A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
|
A `Boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
|
||||||
for otherwise it is `undefined`.
|
for otherwise it is `undefined`.
|
||||||
|
|
||||||
|
### `process.contextId` _Readonly_
|
||||||
|
|
||||||
|
A `String` (optional) representing a globally unique ID of the current JavaScript context.
|
||||||
|
Each frame has its own JavaScript context. When contextIsolation is enabled, the isolated
|
||||||
|
world also has a separate JavaScript context.
|
||||||
|
This property is only available in the renderer process.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
The `process` object has the following methods:
|
The `process` object has the following methods:
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
# `sandbox` Option
|
|
||||||
|
|
||||||
> Create a browser window with a sandboxed renderer. With this
|
|
||||||
option enabled, the renderer must communicate via IPC to the main process in order to access node APIs.
|
|
||||||
|
|
||||||
One of the key security features of Chromium is that all blink rendering/JavaScript
|
|
||||||
code is executed within a sandbox. This sandbox uses OS-specific features to ensure
|
|
||||||
that exploits in the renderer process cannot harm the system.
|
|
||||||
|
|
||||||
In other words, when the sandbox is enabled, the renderers can only make changes
|
|
||||||
to the system by delegating tasks to the main process via IPC.
|
|
||||||
[Here's](https://www.chromium.org/developers/design-documents/sandbox) more
|
|
||||||
information about the sandbox.
|
|
||||||
|
|
||||||
Since a major feature in Electron is the ability to run Node.js in the
|
|
||||||
renderer process (making it easier to develop desktop applications using web
|
|
||||||
technologies), the sandbox is disabled by electron. This is because
|
|
||||||
most Node.js APIs require system access. `require()` for example, is not
|
|
||||||
possible without file system permissions, which are not available in a sandboxed
|
|
||||||
environment.
|
|
||||||
|
|
||||||
Usually this is not a problem for desktop applications since the code is always
|
|
||||||
trusted, but it makes Electron less secure than Chromium for displaying
|
|
||||||
untrusted web content. For applications that require more security, the
|
|
||||||
`sandbox` flag will force Electron to spawn a classic Chromium renderer that is
|
|
||||||
compatible with the sandbox.
|
|
||||||
|
|
||||||
A sandboxed renderer doesn't have a Node.js environment running and doesn't
|
|
||||||
expose Node.js JavaScript APIs to client code. The only exception is the preload script,
|
|
||||||
which has access to a subset of the Electron renderer API.
|
|
||||||
|
|
||||||
Another difference is that sandboxed renderers don't modify any of the default
|
|
||||||
JavaScript APIs. Consequently, some APIs such as `window.open` will work as they
|
|
||||||
do in Chromium (i.e. they do not return a [`BrowserWindowProxy`](browser-window-proxy.md)).
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
To create a sandboxed window, pass `sandbox: true` to `webPreferences`:
|
|
||||||
|
|
||||||
```js
|
|
||||||
let win
|
|
||||||
app.whenReady().then(() => {
|
|
||||||
win = new BrowserWindow({
|
|
||||||
webPreferences: {
|
|
||||||
sandbox: true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
win.loadURL('http://google.com')
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
In the above code the [`BrowserWindow`](browser-window.md) that was created has Node.js disabled and can communicate
|
|
||||||
only via IPC. The use of this option stops Electron from creating a Node.js runtime in the renderer. Also,
|
|
||||||
within this new window `window.open` follows the native behavior (by default Electron creates a [`BrowserWindow`](browser-window.md)
|
|
||||||
and returns a proxy to this via `window.open`).
|
|
||||||
|
|
||||||
[`app.enableSandbox`](app.md#appenablesandbox) can be used to force `sandbox: true` for all `BrowserWindow` instances.
|
|
||||||
|
|
||||||
```js
|
|
||||||
let win
|
|
||||||
app.enableSandbox()
|
|
||||||
app.whenReady().then(() => {
|
|
||||||
// no need to pass `sandbox: true` since `app.enableSandbox()` was called.
|
|
||||||
win = new BrowserWindow()
|
|
||||||
win.loadURL('http://google.com')
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
## Preload
|
|
||||||
|
|
||||||
An app can make customizations to sandboxed renderers using a preload script.
|
|
||||||
Here's an example:
|
|
||||||
|
|
||||||
```js
|
|
||||||
let win
|
|
||||||
app.whenReady().then(() => {
|
|
||||||
win = new BrowserWindow({
|
|
||||||
webPreferences: {
|
|
||||||
sandbox: true,
|
|
||||||
preload: path.join(app.getAppPath(), 'preload.js')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
win.loadURL('http://google.com')
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
and preload.js:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// This file is loaded whenever a javascript context is created. It runs in a
|
|
||||||
// private scope that can access a subset of Electron renderer APIs. Without
|
|
||||||
// contextIsolation enabled, it's possible to accidentally leak privileged
|
|
||||||
// globals like ipcRenderer to web content.
|
|
||||||
const { ipcRenderer } = require('electron')
|
|
||||||
|
|
||||||
const defaultWindowOpen = window.open
|
|
||||||
|
|
||||||
window.open = function customWindowOpen (url, ...args) {
|
|
||||||
ipcRenderer.send('report-window-open', location.origin, url, args)
|
|
||||||
return defaultWindowOpen(url + '?from_electron=1', ...args)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Important things to notice in the preload script:
|
|
||||||
|
|
||||||
- Even though the sandboxed renderer doesn't have Node.js running, it still has
|
|
||||||
access to a limited node-like environment: `Buffer`, `process`, `setImmediate`,
|
|
||||||
`clearImmediate` and `require` are available.
|
|
||||||
- The preload script must be contained in a single script, but it is possible to have
|
|
||||||
complex preload code composed with multiple modules by using a tool like
|
|
||||||
webpack or browserify. An example of using browserify is below.
|
|
||||||
|
|
||||||
To create a browserify bundle and use it as a preload script, something like
|
|
||||||
the following should be used:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
browserify preload/index.js \
|
|
||||||
-x electron \
|
|
||||||
--insert-global-vars=__filename,__dirname -o preload.js
|
|
||||||
```
|
|
||||||
|
|
||||||
The `-x` flag should be used with any required module that is already exposed in
|
|
||||||
the preload scope, and tells browserify to use the enclosing `require` function
|
|
||||||
for it. `--insert-global-vars` will ensure that `process`, `Buffer` and
|
|
||||||
`setImmediate` are also taken from the enclosing scope(normally browserify
|
|
||||||
injects code for those).
|
|
||||||
|
|
||||||
Currently the `require` function provided in the preload scope exposes the
|
|
||||||
following modules:
|
|
||||||
|
|
||||||
- `electron`
|
|
||||||
- `crashReporter`
|
|
||||||
- `desktopCapturer`
|
|
||||||
- `ipcRenderer`
|
|
||||||
- `nativeImage`
|
|
||||||
- `webFrame`
|
|
||||||
- `events`
|
|
||||||
- `timers`
|
|
||||||
- `url`
|
|
||||||
|
|
||||||
More may be added as needed to expose more Electron APIs in the sandbox.
|
|
||||||
|
|
||||||
## Rendering untrusted content
|
|
||||||
|
|
||||||
Rendering untrusted content in Electron is still somewhat uncharted territory,
|
|
||||||
though some apps are finding success (e.g. Beaker Browser). Our goal is to get
|
|
||||||
as close to Chrome as we can in terms of the security of sandboxed content, but
|
|
||||||
ultimately we will always be behind due to a few fundamental issues:
|
|
||||||
|
|
||||||
1. We do not have the dedicated resources or expertise that Chromium has to
|
|
||||||
apply to the security of its product. We do our best to make use of what we
|
|
||||||
have, to inherit everything we can from Chromium, and to respond quickly to
|
|
||||||
security issues, but Electron cannot be as secure as Chromium without the
|
|
||||||
resources that Chromium is able to dedicate.
|
|
||||||
2. Some security features in Chrome (such as Safe Browsing and Certificate
|
|
||||||
Transparency) require a centralized authority and dedicated servers, both of
|
|
||||||
which run counter to the goals of the Electron project. As such, we disable
|
|
||||||
those features in Electron, at the cost of the associated security they
|
|
||||||
would otherwise bring.
|
|
||||||
3. There is only one Chromium, whereas there are many thousands of apps built
|
|
||||||
on Electron, all of which behave slightly differently. Accounting for those
|
|
||||||
differences can yield a huge possibility space, and make it challenging to
|
|
||||||
ensure the security of the platform in unusual use cases.
|
|
||||||
4. We can't push security updates to users directly, so we rely on app vendors
|
|
||||||
to upgrade the version of Electron underlying their app in order for
|
|
||||||
security updates to reach users.
|
|
||||||
|
|
||||||
Here are some things to consider before rendering untrusted content:
|
|
||||||
|
|
||||||
- A preload script can accidentally leak privileged APIs to untrusted code,
|
|
||||||
unless [`contextIsolation`](../tutorial/security.md#3-enable-context-isolation-for-remote-content)
|
|
||||||
is also enabled.
|
|
||||||
- Some bug in the V8 engine may allow malicious code to access the renderer
|
|
||||||
preload APIs, effectively granting full access to the system through the
|
|
||||||
`remote` module. Therefore, it is highly recommended to [disable the `remote`
|
|
||||||
module](../tutorial/security.md#15-disable-the-remote-module).
|
|
||||||
If disabling is not feasible, you should selectively [filter the `remote`
|
|
||||||
module](../tutorial/security.md#16-filter-the-remote-module).
|
|
||||||
- While we make our best effort to backport Chromium security fixes to older
|
|
||||||
versions of Electron, we do not make a guarantee that every fix will be
|
|
||||||
backported. Your best chance at staying secure is to be on the latest stable
|
|
||||||
version of Electron.
|
|
||||||
@@ -822,6 +822,11 @@ Returns `Extension[]` - A list of all loaded extensions.
|
|||||||
**Note:** This API cannot be called before the `ready` event of the `app` module
|
**Note:** This API cannot be called before the `ready` event of the `app` module
|
||||||
is emitted.
|
is emitted.
|
||||||
|
|
||||||
|
#### `ses.getStoragePath()`
|
||||||
|
|
||||||
|
A `String | null` indicating the absolute file system path where data for this
|
||||||
|
session is persisted on disk. For in memory sessions this returns `null`.
|
||||||
|
|
||||||
### Instance Properties
|
### Instance Properties
|
||||||
|
|
||||||
The following properties are available on instances of `Session`:
|
The following properties are available on instances of `Session`:
|
||||||
@@ -835,6 +840,11 @@ code to the `setSpellCheckerLanguages` API that isn't in this array will result
|
|||||||
|
|
||||||
A `Boolean` indicating whether builtin spell checker is enabled.
|
A `Boolean` indicating whether builtin spell checker is enabled.
|
||||||
|
|
||||||
|
#### `ses.storagePath` _Readonly_
|
||||||
|
|
||||||
|
A `String | null` indicating the absolute file system path where data for this
|
||||||
|
session is persisted on disk. For in memory sessions this returns `null`.
|
||||||
|
|
||||||
#### `ses.cookies` _Readonly_
|
#### `ses.cookies` _Readonly_
|
||||||
|
|
||||||
A [`Cookies`](cookies.md) object for this session.
|
A [`Cookies`](cookies.md) object for this session.
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
## Class: ShareMenu
|
# ShareMenu
|
||||||
|
|
||||||
> Create share menu on macOS.
|
|
||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
|
||||||
|
|
||||||
The `ShareMenu` class creates [Share Menu][share-menu] on macOS, which can be
|
The `ShareMenu` class creates [Share Menu][share-menu] on macOS, which can be
|
||||||
used to share information from the current context to apps, social media
|
used to share information from the current context to apps, social media
|
||||||
@@ -11,6 +7,12 @@ accounts, and other services.
|
|||||||
For including the share menu as a submenu of other menus, please use the
|
For including the share menu as a submenu of other menus, please use the
|
||||||
`shareMenu` role of [`MenuItem`](menu-item.md).
|
`shareMenu` role of [`MenuItem`](menu-item.md).
|
||||||
|
|
||||||
|
## Class: ShareMenu
|
||||||
|
|
||||||
|
> Create share menu on macOS.
|
||||||
|
|
||||||
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
### `new ShareMenu(sharingItem)`
|
### `new ShareMenu(sharingItem)`
|
||||||
|
|
||||||
* `sharingItem` SharingItem - The item to share.
|
* `sharingItem` SharingItem - The item to share.
|
||||||
|
|||||||
@@ -19,3 +19,7 @@
|
|||||||
property set then its `type` is assumed to be `tasks`. If the `name` property
|
property set then its `type` is assumed to be `tasks`. If the `name` property
|
||||||
is set but the `type` property is omitted then the `type` is assumed to be
|
is set but the `type` property is omitted then the `type` is assumed to be
|
||||||
`custom`.
|
`custom`.
|
||||||
|
|
||||||
|
**Note:** The maximum length of a Jump List item's `description` property is
|
||||||
|
260 characters. Beyond this limit, the item will not be added to the Jump
|
||||||
|
List, nor will it be displayed.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* `title` String (optional) - The text to be displayed for the item in the Jump List.
|
* `title` String (optional) - The text to be displayed for the item in the Jump List.
|
||||||
Should only be set if `type` is `task`.
|
Should only be set if `type` is `task`.
|
||||||
* `description` String (optional) - Description of the task (displayed in a tooltip).
|
* `description` String (optional) - Description of the task (displayed in a tooltip).
|
||||||
Should only be set if `type` is `task`.
|
Should only be set if `type` is `task`. Maximum length 260 characters.
|
||||||
* `iconPath` String (optional) - The absolute path to an icon to be displayed in a
|
* `iconPath` String (optional) - The absolute path to an icon to be displayed in a
|
||||||
Jump List, which can be an arbitrary resource file that contains an icon
|
Jump List, which can be an arbitrary resource file that contains an icon
|
||||||
(e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to
|
(e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# PostBody Object
|
# PostBody Object
|
||||||
|
|
||||||
* `data` Array<[PostData](./post-data.md)> - The post data to be sent to the
|
* `data` ([UploadRawData](upload-raw-data.md) | [UploadFile](upload-file.md))[] - The post data to be sent to the
|
||||||
new window.
|
new window.
|
||||||
* `contentType` String - The `content-type` header used for the data. One of
|
* `contentType` String - The `content-type` header used for the data. One of
|
||||||
`application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to
|
`application/x-www-form-urlencoded` or `multipart/form-data`. Corresponds to
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
# PostData Object
|
|
||||||
|
|
||||||
* `type` String - One of the following:
|
|
||||||
* `rawData` - The data is available as a `Buffer`, in the `rawData` field.
|
|
||||||
* `file` - The object represents a file. The `filePath`, `offset`, `length`
|
|
||||||
and `modificationTime` fields will be used to describe the file.
|
|
||||||
* `blob` - The object represents a `Blob`. The `blobUUID` field will be used
|
|
||||||
to describe the `Blob`.
|
|
||||||
* `bytes` String (optional) - The raw bytes of the post data in a `Buffer`.
|
|
||||||
Required for the `rawData` type.
|
|
||||||
* `filePath` String (optional) - The path of the file being uploaded. Required
|
|
||||||
for the `file` type.
|
|
||||||
* `blobUUID` String (optional) - The `UUID` of the `Blob` being uploaded.
|
|
||||||
Required for the `blob` type.
|
|
||||||
* `offset` Integer (optional) - The offset from the beginning of the file being
|
|
||||||
uploaded, in bytes. Only valid for `file` types.
|
|
||||||
* `length` Integer (optional) - The length of the file being uploaded, in bytes.
|
|
||||||
If set to `-1`, the whole file will be uploaded. Only valid for `file` types.
|
|
||||||
* `modificationTime` Double (optional) - The modification time of the file
|
|
||||||
represented by a double, which is the number of seconds since the `UNIX Epoch`
|
|
||||||
(Jan 1, 1970). Only valid for `file` types.
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# UploadFile Object
|
# UploadFile Object
|
||||||
|
|
||||||
* `type` String - `file`.
|
* `type` 'file' - `file`.
|
||||||
* `filePath` String - Path of file to be uploaded.
|
* `filePath` String - Path of file to be uploaded.
|
||||||
* `offset` Integer - Defaults to `0`.
|
* `offset` Integer - Defaults to `0`.
|
||||||
* `length` Integer - Number of bytes to read from `offset`.
|
* `length` Integer - Number of bytes to read from `offset`.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# UploadRawData Object
|
# UploadRawData Object
|
||||||
|
|
||||||
* `type` String - `rawData`.
|
* `type` 'rawData' - `rawData`.
|
||||||
* `bytes` Buffer - Data to be uploaded.
|
* `bytes` Buffer - Data to be uploaded.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ either process type.
|
|||||||
|
|
||||||
The basic rule is: if a module is [GUI][gui] or low-level system related, then
|
The basic rule is: if a module is [GUI][gui] or low-level system related, then
|
||||||
it should be only available in the main process. You need to be familiar with
|
it should be only available in the main process. You need to be familiar with
|
||||||
the concept of [main process vs. renderer process](../tutorial/quick-start.md#main-and-renderer-processes)
|
the concept of main process vs. renderer process
|
||||||
scripts to be able to use those modules.
|
scripts to be able to use those modules.
|
||||||
|
|
||||||
The main process script is like a normal Node.js script:
|
The main process script is like a normal Node.js script:
|
||||||
@@ -43,8 +43,6 @@ extra ability to use node modules if `nodeIntegration` is enabled:
|
|||||||
</html>
|
</html>
|
||||||
```
|
```
|
||||||
|
|
||||||
To run your app, read [Run your app](../tutorial/quick-start.md#run-your-application).
|
|
||||||
|
|
||||||
## Destructuring assignment
|
## Destructuring assignment
|
||||||
|
|
||||||
As of 0.37, you can use
|
As of 0.37, you can use
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
|
|||||||
* `userInfo` Record<String, unknown>
|
* `userInfo` Record<String, unknown>
|
||||||
* `object` String
|
* `object` String
|
||||||
|
|
||||||
|
Returns `Number` - The ID of this subscription
|
||||||
|
|
||||||
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
|
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
|
||||||
This is necessary for events such as `NSWorkspaceDidActivateApplicationNotification`.
|
This is necessary for events such as `NSWorkspaceDidActivateApplicationNotification`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# TouchBar
|
||||||
|
|
||||||
## Class: TouchBar
|
## Class: TouchBar
|
||||||
|
|
||||||
> Create TouchBar layouts for native macOS applications
|
> Create TouchBar layouts for native macOS applications
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Tray
|
||||||
|
|
||||||
## Class: Tray
|
## Class: Tray
|
||||||
|
|
||||||
> Add icons and context menus to the system's notification area.
|
> Add icons and context menus to the system's notification area.
|
||||||
|
|||||||
@@ -914,7 +914,7 @@ in `webPreferences`.
|
|||||||
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url.
|
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url.
|
||||||
* `userAgent` String (optional) - A user agent originating the request.
|
* `userAgent` String (optional) - A user agent originating the request.
|
||||||
* `extraHeaders` String (optional) - Extra headers separated by "\n".
|
* `extraHeaders` String (optional) - Extra headers separated by "\n".
|
||||||
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md)) (optional)
|
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional)
|
||||||
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
|
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
|
||||||
|
|
||||||
Returns `Promise<void>` - the promise will resolve when the page has finished loading
|
Returns `Promise<void>` - the promise will resolve when the page has finished loading
|
||||||
@@ -1184,6 +1184,16 @@ Ignore application menu shortcuts while this web contents is focused.
|
|||||||
* `url` String - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
* `url` String - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
||||||
* `frameName` String - Name of the window provided in `window.open()`
|
* `frameName` String - Name of the window provided in `window.open()`
|
||||||
* `features` String - Comma separated list of window features provided to `window.open()`.
|
* `features` String - Comma separated list of window features provided to `window.open()`.
|
||||||
|
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
|
||||||
|
`new-window`, `save-to-disk` or `other`.
|
||||||
|
* `referrer` [Referrer](structures/referrer.md) - The referrer that will be
|
||||||
|
passed to the new window. May or may not result in the `Referer` header being
|
||||||
|
sent, depending on the referrer policy.
|
||||||
|
* `postBody` [PostBody](structures/post-body.md) (optional) - The post data that
|
||||||
|
will be sent to the new window, along with the appropriate headers that will
|
||||||
|
be set. If no post data is to be sent, the value will be `null`. Only defined
|
||||||
|
when the window is being created by a form that set `target=_blank`.
|
||||||
|
|
||||||
Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
|
Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
|
||||||
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
|
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
|
||||||
Returning an unrecognized value such as a null, undefined, or an object
|
Returning an unrecognized value such as a null, undefined, or an object
|
||||||
@@ -1320,8 +1330,7 @@ Inserts `text` to the focused element.
|
|||||||
* `text` String - Content to be searched, must not be empty.
|
* `text` String - Content to be searched, must not be empty.
|
||||||
* `options` Object (optional)
|
* `options` Object (optional)
|
||||||
* `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
|
* `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
|
||||||
* `findNext` Boolean (optional) - Whether the operation is first request or a follow up,
|
* `findNext` Boolean (optional) - Whether to begin a new text finding session with this request. Should be `true` for initial requests, and `false` for follow-up requests. Defaults to `false`.
|
||||||
defaults to `false`.
|
|
||||||
* `matchCase` Boolean (optional) - Whether search should be case-sensitive,
|
* `matchCase` Boolean (optional) - Whether search should be case-sensitive,
|
||||||
defaults to `false`.
|
defaults to `false`.
|
||||||
|
|
||||||
@@ -1363,19 +1372,21 @@ Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
|
|||||||
Returns `Boolean` - Whether this page is being captured. It returns true when the capturer count
|
Returns `Boolean` - Whether this page is being captured. It returns true when the capturer count
|
||||||
is large then 0.
|
is large then 0.
|
||||||
|
|
||||||
#### `contents.incrementCapturerCount([size, stayHidden])`
|
#### `contents.incrementCapturerCount([size, stayHidden, stayAwake])`
|
||||||
|
|
||||||
* `size` [Size](structures/size.md) (optional) - The preferred size for the capturer.
|
* `size` [Size](structures/size.md) (optional) - The preferred size for the capturer.
|
||||||
* `stayHidden` Boolean (optional) - Keep the page hidden instead of visible.
|
* `stayHidden` Boolean (optional) - Keep the page hidden instead of visible.
|
||||||
|
* `stayAwake` Boolean (optional) - Keep the system awake instead of allowing it to sleep.
|
||||||
|
|
||||||
Increase the capturer count by one. The page is considered visible when its browser window is
|
Increase the capturer count by one. The page is considered visible when its browser window is
|
||||||
hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.
|
hidden and the capturer count is non-zero. If you would like the page to stay hidden, you should ensure that `stayHidden` is set to true.
|
||||||
|
|
||||||
This also affects the Page Visibility API.
|
This also affects the Page Visibility API.
|
||||||
|
|
||||||
#### `contents.decrementCapturerCount([stayHidden])`
|
#### `contents.decrementCapturerCount([stayHidden, stayAwake])`
|
||||||
|
|
||||||
* `stayHidden` Boolean (optional) - Keep the page in hidden state instead of visible.
|
* `stayHidden` Boolean (optional) - Keep the page in hidden state instead of visible.
|
||||||
|
* `stayAwake` Boolean (optional) - Keep the system awake instead of allowing it to sleep.
|
||||||
|
|
||||||
Decrease the capturer count by one. The page will be set to hidden or occluded state when its
|
Decrease the capturer count by one. The page will be set to hidden or occluded state when its
|
||||||
browser window is hidden or occluded and the capturer count reaches zero. If you want to
|
browser window is hidden or occluded and the capturer count reaches zero. If you want to
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Electron's `webview` tag is based on [Chromium's `webview`][chrome-webview], which
|
Electron's `webview` tag is based on [Chromium's `webview`][chrome-webview], which
|
||||||
is undergoing dramatic architectural changes. This impacts the stability of `webviews`,
|
is undergoing dramatic architectural changes. This impacts the stability of `webviews`,
|
||||||
including rendering, navigation, and event routing. We currently recommend to not
|
including rendering, navigation, and event routing. We currently recommend to not
|
||||||
use the `webview` tag and to consider alternatives, like `iframe`, Electron's `BrowserView`,
|
use the `webview` tag and to consider alternatives, like `iframe`, [Electron's `BrowserView`](browser-view.md),
|
||||||
or an architecture that avoids embedded content altogether.
|
or an architecture that avoids embedded content altogether.
|
||||||
|
|
||||||
## Enabling
|
## Enabling
|
||||||
@@ -274,7 +274,7 @@ webview.addEventListener('dom-ready', () => {
|
|||||||
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url.
|
* `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url.
|
||||||
* `userAgent` String (optional) - A user agent originating the request.
|
* `userAgent` String (optional) - A user agent originating the request.
|
||||||
* `extraHeaders` String (optional) - Extra headers separated by "\n"
|
* `extraHeaders` String (optional) - Extra headers separated by "\n"
|
||||||
* `postData` ([UploadRawData[]](structures/upload-raw-data.md) | [UploadFile[]](structures/upload-file.md)) (optional)
|
* `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional)
|
||||||
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
|
* `baseURLForDataURL` String (optional) - Base url (with trailing path separator) for files to be loaded by the data url. This is needed only if the specified `url` is a data url and needs to load other files.
|
||||||
|
|
||||||
Returns `Promise<void>` - The promise will resolve when the page has finished loading
|
Returns `Promise<void>` - The promise will resolve when the page has finished loading
|
||||||
@@ -515,8 +515,7 @@ Inserts `text` to the focused element.
|
|||||||
* `text` String - Content to be searched, must not be empty.
|
* `text` String - Content to be searched, must not be empty.
|
||||||
* `options` Object (optional)
|
* `options` Object (optional)
|
||||||
* `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
|
* `forward` Boolean (optional) - Whether to search forward or backward, defaults to `true`.
|
||||||
* `findNext` Boolean (optional) - Whether the operation is first request or a follow up,
|
* `findNext` Boolean (optional) - Whether to begin a new text finding session with this request. Should be `true` for initial requests, and `false` for follow-up requests. Defaults to `false`.
|
||||||
defaults to `false`.
|
|
||||||
* `matchCase` Boolean (optional) - Whether search should be case-sensitive,
|
* `matchCase` Boolean (optional) - Whether search should be case-sensitive,
|
||||||
defaults to `false`.
|
defaults to `false`.
|
||||||
|
|
||||||
|
|||||||
@@ -83,9 +83,9 @@ const mainWindow = new BrowserWindow()
|
|||||||
|
|
||||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||||
if (url.startsWith('https://github.com/')) {
|
if (url.startsWith('https://github.com/')) {
|
||||||
return true
|
return { action: 'allow' }
|
||||||
}
|
}
|
||||||
return false
|
return { action: 'deny' }
|
||||||
})
|
})
|
||||||
|
|
||||||
mainWindow.webContents.on('did-create-window', (childWindow) => {
|
mainWindow.webContents.on('did-create-window', (childWindow) => {
|
||||||
|
|||||||
@@ -136,6 +136,22 @@ systemPreferences.isHighContrastColorScheme()
|
|||||||
nativeTheme.shouldUseHighContrastColors
|
nativeTheme.shouldUseHighContrastColors
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Deprecated: WebContents `new-window` event
|
||||||
|
|
||||||
|
The `new-window` event of WebContents has been deprecated. It is replaced by [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler).
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Deprecated in Electron 13
|
||||||
|
webContents.on('new-window', (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
})
|
||||||
|
|
||||||
|
// Replace with
|
||||||
|
webContents.setWindowOpenHandler((details) => {
|
||||||
|
return { action: 'deny' }
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
## Planned Breaking API Changes (12.0)
|
## Planned Breaking API Changes (12.0)
|
||||||
|
|
||||||
### Removed: Pepper Flash support
|
### Removed: Pepper Flash support
|
||||||
@@ -160,6 +176,9 @@ the previous behavior, `contextIsolation: false` must be specified in WebPrefere
|
|||||||
|
|
||||||
We [recommend having contextIsolation enabled](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
|
We [recommend having contextIsolation enabled](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
|
||||||
|
|
||||||
|
Another implication is that `require()` cannot be used in the renderer process unless
|
||||||
|
`nodeIntegration` is `true` and `contextIsolation` is `false`.
|
||||||
|
|
||||||
For more details see: https://github.com/electron/electron/issues/23506
|
For more details see: https://github.com/electron/electron/issues/23506
|
||||||
|
|
||||||
### Removed: `crashReporter.getCrashesDirectory()`
|
### Removed: `crashReporter.getCrashesDirectory()`
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Build Instructions
|
# Build Instructions
|
||||||
|
|
||||||
Follow the guidelines below for building Electron.
|
Follow the guidelines below for building **Electron itself**, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
|
||||||
|
|
||||||
|
[application-distribution]: ../tutorial/application-distribution.md
|
||||||
|
|
||||||
## Platform prerequisites
|
## Platform prerequisites
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Build Instructions (Linux)
|
# Build Instructions (Linux)
|
||||||
|
|
||||||
Follow the guidelines below for building Electron on Linux.
|
Follow the guidelines below for building **Electron itself** on Linux, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
|
||||||
|
|
||||||
|
[application-distribution]: ../tutorial/application-distribution.md
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Build Instructions (macOS)
|
# Build Instructions (macOS)
|
||||||
|
|
||||||
Follow the guidelines below for building Electron on macOS.
|
Follow the guidelines below for building **Electron itself** on macOS, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
|
||||||
|
|
||||||
|
[application-distribution]: ../tutorial/application-distribution.md
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Build Instructions (Windows)
|
# Build Instructions (Windows)
|
||||||
|
|
||||||
Follow the guidelines below for building Electron on Windows.
|
Follow the guidelines below for building **Electron itself** on Windows, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the [application distribution][application-distribution] guide.
|
||||||
|
|
||||||
|
[application-distribution]: ../tutorial/application-distribution.md
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ files, you need to have built Electron so that it knows which compiler flags
|
|||||||
were used. There is one required option for the script `--output-dir`, which
|
were used. There is one required option for the script `--output-dir`, which
|
||||||
tells the script which build directory to pull the compilation information
|
tells the script which build directory to pull the compilation information
|
||||||
from. A typical usage would be:
|
from. A typical usage would be:
|
||||||
`npm run lint:clang-tiy --out-dir ../out/Testing`
|
`npm run lint:clang-tidy --out-dir ../out/Testing`
|
||||||
|
|
||||||
With no filenames provided, all C/C++/Objective-C files will be checked.
|
With no filenames provided, all C/C++/Objective-C files will be checked.
|
||||||
You can provide a list of files to be checked by passing the filenames after
|
You can provide a list of files to be checked by passing the filenames after
|
||||||
the options:
|
the options:
|
||||||
`npm run lint:clang-tiy --out-dir ../out/Testing shell/browser/api/electron_api_app.cc`
|
`npm run lint:clang-tidy --out-dir ../out/Testing shell/browser/api/electron_api_app.cc`
|
||||||
|
|
||||||
While `clang-tidy` has a
|
While `clang-tidy` has a
|
||||||
[long list](https://clang.llvm.org/extra/clang-tidy/checks/list.html)
|
[long list](https://clang.llvm.org/extra/clang-tidy/checks/list.html)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ You can run `npm run lint` to show any style issues detected by `cpplint` and
|
|||||||
## C++ and Python
|
## C++ and Python
|
||||||
|
|
||||||
For C++ and Python, we follow Chromium's [Coding
|
For C++ and Python, we follow Chromium's [Coding
|
||||||
Style](https://www.chromium.org/developers/coding-style). You can use
|
Style](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/styleguide/styleguide.md). You can use
|
||||||
[clang-format](clang-format.md) to format the C++ code automatically. There is
|
[clang-format](clang-format.md) to format the C++ code automatically. There is
|
||||||
also a script `script/cpplint.py` to check whether all files conform.
|
also a script `script/cpplint.py` to check whether all files conform.
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ contributing, and more. Please use the issue tracker for bugs only!
|
|||||||
To submit a bug report:
|
To submit a bug report:
|
||||||
|
|
||||||
When opening a new issue in the [`electron/electron` issue tracker](https://github.com/electron/electron/issues/new/choose), users
|
When opening a new issue in the [`electron/electron` issue tracker](https://github.com/electron/electron/issues/new/choose), users
|
||||||
will be presented with [a template](https://github.com/electron/electron/blob/master/.github/ISSUE_TEMPLATE/Bug_report.md)
|
will be presented with a template that should be filled in.
|
||||||
that should be filled in.
|
|
||||||
|
|
||||||
If you believe that you have found a bug in Electron, please fill out the template
|
If you believe that you have found a bug in Electron, please fill out the template
|
||||||
to the best of your ability.
|
to the best of your ability.
|
||||||
|
|||||||
@@ -100,7 +100,5 @@ script/ - The set of all scripts Electron runs for a variety of purposes.
|
|||||||
└── uploaders/ - Uploads various release-related files during release.
|
└── uploaders/ - Uploads various release-related files during release.
|
||||||
```
|
```
|
||||||
|
|
||||||
* **tools** - Helper scripts used by GN files.
|
|
||||||
* Scripts put here should never be invoked by users directly, unlike those in `script`.
|
|
||||||
* **typings** - TypeScript typings for Electron's internal code.
|
* **typings** - TypeScript typings for Electron's internal code.
|
||||||
* **vendor** - Source code for some third party dependencies.
|
* **vendor** - Source code for some third party dependencies.
|
||||||
|
|||||||
@@ -7,12 +7,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>Drag the boxes below to somewhere in your OS (Finder/Explorer, Desktop, etc.) to copy an example markdown file.</p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
<div style="border:2px solid black;border-radius:3px;padding:5px;display:inline-block" draggable="true" id="drag1">Drag me - File 1</div>
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
<div style="border:2px solid black;border-radius:3px;padding:5px;display:inline-block" draggable="true" id="drag2">Drag me - File 2</div>
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
<a href="#" id="drag">Drag me</a>
|
|
||||||
<script src="renderer.js"></script>
|
<script src="renderer.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
const { app, BrowserWindow, ipcMain, nativeImage, NativeImage } = require('electron')
|
const { app, BrowserWindow, ipcMain, nativeImage, NativeImage } = require('electron')
|
||||||
const fs = require('fs');
|
const path = require('path')
|
||||||
const http = require('http');
|
const fs = require('fs')
|
||||||
|
const https = require('https')
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow() {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true
|
preload: path.join(__dirname, 'preload.js')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
}
|
}
|
||||||
const iconName = 'iconForDragAndDrop.png';
|
|
||||||
const icon = fs.createWriteStream(`${process.cwd()}/${iconName}`);
|
const iconName = path.join(__dirname, 'iconForDragAndDrop.png');
|
||||||
http.get('http://img.icons8.com/ios/452/drag-and-drop.png', (response) => {
|
const icon = fs.createWriteStream(iconName);
|
||||||
|
|
||||||
|
// Create a new file to copy - you can also copy existing files.
|
||||||
|
fs.writeFileSync(path.join(__dirname, 'drag-and-drop-1.md'), '# First file to test drag and drop')
|
||||||
|
fs.writeFileSync(path.join(__dirname, 'drag-and-drop-2.md'), '# Second file to test drag and drop')
|
||||||
|
|
||||||
|
https.get('https://img.icons8.com/ios/452/drag-and-drop.png', (response) => {
|
||||||
response.pipe(icon);
|
response.pipe(icon);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -23,8 +30,8 @@ app.whenReady().then(createWindow)
|
|||||||
|
|
||||||
ipcMain.on('ondragstart', (event, filePath) => {
|
ipcMain.on('ondragstart', (event, filePath) => {
|
||||||
event.sender.startDrag({
|
event.sender.startDrag({
|
||||||
file: filePath,
|
file: path.join(__dirname, filePath),
|
||||||
icon: `${process.cwd()}/${iconName}`
|
icon: iconName,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
8
docs/fiddles/features/drag-and-drop/preload.js
Normal file
8
docs/fiddles/features/drag-and-drop/preload.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
const { contextBridge, ipcRenderer } = require('electron')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
contextBridge.exposeInMainWorld('electron', {
|
||||||
|
startDrag: (fileName) => {
|
||||||
|
ipcRenderer.send('ondragstart', fileName)
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
const { ipcRenderer } = require('electron')
|
document.getElementById('drag1').ondragstart = (event) => {
|
||||||
const fs = require('fs')
|
|
||||||
|
|
||||||
document.getElementById('drag').ondragstart = (event) => {
|
|
||||||
const fileName = 'drag-and-drop.md'
|
|
||||||
fs.writeFileSync(fileName, '# Test drag and drop');
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
ipcRenderer.send('ondragstart', process.cwd() + `/${fileName}`)
|
window.electron.startDrag('drag-and-drop-1.md')
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('drag2').ondragstart = (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
window.electron.startDrag('drag-and-drop-2.md')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>Hit Alt+Ctrl+I on Windows or Opt+Cmd+I on Mac to see a message printed to the console.</p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ function createWindow () {
|
|||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
<p>Hit Ctrl+I to see a message printed to the console.</p>
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const { app, BrowserWindow } = require('electron')
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
const win = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true } })
|
const win = new BrowserWindow({ width: 800, height: 600 })
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
win.webContents.on('before-input-event', (event, input) => {
|
win.webContents.on('before-input-event', (event, input) => {
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>Hit Alt+Shift+I on Windows, or Opt+Cmd+I on mac to see a message printed to the console.</p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ function createWindow () {
|
|||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
|
|||||||
17
docs/fiddles/features/keyboard-shortcuts/web-apis/index.html
Normal file
17
docs/fiddles/features/keyboard-shortcuts/web-apis/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
|
||||||
|
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
|
||||||
|
<p>Hit any key with this window focused to see it captured here.</p>
|
||||||
|
<div><span>Last Key Pressed: </span><span id="last-keypress"></span></div>
|
||||||
|
<script src="./renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
35
docs/fiddles/features/keyboard-shortcuts/web-apis/main.js
Normal file
35
docs/fiddles/features/keyboard-shortcuts/web-apis/main.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// Modules to control application life and create native browser window
|
||||||
|
const {app, BrowserWindow} = require('electron')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
// Create the browser window.
|
||||||
|
const mainWindow = new BrowserWindow({
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
})
|
||||||
|
|
||||||
|
// and load the index.html of the app.
|
||||||
|
mainWindow.loadFile('index.html')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method will be called when Electron has finished
|
||||||
|
// initialization and is ready to create browser windows.
|
||||||
|
// Some APIs can only be used after this event occurs.
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
createWindow()
|
||||||
|
|
||||||
|
app.on('activate', function () {
|
||||||
|
// On macOS it's common to re-create a window in the app when the
|
||||||
|
// dock icon is clicked and there are no other windows open.
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) createWindow()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Quit when all windows are closed, except on macOS. There, it's common
|
||||||
|
// for applications and their menu bar to stay active until the user quits
|
||||||
|
// explicitly with Cmd + Q.
|
||||||
|
app.on('window-all-closed', function () {
|
||||||
|
if (process.platform !== 'darwin') app.quit()
|
||||||
|
})
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
function handleKeyPress (event) {
|
||||||
|
// You can put code here to handle the keypress.
|
||||||
|
document.getElementById("last-keypress").innerText = event.key
|
||||||
|
console.log(`You pressed ${event.key}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('keyup', handleKeyPress, true)
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
const { app, BrowserWindow, ipcMain, nativeTheme } = require('electron')
|
const { app, BrowserWindow, ipcMain, nativeTheme } = require('electron')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true
|
preload: path.join(__dirname, 'preload.js')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -25,16 +26,18 @@ function createWindow () {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
app.whenReady().then(createWindow)
|
app.whenReady().then(() => {
|
||||||
|
createWindow()
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
app.quit()
|
app.quit()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('activate', () => {
|
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
|
||||||
createWindow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|||||||
6
docs/fiddles/features/macos-dark-mode/preload.js
Normal file
6
docs/fiddles/features/macos-dark-mode/preload.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
const { contextBridge, ipcRenderer } = require('electron')
|
||||||
|
|
||||||
|
contextBridge.exposeInMainWorld('darkMode', {
|
||||||
|
toggle: () => ipcRenderer.invoke('dark-mode:toggle'),
|
||||||
|
system: () => ipcRenderer.invoke('dark-mode:system')
|
||||||
|
})
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
const { ipcRenderer } = require('electron')
|
|
||||||
|
|
||||||
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
|
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
|
||||||
const isDarkMode = await ipcRenderer.invoke('dark-mode:toggle')
|
const isDarkMode = await window.darkMode.toggle()
|
||||||
document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'
|
document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'
|
||||||
})
|
})
|
||||||
|
|
||||||
document.getElementById('reset-to-system').addEventListener('click', async () => {
|
document.getElementById('reset-to-system').addEventListener('click', async () => {
|
||||||
await ipcRenderer.invoke('dark-mode:system')
|
await window.darkMode.system()
|
||||||
document.getElementById('theme-source').innerHTML = 'System'
|
document.getElementById('theme-source').innerHTML = 'System'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>Right click the dock icon to see the custom menu options.</p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ function createWindow () {
|
|||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
@@ -27,7 +24,9 @@ const dockMenu = Menu.buildFromTemplate([
|
|||||||
])
|
])
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
app.dock.setMenu(dockMenu)
|
if (process.platform === 'darwin') {
|
||||||
|
app.dock.setMenu(dockMenu)
|
||||||
|
}
|
||||||
}).then(createWindow)
|
}).then(createWindow)
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>After launching this application, you should see the system notification.</p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -3,21 +3,17 @@ const { app, BrowserWindow, Notification } = require('electron')
|
|||||||
function createWindow () {
|
function createWindow () {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NOTIFICATION_TITLE = 'Basic Notification'
|
||||||
|
const NOTIFICATION_BODY = 'Notification from the Main process'
|
||||||
|
|
||||||
function showNotification () {
|
function showNotification () {
|
||||||
const notification = {
|
new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
|
||||||
title: 'Basic Notification',
|
|
||||||
body: 'Notification from the Main process'
|
|
||||||
}
|
|
||||||
new Notification(notification).show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app.whenReady().then(createWindow).then(showNotification)
|
app.whenReady().then(createWindow).then(showNotification)
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Hello World!</title>
|
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Hello World!</h1>
|
|
||||||
<p>
|
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
const { app, BrowserWindow } = require('electron')
|
const { app, BrowserWindow } = require('electron')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
app.disableHardwareAcceleration()
|
app.disableHardwareAcceleration()
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ app.whenReady().then(() => {
|
|||||||
fs.writeFileSync('ex.png', image.toPNG())
|
fs.writeFileSync('ex.png', image.toPNG())
|
||||||
})
|
})
|
||||||
win.webContents.setFrameRate(60)
|
win.webContents.setFrameRate(60)
|
||||||
console.log(`The screenshot has been successfully saved to ${process.cwd()}/ex.png`)
|
console.log(`The screenshot has been successfully saved to ${path.join(process.cwd(), 'ex.png')}`)
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
|||||||
13
docs/fiddles/features/online-detection/index.html
Normal file
13
docs/fiddles/features/online-detection/index.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Hello World!</title>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Connection status: <strong id='status'></strong></h1>
|
||||||
|
|
||||||
|
<script src="renderer.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
26
docs/fiddles/features/online-detection/main.js
Normal file
26
docs/fiddles/features/online-detection/main.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
|
const onlineStatusWindow = new BrowserWindow({
|
||||||
|
width: 300,
|
||||||
|
height: 200
|
||||||
|
})
|
||||||
|
|
||||||
|
onlineStatusWindow.loadFile('index.html')
|
||||||
|
}
|
||||||
|
|
||||||
|
app.whenReady().then(() => {
|
||||||
|
createWindow()
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Hello World!</title>
|
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Hello World!</h1>
|
|
||||||
<p>
|
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
<script src="renderer.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
const { app, BrowserWindow, ipcMain } = require('electron')
|
|
||||||
|
|
||||||
let onlineStatusWindow
|
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
|
||||||
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false, webPreferences: { nodeIntegration: true } })
|
|
||||||
onlineStatusWindow.loadURL(`file://${__dirname}/index.html`)
|
|
||||||
})
|
|
||||||
|
|
||||||
ipcMain.on('online-status-changed', (event, status) => {
|
|
||||||
console.log(status)
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
app.quit()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('activate', () => {
|
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
|
||||||
createWindow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
const { ipcRenderer } = require('electron')
|
|
||||||
const updateOnlineStatus = () => { ipcRenderer.send('online-status-changed', navigator.onLine ? 'online' : 'offline') }
|
|
||||||
|
|
||||||
window.addEventListener('online', updateOnlineStatus)
|
|
||||||
window.addEventListener('offline', updateOnlineStatus)
|
|
||||||
|
|
||||||
updateOnlineStatus()
|
|
||||||
8
docs/fiddles/features/online-detection/renderer.js
Normal file
8
docs/fiddles/features/online-detection/renderer.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
function onlineStatusIndicator () {
|
||||||
|
document.getElementById('status').innerHTML = navigator.onLine ? 'online' : 'offline'
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('online', onlineStatusIndicator)
|
||||||
|
window.addEventListener('offline', onlineStatusIndicator)
|
||||||
|
|
||||||
|
onlineStatusIndicator()
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Hello World!</title>
|
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Hello World!</h1>
|
|
||||||
<p>
|
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
|
||||||
</p>
|
|
||||||
<script src="renderer.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
const { app, BrowserWindow } = require('electron')
|
|
||||||
|
|
||||||
let onlineStatusWindow
|
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
|
||||||
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
|
|
||||||
onlineStatusWindow.loadURL(`file://${__dirname}/index.html`)
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
app.quit()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('activate', () => {
|
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
|
||||||
createWindow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
const alertOnlineStatus = () => { window.alert(navigator.onLine ? 'online' : 'offline') }
|
|
||||||
|
|
||||||
window.addEventListener('online', alertOnlineStatus)
|
|
||||||
window.addEventListener('offline', alertOnlineStatus)
|
|
||||||
|
|
||||||
alertOnlineStatus()
|
|
||||||
@@ -7,10 +7,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>Keep an eye on the dock (Mac) or taskbar (Windows, Unity) for this application!</p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
<p>It should indicate a progress that advances from 0 to 100%.</p>
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
<p>It should then show indeterminate (Windows) or pin at 100% (other operating systems)
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
briefly and then loop.</p>
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,21 +1,39 @@
|
|||||||
const { app, BrowserWindow } = require('electron')
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
|
||||||
|
let progressInterval
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
win.setProgressBar(0.5)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const INCREMENT = 0.03
|
||||||
|
const INTERVAL_DELAY = 100 // ms
|
||||||
|
|
||||||
|
let c = 0
|
||||||
|
progressInterval = setInterval(() => {
|
||||||
|
// update progress bar to next value
|
||||||
|
// values between 0 and 1 will show progress, >1 will show indeterminate or stick at 100%
|
||||||
|
win.setProgressBar(c)
|
||||||
|
|
||||||
|
// increment or reset progress bar
|
||||||
|
if (c < 2) {
|
||||||
|
c += INCREMENT
|
||||||
|
} else {
|
||||||
|
c = (-INCREMENT * 5) // reset to a bit less than 0 to show reset state
|
||||||
|
}
|
||||||
|
}, INTERVAL_DELAY)
|
||||||
|
}
|
||||||
|
|
||||||
app.whenReady().then(createWindow)
|
app.whenReady().then(createWindow)
|
||||||
|
|
||||||
|
// before the app is terminated, clear both timers
|
||||||
|
app.on('before-quit', () => {
|
||||||
|
clearInterval(progressInterval)
|
||||||
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<p>
|
<p>
|
||||||
We are using node <script>document.write(process.versions.node)</script>,
|
We are using Node.js <span id="node-version"></span>,
|
||||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
Chromium <span id="chrome-version"></span>,
|
||||||
and Electron <script>document.write(process.versions.electron)</script>.
|
and Electron <span id="electron-version"></span>.
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,18 +1,27 @@
|
|||||||
const { app, BrowserWindow } = require('electron')
|
const { app, BrowserWindow } = require('electron')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true
|
preload: path.join(__dirname, 'preload.js')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
}
|
}
|
||||||
|
|
||||||
app.whenReady().then(createWindow)
|
app.whenReady().then(() => {
|
||||||
|
createWindow()
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
@@ -20,8 +29,3 @@ app.on('window-all-closed', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('activate', () => {
|
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
|
||||||
createWindow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|||||||
11
docs/fiddles/quick-start/preload.js
Normal file
11
docs/fiddles/quick-start/preload.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const replaceText = (selector, text) => {
|
||||||
|
const element = document.getElementById(selector)
|
||||||
|
if (element) element.innerText = text
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const type of ['chrome', 'node', 'electron']) {
|
||||||
|
replaceText(`${type}-version`, process.versions[type])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user