mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
151 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e14b3ebb8 | ||
|
|
dbaa3528f9 | ||
|
|
44bd6aac3a | ||
|
|
fef7d52e73 | ||
|
|
0bdb5ac85a | ||
|
|
1e54a8d3fe | ||
|
|
5ef4b258ec | ||
|
|
dad125a0e0 | ||
|
|
42e2e54730 | ||
|
|
3795fbaccb | ||
|
|
7358d0fd71 | ||
|
|
f85bd310c8 | ||
|
|
a415eb6f06 | ||
|
|
3f6b9a8fcd | ||
|
|
cc17929ebb | ||
|
|
a85ad0ea38 | ||
|
|
91e09c69bd | ||
|
|
6e27b53527 | ||
|
|
534d313758 | ||
|
|
30b446ca32 | ||
|
|
7e6d0d4c3c | ||
|
|
6eabd3c72b | ||
|
|
f0302c4981 | ||
|
|
3c71a812c3 | ||
|
|
58981b69b1 | ||
|
|
6a451311cd | ||
|
|
09beb48648 | ||
|
|
e6fc453d90 | ||
|
|
305751aa47 | ||
|
|
d8fbdf6b3e | ||
|
|
c84a45f9f2 | ||
|
|
5274c253db | ||
|
|
8e70826af6 | ||
|
|
9afa4194ac | ||
|
|
062f7c0cb1 | ||
|
|
13cfb4ef8f | ||
|
|
39d08c3f2a | ||
|
|
1a6d998c34 | ||
|
|
ab426d5abf | ||
|
|
6ff154c7cc | ||
|
|
910dd786a9 | ||
|
|
d7fedd2961 | ||
|
|
f20a51a87f | ||
|
|
6c29ab10a4 | ||
|
|
b61692d790 | ||
|
|
0e6f172897 | ||
|
|
aa99d73990 | ||
|
|
f1c7562d9c | ||
|
|
08aa57806e | ||
|
|
76450afd47 | ||
|
|
8ac0e2bdec | ||
|
|
c61a14c5d1 | ||
|
|
ecdfca8f13 | ||
|
|
2f9414dcc4 | ||
|
|
816e8e804c | ||
|
|
5f1c3b4d13 | ||
|
|
7b1872dafe | ||
|
|
c10922f15f | ||
|
|
d8edf84cfc | ||
|
|
215ae2b012 | ||
|
|
09c4fdd6d0 | ||
|
|
77d561a8a6 | ||
|
|
3777902abc | ||
|
|
3a079feb87 | ||
|
|
8d68009abc | ||
|
|
4f3be68ad5 | ||
|
|
c7509b0a53 | ||
|
|
fa4052fc9e | ||
|
|
e02fbe1d29 | ||
|
|
7e06da25ef | ||
|
|
f0ae458f6f | ||
|
|
b2955e8cf5 | ||
|
|
ca6738dc08 | ||
|
|
0640a8a02a | ||
|
|
b7d5573584 | ||
|
|
6fb73ba8e7 | ||
|
|
99724da33b | ||
|
|
76975dfefd | ||
|
|
8313ea461e | ||
|
|
2c0327c394 | ||
|
|
603a4af5ee | ||
|
|
5a121dd077 | ||
|
|
db0830e0f8 | ||
|
|
3ca5708faa | ||
|
|
688780aa85 | ||
|
|
7e53953fbf | ||
|
|
4cc3b85adc | ||
|
|
efa621f76d | ||
|
|
659b2c3c52 | ||
|
|
aba5e9892d | ||
|
|
c10eeceb93 | ||
|
|
ce2dcdf42f | ||
|
|
283ddb684f | ||
|
|
5100807a6a | ||
|
|
9d7b59e37d | ||
|
|
67957aac67 | ||
|
|
e774d4f348 | ||
|
|
3e18fba853 | ||
|
|
fa1382d980 | ||
|
|
8f738edc40 | ||
|
|
5b4577af20 | ||
|
|
cf38b9e375 | ||
|
|
bbc84b0e9a | ||
|
|
c655ed075a | ||
|
|
c48e0b8ab6 | ||
|
|
46d609fc2c | ||
|
|
03fe3c42d4 | ||
|
|
952e2905b9 | ||
|
|
7619dd51bf | ||
|
|
e2b823fb07 | ||
|
|
a1dcdc4664 | ||
|
|
2b2900a2f1 | ||
|
|
d87bad743c | ||
|
|
33670ac928 | ||
|
|
8ecbc11aa2 | ||
|
|
4ab3b1d624 | ||
|
|
bce95c4886 | ||
|
|
5b583c8808 | ||
|
|
c20d6e54c5 | ||
|
|
ff7f2a5091 | ||
|
|
10062c9a5b | ||
|
|
82a6e9bd5a | ||
|
|
10131e36f3 | ||
|
|
37078297c6 | ||
|
|
48f4ef65ed | ||
|
|
e174aac845 | ||
|
|
dd1a692aba | ||
|
|
aa05c43994 | ||
|
|
16561d08ae | ||
|
|
edc0a47c89 | ||
|
|
018e2aee8d | ||
|
|
dd10a5ebf2 | ||
|
|
2fe7d59437 | ||
|
|
a4a9210d2d | ||
|
|
69179bbfe7 | ||
|
|
b64b87a8d6 | ||
|
|
7bdc9d8039 | ||
|
|
cbe2a458c9 | ||
|
|
d20e547316 | ||
|
|
bde27c7e6b | ||
|
|
d0d5e20efb | ||
|
|
dc452de295 | ||
|
|
ade2b02e1c | ||
|
|
73e3c29c94 | ||
|
|
24df260185 | ||
|
|
4fe31bd1aa | ||
|
|
948949f83d | ||
|
|
bba63609f2 | ||
|
|
4b793692ea | ||
|
|
f3da81cb77 | ||
|
|
6f8bf917f7 |
@@ -635,9 +635,9 @@ step-electron-publish: &step-electron-publish
|
||||
cd src/electron
|
||||
if [ "$UPLOAD_TO_STORAGE" == "1" ]; then
|
||||
echo 'Uploading Electron release distribution to Azure'
|
||||
script/release/uploaders/upload.py --verbose --upload_to_storage
|
||||
script/release/uploaders/upload.py --verbose --UPLOAD_TO_STORAGE
|
||||
else
|
||||
echo 'Uploading Electron release distribution to GitHub releases'
|
||||
echo 'Uploading Electron release distribution to Github releases'
|
||||
script/release/uploaders/upload.py --verbose
|
||||
fi
|
||||
|
||||
@@ -661,7 +661,6 @@ step-persist-data-for-tests: &step-persist-data-for-tests
|
||||
- src/buildtools/third_party/libc++
|
||||
- src/buildtools/third_party/libc++abi
|
||||
- src/out/Default/obj/buildtools/third_party
|
||||
- src/v8/tools/builtins-pgo
|
||||
|
||||
step-electron-dist-unzip: &step-electron-dist-unzip
|
||||
run:
|
||||
@@ -1007,17 +1006,9 @@ steps-electron-gn-check: &steps-electron-gn-check
|
||||
- *step-generate-deps-hash
|
||||
- *step-touch-sync-done
|
||||
- maybe-restore-portaled-src-cache
|
||||
- run:
|
||||
name: Ensure src checkout worked
|
||||
command: |
|
||||
if [ ! -d "src/third_party/blink" ]; then
|
||||
echo src cache was not restored for an unknown reason
|
||||
exit 1
|
||||
fi
|
||||
- run:
|
||||
name: Wipe Electron
|
||||
command: rm -rf src/electron
|
||||
- *step-checkout-electron
|
||||
- *step-wait-for-goma
|
||||
- *step-gn-gen-default
|
||||
- *step-gn-check
|
||||
|
||||
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
|
||||
steps:
|
||||
|
||||
2
.github/semantic.yml
vendored
Normal file
2
.github/semantic.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Always validate the PR title, and ignore the commits
|
||||
titleOnly: true
|
||||
@@ -1,31 +0,0 @@
|
||||
name: Trigger Major Release Dependency Updates
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
check_tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check Tag
|
||||
run: |
|
||||
if [[ ${{ github.event.release.tag_name }} =~ ^v[0-9]+\.0\.0$ ]]; then
|
||||
echo ::set-output name=should_release::true
|
||||
fi
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check_tag
|
||||
if: needs.check_tag.outputs.should_release == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Trigger New chromedriver Release
|
||||
run: |
|
||||
gh api /repos/:owner/chromedriver/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
|
||||
- name: Trigger New mksnapshot Release
|
||||
run: |
|
||||
gh api /repos/:owner/mksnapshot/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
26
BUILD.gn
26
BUILD.gn
@@ -135,7 +135,7 @@ config("electron_lib_config") {
|
||||
include_dirs = [ "." ]
|
||||
}
|
||||
|
||||
# We generate the definitions twice here, once in //electron/electron.d.ts
|
||||
# We geneate the definitions twice here, once in //electron/electron.d.ts
|
||||
# and once in $target_gen_dir
|
||||
# The one in $target_gen_dir is used for the actual TSC build later one
|
||||
# and the one in //electron/electron.d.ts is used by your IDE (vscode)
|
||||
@@ -391,7 +391,6 @@ source_set("electron_lib") {
|
||||
"//components/user_prefs",
|
||||
"//components/viz/host",
|
||||
"//components/viz/service",
|
||||
"//components/webrtc",
|
||||
"//content/public/browser",
|
||||
"//content/public/child",
|
||||
"//content/public/gpu",
|
||||
@@ -404,6 +403,9 @@ source_set("electron_lib") {
|
||||
"//media/mojo/mojom",
|
||||
"//net:extras",
|
||||
"//net:net_resources",
|
||||
"//ppapi/host",
|
||||
"//ppapi/proxy",
|
||||
"//ppapi/shared_impl",
|
||||
"//printing/buildflags",
|
||||
"//services/device/public/cpp/geolocation",
|
||||
"//services/device/public/cpp/hid",
|
||||
@@ -564,9 +566,8 @@ source_set("electron_lib") {
|
||||
"//ui/base/ime/linux",
|
||||
"//ui/events/devices/x11",
|
||||
"//ui/events/platform/x11",
|
||||
"//ui/linux:linux_ui",
|
||||
"//ui/linux:linux_ui_factory",
|
||||
"//ui/views/controls/webview",
|
||||
"//ui/views/linux_ui:linux_ui_factory",
|
||||
"//ui/wm",
|
||||
]
|
||||
if (ozone_platform_x11) {
|
||||
@@ -622,14 +623,6 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_ppapi) {
|
||||
deps += [
|
||||
"//ppapi/host",
|
||||
"//ppapi/proxy",
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_run_as_node) {
|
||||
sources += [
|
||||
"shell/app/node_main.cc",
|
||||
@@ -679,6 +672,8 @@ source_set("electron_lib") {
|
||||
|
||||
if (enable_basic_printing) {
|
||||
sources += [
|
||||
"shell/browser/printing/print_preview_message_handler.cc",
|
||||
"shell/browser/printing/print_preview_message_handler.h",
|
||||
"shell/browser/printing/print_view_manager_electron.cc",
|
||||
"shell/browser/printing/print_view_manager_electron.h",
|
||||
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
|
||||
@@ -906,13 +901,6 @@ if (is_mac) {
|
||||
"@executable_path/../../../../../..",
|
||||
]
|
||||
}
|
||||
|
||||
# For component ffmpeg under non-component build, it is linked from
|
||||
# @loader_path. However the ffmpeg.dylib is moved to a different place
|
||||
# when generating app bundle, and we should change to link from @rpath.
|
||||
if (is_component_ffmpeg && !is_component_build) {
|
||||
ldflags += [ "-Wcrl,installnametool,-change,@loader_path/libffmpeg.dylib,@rpath/libffmpeg.dylib" ]
|
||||
}
|
||||
}
|
||||
|
||||
template("electron_helper_app") {
|
||||
|
||||
4
DEPS
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'106.0.5249.119',
|
||||
'104.0.5112.102',
|
||||
'node_version':
|
||||
'v16.16.0',
|
||||
'v16.15.0',
|
||||
'nan_version':
|
||||
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -1 +1 @@
|
||||
21.2.0
|
||||
20.1.1
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://circleci.com/gh/electron/electron/tree/main)
|
||||
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
|
||||
[](https://discord.gg/electronjs)
|
||||
[](https://discord.com/invite/APGC3k5yaH)
|
||||
|
||||
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
||||
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
|
||||
@@ -38,7 +38,7 @@ For more installation options and troubleshooting tips, see
|
||||
|
||||
Each Electron release provides binaries for macOS, Windows, and Linux.
|
||||
|
||||
* macOS (High Sierra and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
|
||||
* macOS (El Capitan and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
|
||||
* Windows (Windows 7 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8.
|
||||
* Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on:
|
||||
* Ubuntu 14.04 and newer
|
||||
|
||||
463
appveyor.yml
463
appveyor.yml
@@ -3,7 +3,7 @@
|
||||
# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
|
||||
# e.g. 'target_cpu="x86"' to build for a 32bit platform.
|
||||
# https://gn.googlesource.com/gn/+/master/docs/reference.md#target_cpu
|
||||
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordingly
|
||||
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordningly
|
||||
# if you pass a custom value for 'target_cpu'.
|
||||
# - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
|
||||
# - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
|
||||
@@ -12,7 +12,7 @@
|
||||
# Is used in some publishing scripts, but does NOT affect the Electron binary.
|
||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
|
||||
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
|
||||
# Otherwise the release will be uploaded to the GitHub Releases.
|
||||
# Otherwise the release will be uploaded to the Github Releases.
|
||||
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
|
||||
#
|
||||
# The publishing scripts expect access tokens to be defined as env vars,
|
||||
@@ -34,281 +34,214 @@ environment:
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
|
||||
GOMA_FALLBACK_ON_AUTH_FAILURE: true
|
||||
|
||||
matrix:
|
||||
|
||||
- job_name: Build
|
||||
|
||||
- job_name: Test
|
||||
job_depends_on: Build
|
||||
|
||||
clone_folder: C:\projects\src\electron
|
||||
|
||||
# the first failed job cancels other jobs and fails entire build
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
for:
|
||||
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- job_name: Build
|
||||
|
||||
init:
|
||||
- ps: >-
|
||||
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
|
||||
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
|
||||
}
|
||||
|
||||
build_script:
|
||||
- ps: |
|
||||
build_script:
|
||||
- ps: >-
|
||||
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
|
||||
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
|
||||
} else {
|
||||
node script/yarn.js install --frozen-lockfile
|
||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-warning "Skipping tests for doc only change"; Exit-AppveyorBuild
|
||||
|
||||
$result = node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
|
||||
Write-Output $result
|
||||
if ($result.ExitCode -eq 0) {
|
||||
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
|
||||
}
|
||||
$global:LASTEXITCODE = 0
|
||||
- cd ..
|
||||
- ps: Write-Host "Building $env:GN_CONFIG build"
|
||||
- git config --global core.longpaths true
|
||||
- update_depot_tools.bat
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||
}
|
||||
- git clone https://github.com/electron/build-tools.git
|
||||
- cd build-tools
|
||||
- npm install
|
||||
- mkdir third_party
|
||||
- ps: >-
|
||||
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||
- cd ..\..
|
||||
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
|
||||
if ($goma_login -eq 'Login as Fermi Planck') {
|
||||
Write-warning "Goma authentication is correct";
|
||||
} else {
|
||||
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
|
||||
$host.SetShouldExit(1)
|
||||
}
|
||||
}
|
||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -ne 'release') {
|
||||
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
|
||||
}
|
||||
- >-
|
||||
gclient config
|
||||
--name "src\electron"
|
||||
--unmanaged
|
||||
%GCLIENT_EXTRA_ARGS%
|
||||
"https://github.com/electron/electron"
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
}
|
||||
- echo "Building $env:GN_CONFIG build"
|
||||
- git config --global core.longpaths true
|
||||
- cd ..
|
||||
- mkdir src
|
||||
- update_depot_tools.bat
|
||||
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||
}
|
||||
- git clone https://github.com/electron/build-tools.git
|
||||
- cd build-tools
|
||||
- npm install
|
||||
- mkdir third_party
|
||||
- ps: >-
|
||||
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||
- cd ..
|
||||
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
|
||||
if ($goma_login -eq 'Login as Fermi Planck') {
|
||||
Write-warning "Goma authentication is correct";
|
||||
} else {
|
||||
cd src\electron
|
||||
node script\generate-deps-hash.js
|
||||
$depshash = Get-Content .\.depshash -Raw
|
||||
$zipfile = "Z:\$depshash.7z"
|
||||
cd ..\..
|
||||
if (Test-Path -Path $zipfile) {
|
||||
# file exists, unzip and then gclient sync
|
||||
7z x -y $zipfile -mmt=14 -aoa
|
||||
if (-not (Test-Path -Path "src\buildtools")) {
|
||||
# the zip file must be corrupt - resync
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
if ($env:TARGET_ARCH -ne 'ia32') {
|
||||
# only save on x64/woa to avoid contention saving
|
||||
$env:SAVE_GCLIENT_SRC="true"
|
||||
}
|
||||
} else {
|
||||
# update angle
|
||||
cd src\third_party\angle
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
git fetch
|
||||
cd ..\..\..
|
||||
}
|
||||
} else {
|
||||
# file does not exist, gclient sync, then zip
|
||||
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
|
||||
$host.SetShouldExit(1)
|
||||
}
|
||||
}
|
||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -ne 'release') {
|
||||
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
|
||||
}
|
||||
- >-
|
||||
gclient config
|
||||
--name "src\electron"
|
||||
--unmanaged
|
||||
%GCLIENT_EXTRA_ARGS%
|
||||
"https://github.com/electron/electron"
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
} else {
|
||||
cd src\electron
|
||||
node script\generate-deps-hash.js
|
||||
$depshash = Get-Content .\.depshash -Raw
|
||||
$zipfile = "Z:\$depshash.7z"
|
||||
cd ..\..
|
||||
if (Test-Path -Path $zipfile) {
|
||||
# file exists, unzip and then gclient sync
|
||||
7z x -y $zipfile -mmt=30 -aoa
|
||||
if (-not (Test-Path -Path "src\buildtools")) {
|
||||
# the zip file must be corrupt - resync
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
if ($env:TARGET_ARCH -ne 'ia32') {
|
||||
# only save on x64/woa to avoid contention saving
|
||||
$env:SAVE_GCLIENT_SRC="true"
|
||||
}
|
||||
} else {
|
||||
# update angle
|
||||
cd src\third_party\angle
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
git fetch
|
||||
cd ..\..\..
|
||||
}
|
||||
} else {
|
||||
# file does not exist, gclient sync, then zip
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
if ($env:TARGET_ARCH -ne 'ia32') {
|
||||
# only save on x64/woa to avoid contention saving
|
||||
$env:SAVE_GCLIENT_SRC="true"
|
||||
}
|
||||
}
|
||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync )
|
||||
- ps: >-
|
||||
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
|
||||
# archive current source for future use
|
||||
# only run on x64/woa to avoid contention saving
|
||||
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Could not save source to shared drive; continuing anyway"
|
||||
}
|
||||
# build time generation of file gen/angle/angle_commit.h depends on
|
||||
# third_party/angle/.git
|
||||
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
|
||||
$(7z a $zipfile src\third_party\angle\.git)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
|
||||
}
|
||||
# build time generation of file dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
|
||||
# https://dawn-review.googlesource.com/c/dawn/+/83901
|
||||
$(7z a $zipfile src\third_party\dawn\.git)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Failed to add third_party\dawn\.git; continuing anyway"
|
||||
}
|
||||
}
|
||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync )
|
||||
- ps: >-
|
||||
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
|
||||
# archive current source for future use
|
||||
# only run on x64/woa to avoid contention saving
|
||||
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Could not save source to shared drive; continuing anyway"
|
||||
}
|
||||
- cd src
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
||||
- gn check out/Default //electron:electron_lib
|
||||
- gn check out/Default //electron:electron_app
|
||||
- gn check out/Default //electron/shell/common/api:mojo
|
||||
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
|
||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
|
||||
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||
- ninja -C out/Default electron:electron_dist_zip
|
||||
- ninja -C out/Default shell_browser_ui_unittests
|
||||
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||
- ninja -C out/Default electron:electron_mksnapshot_zip
|
||||
- cd out\Default
|
||||
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
|
||||
- cd ..\..
|
||||
- ninja -C out/Default electron:hunspell_dictionaries_zip
|
||||
- ninja -C out/Default electron:electron_chromedriver_zip
|
||||
- ninja -C out/Default third_party/electron_node:headers
|
||||
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
|
||||
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
||||
- 7z a node_headers.zip out\Default\gen\node_headers
|
||||
- 7z a builtins-pgo.zip v8\tools\builtins-pgo
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
# Needed for msdia140.dll on 64-bit windows
|
||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
||||
ninja -C out/Default electron:electron_symbols
|
||||
# build time generation of file gen/angle/angle_commit.h depends on
|
||||
# third_party/angle/.git
|
||||
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
|
||||
$(7z a $zipfile src\third_party\angle\.git)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
|
||||
}
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
python electron\script\zip-symbols.py
|
||||
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
|
||||
# build time generation of file dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
|
||||
# https://dawn-review.googlesource.com/c/dawn/+/83901
|
||||
$(7z a $zipfile src\third_party\dawn\.git)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Failed to add third_party\dawn\.git; continuing anyway"
|
||||
}
|
||||
}
|
||||
- cd src
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
||||
- gn check out/Default //electron:electron_lib
|
||||
- gn check out/Default //electron:electron_app
|
||||
- gn check out/Default //electron/shell/common/api:mojo
|
||||
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
|
||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
|
||||
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||
- ninja -C out/Default electron:electron_dist_zip
|
||||
- ninja -C out/Default shell_browser_ui_unittests
|
||||
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||
- ninja -C out/Default electron:electron_mksnapshot_zip
|
||||
- cd out\Default
|
||||
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
|
||||
- cd ..\..
|
||||
- ninja -C out/Default electron:hunspell_dictionaries_zip
|
||||
- ninja -C out/Default electron:electron_chromedriver_zip
|
||||
- ninja -C out/Default third_party/electron_node:headers
|
||||
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
|
||||
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
||||
- 7z a node_headers.zip out\Default\gen\node_headers
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
# Needed for msdia140.dll on 64-bit windows
|
||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
||||
ninja -C out/Default electron:electron_symbols
|
||||
}
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
python electron\script\zip-symbols.py
|
||||
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
|
||||
} else {
|
||||
# It's useful to have pdb files when debugging testing builds that are
|
||||
# built on CI.
|
||||
7z a pdb.zip out\Default\*.pdb
|
||||
}
|
||||
- python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
|
||||
test_script:
|
||||
# Workaround for https://github.com/appveyor/ci/issues/2420
|
||||
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
|
||||
- ps: >-
|
||||
if ((-Not (Test-Path Env:\TEST_WOA)) -And (-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) {
|
||||
$env:RUN_TESTS="true"
|
||||
}
|
||||
- ps: >-
|
||||
if ($env:RUN_TESTS -eq 'true') {
|
||||
New-Item .\out\Default\gen\node_headers\Release -Type directory
|
||||
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
|
||||
} else {
|
||||
echo "Skipping tests for $env:GN_CONFIG build"
|
||||
}
|
||||
- cd electron
|
||||
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
||||
- if "%RUN_TESTS%"=="true" ( echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log --disable-features=CalculateNativeWinOcclusion )
|
||||
- if "%RUN_TESTS%"=="true" ( echo Running remote test suite & node script/yarn test -- --trace-uncaught --runners=remote --runTestFilesSeperately --enable-logging=file --log-file=%cd%\electron.log --disable-features=CalculateNativeWinOcclusion )
|
||||
- if "%RUN_TESTS%"=="true" ( echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log --disable-features=CalculateNativeWinOcclusion )
|
||||
- cd ..
|
||||
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
|
||||
- echo "About to verify mksnapshot"
|
||||
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
|
||||
- echo "Done verifying mksnapshot"
|
||||
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )
|
||||
- echo "Done verifying chromedriver"
|
||||
deploy_script:
|
||||
- cd electron
|
||||
- ps: >-
|
||||
if (Test-Path Env:\ELECTRON_RELEASE) {
|
||||
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
|
||||
Write-Output "Uploading Electron release distribution to azure"
|
||||
& python script\release\uploaders\upload.py --verbose --upload_to_storage
|
||||
} else {
|
||||
# It's useful to have pdb files when debugging testing builds that are
|
||||
# built on CI.
|
||||
7z a pdb.zip out\Default\*.pdb
|
||||
Write-Output "Uploading Electron release distribution to github releases"
|
||||
& python script\release\uploaders\upload.py --verbose
|
||||
}
|
||||
- python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
|
||||
|
||||
deploy_script:
|
||||
- cd electron
|
||||
- ps: >-
|
||||
if (Test-Path Env:\ELECTRON_RELEASE) {
|
||||
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
|
||||
Write-Output "Uploading Electron release distribution to azure"
|
||||
& python script\release\uploaders\upload.py --verbose --upload_to_storage
|
||||
} else {
|
||||
Write-Output "Uploading Electron release distribution to github releases"
|
||||
& python script\release\uploaders\upload.py --verbose
|
||||
}
|
||||
} elseif (Test-Path Env:\TEST_WOA) {
|
||||
node script/release/ci-release-build.js --job=electron-woa-testing --ci=GHA --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
|
||||
}
|
||||
on_finish:
|
||||
# Uncomment this lines to enable RDP
|
||||
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
- cd C:\projects\src
|
||||
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
|
||||
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
|
||||
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
|
||||
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
|
||||
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
|
||||
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
|
||||
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
|
||||
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
|
||||
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
|
||||
- if exist builtins-pgo.zip (appveyor-retry appveyor PushArtifact builtins-pgo.zip)
|
||||
- ps: >-
|
||||
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
|
||||
appveyor-retry appveyor PushArtifact pdb.zip
|
||||
}
|
||||
} elseif (Test-Path Env:\TEST_WOA) {
|
||||
node script/release/ci-release-build.js --job=electron-woa-testing --ci=GHA --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
|
||||
}
|
||||
on_finish:
|
||||
# Uncomment this lines to enable RDP
|
||||
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
- cd ..
|
||||
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
|
||||
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
|
||||
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
|
||||
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
|
||||
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
|
||||
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
|
||||
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
|
||||
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
|
||||
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
|
||||
- ps: >-
|
||||
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
|
||||
appveyor-retry appveyor PushArtifact pdb.zip
|
||||
}
|
||||
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- job_name: Test
|
||||
|
||||
init:
|
||||
- ps: |
|
||||
if ($env:RUN_TESTS -ne 'true') {
|
||||
Write-warning "Skipping tests for $env:APPVEYOR_PROJECT_NAME"; Exit-AppveyorBuild
|
||||
}
|
||||
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
|
||||
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
|
||||
}
|
||||
build_script:
|
||||
- ps: |
|
||||
node script/yarn.js install --frozen-lockfile
|
||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-warning "Skipping tests for doc only change"; Exit-AppveyorBuild
|
||||
}
|
||||
$global:LASTEXITCODE = 0
|
||||
- ps: |
|
||||
cd ..
|
||||
mkdir out\Default
|
||||
cd ..
|
||||
# Download build artifacts
|
||||
$apiUrl = 'https://ci.appveyor.com/api'
|
||||
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
|
||||
$artifacts_to_download = @('dist.zip','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','builtins-pgo.zip')
|
||||
foreach ($job in $build_info.build.jobs) {
|
||||
if ($job.name -eq "Build") {
|
||||
$jobId = $job.jobId
|
||||
foreach($artifact_name in $artifacts_to_download) {
|
||||
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
|
||||
$outfile = "src\out\Default\$artifact_name"
|
||||
} else {
|
||||
$outfile = $artifact_name
|
||||
}
|
||||
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
|
||||
}
|
||||
}
|
||||
}
|
||||
- ps: |
|
||||
$out_default_zips = @('dist.zip','chromedriver.zip','mksnapshot.zip')
|
||||
foreach($zip_name in $out_default_zips) {
|
||||
7z x -y -osrc\out\Default $zip_name
|
||||
}
|
||||
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
|
||||
- ps: 7z x -y -osrc node_headers.zip
|
||||
- ps: 7z x -y -osrc builtins-pgo.zip
|
||||
|
||||
test_script:
|
||||
# Workaround for https://github.com/appveyor/ci/issues/2420
|
||||
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
|
||||
- ps: |
|
||||
cd src
|
||||
New-Item .\out\Default\gen\node_headers\Release -Type directory
|
||||
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
|
||||
- cd electron
|
||||
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log
|
||||
- echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log
|
||||
- cd ..
|
||||
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
||||
- echo "About to verify mksnapshot"
|
||||
- echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
|
||||
- echo "Done verifying mksnapshot"
|
||||
- echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
|
||||
- echo "Done verifying chromedriver"
|
||||
|
||||
on_finish:
|
||||
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
|
||||
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
|
||||
node_module_version = 109
|
||||
node_module_version = 107
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_embedder_string = "-electron.0"
|
||||
@@ -45,3 +45,5 @@ enable_cet_shadow_stack = false
|
||||
# V8 in the browser process.
|
||||
# Ref: https://source.chromium.org/chromium/chromium/src/+/45fba672185aae233e75d6ddc81ea1e0b30db050:v8/BUILD.gn;l=281
|
||||
is_cfi = false
|
||||
|
||||
v8_enable_sandboxed_pointers = false
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
template("node_action") {
|
||||
assert(defined(invoker.script), "Need script path to run")
|
||||
assert(defined(invoker.args), "Need script arguments")
|
||||
import("node.gni")
|
||||
|
||||
# TODO(MarshallOfSound): Move to electron/node, this is the only place it is used now
|
||||
# Run an action with a given working directory. Behaves identically to the
|
||||
# action() target type, with the exception that it changes directory before
|
||||
# running the script.
|
||||
#
|
||||
# Parameters:
|
||||
# cwd [required]: Directory to change to before running the script.
|
||||
template("chdir_action") {
|
||||
action(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
"*",
|
||||
[
|
||||
"deps",
|
||||
"public_deps",
|
||||
"sources",
|
||||
"inputs",
|
||||
"outputs",
|
||||
"script",
|
||||
"args",
|
||||
])
|
||||
if (!defined(inputs)) {
|
||||
inputs = []
|
||||
assert(defined(cwd), "Need cwd in $target_name")
|
||||
script = "//electron/build/run-in-dir.py"
|
||||
if (defined(sources)) {
|
||||
sources += [ invoker.script ]
|
||||
} else {
|
||||
assert(defined(inputs))
|
||||
inputs += [ invoker.script ]
|
||||
}
|
||||
inputs += [ invoker.script ]
|
||||
script = "//electron/build/run-node.py"
|
||||
args = [ rebase_path(invoker.script) ] + invoker.args
|
||||
args = [
|
||||
rebase_path(cwd),
|
||||
rebase_path(invoker.script),
|
||||
]
|
||||
args += invoker.args
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
config("build_time_executable") {
|
||||
configs = []
|
||||
|
||||
if (is_electron_build && !is_component_build) {
|
||||
# The executables which have this config applied are dependent on ffmpeg,
|
||||
# which is always a shared library in an Electron build. However, in the
|
||||
# non-component build, executables don't have rpath set to search for
|
||||
# libraries in the executable's directory, so ffmpeg cannot be found. So
|
||||
# let's make sure rpath is set here.
|
||||
# See '//build/config/gcc/BUILD.gn' for details on the rpath setting.
|
||||
if (is_linux) {
|
||||
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
ldflags = [ "-Wl,-rpath,@loader_path/." ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# For MAS build, we force defining "MAS_BUILD".
|
||||
config("mas_build") {
|
||||
if (is_mas_build) {
|
||||
|
||||
@@ -19,13 +19,17 @@ TEMPLATE_H = """
|
||||
#define FUSE_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
namespace electron::fuses {
|
||||
namespace electron {
|
||||
|
||||
namespace fuses {
|
||||
|
||||
extern const volatile char kFuseWire[];
|
||||
|
||||
{getters}
|
||||
|
||||
} // namespace electron::fuses
|
||||
} // namespace fuses
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // ELECTRON_FUSES_H_
|
||||
"""
|
||||
@@ -33,13 +37,17 @@ extern const volatile char kFuseWire[];
|
||||
TEMPLATE_CC = """
|
||||
#include "electron/fuses.h"
|
||||
|
||||
namespace electron::fuses {
|
||||
namespace electron {
|
||||
|
||||
namespace fuses {
|
||||
|
||||
const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version */ {fuse_version}, /* fuse_wire_length */ {fuse_wire_length}, /* fuse_wire */ {initial_config}};
|
||||
|
||||
{getters}
|
||||
|
||||
} // namespace electron:fuses
|
||||
}
|
||||
|
||||
}
|
||||
"""
|
||||
|
||||
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:
|
||||
|
||||
@@ -7,6 +7,5 @@
|
||||
"node_options": "1",
|
||||
"node_cli_inspect": "1",
|
||||
"embedded_asar_integrity_validation": "0",
|
||||
"only_load_app_from_asar": "0",
|
||||
"load_browser_process_specific_v8_snapshot": "0"
|
||||
"only_load_app_from_asar": "0"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ TEMPLATE = """
|
||||
#include "node_native_module.h"
|
||||
#include "node_internals.h"
|
||||
|
||||
namespace node::native_module {{
|
||||
namespace node {{
|
||||
|
||||
namespace native_module {{
|
||||
|
||||
{definitions}
|
||||
|
||||
@@ -16,7 +18,9 @@ void NativeModuleLoader::LoadEmbedderJavaScriptSource() {{
|
||||
{initializers}
|
||||
}}
|
||||
|
||||
}} // namespace node::native_module
|
||||
}} // namespace native_module
|
||||
|
||||
}} // namespace node
|
||||
"""
|
||||
|
||||
def main():
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Cocoa .app bundle. The presence of these empty directories is sufficient to
|
||||
# convince Cocoa that the application supports the named localization, even if
|
||||
# an InfoPlist.strings file is not provided. Chrome uses these empty locale
|
||||
# directories for its helper executable bundles, which do not otherwise
|
||||
# directoires for its helper executable bundles, which do not otherwise
|
||||
# require any direct Cocoa locale support.
|
||||
|
||||
import os
|
||||
|
||||
21
build/node.gni
Normal file
21
build/node.gni
Normal file
@@ -0,0 +1,21 @@
|
||||
template("node_action") {
|
||||
assert(defined(invoker.script), "Need script path to run")
|
||||
assert(defined(invoker.args), "Need script argumets")
|
||||
|
||||
action(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"deps",
|
||||
"public_deps",
|
||||
"sources",
|
||||
"inputs",
|
||||
"outputs",
|
||||
])
|
||||
if (!defined(inputs)) {
|
||||
inputs = []
|
||||
}
|
||||
inputs += [ invoker.script ]
|
||||
script = "//electron/build/run-node.py"
|
||||
args = [ rebase_path(invoker.script) ] + invoker.args
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
template("npm_action") {
|
||||
assert(defined(invoker.script),
|
||||
"Need script name to run (must be defined in package.json)")
|
||||
assert(defined(invoker.args), "Need script arguments")
|
||||
assert(defined(invoker.args), "Need script argumets")
|
||||
|
||||
action("npm_pre_flight_" + target_name) {
|
||||
inputs = [
|
||||
|
||||
@@ -51,7 +51,7 @@ template("compile_ib_files") {
|
||||
# Template to compile and package Mac XIB files as bundle data.
|
||||
# Arguments
|
||||
# sources:
|
||||
# list of string, sources to compile
|
||||
# list of string, sources to comiple
|
||||
# output_path:
|
||||
# (optional) string, the path to use for the outputs list in the
|
||||
# bundle_data step. If unspecified, defaults to bundle_resources_dir.
|
||||
|
||||
@@ -6,7 +6,6 @@ import("//build/config/ozone.gni")
|
||||
import("//build/config/ui.gni")
|
||||
import("//components/spellcheck/spellcheck_build_features.gni")
|
||||
import("//electron/buildflags/buildflags.gni")
|
||||
import("//ppapi/buildflags/buildflags.gni")
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
import("//third_party/widevine/cdm/widevine.gni")
|
||||
|
||||
@@ -105,7 +104,6 @@ static_library("chrome") {
|
||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h",
|
||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm",
|
||||
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
|
||||
"//chrome/browser/platform_util_mac.mm",
|
||||
"//chrome/browser/process_singleton_mac.mm",
|
||||
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h",
|
||||
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm",
|
||||
@@ -157,7 +155,10 @@ static_library("chrome") {
|
||||
"//services/strings",
|
||||
]
|
||||
|
||||
deps = [ "//chrome/browser:resource_prefetch_predictor_proto" ]
|
||||
deps = [
|
||||
"//chrome/browser:resource_prefetch_predictor_proto",
|
||||
"//components/optimization_guide/proto:optimization_guide_proto",
|
||||
]
|
||||
|
||||
if (is_linux) {
|
||||
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
|
||||
@@ -230,10 +231,6 @@ static_library("chrome") {
|
||||
"//chrome/browser/printing/printer_query.h",
|
||||
"//chrome/browser/printing/printing_service.cc",
|
||||
"//chrome/browser/printing/printing_service.h",
|
||||
"//components/printing/browser/print_to_pdf/pdf_print_job.cc",
|
||||
"//components/printing/browser/print_to_pdf/pdf_print_job.h",
|
||||
"//components/printing/browser/print_to_pdf/pdf_print_utils.cc",
|
||||
"//components/printing/browser/print_to_pdf/pdf_print_utils.h",
|
||||
]
|
||||
|
||||
if (enable_oop_printing) {
|
||||
@@ -373,20 +370,15 @@ source_set("plugins") {
|
||||
deps += [
|
||||
"//components/strings",
|
||||
"//media:media_buildflags",
|
||||
"//ppapi/buildflags",
|
||||
"//ppapi/host",
|
||||
"//ppapi/proxy",
|
||||
"//ppapi/proxy:ipc",
|
||||
"//ppapi/shared_impl",
|
||||
"//services/device/public/mojom",
|
||||
"//skia",
|
||||
"//storage/browser",
|
||||
]
|
||||
|
||||
if (enable_ppapi) {
|
||||
deps += [
|
||||
"//ppapi/buildflags",
|
||||
"//ppapi/host",
|
||||
"//ppapi/proxy",
|
||||
"//ppapi/proxy:ipc",
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
# This source set is just so we don't have to depend on all of //chrome/browser
|
||||
@@ -408,19 +400,14 @@ source_set("chrome_spellchecker") {
|
||||
"//chrome/browser/spellchecker/spellcheck_factory.h",
|
||||
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
|
||||
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.cc",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.h",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
|
||||
"//chrome/browser/spellchecker/spellcheck_service.cc",
|
||||
"//chrome/browser/spellchecker/spellcheck_service.h",
|
||||
]
|
||||
|
||||
if (!is_mac) {
|
||||
sources += [
|
||||
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.cc",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.h",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
|
||||
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (has_spellcheck_panel) {
|
||||
sources += [
|
||||
"//chrome/browser/spellchecker/spell_check_panel_host_impl.cc",
|
||||
|
||||
@@ -83,7 +83,7 @@ function loadApplicationPackage (packagePath: string) {
|
||||
});
|
||||
|
||||
try {
|
||||
// Override app's package.json data.
|
||||
// Override app name and version.
|
||||
packagePath = path.resolve(packagePath);
|
||||
const packageJsonPath = path.join(packagePath, 'package.json');
|
||||
let appPath;
|
||||
@@ -104,16 +104,6 @@ function loadApplicationPackage (packagePath: string) {
|
||||
} else if (packageJson.name) {
|
||||
app.name = packageJson.name;
|
||||
}
|
||||
if (packageJson.desktopName) {
|
||||
app.setDesktopName(packageJson.desktopName);
|
||||
} else {
|
||||
app.setDesktopName(`${app.name}.desktop`);
|
||||
}
|
||||
// Set v8 flags, deliberately lazy load so that apps that do not use this
|
||||
// feature do not pay the price
|
||||
if (packageJson.v8Flags) {
|
||||
require('v8').setFlagsFromString(packageJson.v8Flags);
|
||||
}
|
||||
appPath = packagePath;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ an issue:
|
||||
* [Mac App Store](tutorial/mac-app-store-submission-guide.md)
|
||||
* [Windows Store](tutorial/windows-store-guide.md)
|
||||
* [Snapcraft](tutorial/snapcraft.md)
|
||||
* [ASAR Archives](tutorial/asar-archives.md)
|
||||
* [Updates](tutorial/updates.md)
|
||||
* [Getting Support](tutorial/support.md)
|
||||
|
||||
@@ -83,6 +82,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||
* Electron Releases & Developer Feedback
|
||||
* [Versioning Policy](tutorial/electron-versioning.md)
|
||||
* [Release Timelines](tutorial/electron-timelines.md)
|
||||
* [Testing Widevine CDM](tutorial/testing-widevine-cdm.md)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -130,11 +130,6 @@ set `NSPrincipalClass` to `AtomApplication`.
|
||||
|
||||
You should call `event.preventDefault()` if you want to handle this event.
|
||||
|
||||
As with the `open-file` event, be sure to register a listener for the `open-url`
|
||||
event early in your application startup to detect if the the application being
|
||||
is being opened to handle a URL. If you register the listener in response to a
|
||||
`ready` event, you'll miss URLs that trigger the launch of your application.
|
||||
|
||||
### Event: 'activate' _macOS_
|
||||
|
||||
Returns:
|
||||
@@ -715,7 +710,7 @@ To set the locale, you'll want to use a command line switch at app startup, whic
|
||||
**Note:** When distributing your packaged app, you have to also ship the
|
||||
`locales` folder.
|
||||
|
||||
**Note:** This API must be called after the `ready` event is emitted.
|
||||
**Note:** On Windows, you have to call it after the `ready` events gets emitted.
|
||||
|
||||
### `app.getLocaleCountryCode()`
|
||||
|
||||
@@ -723,12 +718,6 @@ Returns `string` - User operating system's locale two-letter [ISO 3166](https://
|
||||
|
||||
**Note:** When unable to detect locale country code, it returns empty string.
|
||||
|
||||
### `app.getSystemLocale()`
|
||||
|
||||
Returns `string` - The current system locale. On Windows and Linux, it is fetched using Chromium's `i18n` library. On macOS, the `NSLocale` object is used instead.
|
||||
|
||||
**Note:** This API must be called after the `ready` event is emitted.
|
||||
|
||||
### `app.addRecentDocument(path)` _macOS_ _Windows_
|
||||
|
||||
* `path` string
|
||||
@@ -1392,7 +1381,7 @@ method returns false. If we fail to perform the copy, then this method will
|
||||
throw an error. The message in the error should be informative and tell
|
||||
you exactly what went wrong.
|
||||
|
||||
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the preexisting running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
|
||||
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ green and non-draggable regions will be colored red to aid debugging.
|
||||
|
||||
### `ELECTRON_DEBUG_NOTIFICATIONS`
|
||||
|
||||
Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to.
|
||||
Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a
|
||||
tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to.
|
||||
|
||||
Sample output:
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ console.log(image)
|
||||
* `options` Object
|
||||
* `width` Integer
|
||||
* `height` Integer
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `NativeImage`
|
||||
|
||||
@@ -162,7 +162,7 @@ pixel data returned by `toBitmap()`. The specific format is platform-dependent.
|
||||
* `options` Object (optional)
|
||||
* `width` Integer (optional) - Required for bitmap buffers.
|
||||
* `height` Integer (optional) - Required for bitmap buffers.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `NativeImage`
|
||||
|
||||
@@ -225,7 +225,7 @@ The following methods are available on instances of the `NativeImage` class:
|
||||
#### `image.toPNG([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's `PNG` encoded data.
|
||||
|
||||
@@ -238,7 +238,7 @@ Returns `Buffer` - A [Buffer][buffer] that contains the image's `JPEG` encoded d
|
||||
#### `image.toBitmap([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains a copy of the image's raw bitmap pixel
|
||||
data.
|
||||
@@ -246,14 +246,14 @@ data.
|
||||
#### `image.toDataURL([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `string` - The data URL of the image.
|
||||
|
||||
#### `image.getBitmap([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.
|
||||
|
||||
@@ -276,7 +276,7 @@ Returns `boolean` - Whether the image is empty.
|
||||
|
||||
#### `image.getSize([scaleFactor])`
|
||||
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns [`Size`](structures/size.md).
|
||||
|
||||
@@ -317,20 +317,20 @@ will be preserved in the resized image.
|
||||
|
||||
#### `image.getAspectRatio([scaleFactor])`
|
||||
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Number` - The image's aspect ratio.
|
||||
Returns `Float` - The image's aspect ratio.
|
||||
|
||||
If `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.
|
||||
|
||||
#### `image.getScaleFactors()`
|
||||
|
||||
Returns `Number[]` - An array of all scale factors corresponding to representations for a given nativeImage.
|
||||
Returns `Float[]` - An array of all scale factors corresponding to representations for a given nativeImage.
|
||||
|
||||
#### `image.addRepresentation(options)`
|
||||
|
||||
* `options` Object
|
||||
* `scaleFactor` Number (optional) - The scale factor to add the image representation for.
|
||||
* `scaleFactor` Double - The scale factor to add the image representation for.
|
||||
* `width` Integer (optional) - Defaults to 0. Required if a bitmap buffer
|
||||
is specified as `buffer`.
|
||||
* `height` Integer (optional) - Defaults to 0. Required if a bitmap buffer
|
||||
|
||||
@@ -10,12 +10,11 @@ An example of implementing a protocol that has the same effect as the
|
||||
```javascript
|
||||
const { app, protocol } = require('electron')
|
||||
const path = require('path')
|
||||
const url = require('url')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
protocol.registerFileProtocol('atom', (request, callback) => {
|
||||
const filePath = url.fileURLToPath('file://' + request.url.slice('atom://'.length))
|
||||
callback(filePath)
|
||||
const url = request.url.substr(7)
|
||||
callback({ path: path.normalize(`${__dirname}/${url}`) })
|
||||
})
|
||||
})
|
||||
```
|
||||
@@ -176,7 +175,7 @@ property.
|
||||
* `handler` Function
|
||||
* `request` [ProtocolRequest](structures/protocol-request.md)
|
||||
* `callback` Function
|
||||
* `response` [ProtocolResponse](structures/protocol-response.md)
|
||||
* `response` ProtocolResponse
|
||||
|
||||
Returns `boolean` - Whether the protocol was successfully registered
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
# pushNotifications
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
> Register for and receive notifications from remote push notification services
|
||||
|
||||
For example, when registering for push notifications via Apple push notification services (APNS):
|
||||
|
||||
```javascript
|
||||
const { pushNotifications, Notification } = require('electron')
|
||||
|
||||
pushNotifications.registerForAPNSNotifications().then((token) => {
|
||||
// forward token to your remote notification server
|
||||
})
|
||||
|
||||
pushNotifications.on('received-apns-notification', (event, userInfo) => {
|
||||
// generate a new Notification object with the relevant userInfo fields
|
||||
})
|
||||
```
|
||||
|
||||
## Events
|
||||
|
||||
The `pushNotification` module emits the following events:
|
||||
|
||||
#### Event: 'received-apns-notification' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
* `userInfo` Record<String, any>
|
||||
|
||||
Emitted when the app receives a remote notification while running.
|
||||
See: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
|
||||
|
||||
## Methods
|
||||
|
||||
The `pushNotification` module has the following methods:
|
||||
|
||||
### `pushNotifications.registerForAPNSNotifications()` _macOS_
|
||||
|
||||
Returns `Promise<string>`
|
||||
|
||||
Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/sremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message.
|
||||
See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
|
||||
|
||||
### `pushNotifications.unregisterForAPNSNotifications()` _macOS_
|
||||
|
||||
Unregisters the app from notifications received from APNS.
|
||||
See: https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
|
||||
@@ -635,7 +635,7 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
|
||||
* `notifications` - Request notification creation and the ability to display them in the user's system tray.
|
||||
* `midi` - Request MIDI access in the `webmidi` API.
|
||||
* `midiSysex` - Request the use of system exclusive messages in the `webmidi` API.
|
||||
* `pointerLock` - Request to directly interpret mouse movements as an input method. Click [here](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) to know more. These requests always appear to originate from the main frame.
|
||||
* `pointerLock` - Request to directly interpret mouse movements as an input method. Click [here](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) to know more.
|
||||
* `fullscreen` - Request for the app to enter fullscreen mode.
|
||||
* `openExternal` - Request to open links in external applications.
|
||||
* `unknown` - An unrecognized permission request
|
||||
@@ -769,71 +769,6 @@ app.whenReady().then(() => {
|
||||
})
|
||||
```
|
||||
|
||||
#### `ses.setBluetoothPairingHandler(handler)` _Windows_ _Linux_
|
||||
|
||||
* `handler` Function | null
|
||||
* `details` Object
|
||||
* `deviceId` string
|
||||
* `pairingKind` string - The type of pairing prompt being requested.
|
||||
One of the following values:
|
||||
* `confirm`
|
||||
This prompt is requesting confirmation that the Bluetooth device should
|
||||
be paired.
|
||||
* `confirmPin`
|
||||
This prompt is requesting confirmation that the provided PIN matches the
|
||||
pin displayed on the device.
|
||||
* `providePin`
|
||||
This prompt is requesting that a pin be provided for the device.
|
||||
* `frame` [WebFrameMain](web-frame-main.md)
|
||||
* `pin` string (optional) - The pin value to verify if `pairingKind` is `confirmPin`.
|
||||
* `callback` Function
|
||||
* `response` Object
|
||||
* `confirmed` boolean - `false` should be passed in if the dialog is canceled.
|
||||
If the `pairingKind` is `confirm` or `confirmPin`, this value should indicate
|
||||
if the pairing is confirmed. If the `pairingKind` is `providePin` the value
|
||||
should be `true` when a value is provided.
|
||||
* `pin` string | null (optional) - When the `pairingKind` is `providePin`
|
||||
this value should be the required pin for the Bluetooth device.
|
||||
|
||||
Sets a handler to respond to Bluetooth pairing requests. This handler
|
||||
allows developers to handle devices that require additional validation
|
||||
before pairing. When a handler is not defined, any pairing on Linux or Windows
|
||||
that requires additional validation will be automatically cancelled.
|
||||
macOS does not require a handler because macOS handles the pairing
|
||||
automatically. To clear the handler, call `setBluetoothPairingHandler(null)`.
|
||||
|
||||
```javascript
|
||||
|
||||
const { app, BrowserWindow, ipcMain, session } = require('electron')
|
||||
|
||||
let bluetoothPinCallback = null
|
||||
|
||||
function createWindow () {
|
||||
const mainWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Listen for an IPC message from the renderer to get the response for the Bluetooth pairing.
|
||||
ipcMain.on('bluetooth-pairing-response', (event, response) => {
|
||||
bluetoothPinCallback(response)
|
||||
})
|
||||
|
||||
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
|
||||
bluetoothPinCallback = callback
|
||||
// Send a IPC message to the renderer to prompt the user to confirm the pairing.
|
||||
// Note that this will require logic in the renderer to handle this message and
|
||||
// display a prompt to the user.
|
||||
mainWindow.webContents.send('bluetooth-pairing-request', details)
|
||||
})
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow()
|
||||
})
|
||||
```
|
||||
|
||||
#### `ses.clearHostResolverCache()`
|
||||
|
||||
Returns `Promise<void>` - Resolves when the operation is complete.
|
||||
@@ -997,7 +932,7 @@ Returns `string[]` - An array of language codes the spellchecker is enabled for.
|
||||
will fallback to using `en-US`. By default on launch if this setting is an empty list Electron will try to populate this
|
||||
setting with the current OS locale. This setting is persisted across restarts.
|
||||
|
||||
**Note:** On macOS the OS spellchecker is used and has its own list of languages. On macOS, this API will return whichever languages have been configured by the OS.
|
||||
**Note:** On macOS the OS spellchecker is used and has its own list of languages. This API is a no-op on macOS.
|
||||
|
||||
#### `ses.setSpellCheckerDictionaryDownloadURL(url)`
|
||||
|
||||
|
||||
@@ -45,13 +45,6 @@ returns `null`.
|
||||
Returns `WebContents` | undefined - A WebContents instance with the given ID, or
|
||||
`undefined` if there is no WebContents associated with the given ID.
|
||||
|
||||
### `webContents.fromFrame(frame)`
|
||||
|
||||
* `frame` WebFrameMain
|
||||
|
||||
Returns `WebContents` | undefined - A WebContents instance with the given WebFrameMain, or
|
||||
`undefined` if there is no WebContents associated with the given WebFrameMain.
|
||||
|
||||
### `webContents.fromDevToolsTargetId(targetId)`
|
||||
|
||||
* `targetId` string - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance.
|
||||
@@ -869,8 +862,6 @@ Returns:
|
||||
|
||||
Emitted when the renderer process sends an asynchronous message via `ipcRenderer.send()`.
|
||||
|
||||
See also [`webContents.ipc`](#contentsipc-readonly), which provides an [`IpcMain`](ipc-main.md)-like interface for responding to IPC messages specifically from this WebContents.
|
||||
|
||||
#### Event: 'ipc-message-sync'
|
||||
|
||||
Returns:
|
||||
@@ -881,8 +872,6 @@ Returns:
|
||||
|
||||
Emitted when the renderer process sends a synchronous message via `ipcRenderer.sendSync()`.
|
||||
|
||||
See also [`webContents.ipc`](#contentsipc-readonly), which provides an [`IpcMain`](ipc-main.md)-like interface for responding to IPC messages specifically from this WebContents.
|
||||
|
||||
#### Event: 'preferred-size-changed'
|
||||
|
||||
Returns:
|
||||
@@ -1439,7 +1428,7 @@ Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/
|
||||
* `header` string (optional) - string to be printed as page header.
|
||||
* `footer` string (optional) - string to be printed as page footer.
|
||||
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A3`,
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`.
|
||||
* `callback` Function (optional)
|
||||
* `success` boolean - Indicates success of the print call.
|
||||
* `failureReason` string - Error description called back if the print fails.
|
||||
@@ -1470,28 +1459,43 @@ win.webContents.print(options, (success, errorType) => {
|
||||
#### `contents.printToPDF(options)`
|
||||
|
||||
* `options` Object
|
||||
* `landscape` boolean (optional) - Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
|
||||
* `displayHeaderFooter` boolean (optional) - Whether to display header and footer. Defaults to false.
|
||||
* `printBackground` boolean (optional) - Whether to print background graphics. Defaults to false.
|
||||
* `scale` number(optional) - Scale of the webpage rendering. Defaults to 1.
|
||||
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`,
|
||||
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing `height` and `width` in inches. Defaults to `Letter`.
|
||||
* `margins` Object (optional)
|
||||
* `top` number (optional) - Top margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `bottom` number (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `left` number (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
|
||||
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `<span class=title></span>` would generate span containing the title.
|
||||
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
|
||||
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
||||
* `headerFooter` Record<string, string> (optional) - the header and footer for the PDF.
|
||||
* `title` string - The title for the PDF header.
|
||||
* `url` string - the url for the PDF footer.
|
||||
* `landscape` boolean (optional) - `true` for landscape, `false` for portrait.
|
||||
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
|
||||
default margin, 1 for no margin, and 2 for minimum margin.
|
||||
* `scaleFactor` number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
||||
* `from` number - Index of the first page to print (0-based).
|
||||
* `to` number - Index of the last page to print (inclusive) (0-based).
|
||||
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
|
||||
* `printBackground` boolean (optional) - Whether to print CSS backgrounds.
|
||||
* `printSelectionOnly` boolean (optional) - Whether to print selection only.
|
||||
|
||||
Returns `Promise<Buffer>` - Resolves with the generated PDF data.
|
||||
|
||||
Prints the window's web page as PDF.
|
||||
Prints window's web page as PDF with Chromium's preview printing custom
|
||||
settings.
|
||||
|
||||
The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
|
||||
|
||||
By default, an empty `options` will be regarded as:
|
||||
|
||||
```javascript
|
||||
{
|
||||
marginsType: 0,
|
||||
printBackground: false,
|
||||
printSelectionOnly: false,
|
||||
landscape: false,
|
||||
pageSize: 'A4',
|
||||
scaleFactor: 100
|
||||
}
|
||||
```
|
||||
|
||||
Use `page-break-before: always;` CSS style to force to print to a new page.
|
||||
|
||||
An example of `webContents.printToPDF`:
|
||||
|
||||
```javascript
|
||||
@@ -1500,7 +1504,7 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
|
||||
const win = new BrowserWindow()
|
||||
const win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.loadURL('http://github.com')
|
||||
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
@@ -1517,8 +1521,6 @@ win.webContents.on('did-finish-load', () => {
|
||||
})
|
||||
```
|
||||
|
||||
See [Page.printToPdf](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) for more information.
|
||||
|
||||
#### `contents.addWorkSpace(path)`
|
||||
|
||||
* `path` string
|
||||
@@ -1998,35 +2000,6 @@ This corresponds to the [animationPolicy][] accessibility feature in Chromium.
|
||||
|
||||
### Instance Properties
|
||||
|
||||
#### `contents.ipc` _Readonly_
|
||||
|
||||
An [`IpcMain`](ipc-main.md) scoped to just IPC messages sent from this
|
||||
WebContents.
|
||||
|
||||
IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
|
||||
`ipcRenderer.postMessage` will be delivered in the following order:
|
||||
|
||||
1. `contents.on('ipc-message')`
|
||||
2. `contents.mainFrame.on(channel)`
|
||||
3. `contents.ipc.on(channel)`
|
||||
4. `ipcMain.on(channel)`
|
||||
|
||||
Handlers registered with `invoke` will be checked in the following order. The
|
||||
first one that is defined will be called, the rest will be ignored.
|
||||
|
||||
1. `contents.mainFrame.handle(channel)`
|
||||
2. `contents.handle(channel)`
|
||||
3. `ipcMain.handle(channel)`
|
||||
|
||||
A handler or event listener registered on the WebContents will receive IPC
|
||||
messages sent from any frame, including child frames. In most cases, only the
|
||||
main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
|
||||
option is enabled, it is possible for child frames to send IPC messages also.
|
||||
In that case, handlers should check the `senderFrame` property of the IPC event
|
||||
to ensure that the message is coming from the expected frame. Alternatively,
|
||||
register handlers on the appropriate frame directly using the
|
||||
[`WebFrameMain.ipc`](web-frame-main.md#frameipc-readonly) interface.
|
||||
|
||||
#### `contents.audioMuted`
|
||||
|
||||
A `boolean` property that determines whether this page is muted.
|
||||
@@ -2086,11 +2059,6 @@ when the page becomes backgrounded. This also affects the Page Visibility API.
|
||||
|
||||
A [`WebFrameMain`](web-frame-main.md) property that represents the top frame of the page's frame hierarchy.
|
||||
|
||||
#### `contents.opener` _Readonly_
|
||||
|
||||
A [`WebFrameMain`](web-frame-main.md) property that represents the frame that opened this WebContents, either
|
||||
with open(), or by navigating a link with a target attribute.
|
||||
|
||||
[keyboardevent]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
||||
|
||||
@@ -140,45 +140,10 @@ ipcRenderer.on('port', (e, msg) => {
|
||||
|
||||
### Instance Properties
|
||||
|
||||
#### `frame.ipc` _Readonly_
|
||||
|
||||
An [`IpcMain`](ipc-main.md) instance scoped to the frame.
|
||||
|
||||
IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
|
||||
`ipcRenderer.postMessage` will be delivered in the following order:
|
||||
|
||||
1. `contents.on('ipc-message')`
|
||||
2. `contents.mainFrame.on(channel)`
|
||||
3. `contents.ipc.on(channel)`
|
||||
4. `ipcMain.on(channel)`
|
||||
|
||||
Handlers registered with `invoke` will be checked in the following order. The
|
||||
first one that is defined will be called, the rest will be ignored.
|
||||
|
||||
1. `contents.mainFrame.handle(channel)`
|
||||
2. `contents.handle(channel)`
|
||||
3. `ipcMain.handle(channel)`
|
||||
|
||||
In most cases, only the main frame of a WebContents can send or receive IPC
|
||||
messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
|
||||
possible for child frames to send and receive IPC messages also. The
|
||||
[`WebContents.ipc`](web-contents.md#contentsipc-readonly) interface may be more
|
||||
convenient when `nodeIntegrationInSubFrames` is not enabled.
|
||||
|
||||
#### `frame.url` _Readonly_
|
||||
|
||||
A `string` representing the current URL of the frame.
|
||||
|
||||
#### `frame.origin` _Readonly_
|
||||
|
||||
A `string` representing the current origin of the frame, serialized according
|
||||
to [RFC 6454](https://www.rfc-editor.org/rfc/rfc6454). This may be different
|
||||
from the URL. For instance, if the frame is a child window opened to
|
||||
`about:blank`, then `frame.origin` will return the parent frame's origin, while
|
||||
`frame.url` will return the empty string. Pages without a scheme/host/port
|
||||
triple origin will have the serialized origin of `"null"` (that is, the string
|
||||
containing the letters n, u, l, l).
|
||||
|
||||
#### `frame.top` _Readonly_
|
||||
|
||||
A `WebFrameMain | null` representing top frame in the frame hierarchy to which `frame`
|
||||
|
||||
@@ -565,21 +565,21 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
|
||||
### `<webview>.printToPDF(options)`
|
||||
|
||||
* `options` Object
|
||||
* `landscape` boolean (optional) - Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
|
||||
* `displayHeaderFooter` boolean (optional) - Whether to display header and footer. Defaults to false.
|
||||
* `printBackground` boolean (optional) - Whether to print background graphics. Defaults to false.
|
||||
* `scale` number(optional) - Scale of the webpage rendering. Defaults to 1.
|
||||
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`,
|
||||
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing `height` and `width` in inches. Defaults to `Letter`.
|
||||
* `margins` Object (optional)
|
||||
* `top` number (optional) - Top margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `bottom` number (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `left` number (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
|
||||
* `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
|
||||
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `<span class=title></span>` would generate span containing the title.
|
||||
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
|
||||
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
|
||||
* `headerFooter` Record<string, string> (optional) - the header and footer for the PDF.
|
||||
* `title` string - The title for the PDF header.
|
||||
* `url` string - the url for the PDF footer.
|
||||
* `landscape` boolean (optional) - `true` for landscape, `false` for portrait.
|
||||
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
|
||||
default margin, 1 for no margin, and 2 for minimum margin.
|
||||
and `width` in microns.
|
||||
* `scaleFactor` number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
||||
* `pageRanges` Record<string, number> (optional) - The page range to print. On macOS, only the first range is honored.
|
||||
* `from` number - Index of the first page to print (0-based).
|
||||
* `to` number - Index of the last page to print (inclusive) (0-based).
|
||||
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
|
||||
* `printBackground` boolean (optional) - Whether to print CSS backgrounds.
|
||||
* `printSelectionOnly` boolean (optional) - Whether to print selection only.
|
||||
|
||||
Returns `Promise<Uint8Array>` - Resolves with the generated PDF data.
|
||||
|
||||
|
||||
@@ -14,68 +14,6 @@ This document uses the following convention to categorize breaking changes:
|
||||
|
||||
## Planned Breaking API Changes (20.0)
|
||||
|
||||
### Behavior Changed: V8 Memory Cage enabled
|
||||
|
||||
The V8 memory cage has been enabled, which has implications for native modules
|
||||
which wrap non-V8 memory with `ArrayBuffer` or `Buffer`. See the [blog post
|
||||
about the V8 memory cage](https://www.electronjs.org/blog/v8-memory-cage) for
|
||||
more details.
|
||||
|
||||
### API Changed: `webContents.printToPDF()`
|
||||
|
||||
`webContents.printToPDF()` has been modified to conform to [`Page.printToPDF`](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) in the Chrome DevTools Protocol. This has been changes in order to
|
||||
address changes upstream that made our previous implementation untenable and rife with bugs.
|
||||
|
||||
**Arguments Changed**
|
||||
|
||||
* `pageRanges`
|
||||
|
||||
**Arguments Removed**
|
||||
|
||||
* `printSelectionOnly`
|
||||
* `marginsType`
|
||||
* `headerFooter`
|
||||
* `scaleFactor`
|
||||
|
||||
**Arguments Added**
|
||||
|
||||
* `headerTemplate`
|
||||
* `footerTemplate`
|
||||
* `displayHeaderFooter`
|
||||
* `margins`
|
||||
* `scale`
|
||||
* `preferCSSPageSize`
|
||||
|
||||
```js
|
||||
// Main process
|
||||
const { webContents } = require('electron')
|
||||
|
||||
webContents.printToPDF({
|
||||
landscape: true,
|
||||
displayHeaderFooter: true,
|
||||
printBackground: true,
|
||||
scale: 2,
|
||||
pageSize: 'Ledger',
|
||||
margins: {
|
||||
top: 2,
|
||||
bottom: 2,
|
||||
left: 2,
|
||||
right: 2
|
||||
},
|
||||
pageRanges: '1-5, 8, 11-13',
|
||||
headerTemplate: '<h1>Title</h1>',
|
||||
footerTemplate: '<div><span class="pageNumber"></span></div>',
|
||||
preferCSSPageSize: true
|
||||
}).then(data => {
|
||||
fs.writeFile(pdfPath, data, (error) => {
|
||||
if (error) throw error
|
||||
console.log(`Wrote PDF successfully to ${pdfPath}`)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(`Failed to write PDF to ${pdfPath}: `, error)
|
||||
})
|
||||
```
|
||||
|
||||
### Default Changed: renderers without `nodeIntegration: true` are sandboxed by default
|
||||
|
||||
Previously, renderers that specified a preload script defaulted to being
|
||||
|
||||
@@ -64,7 +64,7 @@ If you want to add a new API module to Electron, you'll want to look in [creatin
|
||||
|
||||
Electron has a fully-fledged governance system that oversees activity in Electron and whose working groups are responsible for areas like APIs, releases, and upgrades to Electron's dependencies including Chromium and Node.js. Depending on how frequently and to what end you want to contribute, you may want to consider joining a working group.
|
||||
|
||||
Details about each group and their responsibilities can be found in the [governance repo](https://github.com/electron/governance).
|
||||
Details about each group and their reponsibilities can be found in the [governance repo](https://github.com/electron/governance).
|
||||
|
||||
## Patches in Electron
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ $ sudo yum install clang dbus-devel gtk3-devel libnotify-devel \
|
||||
On Fedora, install the following libraries:
|
||||
|
||||
```sh
|
||||
$ sudo dnf install clang dbus-devel gperf gtk3-devel \
|
||||
libnotify-devel libgnome-keyring-devel libcap-devel \
|
||||
$ sudo dnf install clang dbus-devel gtk3-devel libnotify-devel \
|
||||
libgnome-keyring-devel xorg-x11-server-utils libcap-devel \
|
||||
cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \
|
||||
nss-devel python-dbusmock
|
||||
nss-devel python-dbusmock openjdk-8-jre
|
||||
```
|
||||
|
||||
On Arch Linux / Manjaro, install the following libraries:
|
||||
|
||||
@@ -9,7 +9,7 @@ Some of the more common approaches are outlined below.
|
||||
|
||||
Chromium contains logging macros which can aid debugging by printing information to console in C++ and Objective-C++.
|
||||
|
||||
You might use this to print out variable values, function names, and line numbers, amongst other things.
|
||||
You might use this to print out variable values, function names, and line numbers, amonst other things.
|
||||
|
||||
Some examples:
|
||||
|
||||
@@ -25,7 +25,7 @@ See [logging.h](https://chromium.googlesource.com/chromium/src/base/+/refs/heads
|
||||
|
||||
## Printing Stacktraces
|
||||
|
||||
Chromium contains a helper to print stack traces to console without interrupting the program.
|
||||
Chromium contains a helper to print stack traces to console without interrrupting the program.
|
||||
|
||||
```cpp
|
||||
#include "base/debug/stack_trace.h"
|
||||
|
||||
@@ -135,7 +135,7 @@ is only available in renderer processes.
|
||||
|
||||
If [sub-pixel anti-aliasing](https://alienryderflex.com/sub_pixel/) is deactivated, then fonts on LCD screens can look blurry. Example:
|
||||
|
||||

|
||||
![subpixel rendering example]
|
||||
|
||||
Sub-pixel anti-aliasing needs a non-transparent background of the layer containing the font glyphs. (See [this issue](https://github.com/electron/electron/issues/6344#issuecomment-420371918) for more info).
|
||||
|
||||
@@ -161,3 +161,4 @@ Notice that just setting the background in the CSS does not have the desired eff
|
||||
[indexed-db]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
||||
[message-port]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
|
||||
[browser-window]: api/browser-window.md
|
||||
[subpixel rendering example]: images/subpixel-rendering-screenshot.gif
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
const {app, BrowserWindow, ipcMain} = require('electron')
|
||||
const {app, BrowserWindow} = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
function createWindow () {
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
height: 600
|
||||
})
|
||||
|
||||
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
|
||||
@@ -17,18 +14,6 @@ function createWindow () {
|
||||
}
|
||||
})
|
||||
|
||||
// Listen for a message from the renderer to get the response for the Bluetooth pairing.
|
||||
ipcMain.on('bluetooth-pairing-response', (event, response) => {
|
||||
bluetoothPinCallback(response)
|
||||
})
|
||||
|
||||
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
|
||||
|
||||
bluetoothPinCallback = callback
|
||||
// Send a message to the renderer to prompt the user to confirm the pairing.
|
||||
mainWindow.webContents.send('bluetooth-pairing-request', details)
|
||||
})
|
||||
|
||||
mainWindow.loadFile('index.html')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
|
||||
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
|
||||
})
|
||||
@@ -5,30 +5,4 @@ async function testIt() {
|
||||
document.getElementById('device-name').innerHTML = device.name || `ID: ${device.id}`
|
||||
}
|
||||
|
||||
document.getElementById('clickme').addEventListener('click',testIt)
|
||||
|
||||
window.electronAPI.bluetoothPairingRequest((event, details) => {
|
||||
const response = {}
|
||||
|
||||
switch (details.pairingKind) {
|
||||
case 'confirm': {
|
||||
response.confirmed = confirm(`Do you want to connect to device ${details.deviceId}?`)
|
||||
break
|
||||
}
|
||||
case 'confirmPin': {
|
||||
response.confirmed = confirm(`Does the pin ${details.pin} match the pin displayed on device ${details.deviceId}?`)
|
||||
break
|
||||
}
|
||||
case 'providePin': {
|
||||
const pin = prompt(`Please provide a pin for ${details.deviceId}.`)
|
||||
if (pin) {
|
||||
response.pin = pin
|
||||
response.confirmed = true
|
||||
} else {
|
||||
response.confirmed = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.electronAPI.bluetoothPairingResponse(response)
|
||||
})
|
||||
document.getElementById('clickme').addEventListener('click',testIt)
|
||||
@@ -33,16 +33,12 @@ function createWindow () {
|
||||
if (permission === 'serial' && details.securityOrigin === 'file:///') {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
mainWindow.webContents.session.setDevicePermissionHandler((details) => {
|
||||
if (details.deviceType === 'serial' && details.origin === 'file://') {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
@@ -11,8 +11,8 @@ can either use specialized tooling or manual approaches.
|
||||
## With tooling
|
||||
|
||||
There are a couple tools out there that exist to package and distribute your Electron app.
|
||||
We recommend using [Electron Forge](./forge-overview.md). You can check out
|
||||
its [documentation](https://www.electronforge.io) directly, or refer to the [Packaging and Distribution](./tutorial-5-packaging.md)
|
||||
We recommend using [Electron Forge](https://www.electronforge.io). You can check out
|
||||
its documentation directly, or refer to the [Packaging and Distribution](./tutorial-5-packaging.md)
|
||||
part of the Electron tutorial.
|
||||
|
||||
## Manual packaging
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
---
|
||||
title: ASAR Archives
|
||||
description: What is ASAR archive and how does it affect the application.
|
||||
slug: asar-archives
|
||||
hide_title: false
|
||||
---
|
||||
|
||||
After creating an [application distribution](application-distribution.md), the
|
||||
app's source code are usually bundled into an [ASAR
|
||||
archive](https://github.com/electron/asar), which is a simple extensive archive
|
||||
format designed for Electron apps. By bundling the app we can mitigate issues
|
||||
around long path names on Windows, speed up `require` and conceal your source
|
||||
code from cursory inspection.
|
||||
|
||||
The bundled app runs in a virtual file system and most APIs would just work
|
||||
normally, but for some cases you might want to work on ASAR archives explicitly
|
||||
due to a few caveats.
|
||||
|
||||
## Using ASAR Archives
|
||||
|
||||
In Electron there are two sets of APIs: Node APIs provided by Node.js and Web
|
||||
APIs provided by Chromium. Both APIs support reading files from ASAR archives.
|
||||
|
||||
### Node API
|
||||
|
||||
With special patches in Electron, Node APIs like `fs.readFile` and `require`
|
||||
treat ASAR archives as virtual directories, and the files in it as normal
|
||||
files in the filesystem.
|
||||
|
||||
For example, suppose we have an `example.asar` archive under `/path/to`:
|
||||
|
||||
```sh
|
||||
$ asar list /path/to/example.asar
|
||||
/app.js
|
||||
/file.txt
|
||||
/dir/module.js
|
||||
/static/index.html
|
||||
/static/main.css
|
||||
/static/jquery.min.js
|
||||
```
|
||||
|
||||
Read a file in the ASAR archive:
|
||||
|
||||
```javascript
|
||||
const fs = require('fs')
|
||||
fs.readFileSync('/path/to/example.asar/file.txt')
|
||||
```
|
||||
|
||||
List all files under the root of the archive:
|
||||
|
||||
```javascript
|
||||
const fs = require('fs')
|
||||
fs.readdirSync('/path/to/example.asar')
|
||||
```
|
||||
|
||||
Use a module from the archive:
|
||||
|
||||
```javascript
|
||||
require('./path/to/example.asar/dir/module.js')
|
||||
```
|
||||
|
||||
You can also display a web page in an ASAR archive with `BrowserWindow`:
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow()
|
||||
|
||||
win.loadURL('file:///path/to/example.asar/static/index.html')
|
||||
```
|
||||
|
||||
### Web API
|
||||
|
||||
In a web page, files in an archive can be requested with the `file:` protocol.
|
||||
Like the Node API, ASAR archives are treated as directories.
|
||||
|
||||
For example, to get a file with `$.get`:
|
||||
|
||||
```html
|
||||
<script>
|
||||
let $ = require('./jquery.min.js')
|
||||
$.get('file:///path/to/example.asar/file.txt', (data) => {
|
||||
console.log(data)
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
### Treating an ASAR archive as a Normal File
|
||||
|
||||
For some cases like verifying the ASAR archive's checksum, we need to read the
|
||||
content of an ASAR archive as a file. For this purpose you can use the built-in
|
||||
`original-fs` module which provides original `fs` APIs without `asar` support:
|
||||
|
||||
```javascript
|
||||
const originalFs = require('original-fs')
|
||||
originalFs.readFileSync('/path/to/example.asar')
|
||||
```
|
||||
|
||||
You can also set `process.noAsar` to `true` to disable the support for `asar` in
|
||||
the `fs` module:
|
||||
|
||||
```javascript
|
||||
const fs = require('fs')
|
||||
process.noAsar = true
|
||||
fs.readFileSync('/path/to/example.asar')
|
||||
```
|
||||
|
||||
## Limitations of the Node API
|
||||
|
||||
Even though we tried hard to make ASAR archives in the Node API work like
|
||||
directories as much as possible, there are still limitations due to the
|
||||
low-level nature of the Node API.
|
||||
|
||||
### Archives Are Read-only
|
||||
|
||||
The archives can not be modified so all Node APIs that can modify files will not
|
||||
work with ASAR archives.
|
||||
|
||||
### Working Directory Can Not Be Set to Directories in Archive
|
||||
|
||||
Though ASAR archives are treated as directories, there are no actual
|
||||
directories in the filesystem, so you can never set the working directory to
|
||||
directories in ASAR archives. Passing them as the `cwd` option of some APIs
|
||||
will also cause errors.
|
||||
|
||||
### Extra Unpacking on Some APIs
|
||||
|
||||
Most `fs` APIs can read a file or get a file's information from ASAR archives
|
||||
without unpacking, but for some APIs that rely on passing the real file path to
|
||||
underlying system calls, Electron will extract the needed file into a
|
||||
temporary file and pass the path of the temporary file to the APIs to make them
|
||||
work. This adds a little overhead for those APIs.
|
||||
|
||||
APIs that requires extra unpacking are:
|
||||
|
||||
* `child_process.execFile`
|
||||
* `child_process.execFileSync`
|
||||
* `fs.open`
|
||||
* `fs.openSync`
|
||||
* `process.dlopen` - Used by `require` on native modules
|
||||
|
||||
### Fake Stat Information of `fs.stat`
|
||||
|
||||
The `Stats` object returned by `fs.stat` and its friends on files in `asar`
|
||||
archives is generated by guessing, because those files do not exist on the
|
||||
filesystem. So you should not trust the `Stats` object except for getting file
|
||||
size and checking file type.
|
||||
|
||||
### Executing Binaries Inside ASAR archive
|
||||
|
||||
There are Node APIs that can execute binaries like `child_process.exec`,
|
||||
`child_process.spawn` and `child_process.execFile`, but only `execFile` is
|
||||
supported to execute binaries inside ASAR archive.
|
||||
|
||||
This is because `exec` and `spawn` accept `command` instead of `file` as input,
|
||||
and `command`s are executed under shell. There is no reliable way to determine
|
||||
whether a command uses a file in asar archive, and even if we do, we can not be
|
||||
sure whether we can replace the path in command without side effects.
|
||||
|
||||
## Adding Unpacked Files to ASAR archives
|
||||
|
||||
As stated above, some Node APIs will unpack the file to the filesystem when
|
||||
called. Apart from the performance issues, various anti-virus scanners might
|
||||
be triggered by this behavior.
|
||||
|
||||
As a workaround, you can leave various files unpacked using the `--unpack` option.
|
||||
In the following example, shared libraries of native Node.js modules will not be
|
||||
packed:
|
||||
|
||||
```sh
|
||||
$ asar pack app app.asar --unpack *.node
|
||||
```
|
||||
|
||||
After running the command, you will notice that a folder named `app.asar.unpacked`
|
||||
was created together with the `app.asar` file. It contains the unpacked files
|
||||
and should be shipped together with the `app.asar` archive.
|
||||
@@ -1,53 +0,0 @@
|
||||
---
|
||||
title: 'ASAR Integrity'
|
||||
description: 'An experimental feature that ensures the validity of ASAR contents at runtime.'
|
||||
slug: asar-integrity
|
||||
hide_title: false
|
||||
---
|
||||
|
||||
## Platform Support
|
||||
|
||||
Currently ASAR integrity checking is only supported on macOS.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Electron Forge / Electron Packager
|
||||
|
||||
If you are using `>= electron-packager@15.4.0` or `>= @electron-forge/core@6.0.0-beta.61` then all these requirements are met for you automatically and you can skip to [Toggling the Fuse](#toggling-the-fuse).
|
||||
|
||||
### Other build systems
|
||||
|
||||
In order to enable ASAR integrity checking you need to ensure that your `app.asar` file was generated by a version of the `asar` npm package that supports asar integrity. Support was introduced in version `3.1.0`.
|
||||
|
||||
Your must then populate a valid `ElectronAsarIntegrity` dictionary block in your packaged apps `Info.plist`. An example is included below.
|
||||
|
||||
```plist
|
||||
<key>ElectronAsarIntegrity</key>
|
||||
<dict>
|
||||
<key>Resources/app.asar</key>
|
||||
<dict>
|
||||
<key>algorithm</key>
|
||||
<string>SHA256</string>
|
||||
<key>hash</key>
|
||||
<string>9d1f61ea03c4bb62b4416387a521101b81151da0cfbe18c9f8c8b818c5cebfac</string>
|
||||
</dict>
|
||||
</dict>
|
||||
```
|
||||
|
||||
Valid `algorithm` values are currently `SHA256` only. The `hash` is a hash of the ASAR header using the given algorithm. The `asar` package exposes a `getRawHeader` method whose result can then be hashed to generate this value.
|
||||
|
||||
## Toggling the Fuse
|
||||
|
||||
ASAR integrity checking is currently disabled by default and can be enabled by toggling a fuse. See [Electron Fuses](fuses.md) for more information on what Electron Fuses are and how they work. When enabling this fuse you typically also want to enable the `onlyLoadAppFromAsar` fuse otherwise the validity checking can be bypassed via the Electron app code search path.
|
||||
|
||||
```js
|
||||
require('@electron/fuses').flipFuses(
|
||||
// E.g. /a/b/Foo.app
|
||||
pathToPackagedApp,
|
||||
{
|
||||
version: FuseVersion.V1,
|
||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
||||
[FuseV1Options.OnlyLoadAppFromAsar]: true
|
||||
}
|
||||
)
|
||||
```
|
||||
@@ -26,8 +26,10 @@ beginners, using a command line tool is likely to be helpful*.
|
||||
|
||||
## electron-forge
|
||||
|
||||
Electron Forge is a tool for packaging and publishing Electron applications. It unifies Electron's tooling ecosystem
|
||||
into a single extensible interface so that anyone can jump right into making Electron apps.
|
||||
A "complete tool for building modern Electron applications". Electron Forge
|
||||
unifies the existing (and well maintained) build tools for Electron development
|
||||
into a cohesive package so that anyone can jump right in to Electron
|
||||
development.
|
||||
|
||||
Forge comes with [a ready-to-use template](https://electronforge.io/templates) using Webpack as a bundler. It includes an example typescript configuration and provides two configuration files to enable easy customization. It uses the same core modules used by the
|
||||
greater Electron community (like [`electron-packager`](https://github.com/electron/electron-packager)) –
|
||||
|
||||
@@ -54,11 +54,85 @@ and notarized requires a few additions to your configuration. [Forge](https://el
|
||||
collection of the official Electron tools, using [`electron-packager`],
|
||||
[`electron-osx-sign`], and [`electron-notarize`] under the hood.
|
||||
|
||||
Detailed instructions on how to configure your application can be found in the [Electron Forge Code Signing Tutorial](https://www.electronforge.io/guides/code-signing/code-signing-macos).
|
||||
Let's take a look at an example `package.json` configuration with all required fields. Not all of them are
|
||||
required: the tools will be clever enough to automatically find a suitable `identity`, for instance,
|
||||
but we recommend that you are explicit.
|
||||
|
||||
```json title="package.json" {7}
|
||||
{
|
||||
"name": "my-app",
|
||||
"version": "0.0.1",
|
||||
"config": {
|
||||
"forge": {
|
||||
"packagerConfig": {
|
||||
"osxSign": {
|
||||
"identity": "Developer ID Application: Felix Rieseberg (LT94ZKYDCJ)",
|
||||
"hardened-runtime": true,
|
||||
"entitlements": "entitlements.plist",
|
||||
"entitlements-inherit": "entitlements.plist",
|
||||
"signature-flags": "library"
|
||||
},
|
||||
"osxNotarize": {
|
||||
"appleId": "felix@felix.fun",
|
||||
"appleIdPassword": "my-apple-id-password"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `entitlements.plist` file referenced here needs the following macOS-specific entitlements
|
||||
to assure the Apple security mechanisms that your app is doing these things
|
||||
without meaning any harm:
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.debugger</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
Note that up until Electron 12, the `com.apple.security.cs.allow-unsigned-executable-memory` entitlement was required
|
||||
as well. However, it should not be used anymore if it can be avoided.
|
||||
|
||||
To see all of this in action, check out Electron Fiddle's source code,
|
||||
[especially its `electron-forge` configuration
|
||||
file](https://github.com/electron/fiddle/blob/master/forge.config.js).
|
||||
|
||||
If you plan to access the microphone or camera within your app using Electron's APIs, you'll also
|
||||
need to add the following entitlements:
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<key>com.apple.security.device.audio-input</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.camera</key>
|
||||
<true/>
|
||||
```
|
||||
|
||||
If these are not present in your app's entitlements when you invoke, for example:
|
||||
|
||||
```js title="main.js"
|
||||
const { systemPreferences } = require('electron')
|
||||
const microphone = systemPreferences.askForMediaAccess('microphone')
|
||||
```
|
||||
|
||||
Your app may crash. See the Resource Access section in [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) for more information and entitlements you may need.
|
||||
|
||||
### Using Electron Builder
|
||||
|
||||
Electron Builder comes with a custom solution for signing your application. You
|
||||
can find [its documentation here](https://www.electron.build/code-signing).
|
||||
|
||||
### Using Electron Packager
|
||||
|
||||
If you're not using an integrated build pipeline like Forge, you
|
||||
If you're not using an integrated build pipeline like Forge or Builder, you
|
||||
are likely using [`electron-packager`], which includes [`electron-osx-sign`] and
|
||||
[`electron-notarize`].
|
||||
|
||||
@@ -130,7 +204,36 @@ commit it to your source code.
|
||||
|
||||
### Using Electron Forge
|
||||
|
||||
Electron Forge is the recommended way to sign your `Squirrel.Windows` and `WiX MSI` installers. Detailed instructions on how to configure your application can be found in the [Electron Forge Code Signing Tutorial](https://www.electronforge.io/guides/code-signing/code-signing-macos).
|
||||
Once you have a code signing certificate file (`.pfx`), you can sign
|
||||
[Squirrel.Windows][maker-squirrel] and [MSI][maker-msi] installers in Electron Forge
|
||||
with the `certificateFile` and `certificatePassword` fields in their respective
|
||||
configuration objects.
|
||||
|
||||
For example, if you keep your Forge config in your `package.json` file and are
|
||||
creating a Squirrel.Windows installer:
|
||||
|
||||
```json {9-15} title='package.json'
|
||||
{
|
||||
"name": "my-app",
|
||||
"version": "0.0.1",
|
||||
//...
|
||||
"config": {
|
||||
"forge": {
|
||||
"packagerConfig": {},
|
||||
"makers": [
|
||||
{
|
||||
"name": "@electron-forge/maker-squirrel",
|
||||
"config": {
|
||||
"certificateFile": "./cert.pfx",
|
||||
"certificatePassword": "this-is-a-secret"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
### Using electron-winstaller (Squirrel.Windows)
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@ with bluetooth devices. In order to use this API in Electron, developers will
|
||||
need to handle the [`select-bluetooth-device` event on the webContents](../api/web-contents.md#event-select-bluetooth-device)
|
||||
associated with the device request.
|
||||
|
||||
Additionally, [`ses.setBluetoothPairingHandler(handler)`](../api/session.md#sessetbluetoothpairinghandlerhandler-windows-linux)
|
||||
can be used to handle pairing to bluetooth devices on Windows or Linux when
|
||||
additional validation such as a pin is needed.
|
||||
|
||||
### Example
|
||||
|
||||
This example demonstrates an Electron application that automatically selects
|
||||
@@ -47,7 +43,7 @@ the WebHID API:
|
||||
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
|
||||
can be used to provide default permissioning to devices without first calling
|
||||
for permission to devices via `navigator.hid.requestDevice`. Additionally,
|
||||
the default behavior of Electron is to store granted device permission through
|
||||
the default behavior of Electron is to store granted device permision through
|
||||
the lifetime of the corresponding WebContents. If longer term storage is
|
||||
needed, a developer can store granted device permissions (eg when handling
|
||||
the `select-hid-device` event) and then read from that storage with
|
||||
@@ -96,7 +92,7 @@ There are several additional APIs for working with the Web Serial API:
|
||||
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
|
||||
can be used to provide default permissioning to devices without first calling
|
||||
for permission to devices via `navigator.serial.requestPort`. Additionally,
|
||||
the default behavior of Electron is to store granted device permission through
|
||||
the default behavior of Electron is to store granted device permision through
|
||||
the lifetime of the corresponding WebContents. If longer term storage is
|
||||
needed, a developer can store granted device permissions (eg when handling
|
||||
the `select-serial-port` event) and then read from that storage with
|
||||
|
||||
@@ -11,7 +11,7 @@ you can deliver it to your users.
|
||||
## Packaging
|
||||
|
||||
To distribute your app with Electron, you need to package all your resources and assets
|
||||
into an executable and rebrand it. To do this, you can either use specialized tooling like Electron Forge
|
||||
into an executable and rebrand it. To do this, you can either use specialized tooling
|
||||
or do it manually. See the [Application Packaging][application-packaging] tutorial
|
||||
for more information.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ npm install --save-dev electron@latest
|
||||
|
||||
There are several major changes from our 1.x strategy outlined below. Each change is intended to satisfy the needs and priorities of developers/maintainers and app developers.
|
||||
|
||||
1. Strict use of the [SemVer](#semver) spec
|
||||
1. Strict use of the the [SemVer](#semver) spec
|
||||
2. Introduction of semver-compliant `-beta` tags
|
||||
3. Introduction of [conventional commit messages](https://conventionalcommits.org/)
|
||||
4. Well-defined stabilization branches
|
||||
|
||||
@@ -50,7 +50,7 @@ guide!).
|
||||
|
||||
You can find the full list of "How to?" in the sidebar. If there is
|
||||
something that you would like to do that is not documented, please join
|
||||
our [Discord server][discord] and let us know!
|
||||
our [Discord server][] and let us know!
|
||||
|
||||
[discord]: https://discord.gg/electronjs
|
||||
[discord server]: https://discord.com/invite/electron
|
||||
[fiddle]: https://www.electronjs.org/fiddle
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Distributing Apps With Electron Forge
|
||||
|
||||
Electron Forge is a tool for packaging and publishing Electron applications.
|
||||
It unifies Electron's build tooling ecosystem into
|
||||
a single extensible interface so that anyone can jump right into making Electron apps.
|
||||
|
||||
## Getting started
|
||||
|
||||
The [Electron Forge docs] contain detailed information on taking your application
|
||||
from source code to your end users' machines.
|
||||
This includes:
|
||||
|
||||
* Packaging your application [(package)]
|
||||
* Generating executables and installers for each OS [(make)], and,
|
||||
* Publishing these files to online platforms to download [(publish)].
|
||||
|
||||
For beginners, we recommend following through Electron's [tutorial] to develop, build,
|
||||
package and publish your first Electron app. If you have already developed an app on your machine
|
||||
and want to start on packaging and distribution, start from [step 5] of the tutorial.
|
||||
|
||||
## Getting help
|
||||
|
||||
* If you need help with developing your app, our [community Discord server][discord] is a great place
|
||||
to get advice from other Electron app developers.
|
||||
* If you suspect you're running into a bug with Forge, please check the [GitHub issue tracker]
|
||||
to see if any existing issues match your problem. If not, feel free to fill out our bug report
|
||||
template and submit a new issue.
|
||||
|
||||
[Electron Forge Docs]: https://www.electronforge.io/
|
||||
[step 5]: ./tutorial-5-packaging.md
|
||||
[(package)]: https://www.electronforge.io/cli#package
|
||||
[(make)]: https://www.electronforge.io/cli#make
|
||||
[(publish)]: https://www.electronforge.io/cli#publish
|
||||
[GitHub issue tracker]: https://github.com/electron-userland/electron-forge/issues
|
||||
[discord]: https://discord.gg/APGC3k5yaH
|
||||
[tutorial]: https://www.electronjs.org/docs/latest/tutorial/tutorial-prerequisites
|
||||
@@ -8,59 +8,6 @@ For a subset of Electron functionality it makes sense to disable certain feature
|
||||
|
||||
Fuses are the solution to this problem, at a high level they are "magic bits" in the Electron binary that can be flipped when packaging your Electron app to enable / disable certain features / restrictions. Because they are flipped at package time before you code sign your app the OS becomes responsible for ensuring those bits aren't flipped back via OS level code signing validation (Gatekeeper / App Locker).
|
||||
|
||||
## Current Fuses
|
||||
|
||||
### `runAsNode`
|
||||
|
||||
**Default:** Enabled
|
||||
**@electron/fuses:** `FuseV1Options.RunAsNode`
|
||||
|
||||
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function.
|
||||
|
||||
### `cookieEncryption`
|
||||
|
||||
**Default:** Disabled
|
||||
**@electron/fuses:** `FuseV1Options.EnableCookieEncryption`
|
||||
|
||||
The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse.
|
||||
|
||||
### `nodeOptions`
|
||||
|
||||
**Default:** Enabled
|
||||
**@electron/fuses:** `FuseV1Options.EnableNodeOptionsEnvironmentVariable`
|
||||
|
||||
The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) environment variable is respected or not. This environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse.
|
||||
|
||||
### `nodeCliInspect`
|
||||
|
||||
**Default:** Enabled
|
||||
**@electron/fuses:** `FuseV1Options.EnableNodeCliInspectArguments`
|
||||
|
||||
The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse.
|
||||
|
||||
### `embeddedAsarIntegrityValidation`
|
||||
|
||||
**Default:** Disabled
|
||||
**@electron/fuses:** `FuseV1Options.EnableEmbeddedAsarIntegrityValidation`
|
||||
|
||||
The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive.
|
||||
|
||||
For more information on how to use asar integrity validation please read the [Asar Integrity](asar-integrity.md) documentation.
|
||||
|
||||
### `onlyLoadAppFromAsar`
|
||||
|
||||
**Default:** Disabled
|
||||
**@electron/fuses:** `FuseV1Options.OnlyLoadAppFromAsar`
|
||||
|
||||
The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code.
|
||||
|
||||
### `loadBrowserProcessSpecificV8Snapshot`
|
||||
|
||||
**Default:** Disabled
|
||||
**@electron/fuses:** `FuseV1Options.LoadBrowserProcessSpecificV8Snapshot`
|
||||
|
||||
The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do.
|
||||
|
||||
## How do I flip the fuses?
|
||||
|
||||
### The easy way
|
||||
@@ -73,18 +20,11 @@ require('@electron/fuses').flipFuses(
|
||||
require('electron'),
|
||||
// Fuses to flip
|
||||
{
|
||||
version: FuseVersion.V1,
|
||||
[FuseV1Options.RunAsNode]: false
|
||||
runAsNode: false
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
You can validate the fuses have been flipped or check the fuse status of an arbitrary Electron app using the fuses CLI.
|
||||
|
||||
```bash
|
||||
npx @electron/fuses read --app /Applications/Foo.app
|
||||
```
|
||||
|
||||
### The hard way
|
||||
|
||||
#### Quick Glossary
|
||||
|
||||
@@ -69,7 +69,7 @@ Are you getting stuck anywhere? Here are a few links to places to look:
|
||||
[tutorial]: tutorial-1-prerequisites.md
|
||||
[api documentation]: ../api/app.md
|
||||
[chromium]: https://www.chromium.org/
|
||||
[discord]: https://discord.gg/electronjs
|
||||
[discord]: https://discord.com/invite/APGC3k5yaH
|
||||
[examples]: examples.md
|
||||
[fiddle]: https://electronjs.org/fiddle
|
||||
[issue-tracker]: https://github.com/electron/electron/issues
|
||||
|
||||
@@ -101,7 +101,7 @@ app.whenReady().then(async () => {
|
||||
}
|
||||
})
|
||||
|
||||
const secondaryWindow = new BrowserWindow({
|
||||
const secondaryWindow = BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
contextIsolation: false,
|
||||
@@ -144,7 +144,7 @@ to use `contextIsolation` and set up specific contextBridge calls for each of yo
|
||||
expected messages, but for the simplicity of this example we don't. You can find an
|
||||
example of context isolation further down this page at [Communicating directly between the main process and the main world of a context-isolated page](#communicating-directly-between-the-main-process-and-the-main-world-of-a-context-isolated-page)
|
||||
|
||||
That means window.electronMessagePort is globally available and you can call
|
||||
That means window.messagePort is globally available and you can call
|
||||
`postMessage` on it from anywhere in your app to send a message to the other
|
||||
renderer.
|
||||
|
||||
@@ -272,7 +272,7 @@ const makeStreamingRequest = (element, callback) => {
|
||||
}
|
||||
|
||||
makeStreamingRequest(42, (data) => {
|
||||
console.log('got response data:', data)
|
||||
console.log('got response data:', event.data)
|
||||
})
|
||||
// We will see "got response data: 42" 10 times.
|
||||
```
|
||||
|
||||
@@ -20,8 +20,6 @@ const win = new BrowserWindow({
|
||||
The `nodeIntegrationInWorker` can be used independent of `nodeIntegration`, but
|
||||
`sandbox` must not be set to `true`.
|
||||
|
||||
**Note:** This option is not available in [`SharedWorker`s](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker) or [`Service Worker`s](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker) owing to incompatibilities in sandboxing policies.
|
||||
|
||||
## Available APIs
|
||||
|
||||
All built-in modules of Node.js are supported in Web Workers, and `asar`
|
||||
|
||||
@@ -83,7 +83,7 @@ terminated as well.
|
||||
|
||||
The main process also controls your application's lifecycle through Electron's
|
||||
[`app`][app] module. This module provides a large set of events and methods
|
||||
that you can use to add custom application behaviour (for instance, programmatically
|
||||
that you can use to add custom application behaviour (for instance, programatically
|
||||
quitting your application, modifying the application dock, or showing an About panel).
|
||||
|
||||
As a practical example, the app shown in the [quick start guide][quick-start-lifecycle]
|
||||
|
||||
@@ -12,10 +12,28 @@ the GPU service and the network service.
|
||||
|
||||
See Chromium's [Sandbox design document][sandbox] for more information.
|
||||
|
||||
Starting from Electron 20, the sandbox is enabled for renderer processes without any
|
||||
further configuration. If you want to disable the sandbox for a process, see the
|
||||
[Disabling the sandbox for a single process](#disabling-the-sandbox-for-a-single-process)
|
||||
section.
|
||||
## Electron's sandboxing policies
|
||||
|
||||
Electron comes with a mixed sandbox environment, meaning sandboxed processes can run
|
||||
alongside privileged ones. By default, renderer processes are not sandboxed, but
|
||||
utility processes are. Note that as in Chromium, the main (browser) process is
|
||||
privileged and cannot be sandboxed.
|
||||
|
||||
Historically, this mixed sandbox approach was established because having Node.js available
|
||||
in the renderer is an extremely powerful tool for app developers. Unfortunately, this
|
||||
feature is also an equally massive security vulnerability.
|
||||
|
||||
Theoretically, unsandboxed renderers are not a problem for desktop applications that
|
||||
only display trusted code, but they make Electron less secure than Chromium for
|
||||
displaying untrusted web content. However, even purportedly trusted code may be
|
||||
dangerous — there are countless attack vectors that malicious actors can use, from
|
||||
cross-site scripting to content injection to man-in-the-middle attacks on remotely loaded
|
||||
websites, just to name a few. For this reason, we recommend enabling renderer sandboxing
|
||||
for the vast majority of cases under an abundance of caution.
|
||||
|
||||
<!--TODO: update this guide when #28466 is either solved or closed -->
|
||||
Note that there is an active discussion in the issue tracker to enable renderer sandboxing
|
||||
by default. See [#28466][issue-28466]) for details.
|
||||
|
||||
## Sandbox behaviour in Electron
|
||||
|
||||
@@ -28,17 +46,12 @@ When renderer processes in Electron are sandboxed, they behave in the same way a
|
||||
regular Chrome renderer would. A sandboxed renderer won't have a Node.js
|
||||
environment initialized.
|
||||
|
||||
<!-- TODO(erickzhao): when we have a solid guide for IPC, link it here -->
|
||||
Therefore, when the sandbox is enabled, renderer processes can only perform privileged
|
||||
tasks (such as interacting with the filesystem, making changes to the system, or spawning
|
||||
subprocesses) by delegating these tasks to the main process via inter-process
|
||||
communication (IPC).
|
||||
|
||||
:::note
|
||||
|
||||
For more info on inter-process communication, check out our [IPC guide](./ipc.md).
|
||||
|
||||
:::
|
||||
|
||||
### Preload scripts
|
||||
|
||||
In order to allow renderer processes to communicate with the main process, preload
|
||||
@@ -53,7 +66,7 @@ but can only import a subset of Electron and Node's built-in modules:
|
||||
|
||||
In addition, the preload script also polyfills certain Node.js primitives as globals:
|
||||
|
||||
* [`Buffer`](https://nodejs.org/api/buffer.html)
|
||||
* [`Buffer`](https://nodejs.org/api/Buffer.html)
|
||||
* [`process`](../api/process.md)
|
||||
* [`clearImmediate`](https://nodejs.org/api/timers.html#timers_clearimmediate_immediate)
|
||||
* [`setImmediate`](https://nodejs.org/api/timers.html#timers_setimmediate_callback_args)
|
||||
@@ -70,17 +83,13 @@ privileged APIs to untrusted code running in the renderer process unless
|
||||
|
||||
## Configuring the sandbox
|
||||
|
||||
For most apps, sandboxing is the best choice. In certain use cases that are incompatible with
|
||||
the sandbox (for instance, when using native node modules in the renderer),
|
||||
it is possible to disable the sandbox for specific processes. This comes with security
|
||||
risks, especially if any untrusted code or content is present in the unsandboxed process.
|
||||
### Enabling the sandbox for a single process
|
||||
|
||||
### Disabling the sandbox for a single process
|
||||
In Electron, renderer sandboxing can be enabled on a per-process basis with
|
||||
the `sandbox: true` preference in the [`BrowserWindow`][browser-window] constructor.
|
||||
|
||||
In Electron, renderer sandboxing can be disabled on a per-process basis with
|
||||
the `sandbox: false` preference in the [`BrowserWindow`][browser-window] constructor.
|
||||
|
||||
```js title='main.js'
|
||||
```js
|
||||
// main.js
|
||||
app.whenReady().then(() => {
|
||||
const win = new BrowserWindow({
|
||||
webPreferences: {
|
||||
@@ -91,30 +100,17 @@ app.whenReady().then(() => {
|
||||
})
|
||||
```
|
||||
|
||||
Sandboxing is also disabled whenever Node.js integration is enabled in the renderer.
|
||||
This can be done through the BrowserWindow constructor with the `nodeIntegration: true` flag.
|
||||
|
||||
```js title='main.js'
|
||||
app.whenReady().then(() => {
|
||||
const win = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
win.loadURL('https://google.com')
|
||||
})
|
||||
```
|
||||
|
||||
### Enabling the sandbox globally
|
||||
|
||||
If you want to force sandboxing for all renderers, you can also use the
|
||||
[`app.enableSandbox`][enable-sandbox] API. Note that this API has to be called before the
|
||||
app's `ready` event.
|
||||
|
||||
```js title='main.js'
|
||||
```js
|
||||
// main.js
|
||||
app.enableSandbox()
|
||||
app.whenReady().then(() => {
|
||||
// any sandbox:false calls are overridden since `app.enableSandbox()` was called.
|
||||
// no need to pass `sandbox: true` since `app.enableSandbox()` was called.
|
||||
const win = new BrowserWindow()
|
||||
win.loadURL('https://google.com')
|
||||
})
|
||||
@@ -143,16 +139,16 @@ issues:
|
||||
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.
|
||||
1. Some security features in Chrome (such as Safe Browsing and Certificate
|
||||
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.
|
||||
1. There is only one Chromium, whereas there are many thousands of apps built
|
||||
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.
|
||||
1. We can't push security updates to users directly, so we rely on app vendors
|
||||
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.
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ the sandbox in all renderers. Loading, reading or processing any untrusted
|
||||
content in an unsandboxed process, including the main process, is not advised.
|
||||
|
||||
:::info
|
||||
For more information on what Process Sandboxing is and how to enable it please
|
||||
For more information on what `contextIsolation` is and how to enable it please
|
||||
see our dedicated [Process Sandboxing](sandbox.md) document.
|
||||
:::info
|
||||
|
||||
|
||||
95
docs/tutorial/testing-widevine-cdm.md
Normal file
95
docs/tutorial/testing-widevine-cdm.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# Testing Widevine CDM
|
||||
|
||||
In Electron you can use the Widevine CDM library shipped with Chrome browser.
|
||||
|
||||
Widevine Content Decryption Modules (CDMs) are how streaming services protect
|
||||
content using HTML5 video to web browsers without relying on an NPAPI plugin
|
||||
like Flash or Silverlight. Widevine support is an alternative solution for
|
||||
streaming services that currently rely on Silverlight for playback of
|
||||
DRM-protected video content. It will allow websites to show DRM-protected video
|
||||
content in Firefox without the use of NPAPI plugins. The Widevine CDM runs in an
|
||||
open-source CDM sandbox providing better user security than NPAPI plugins.
|
||||
|
||||
#### Note on VMP
|
||||
|
||||
As of [`Electron v1.8.0 (Chrome v59)`](https://electronjs.org/releases#1.8.1),
|
||||
the below steps are may only be some of the necessary steps to enable Widevine;
|
||||
any app on or after that version intending to use the Widevine CDM may need to
|
||||
be signed using a license obtained from [Widevine](https://www.widevine.com/)
|
||||
itself.
|
||||
|
||||
Per [Widevine](https://www.widevine.com/):
|
||||
|
||||
> Chrome 59 (and later) includes support for Verified Media Path (VMP). VMP
|
||||
> provides a method to verify the authenticity of a device platform. For browser
|
||||
> deployments, this will provide an additional signal to determine if a
|
||||
> browser-based implementation is reliable and secure.
|
||||
>
|
||||
> The proxy integration guide has been updated with information about VMP and
|
||||
> how to issue licenses.
|
||||
>
|
||||
> Widevine recommends our browser-based integrations (vendors and browser-based
|
||||
> applications) add support for VMP.
|
||||
|
||||
To enable video playback with this new restriction,
|
||||
[castLabs](https://castlabs.com/open-source/downstream/) has created a
|
||||
[fork](https://github.com/castlabs/electron-releases) that has implemented the
|
||||
necessary changes to enable Widevine to be played in an Electron application if
|
||||
one has obtained the necessary licenses from widevine.
|
||||
|
||||
## Getting the library
|
||||
|
||||
Open `chrome://components/` in Chrome browser, find `Widevine Content Decryption Module`
|
||||
and make sure it is up to date, then you can find the library files from the
|
||||
application directory.
|
||||
|
||||
### On Windows
|
||||
|
||||
The library file `widevinecdm.dll` will be under
|
||||
`Program Files(x86)/Google/Chrome/Application/CHROME_VERSION/WidevineCdm/_platform_specific/win_(x86|x64)/`
|
||||
directory.
|
||||
|
||||
### On macOS
|
||||
|
||||
The library file `libwidevinecdm.dylib` will be under
|
||||
`/Applications/Google Chrome.app/Contents/Versions/CHROME_VERSION/Google Chrome Framework.framework/Versions/A/Libraries/WidevineCdm/_platform_specific/mac_(x86|x64)/`
|
||||
directory.
|
||||
|
||||
**Note:** Make sure that chrome version used by Electron is greater than or
|
||||
equal to the `min_chrome_version` value of Chrome's widevine cdm component.
|
||||
The value can be found in `manifest.json` under `WidevineCdm` directory.
|
||||
|
||||
## Using the library
|
||||
|
||||
After getting the library files, you should pass the path to the file
|
||||
with `--widevine-cdm-path` command line switch, and the library's version
|
||||
with `--widevine-cdm-version` switch. The command line switches have to be
|
||||
passed before the `ready` event of `app` module gets emitted.
|
||||
|
||||
Example code:
|
||||
|
||||
```javascript
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// You have to pass the directory that contains widevine library here, it is
|
||||
// * `libwidevinecdm.dylib` on macOS,
|
||||
// * `widevinecdm.dll` on Windows.
|
||||
app.commandLine.appendSwitch('widevine-cdm-path', '/path/to/widevine_library')
|
||||
// The version of plugin can be got from `chrome://components` page in Chrome.
|
||||
app.commandLine.appendSwitch('widevine-cdm-version', '1.4.8.866')
|
||||
|
||||
let win = null
|
||||
app.whenReady().then(() => {
|
||||
win = new BrowserWindow()
|
||||
win.show()
|
||||
})
|
||||
```
|
||||
|
||||
## Verifying Widevine CDM support
|
||||
|
||||
To verify whether widevine works, you can use following ways:
|
||||
|
||||
* Open https://shaka-player-demo.appspot.com/ and load a manifest that uses
|
||||
`Widevine`.
|
||||
* Open http://www.dash-player.com/demo/drm-test-area/, check whether the page
|
||||
says `bitdash uses Widevine in your browser`, then play the video.
|
||||
@@ -123,7 +123,7 @@ the list of versions in the [electron/releases] repository.
|
||||
[homebrew]: https://brew.sh/
|
||||
[mdn-guide]: https://developer.mozilla.org/en-US/docs/Learn/
|
||||
[node]: https://nodejs.org/
|
||||
[node-guide]: https://nodejs.dev/en/learn/
|
||||
[node-guide]: https://nodejs.dev/learn
|
||||
[node-download]: https://nodejs.org/en/download/
|
||||
[nvm]: https://github.com/nvm-sh/nvm
|
||||
[process-model]: ./process-model.md
|
||||
|
||||
@@ -369,12 +369,12 @@ run. Create a launch.json configuration in a new `.vscode` folder in your projec
|
||||
"name": "Renderer",
|
||||
"port": 9222,
|
||||
"request": "attach",
|
||||
"type": "chrome",
|
||||
"type": "pwa-chrome",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"name": "Main",
|
||||
"type": "node",
|
||||
"type": "pwa-node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||
@@ -398,11 +398,11 @@ What we have done in the `launch.json` file is to create 3 configurations:
|
||||
- `Main` is used to start the main process and also expose port 9222 for remote debugging
|
||||
(`--remote-debugging-port=9222`). This is the port that we will use to attach the debugger
|
||||
for the `Renderer`. Because the main process is a Node.js process, the type is set to
|
||||
`node`.
|
||||
`pwa-node` (`pwa-` is the prefix that tells VS Code to use the latest JavaScript debugger).
|
||||
- `Renderer` is used to debug the renderer process. Because the main process is the one
|
||||
that creates the process, we have to "attach" to it (`"request": "attach"`) instead of
|
||||
creating a new one.
|
||||
The renderer process is a web one, so the debugger we have to use is `chrome`.
|
||||
The renderer process is a web one, so the debugger we have to use is `pwa-chrome`.
|
||||
- `Main + renderer` is a [compound task] that executes the previous ones simultaneously.
|
||||
|
||||
:::caution
|
||||
|
||||
@@ -38,25 +38,7 @@ called a **preload**.
|
||||
## Augmenting the renderer with a preload script
|
||||
|
||||
A BrowserWindow's preload script runs in a context that has access to both the HTML DOM
|
||||
and a limited subset of Node.js and Electron APIs.
|
||||
|
||||
:::info Preload script sandboxing
|
||||
|
||||
From Electron 20 onwards, preload scripts are **sandboxed** by default and no longer have access
|
||||
to a full Node.js environment. Practically, this means that you have a polyfilled `require`
|
||||
function that only has access to a limited set of APIs.
|
||||
|
||||
| Available API | Details |
|
||||
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Electron modules | Renderer process modules |
|
||||
| Node.js modules | [`events`](https://nodejs.org/api/events.html), [`timers`](https://nodejs.org/api/timers.html), [`url`](https://nodejs.org/api/url.html) |
|
||||
| Polyfilled globals | [`Buffer`](https://nodejs.org/api/buffer.html), [`process`](../api/process.md), [`clearImmediate`](https://nodejs.org/api/timers.html#timers_clearimmediate_immediate), [`setImmediate`](https://nodejs.org/api/timers.html#timers_setimmediate_callback_args) |
|
||||
|
||||
For more information, check out the [Process Sandboxing](./sandbox.md) guide.
|
||||
|
||||
:::
|
||||
|
||||
Preload scripts are injected before a web page loads in the renderer,
|
||||
and a Node.js environment. Preload scripts are injected before a web page loads in the renderer,
|
||||
similar to a Chrome extension's [content scripts][content-script]. To add features to your renderer
|
||||
that require privileged access, you can define [global] objects through the
|
||||
[contextBridge][contextbridge] API.
|
||||
|
||||
@@ -62,7 +62,7 @@ into end users' hands.
|
||||
|
||||
<!-- Link labels -->
|
||||
|
||||
[discord]: https://discord.gg/electronjs
|
||||
[discord]: https://discord.com/invite/APGC3k5yaH
|
||||
[github]: https://github.com/electron/electronjs.org-new/issues/new
|
||||
[how-to]: ./examples.md
|
||||
[node-platform]: https://nodejs.org/api/process.html#process_process_platform
|
||||
|
||||
@@ -111,12 +111,6 @@ Electron Forge can be configured to create distributables in different OS-specif
|
||||
|
||||
:::
|
||||
|
||||
:::tip Creating and Adding Application Icons
|
||||
|
||||
Setting custom application icons requires a few additions to your config. Check out [Forge's icon tutorial] for more information.
|
||||
|
||||
:::
|
||||
|
||||
:::note Packaging without Electron Forge
|
||||
|
||||
If you want to manually package your code, or if you're just interested understanding the
|
||||
@@ -220,7 +214,6 @@ information.
|
||||
[electron forge]: https://www.electronforge.io
|
||||
[electron forge cli documentation]: https://www.electronforge.io/cli#commands
|
||||
[makers]: https://www.electronforge.io/config/makers
|
||||
[Forge's icon tutorial]: https://www.electronforge.io/guides/create-and-add-icons
|
||||
|
||||
<!-- Tutorial links -->
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ into your app code.
|
||||
## Using update.electronjs.org
|
||||
|
||||
The Electron maintainers provide a free auto-updating service for open-source apps
|
||||
at [https://update.electronjs.org](https://update.electronjs.org). Its requirements are:
|
||||
at https://update.electronjs.org. Its requirements are:
|
||||
|
||||
- Your app runs on macOS or Windows
|
||||
- Your app has a public GitHub repository
|
||||
@@ -226,7 +226,7 @@ rest of our docs and happy developing! If you have questions, please stop by our
|
||||
|
||||
[autoupdater]: ../api/auto-updater.md
|
||||
[code-signed]: ./code-signing.md
|
||||
[discord server]: https://discord.gg/electronjs
|
||||
[discord server]: https://discord.com/invite/APGC3k5yaH
|
||||
[electron fiddle]: https://electronjs.org/fiddle
|
||||
[fiddle-build]: https://github.com/electron/fiddle/blob/master/.github/workflows/build.yaml
|
||||
[fiddle-forge-config]: https://github.com/electron/fiddle/blob/master/forge.config.js
|
||||
|
||||
@@ -115,7 +115,7 @@ const win = new BrowserWindow({
|
||||
})
|
||||
```
|
||||
|
||||
On either platform `titleBarOverlay` can also be an object. On both macOS and Windows, the height of the overlay can be specified with the `height` property. On Windows, the color of the overlay and its symbols can be specified using the `color` and `symbolColor` properties respectively.
|
||||
On Windows, you can also specify additional parameters. The color of the overlay and its symbols can be specified by setting `titleBarOverlay` to an object and using the `color` and `symbolColor` properties respectively. The height of the overlay can also be specified with the `height` property.
|
||||
|
||||
If a color option is not specified, the color will default to its system color for the window control buttons. Similarly, if the height option is not specified it will default to the default height:
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ auto_filenames = {
|
||||
"docs/api/power-save-blocker.md",
|
||||
"docs/api/process.md",
|
||||
"docs/api/protocol.md",
|
||||
"docs/api/push-notifications.md",
|
||||
"docs/api/safe-storage.md",
|
||||
"docs/api/screen.md",
|
||||
"docs/api/service-workers.md",
|
||||
@@ -142,7 +141,6 @@ auto_filenames = {
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/ipc-messages.ts",
|
||||
"lib/common/web-view-methods.ts",
|
||||
"lib/common/webpack-globals-provider.ts",
|
||||
"lib/renderer/api/context-bridge.ts",
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
@@ -214,7 +212,6 @@ auto_filenames = {
|
||||
"lib/browser/api/power-monitor.ts",
|
||||
"lib/browser/api/power-save-blocker.ts",
|
||||
"lib/browser/api/protocol.ts",
|
||||
"lib/browser/api/push-notifications.ts",
|
||||
"lib/browser/api/safe-storage.ts",
|
||||
"lib/browser/api/screen.ts",
|
||||
"lib/browser/api/session.ts",
|
||||
|
||||
@@ -129,7 +129,6 @@ filenames = {
|
||||
"shell/browser/api/electron_api_menu_mac.mm",
|
||||
"shell/browser/api/electron_api_native_theme_mac.mm",
|
||||
"shell/browser/api/electron_api_power_monitor_mac.mm",
|
||||
"shell/browser/api/electron_api_push_notifications_mac.mm",
|
||||
"shell/browser/api/electron_api_system_preferences_mac.mm",
|
||||
"shell/browser/api/electron_api_web_contents_mac.mm",
|
||||
"shell/browser/auto_updater_mac.mm",
|
||||
@@ -297,8 +296,6 @@ filenames = {
|
||||
"shell/browser/api/electron_api_printing.cc",
|
||||
"shell/browser/api/electron_api_protocol.cc",
|
||||
"shell/browser/api/electron_api_protocol.h",
|
||||
"shell/browser/api/electron_api_push_notifications.cc",
|
||||
"shell/browser/api/electron_api_push_notifications.h",
|
||||
"shell/browser/api/electron_api_safe_storage.cc",
|
||||
"shell/browser/api/electron_api_safe_storage.h",
|
||||
"shell/browser/api/electron_api_screen.cc",
|
||||
@@ -416,6 +413,8 @@ filenames = {
|
||||
"shell/browser/media/media_capture_devices_dispatcher.h",
|
||||
"shell/browser/media/media_device_id_salt.cc",
|
||||
"shell/browser/media/media_device_id_salt.h",
|
||||
"shell/browser/media/media_stream_devices_controller.cc",
|
||||
"shell/browser/media/media_stream_devices_controller.h",
|
||||
"shell/browser/microtasks_runner.cc",
|
||||
"shell/browser/microtasks_runner.h",
|
||||
"shell/browser/native_browser_view.cc",
|
||||
@@ -647,6 +646,8 @@ filenames = {
|
||||
"shell/common/process_util.h",
|
||||
"shell/common/skia_util.cc",
|
||||
"shell/common/skia_util.h",
|
||||
"shell/common/v8_value_converter.cc",
|
||||
"shell/common/v8_value_converter.h",
|
||||
"shell/common/v8_value_serializer.cc",
|
||||
"shell/common/v8_value_serializer.h",
|
||||
"shell/common/world_ids.h",
|
||||
|
||||
@@ -42,11 +42,9 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/is_sorted.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/is_sorted_until.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/iter_swap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/iterator_operations.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/lexicographical_compare.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/lower_bound.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/make_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/make_projected.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/max.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/max_element.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/merge.h",
|
||||
@@ -69,92 +67,14 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/pop_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/prev_permutation.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/push_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_adjacent_find.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_all_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_any_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_binary_search.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_clamp.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_backward.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_n.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_count.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_count_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_equal.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_equal_range.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_fill.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_fill_n.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_end.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_first_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_if_not.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_for_each.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_for_each_n.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_generate.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_generate_n.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_includes.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_inplace_merge.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_heap_until.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_partitioned.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_permutation.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_sorted.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_sorted_until.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_iterator_concept.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_lexicographical_compare.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_lower_bound.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_make_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_max.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_max_element.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_merge.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_min.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_min_element.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_minmax.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_minmax_element.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_mismatch.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_move.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_move_backward.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_next_permutation.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_none_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_nth_element.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partial_sort.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partial_sort_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition_point.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_pop_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_prev_permutation.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_push_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_copy_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_copy_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_reverse.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_reverse_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_rotate.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_rotate_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sample.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_search.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_search_n.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_difference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_intersection.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_symmetric_difference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_union.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_shuffle.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort_heap.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_partition.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_sort.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_swap_ranges.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_transform.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_upper_bound.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/remove.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/remove_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/remove_copy_if.h",
|
||||
@@ -184,11 +104,9 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/stable_sort.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/swap_ranges.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/transform.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/uniform_random_bit_generator_adaptor.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/unique.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/unique_copy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_iter.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_range.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__algorithm/upper_bound.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__assert",
|
||||
"//buildtools/third_party/libc++/trunk/include/__availability",
|
||||
@@ -200,28 +118,15 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__charconv/chars_format.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__charconv/from_chars_result.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__charconv/tables.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_base_10.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_result.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/calendar.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_timespec.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/day.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/duration.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/file_clock.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/hh_mm_ss.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/high_resolution_clock.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/literals.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/month.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/month_weekday.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/monthday.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/steady_clock.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/system_clock.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/time_point.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/weekday.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/year.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/year_month.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/year_month_day.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__chrono/year_month_weekday.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__compare/common_comparison_category.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__compare/compare_partial_order_fallback.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__compare/compare_strong_order_fallback.h",
|
||||
@@ -264,7 +169,6 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__coroutine/noop_coroutine_handle.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__coroutine/trivial_awaitables.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__debug",
|
||||
"//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__errc",
|
||||
"//buildtools/third_party/libc++/trunk/include/__filesystem/copy_options.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__filesystem/directory_entry.h",
|
||||
@@ -282,12 +186,7 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__filesystem/recursive_directory_iterator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__filesystem/space_info.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__filesystem/u8path.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/buffer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/concepts.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/enable_insertable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/extended_grapheme_cluster_table.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/format_arg.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/format_arg_store.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/format_args.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/format_context.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/format_error.h",
|
||||
@@ -301,11 +200,9 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/formatter_floating_point.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/formatter_integer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/formatter_integral.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/formatter_output.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/formatter_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/formatter_string.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/parser_std_format_spec.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__format/unicode.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/binary_function.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/binary_negate.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/bind.h",
|
||||
@@ -313,7 +210,6 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/bind_front.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/binder1st.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/binder2nd.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/boyer_moore_searcher.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/compose.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/default_searcher.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/function.h",
|
||||
@@ -334,16 +230,11 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/unary_negate.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/unwrap_ref.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__functional/weak_result_type.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__fwd/hash.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__fwd/pair.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__fwd/span.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__fwd/string_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__hash_table",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ios/fpos.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/access.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/advance.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/back_insert_iterator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/bounded_iter.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/common_iterator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/concepts.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/counted_iterator.h",
|
||||
@@ -364,7 +255,6 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/iterator_traits.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/mergeable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/move_iterator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/move_sentinel.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/next.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/ostream_iterator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/ostreambuf_iterator.h",
|
||||
@@ -378,15 +268,14 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/sortable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/unreachable_sentinel.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__iterator/wrap_iter.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__libcpp_version",
|
||||
"//buildtools/third_party/libc++/trunk/include/__locale",
|
||||
"//buildtools/third_party/libc++/trunk/include/__mbstate_t.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/addressof.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/allocate_at_least.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/allocation_guard.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/allocator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_arg_t.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_traits.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/assume_aligned.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/auto_ptr.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/compressed_pair.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/concepts.h",
|
||||
@@ -396,7 +285,6 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/ranges_uninitialized_algorithms.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/raw_storage_iterator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/shared_ptr.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/swap_allocator.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/temporary_buffer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/uninitialized_algorithms.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h",
|
||||
@@ -467,10 +355,8 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/empty_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/enable_borrowed_range.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/enable_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/filter_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/iota_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/join_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/lazy_split_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/non_propagating_cache.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/owning_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/range_adaptor.h",
|
||||
@@ -485,16 +371,16 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/transform_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/view_interface.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/views.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__ranges/zip_view.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__split_buffer",
|
||||
"//buildtools/third_party/libc++/trunk/include/__std_stream",
|
||||
"//buildtools/third_party/libc++/trunk/include/__string/char_traits.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__string/extern_template_lists.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__string",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/android/locale_bionic.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/fuchsia/xlocale.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/ibm/gettod_zos.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/ibm/limits.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/ibm/locale_mgmt_zos.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/ibm/nanosleep.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/ibm/support.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/ibm/xlocale.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/musl/xlocale.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__support/newlib/xlocale.h",
|
||||
@@ -512,136 +398,10 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__threading_support",
|
||||
"//buildtools/third_party/libc++/trunk/include/__tree",
|
||||
"//buildtools/third_party/libc++/trunk/include/__tuple",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_const.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_cv.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_lvalue_reference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_rvalue_reference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_volatile.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/aligned_storage.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/aligned_union.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/alignment_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/apply_cv.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/can_extract_key.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/common_reference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/common_type.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/conditional.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/conjunction.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/copy_cv.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/copy_cvref.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/decay.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/dependent_type.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/disjunction.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/enable_if.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/extent.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/has_unique_object_representation.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/has_virtual_destructor.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/integral_constant.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_abstract.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_aggregate.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_arithmetic.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_array.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_base_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_bounded_array.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_callable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_char_like_type.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_class.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_compound.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_const.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_constant_evaluated.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_convertible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_copy_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_copy_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_core_convertible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_default_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_destructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_empty.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_enum.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_final.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_floating_point.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_function.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_fundamental.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_implicitly_default_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_integral.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_literal_type.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_function_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_object_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_move_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_move_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_convertible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_copy_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_copy_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_default_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_destructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_move_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_move_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_null_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_object.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_pod.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_polymorphic.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_primary_template.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_reference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_reference_wrapper.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_referenceable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_same.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_scalar.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_scoped_enum.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed_integer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_standard_layout.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_swappable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivial.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copy_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copy_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copyable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_default_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_destructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_assignable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_constructible.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_unbounded_array.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_union.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_unsigned.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_unsigned_integer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_valid_expansion.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_void.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_volatile.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/lazy.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_32_64_or_128_bit.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_const_lvalue_ref.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_signed.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_unsigned.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/maybe_const.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/nat.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/negation.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/promote.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/rank.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_all_extents.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_const.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_const_ref.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_cv.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_cvref.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_extent.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_pointer.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_reference.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_volatile.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/result_of.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/type_identity.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/type_list.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/underlying_type.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__type_traits/void_t.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__undef_macros",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/as_const.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/auto_cast.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/cmp.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/convert_to_integral.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/declval.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/exchange.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/forward.h",
|
||||
@@ -657,7 +417,6 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/transaction.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__utility/unreachable.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__variant/monostate.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/__verbose_abort",
|
||||
"//buildtools/third_party/libc++/trunk/include/algorithm",
|
||||
"//buildtools/third_party/libc++/trunk/include/any",
|
||||
"//buildtools/third_party/libc++/trunk/include/array",
|
||||
@@ -753,7 +512,7 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/map",
|
||||
"//buildtools/third_party/libc++/trunk/include/math.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/memory",
|
||||
"//buildtools/third_party/libc++/trunk/include/module.modulemap.in",
|
||||
"//buildtools/third_party/libc++/trunk/include/module.modulemap",
|
||||
"//buildtools/third_party/libc++/trunk/include/mutex",
|
||||
"//buildtools/third_party/libc++/trunk/include/new",
|
||||
"//buildtools/third_party/libc++/trunk/include/numbers",
|
||||
@@ -773,7 +532,6 @@ libcxx_headers = [
|
||||
"//buildtools/third_party/libc++/trunk/include/span",
|
||||
"//buildtools/third_party/libc++/trunk/include/sstream",
|
||||
"//buildtools/third_party/libc++/trunk/include/stack",
|
||||
"//buildtools/third_party/libc++/trunk/include/stdatomic.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/stdbool.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/stddef.h",
|
||||
"//buildtools/third_party/libc++/trunk/include/stdexcept",
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ const spawnUpdate = function (args: string[], detached: boolean, callback: Funct
|
||||
|
||||
try {
|
||||
// Ensure we don't spawn multiple squirrel processes
|
||||
// Process spawned, same args: Attach events to already running process
|
||||
// Process spawned, same args: Attach events to alread running process
|
||||
// Process spawned, different args: Return with error
|
||||
// No process spawned: Spawn new process
|
||||
if (spawnedProcess && !isSameArgs(args)) {
|
||||
|
||||
@@ -72,8 +72,9 @@ BrowserWindow.getAllWindows = () => {
|
||||
|
||||
BrowserWindow.getFocusedWindow = () => {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
if (!window.isDestroyed() && window.webContents && !window.webContents.isDestroyed()) {
|
||||
if (window.isFocused() || window.webContents.isDevToolsFocused()) return window;
|
||||
const hasWC = window.webContents && !window.webContents.isDestroyed();
|
||||
if (!window.isDestroyed() && hasWC) {
|
||||
if (window.isFocused() || window.isDevToolsFocused()) return window;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -2,4 +2,7 @@ import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
|
||||
|
||||
const ipcMain = new IpcMainImpl();
|
||||
|
||||
// Do not throw exception when channel name is "error".
|
||||
ipcMain.on('error', () => {});
|
||||
|
||||
export default ipcMain;
|
||||
|
||||
@@ -142,7 +142,7 @@ Menu.prototype.insert = function (pos, item) {
|
||||
if (item.icon) this.setIcon(pos, item.icon);
|
||||
if (item.role) this.setRole(pos, item.role);
|
||||
|
||||
// Make menu accessible to items.
|
||||
// Make menu accessable to items.
|
||||
item.overrideReadOnlyProperty('menu', this);
|
||||
|
||||
// Remember the items.
|
||||
|
||||
@@ -22,7 +22,6 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'Notification', loader: () => require('./notification') },
|
||||
{ name: 'powerMonitor', loader: () => require('./power-monitor') },
|
||||
{ name: 'powerSaveBlocker', loader: () => require('./power-save-blocker') },
|
||||
{ name: 'pushNotifications', loader: () => require('./push-notifications') },
|
||||
{ name: 'protocol', loader: () => require('./protocol') },
|
||||
{ name: 'safeStorage', loader: () => require('./safe-storage') },
|
||||
{ name: 'screen', loader: () => require('./screen') },
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
const { pushNotifications } = process._linkedBinding('electron_browser_push_notifications');
|
||||
|
||||
export default pushNotifications;
|
||||
@@ -9,15 +9,12 @@ import { ipcMainInternal } from '@electron/internal/browser/ipc-main-internal';
|
||||
import * as ipcMainUtils from '@electron/internal/browser/ipc-main-internal-utils';
|
||||
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
|
||||
|
||||
// session is not used here, the purpose is to make sure session is initialized
|
||||
// session is not used here, the purpose is to make sure session is initalized
|
||||
// before the webContents module.
|
||||
// eslint-disable-next-line
|
||||
session
|
||||
|
||||
const webFrameMainBinding = process._linkedBinding('electron_browser_web_frame_main');
|
||||
|
||||
let nextId = 0;
|
||||
const getNextId = function () {
|
||||
return ++nextId;
|
||||
@@ -66,20 +63,6 @@ const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
|
||||
}
|
||||
} as const;
|
||||
|
||||
const paperFormats: Record<string, ElectronInternal.PageSize> = {
|
||||
letter: { width: 8.5, height: 11 },
|
||||
legal: { width: 8.5, height: 14 },
|
||||
tabloid: { width: 11, height: 17 },
|
||||
ledger: { width: 17, height: 11 },
|
||||
a0: { width: 33.1, height: 46.8 },
|
||||
a1: { width: 23.4, height: 33.1 },
|
||||
a2: { width: 16.54, height: 23.4 },
|
||||
a3: { width: 11.7, height: 16.54 },
|
||||
a4: { width: 8.27, height: 11.7 },
|
||||
a5: { width: 5.83, height: 8.27 },
|
||||
a6: { width: 4.13, height: 5.83 }
|
||||
} as const;
|
||||
|
||||
// The minimum micron size Chromium accepts is that where:
|
||||
// Per printing/units.h:
|
||||
// * kMicronsPerInch - Length of an inch in 0.001mm unit.
|
||||
@@ -93,6 +76,42 @@ const isValidCustomPageSize = (width: number, height: number) => {
|
||||
return [width, height].every(x => x > 352);
|
||||
};
|
||||
|
||||
// Default printing setting
|
||||
const defaultPrintingSetting = {
|
||||
// Customizable.
|
||||
pageRange: [] as {from: number, to: number}[],
|
||||
mediaSize: {} as ElectronInternal.MediaSize,
|
||||
landscape: false,
|
||||
headerFooterEnabled: false,
|
||||
marginsType: 0,
|
||||
scaleFactor: 100,
|
||||
shouldPrintBackgrounds: false,
|
||||
shouldPrintSelectionOnly: false,
|
||||
// Non-customizable.
|
||||
printWithCloudPrint: false,
|
||||
printWithPrivet: false,
|
||||
printWithExtension: false,
|
||||
pagesPerSheet: 1,
|
||||
isFirstRequest: false,
|
||||
previewUIID: 0,
|
||||
// True, if the document source is modifiable. e.g. HTML and not PDF.
|
||||
previewModifiable: true,
|
||||
printToPDF: true,
|
||||
deviceName: 'Save as PDF',
|
||||
generateDraftData: true,
|
||||
dpiHorizontal: 72,
|
||||
dpiVertical: 72,
|
||||
rasterizePDF: false,
|
||||
duplex: 0,
|
||||
copies: 1,
|
||||
// 2 = color - see ColorModel in //printing/print_job_constants.h
|
||||
color: 2,
|
||||
collate: true,
|
||||
printerType: 2,
|
||||
title: undefined as string | undefined,
|
||||
url: undefined as string | undefined
|
||||
} as const;
|
||||
|
||||
// JavaScript implementations of WebContents.
|
||||
const binding = process._linkedBinding('electron_browser_web_contents');
|
||||
const printing = process._linkedBinding('electron_browser_printing');
|
||||
@@ -127,6 +146,13 @@ WebContents.prototype.sendToFrame = function (frameId, channel, ...args) {
|
||||
return true;
|
||||
};
|
||||
|
||||
WebContents.prototype._sendToFrameInternal = function (frameId, channel, ...args) {
|
||||
const frame = getWebFrame(this, frameId);
|
||||
if (!frame) return false;
|
||||
frame._sendInternal(channel, ...args);
|
||||
return true;
|
||||
};
|
||||
|
||||
// Following methods are mapped to webFrame.
|
||||
const webFrameMethods = [
|
||||
'insertCSS',
|
||||
@@ -167,136 +193,136 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (worldId
|
||||
let pendingPromise: Promise<any> | undefined;
|
||||
WebContents.prototype.printToPDF = async function (options) {
|
||||
const printSettings: Record<string, any> = {
|
||||
requestID: getNextId(),
|
||||
landscape: false,
|
||||
displayHeaderFooter: false,
|
||||
headerTemplate: '',
|
||||
footerTemplate: '',
|
||||
printBackground: false,
|
||||
scale: 1.0,
|
||||
paperWidth: 8.5,
|
||||
paperHeight: 11.0,
|
||||
marginTop: 0.0,
|
||||
marginBottom: 0.0,
|
||||
marginLeft: 0.0,
|
||||
marginRight: 0.0,
|
||||
pageRanges: '',
|
||||
preferCSSPageSize: false
|
||||
...defaultPrintingSetting,
|
||||
requestID: getNextId()
|
||||
};
|
||||
|
||||
if (options.landscape !== undefined) {
|
||||
if (typeof options.landscape !== 'boolean') {
|
||||
return Promise.reject(new Error('landscape must be a Boolean'));
|
||||
const error = new Error('landscape must be a Boolean');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.landscape = options.landscape;
|
||||
}
|
||||
|
||||
if (options.displayHeaderFooter !== undefined) {
|
||||
if (typeof options.displayHeaderFooter !== 'boolean') {
|
||||
return Promise.reject(new Error('displayHeaderFooter must be a Boolean'));
|
||||
if (options.scaleFactor !== undefined) {
|
||||
if (typeof options.scaleFactor !== 'number') {
|
||||
const error = new Error('scaleFactor must be a Number');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.displayHeaderFooter = options.displayHeaderFooter;
|
||||
printSettings.scaleFactor = options.scaleFactor;
|
||||
}
|
||||
|
||||
if (options.marginsType !== undefined) {
|
||||
if (typeof options.marginsType !== 'number') {
|
||||
const error = new Error('marginsType must be a Number');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.marginsType = options.marginsType;
|
||||
}
|
||||
|
||||
if (options.printSelectionOnly !== undefined) {
|
||||
if (typeof options.printSelectionOnly !== 'boolean') {
|
||||
const error = new Error('printSelectionOnly must be a Boolean');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.shouldPrintSelectionOnly = options.printSelectionOnly;
|
||||
}
|
||||
|
||||
if (options.printBackground !== undefined) {
|
||||
if (typeof options.printBackground !== 'boolean') {
|
||||
return Promise.reject(new Error('printBackground must be a Boolean'));
|
||||
const error = new Error('printBackground must be a Boolean');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.shouldPrintBackgrounds = options.printBackground;
|
||||
}
|
||||
|
||||
if (options.scale !== undefined) {
|
||||
if (typeof options.scale !== 'number') {
|
||||
return Promise.reject(new Error('scale must be a Number'));
|
||||
}
|
||||
printSettings.scale = options.scale;
|
||||
}
|
||||
|
||||
const { pageSize } = options;
|
||||
if (pageSize !== undefined) {
|
||||
if (typeof pageSize === 'string') {
|
||||
const format = paperFormats[pageSize.toLowerCase()];
|
||||
if (!format) {
|
||||
return Promise.reject(new Error(`Invalid pageSize ${pageSize}`));
|
||||
}
|
||||
|
||||
printSettings.paperWidth = format.width;
|
||||
printSettings.paperHeight = format.height;
|
||||
} else if (typeof options.pageSize === 'object') {
|
||||
if (!pageSize.height || !pageSize.width) {
|
||||
return Promise.reject(new Error('height and width properties are required for pageSize'));
|
||||
}
|
||||
|
||||
printSettings.paperWidth = pageSize.width;
|
||||
printSettings.paperHeight = pageSize.height;
|
||||
} else {
|
||||
return Promise.reject(new Error('pageSize must be a String or Object'));
|
||||
}
|
||||
}
|
||||
|
||||
const { margins } = options;
|
||||
if (margins !== undefined) {
|
||||
if (typeof margins !== 'object') {
|
||||
return Promise.reject(new Error('margins must be an Object'));
|
||||
}
|
||||
|
||||
if (margins.top !== undefined) {
|
||||
if (typeof margins.top !== 'number') {
|
||||
return Promise.reject(new Error('margins.top must be a Number'));
|
||||
}
|
||||
printSettings.marginTop = margins.top;
|
||||
}
|
||||
|
||||
if (margins.bottom !== undefined) {
|
||||
if (typeof margins.bottom !== 'number') {
|
||||
return Promise.reject(new Error('margins.bottom must be a Number'));
|
||||
}
|
||||
printSettings.marginBottom = margins.bottom;
|
||||
}
|
||||
|
||||
if (margins.left !== undefined) {
|
||||
if (typeof margins.left !== 'number') {
|
||||
return Promise.reject(new Error('margins.left must be a Number'));
|
||||
}
|
||||
printSettings.marginLeft = margins.left;
|
||||
}
|
||||
|
||||
if (margins.right !== undefined) {
|
||||
if (typeof margins.right !== 'number') {
|
||||
return Promise.reject(new Error('margins.right must be a Number'));
|
||||
}
|
||||
printSettings.marginRight = margins.right;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.pageRanges !== undefined) {
|
||||
if (typeof options.pageRanges !== 'string') {
|
||||
return Promise.reject(new Error('printBackground must be a String'));
|
||||
const pageRanges = options.pageRanges;
|
||||
if (!Object.prototype.hasOwnProperty.call(pageRanges, 'from') || !Object.prototype.hasOwnProperty.call(pageRanges, 'to')) {
|
||||
const error = new Error('pageRanges must be an Object with \'from\' and \'to\' properties');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.pageRanges = options.pageRanges;
|
||||
|
||||
if (typeof pageRanges.from !== 'number') {
|
||||
const error = new Error('pageRanges.from must be a Number');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
if (typeof pageRanges.to !== 'number') {
|
||||
const error = new Error('pageRanges.to must be a Number');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
// Chromium uses 1-based page ranges, so increment each by 1.
|
||||
printSettings.pageRange = [{
|
||||
from: pageRanges.from + 1,
|
||||
to: pageRanges.to + 1
|
||||
}];
|
||||
}
|
||||
|
||||
if (options.headerTemplate !== undefined) {
|
||||
if (typeof options.headerTemplate !== 'string') {
|
||||
return Promise.reject(new Error('headerTemplate must be a String'));
|
||||
if (options.headerFooter !== undefined) {
|
||||
const headerFooter = options.headerFooter;
|
||||
printSettings.headerFooterEnabled = true;
|
||||
if (typeof headerFooter === 'object') {
|
||||
if (!headerFooter.url || !headerFooter.title) {
|
||||
const error = new Error('url and title properties are required for headerFooter');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
if (typeof headerFooter.title !== 'string') {
|
||||
const error = new Error('headerFooter.title must be a String');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.title = headerFooter.title;
|
||||
|
||||
if (typeof headerFooter.url !== 'string') {
|
||||
const error = new Error('headerFooter.url must be a String');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.url = headerFooter.url;
|
||||
} else {
|
||||
const error = new Error('headerFooter must be an Object');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.headerTemplate = options.headerTemplate;
|
||||
}
|
||||
|
||||
if (options.footerTemplate !== undefined) {
|
||||
if (typeof options.footerTemplate !== 'string') {
|
||||
return Promise.reject(new Error('footerTemplate must be a String'));
|
||||
// Optionally set size for PDF.
|
||||
if (options.pageSize !== undefined) {
|
||||
const pageSize = options.pageSize;
|
||||
if (typeof pageSize === 'object') {
|
||||
if (!pageSize.height || !pageSize.width) {
|
||||
const error = new Error('height and width properties are required for pageSize');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
// Dimensions in Microns - 1 meter = 10^6 microns
|
||||
const height = Math.ceil(pageSize.height);
|
||||
const width = Math.ceil(pageSize.width);
|
||||
if (!isValidCustomPageSize(width, height)) {
|
||||
const error = new Error('height and width properties must be minimum 352 microns.');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
printSettings.mediaSize = {
|
||||
name: 'CUSTOM',
|
||||
custom_display_name: 'Custom',
|
||||
height_microns: height,
|
||||
width_microns: width
|
||||
};
|
||||
} else if (Object.prototype.hasOwnProperty.call(PDFPageSizes, pageSize)) {
|
||||
printSettings.mediaSize = PDFPageSizes[pageSize];
|
||||
} else {
|
||||
const error = new Error(`Unsupported pageSize: ${pageSize}`);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
printSettings.footerTemplate = options.footerTemplate;
|
||||
}
|
||||
|
||||
if (options.preferCSSPageSize !== undefined) {
|
||||
if (typeof options.preferCSSPageSize !== 'boolean') {
|
||||
return Promise.reject(new Error('footerTemplate must be a String'));
|
||||
}
|
||||
printSettings.preferCSSPageSize = options.preferCSSPageSize;
|
||||
} else {
|
||||
printSettings.mediaSize = PDFPageSizes.A4;
|
||||
}
|
||||
|
||||
// Chromium expects this in a 0-100 range number, not as float
|
||||
printSettings.scaleFactor = Math.ceil(printSettings.scaleFactor) % 100;
|
||||
// PrinterType enum from //printing/print_job_constants.h
|
||||
printSettings.printerType = 2;
|
||||
if (this._printToPDF) {
|
||||
if (pendingPromise) {
|
||||
pendingPromise = pendingPromise.then(() => this._printToPDF(printSettings));
|
||||
@@ -536,11 +562,6 @@ const addReturnValueToEvent = (event: Electron.IpcMainEvent) => {
|
||||
});
|
||||
};
|
||||
|
||||
const getWebFrameForEvent = (event: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent) => {
|
||||
if (!event.processId || !event.frameId) return null;
|
||||
return webFrameMainBinding.fromIdOrNull(event.processId, event.frameId);
|
||||
};
|
||||
|
||||
const commandLine = process._linkedBinding('electron_common_command_line');
|
||||
const environment = process._linkedBinding('electron_common_environment');
|
||||
|
||||
@@ -564,12 +585,6 @@ WebContents.prototype._init = function () {
|
||||
|
||||
this._windowOpenHandler = null;
|
||||
|
||||
const ipc = new IpcMainImpl();
|
||||
Object.defineProperty(this, 'ipc', {
|
||||
get () { return ipc; },
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
// Dispatch IPC messages to the ipc module.
|
||||
this.on('-ipc-message' as any, function (this: Electron.WebContents, event: Electron.IpcMainEvent, internal: boolean, channel: string, args: any[]) {
|
||||
addSenderFrameToEvent(event);
|
||||
@@ -578,9 +593,6 @@ WebContents.prototype._init = function () {
|
||||
} else {
|
||||
addReplyToEvent(event);
|
||||
this.emit('ipc-message', event, channel, ...args);
|
||||
const maybeWebFrame = getWebFrameForEvent(event);
|
||||
maybeWebFrame && maybeWebFrame.ipc.emit(channel, event, ...args);
|
||||
ipc.emit(channel, event, ...args);
|
||||
ipcMain.emit(channel, event, ...args);
|
||||
}
|
||||
});
|
||||
@@ -592,10 +604,8 @@ WebContents.prototype._init = function () {
|
||||
console.error(`Error occurred in handler for '${channel}':`, error);
|
||||
event.sendReply({ error: error.toString() });
|
||||
};
|
||||
const maybeWebFrame = getWebFrameForEvent(event);
|
||||
const targets: (ElectronInternal.IpcMainInternal| null)[] = internal ? [ipcMainInternal] : [maybeWebFrame && maybeWebFrame.ipc, ipc, ipcMain];
|
||||
const target = targets.find(target => target && (target as any)._invokeHandlers.has(channel));
|
||||
if (target) {
|
||||
const target = internal ? ipcMainInternal : ipcMain;
|
||||
if ((target as any)._invokeHandlers.has(channel)) {
|
||||
(target as any)._invokeHandlers.get(channel)(event, ...args);
|
||||
} else {
|
||||
event._throw(`No handler registered for '${channel}'`);
|
||||
@@ -609,13 +619,10 @@ WebContents.prototype._init = function () {
|
||||
ipcMainInternal.emit(channel, event, ...args);
|
||||
} else {
|
||||
addReplyToEvent(event);
|
||||
const maybeWebFrame = getWebFrameForEvent(event);
|
||||
if (this.listenerCount('ipc-message-sync') === 0 && ipc.listenerCount(channel) === 0 && ipcMain.listenerCount(channel) === 0 && (!maybeWebFrame || maybeWebFrame.ipc.listenerCount(channel) === 0)) {
|
||||
if (this.listenerCount('ipc-message-sync') === 0 && ipcMain.listenerCount(channel) === 0) {
|
||||
console.warn(`WebContents #${this.id} called ipcRenderer.sendSync() with '${channel}' channel without listeners.`);
|
||||
}
|
||||
this.emit('ipc-message-sync', event, channel, ...args);
|
||||
maybeWebFrame && maybeWebFrame.ipc.emit(channel, event, ...args);
|
||||
ipc.emit(channel, event, ...args);
|
||||
ipcMain.emit(channel, event, ...args);
|
||||
}
|
||||
});
|
||||
@@ -623,9 +630,6 @@ WebContents.prototype._init = function () {
|
||||
this.on('-ipc-ports' as any, function (event: Electron.IpcMainEvent, internal: boolean, channel: string, message: any, ports: any[]) {
|
||||
addSenderFrameToEvent(event);
|
||||
event.ports = ports.map(p => new MessagePortMain(p));
|
||||
const maybeWebFrame = getWebFrameForEvent(event);
|
||||
maybeWebFrame && maybeWebFrame.ipc.emit(channel, event, message);
|
||||
ipc.emit(channel, event, message);
|
||||
ipcMain.emit(channel, event, message);
|
||||
});
|
||||
|
||||
@@ -838,10 +842,6 @@ export function fromId (id: string) {
|
||||
return binding.fromId(id);
|
||||
}
|
||||
|
||||
export function fromFrame (frame: Electron.WebFrameMain) {
|
||||
return binding.fromFrame(frame);
|
||||
}
|
||||
|
||||
export function fromDevToolsTargetId (targetId: string) {
|
||||
return binding.fromDevToolsTargetId(targetId);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
|
||||
import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
|
||||
|
||||
const { WebFrameMain, fromId } = process._linkedBinding('electron_browser_web_frame_main');
|
||||
|
||||
Object.defineProperty(WebFrameMain.prototype, 'ipc', {
|
||||
get () {
|
||||
const ipc = new IpcMainImpl();
|
||||
Object.defineProperty(this, 'ipc', { value: ipc });
|
||||
return ipc;
|
||||
}
|
||||
});
|
||||
|
||||
WebFrameMain.prototype.send = function (channel, ...args) {
|
||||
if (typeof channel !== 'string') {
|
||||
throw new Error('Missing required channel argument');
|
||||
|
||||
@@ -31,7 +31,7 @@ export const setDefaultApplicationMenu = () => {
|
||||
{
|
||||
label: 'Community Discussions',
|
||||
click: async () => {
|
||||
await shell.openExternal('https://discord.gg/electronjs');
|
||||
await shell.openExternal('https://discord.com/invite/APGC3k5yaH');
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -4,13 +4,6 @@ import { IpcMainInvokeEvent } from 'electron/main';
|
||||
export class IpcMainImpl extends EventEmitter {
|
||||
private _invokeHandlers: Map<string, (e: IpcMainInvokeEvent, ...args: any[]) => void> = new Map();
|
||||
|
||||
constructor () {
|
||||
super();
|
||||
|
||||
// Do not throw exception when channel name is "error".
|
||||
this.on('error', () => {});
|
||||
}
|
||||
|
||||
handle: Electron.IpcMain['handle'] = (method, fn) => {
|
||||
if (this._invokeHandlers.has(method)) {
|
||||
throw new Error(`Attempted to register a second handler for '${method}'`);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
|
||||
|
||||
export const ipcMainInternal = new IpcMainImpl() as ElectronInternal.IpcMainInternal;
|
||||
|
||||
// Do not throw exception when channel name is "error".
|
||||
ipcMainInternal.on('error', () => {});
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
"electron",
|
||||
"electron/main",
|
||||
"electron/renderer"
|
||||
],
|
||||
"patterns": [
|
||||
"./*",
|
||||
"../*",
|
||||
"@electron/internal/browser/*",
|
||||
"@electron/internal/isolated_renderer/*",
|
||||
"@electron/internal/renderer/*",
|
||||
"@electron/internal/sandboxed_worker/*",
|
||||
"@electron/internal/worker/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import type * as ipcRendererUtilsModule from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
|
||||
const clipboard = process._linkedBinding('electron_common_clipboard');
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
"electron",
|
||||
"electron/main"
|
||||
],
|
||||
"patterns": [
|
||||
"./*",
|
||||
"../*",
|
||||
"@electron/internal/browser/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
"electron",
|
||||
"electron/main"
|
||||
],
|
||||
"patterns": [
|
||||
"./*",
|
||||
"../*",
|
||||
"@electron/internal/browser/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ipcRenderer } from 'electron/renderer';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
|
||||
import type * as webViewInitModule from '@electron/internal/renderer/web-view/web-view-init';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { internalContextBridge } from '@electron/internal/renderer/api/context-b
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
import { webFrame } from 'electron/renderer';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
import { IPC_MESSAGES } from '../common/ipc-messages';
|
||||
|
||||
const { contextIsolationEnabled } = internalContextBridge;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { webFrame, WebFrame } from 'electron/renderer';
|
||||
import { webFrame, WebFrame } from 'electron';
|
||||
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
|
||||
@@ -8,8 +8,16 @@ export interface GuestViewDelegate {
|
||||
dispatchEvent (eventName: string, props: Record<string, any>): void;
|
||||
}
|
||||
|
||||
const DEPRECATED_EVENTS: Record<string, string> = {
|
||||
'page-title-updated': 'page-title-set'
|
||||
} as const;
|
||||
|
||||
export function registerEvents (viewInstanceId: number, delegate: GuestViewDelegate) {
|
||||
ipcRendererInternal.on(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DISPATCH_EVENT}-${viewInstanceId}`, function (event, eventName, props) {
|
||||
if (DEPRECATED_EVENTS[eventName] != null) {
|
||||
delegate.dispatchEvent(DEPRECATED_EVENTS[eventName], props);
|
||||
}
|
||||
|
||||
delegate.dispatchEvent(eventName, props);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
"electron",
|
||||
"electron/main"
|
||||
],
|
||||
"patterns": [
|
||||
"./*",
|
||||
"../*",
|
||||
"@electron/internal/browser/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
"electron",
|
||||
"electron/main"
|
||||
],
|
||||
"patterns": [
|
||||
"./*",
|
||||
"../*",
|
||||
"@electron/internal/browser/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -70,30 +70,8 @@ function isInstalled () {
|
||||
|
||||
// unzips and makes path.txt point at the correct executable
|
||||
function extractFile (zipPath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const distPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist');
|
||||
|
||||
extract(zipPath, { dir: path.join(__dirname, 'dist') })
|
||||
.then(() => {
|
||||
// If the zip contains an "electron.d.ts" file,
|
||||
// move that up
|
||||
const srcTypeDefPath = path.join(distPath, 'electron.d.ts');
|
||||
const targetTypeDefPath = path.join(__dirname, 'electron.d.ts');
|
||||
const hasTypeDefinitions = fs.existsSync(srcTypeDefPath);
|
||||
|
||||
if (hasTypeDefinitions) {
|
||||
try {
|
||||
fs.renameSync(srcTypeDefPath, targetTypeDefPath);
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
}
|
||||
|
||||
// Write a "path.txt" file.
|
||||
return fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath);
|
||||
})
|
||||
.catch((err) => reject(err));
|
||||
});
|
||||
return extract(zipPath, { dir: path.join(__dirname, 'dist') })
|
||||
.then(() => fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath));
|
||||
}
|
||||
|
||||
function getPlatformPath () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "21.2.0",
|
||||
"version": "20.1.1",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
@@ -47,8 +47,8 @@
|
||||
"express": "^4.16.4",
|
||||
"folder-hash": "^2.1.1",
|
||||
"fs-extra": "^9.0.1",
|
||||
"got": "^11.8.5",
|
||||
"husky": "^8.0.1",
|
||||
"got": "^6.3.0",
|
||||
"husky": "^6.0.0",
|
||||
"klaw": "^3.0.0",
|
||||
"lint": "^1.1.2",
|
||||
"lint-staged": "^10.2.11",
|
||||
|
||||
@@ -12,6 +12,7 @@ webview_cross_drag.patch
|
||||
gin_enable_disable_v8_platform.patch
|
||||
disable-redraw-lock.patch
|
||||
enable_reset_aspect_ratio.patch
|
||||
v8_context_snapshot_generator.patch
|
||||
boringssl_build_gn.patch
|
||||
pepper_plugin_support.patch
|
||||
gtk_visibility.patch
|
||||
@@ -76,6 +77,7 @@ chore_provide_iswebcontentscreationoverridden_with_full_params.patch
|
||||
fix_properly_honor_printing_page_ranges.patch
|
||||
export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch
|
||||
fix_export_zlib_symbols.patch
|
||||
don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch
|
||||
web_contents.patch
|
||||
webview_fullscreen.patch
|
||||
disable_unload_metrics.patch
|
||||
@@ -108,20 +110,14 @@ make_gtk_getlibgtk_public.patch
|
||||
build_disable_print_content_analysis.patch
|
||||
custom_protocols_plzserviceworker.patch
|
||||
feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
|
||||
posix_replace_doubleforkandexec_with_forkandspawn.patch
|
||||
fix_allow_guest_webcontents_to_enter_fullscreen.patch
|
||||
disable_freezing_flags_after_init_in_node.patch
|
||||
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
|
||||
chore_add_electron_deps_to_gitignores.patch
|
||||
chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
|
||||
add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
|
||||
revert_spellcheck_fully_launch_spell_check_delayed_initialization.patch
|
||||
fix_mac_build_with_enable_plugins_false.patch
|
||||
fix_windows_build_with_enable_plugins_false.patch
|
||||
remove_default_window_title.patch
|
||||
add_electron_deps_to_license_credits_file.patch
|
||||
feat_add_set_can_resize_mutator.patch
|
||||
fix_revert_emulationhandler_update_functions_to_early_return.patch
|
||||
fix_return_v8_value_from_localframe_requestexecutescript.patch
|
||||
disable_optimization_guide_for_preconnect_feature.patch
|
||||
fix_the_gn_gen_for_components_segmentation_platform.patch
|
||||
fix_crash_loading_non-standard_schemes_in_iframes.patch
|
||||
create_browser_v8_snapshot_file_name_fuse.patch
|
||||
cherry-pick-c83640db21b5.patch
|
||||
fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
|
||||
3. Ctrl-Shift-= and Ctrl-Plus show up as such
|
||||
|
||||
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
|
||||
index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f942b277b 100644
|
||||
index 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a1f702d8b 100644
|
||||
--- a/ui/base/accelerators/accelerator.cc
|
||||
+++ b/ui/base/accelerators/accelerator.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
@@ -44,7 +44,7 @@ index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
@@ -445,7 +455,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
|
||||
@@ -447,7 +457,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
|
||||
const std::u16string& shortcut) const {
|
||||
std::u16string result = shortcut;
|
||||
|
||||
@@ -53,7 +53,7 @@ index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f
|
||||
result = ApplyModifierToAcceleratorString(result, IDS_APP_SHIFT_KEY);
|
||||
|
||||
// Note that we use 'else-if' in order to avoid using Ctrl+Alt as a shortcut.
|
||||
@@ -453,7 +463,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
|
||||
@@ -455,7 +465,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
|
||||
// more information.
|
||||
if (IsCtrlDown())
|
||||
result = ApplyModifierToAcceleratorString(result, IDS_APP_CTRL_KEY);
|
||||
|
||||
@@ -10,7 +10,7 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f676d35507e 100644
|
||||
index 3cd3d27448485e30dda92782df2df1e11635b26b..39c1615e0ac1456d2d2b350e03ef6e56c8efee53 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
@@ -24,16 +24,16 @@ index d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f67
|
||||
// We are experiencing what appear to be memory-stomp issues in the GPU
|
||||
// process. These issues seem to be impacting the task executor and listeners
|
||||
// registered to it. Create the task executor on the heap to guard against
|
||||
@@ -323,7 +327,6 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
const_cast<base::CommandLine*>(&command_line), gpu_preferences);
|
||||
const bool dead_on_arrival = !init_success;
|
||||
@@ -345,7 +349,6 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
ChildProcess gpu_process(io_thread_priority);
|
||||
DCHECK(base::ThreadPoolInstance::Get()->WasStarted());
|
||||
|
||||
- auto* client = GetContentClient()->gpu();
|
||||
if (client) {
|
||||
client->PostSandboxInitialized();
|
||||
}
|
||||
if (client)
|
||||
client->PostIOThreadCreated(gpu_process.io_task_runner());
|
||||
|
||||
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
|
||||
index a5d868b9e409c986bc85dfd71bb0363b5fa22145..9abe1cf5b2cc8ce60387ddf81b7c13aff9c178c4 100644
|
||||
index 04274b751b498456fc4b269bfbc6399b4f27d3ed..2fb98baf0df4e191e5e18fd7055cc2d92a2156df 100644
|
||||
--- a/content/public/gpu/content_gpu_client.h
|
||||
+++ b/content/public/gpu/content_gpu_client.h
|
||||
@@ -29,6 +29,10 @@ class CONTENT_EXPORT ContentGpuClient {
|
||||
|
||||
@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 7d169540590b83924766b1d423dc1bc46ab35250..f5bbb6ab26bd714d667236071a2eb0a5794a5631 100644
|
||||
index accbd08ec3f126e5fd5d5f3c7f636d8ccea56457..59e6c571ceb6699ddcb5cb178383ed382b277dea 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -136,6 +136,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
@@ -23,10 +23,10 @@ index 7d169540590b83924766b1d423dc1bc46ab35250..f5bbb6ab26bd714d667236071a2eb0a5
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 8199122b2d759aa8b27affabe67b108fb9a16c38..97cf24ad5f4a64322f242b0c339a807e3edb23fc 100644
|
||||
index 2c84b31ec771c11818e677e5d120fb965db6da86..f703ab8f616e9765ed3384654a271f251c16ac71 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4345,6 +4345,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4469,6 +4469,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 8199122b2d759aa8b27affabe67b108fb9a16c38..97cf24ad5f4a64322f242b0c339a807e
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index c8e822502d1b18c701a303024c3cba7e434d7829..89a048fbdaec8a8ea184790b78b0c63cfda7d171 100644
|
||||
index 3d492ed695a78519207c3e760405b2b7f4edb80e..d6ea308e4eaba67a597af2c08c406942588811a1 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -588,6 +588,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -608,6 +608,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
uint32_t ng_call_count) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index c8e822502d1b18c701a303024c3cba7e434d7829..89a048fbdaec8a8ea184790b78b0c63c
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index 4ef7353157272a623cea6b086b84da72ca795fca..548f6afd429695088bd83743fa6f6c1cd4197276 100644
|
||||
index 97c7d874e74ed65e960b1cce18edc1520583a2ab..c6317472b0ce1375e1c5762be59684a74c7bcde5 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -584,6 +584,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -602,6 +602,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -67,10 +67,10 @@ index 4ef7353157272a623cea6b086b84da72ca795fca..548f6afd429695088bd83743fa6f6c1c
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index c8af53d40eaa1dd3a0067948a8cda80d1599cee3..4de918ee52efa7ec27a21aa2f57616d31dfd07d1 100644
|
||||
index a6ba8411384855c82712960375bc949c5c2bd522..fc86ca807c9c1bda9236160580b094153778e18b 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -209,6 +209,7 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -207,6 +207,7 @@ void LocalWindowProxy::Initialize() {
|
||||
}
|
||||
|
||||
InstallConditionalFeatures();
|
||||
@@ -79,10 +79,10 @@ index c8af53d40eaa1dd3a0067948a8cda80d1599cee3..4de918ee52efa7ec27a21aa2f57616d3
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index 83a62e23b1d395b0aa545de5b828c24196cccc6d..0ca8163eb9ab87aead27bc8b2ee9e614d7e1d8c7 100644
|
||||
index c5b2d86bb3f7d75e99fda9c116dfd8f6ba036f1b..9d3e10d067006fa2043929dc3f9ab39f9bc126c9 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -301,6 +301,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
@@ -298,6 +298,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
@@ -92,7 +92,7 @@ index 83a62e23b1d395b0aa545de5b828c24196cccc6d..0ca8163eb9ab87aead27bc8b2ee9e614
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
index 2ac22a0410eea7f67cc7eb066879da649f7c6a0e..53ec3d177afbd75b4e67c6ab847094994c291dcb 100644
|
||||
index da7bd0f6c3aa7f4b787c404e1d169ee261e17836..ad2e7a0905dd7678a1f29aa03c9571bc84678029 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
@@ -273,6 +273,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -110,7 +110,7 @@ index 2ac22a0410eea7f67cc7eb066879da649f7c6a0e..53ec3d177afbd75b4e67c6ab84709499
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
index c974fa2f7c7f9c2aa5f075ec4aeb887d0b104453..b4ed9b2fadcfad7676387045b8581eb8d33e89e8 100644
|
||||
index f2e228ab14d71999c64c204d5f65df326fadbd17..d983d944a5d28de8711c50efe73e4b104b403f9b 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
@@ -80,6 +80,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
||||
@@ -123,10 +123,10 @@ index c974fa2f7c7f9c2aa5f075ec4aeb887d0b104453..b4ed9b2fadcfad7676387045b8581eb8
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index a2d7e97958d378dc5d37524f2f5516205c010749..e3f605938b3eea7f1c4dfac8e3c25014ebd15476 100644
|
||||
index a9bd5283d3c65728dd3293abe88ffd02d3eee4fc..f5e4a927f2f5114e62d76fec86d6a5d2d2321166 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -367,6 +367,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -352,6 +352,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -8,15 +8,15 @@ decorations in maximized mode where needed, preventing empty space caused
|
||||
by decoration shadows and rounded titlebars around the window while maximized.
|
||||
|
||||
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
|
||||
index dd42b1e87cf30413f96fdcfed9d8dc8c04fd537a..6c0612fb0f0dca32486d04491f9cd49a428836d1 100644
|
||||
index 12193ad9090de969b81fa6aa6bed9520aea5bae1..99ea60219b39a6864bdea45ba0917316bff7f2d9 100644
|
||||
--- a/ui/gtk/gtk_ui.cc
|
||||
+++ b/ui/gtk/gtk_ui.cc
|
||||
@@ -500,13 +500,15 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
|
||||
@@ -556,13 +556,15 @@ std::unique_ptr<views::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
-ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
|
||||
+ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
|
||||
-views::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
|
||||
+views::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
|
||||
if (!GtkCheckVersion(3, 14))
|
||||
return nullptr;
|
||||
auto& provider =
|
||||
@@ -31,24 +31,24 @@ index dd42b1e87cf30413f96fdcfed9d8dc8c04fd537a..6c0612fb0f0dca32486d04491f9cd49a
|
||||
}
|
||||
|
||||
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
|
||||
index e73bbdf28fba1f5b96d326dd7b0fd9aaa33ba221..5a537c8f6291909392824d62fc04209ad662d59a 100644
|
||||
index 65f9d6c81804d1b0efb88ced4a9c80c000ba0f5a..35d851a054a2b2f9887c77a9faaf16ce1aa363b9 100644
|
||||
--- a/ui/gtk/gtk_ui.h
|
||||
+++ b/ui/gtk/gtk_ui.h
|
||||
@@ -94,7 +94,7 @@ class GtkUi : public ui::LinuxUiBase {
|
||||
@@ -89,7 +89,7 @@ class GtkUi : public views::LinuxUI {
|
||||
bool PreferDarkTheme() const override;
|
||||
bool AnimationsEnabled() const override;
|
||||
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
|
||||
- ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
|
||||
+ ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
|
||||
std::unique_ptr<views::NavButtonProvider> CreateNavButtonProvider() override;
|
||||
- views::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
|
||||
+ views::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
|
||||
base::flat_map<std::string, std::string> GetKeyboardLayoutMap() override;
|
||||
std::string GetCursorThemeName() override;
|
||||
int GetCursorThemeSize() override;
|
||||
@@ -199,6 +199,8 @@ class GtkUi : public ui::LinuxUiBase {
|
||||
@@ -188,6 +188,8 @@ class GtkUi : public views::LinuxUI {
|
||||
// while Chrome is running.
|
||||
std::unique_ptr<ui::WindowFrameProvider> solid_frame_provider_;
|
||||
std::unique_ptr<ui::WindowFrameProvider> transparent_frame_provider_;
|
||||
+ std::unique_ptr<ui::WindowFrameProvider> solid_maximized_frame_provider_;
|
||||
+ std::unique_ptr<ui::WindowFrameProvider> transparent_maximized_frame_provider_;
|
||||
std::unique_ptr<views::WindowFrameProvider> solid_frame_provider_;
|
||||
std::unique_ptr<views::WindowFrameProvider> transparent_frame_provider_;
|
||||
+ std::unique_ptr<views::WindowFrameProvider> solid_maximized_frame_provider_;
|
||||
+ std::unique_ptr<views::WindowFrameProvider> transparent_maximized_frame_provider_;
|
||||
};
|
||||
|
||||
} // namespace gtk
|
||||
@@ -139,19 +139,19 @@ index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb76995
|
||||
// In GTK4, there's no way to obtain the frame thickness from CSS values
|
||||
// directly, so we must determine it experimentally based on the drawn
|
||||
diff --git a/ui/gtk/window_frame_provider_gtk.h b/ui/gtk/window_frame_provider_gtk.h
|
||||
index 8370c1cb3f8c3532d94e1265242cbf2397920480..2e0105ba8782dfe0a3ac169850734032c8ab071c 100644
|
||||
index d3039d73161378197557947aece88d2710c1e486..f7d4605938210b0b75517bb7bcab28b588a16520 100644
|
||||
--- a/ui/gtk/window_frame_provider_gtk.h
|
||||
+++ b/ui/gtk/window_frame_provider_gtk.h
|
||||
@@ -14,7 +14,7 @@ namespace gtk {
|
||||
|
||||
class WindowFrameProviderGtk : public ui::WindowFrameProvider {
|
||||
class WindowFrameProviderGtk : public views::WindowFrameProvider {
|
||||
public:
|
||||
- explicit WindowFrameProviderGtk(bool solid_frame);
|
||||
+ explicit WindowFrameProviderGtk(bool solid_frame, bool maximized);
|
||||
|
||||
WindowFrameProviderGtk(const WindowFrameProviderGtk&) = delete;
|
||||
WindowFrameProviderGtk& operator=(const WindowFrameProviderGtk&) = delete;
|
||||
@@ -69,6 +69,9 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
|
||||
@@ -69,6 +69,9 @@ class WindowFrameProviderGtk : public views::WindowFrameProvider {
|
||||
|
||||
// Cached bitmaps and metrics. The scale is rounded to percent.
|
||||
base::flat_map<int, Asset> assets_;
|
||||
@@ -161,11 +161,11 @@ index 8370c1cb3f8c3532d94e1265242cbf2397920480..2e0105ba8782dfe0a3ac169850734032
|
||||
};
|
||||
|
||||
} // namespace gtk
|
||||
diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
|
||||
index dee97740309e29c29d9c9c6c757455cddc817dbb..e5b71cd2b5e9e6252fe13c54bb54e26365347e2a 100644
|
||||
--- a/ui/linux/linux_ui.h
|
||||
+++ b/ui/linux/linux_ui.h
|
||||
@@ -175,7 +175,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUi {
|
||||
diff --git a/ui/views/linux_ui/linux_ui.h b/ui/views/linux_ui/linux_ui.h
|
||||
index 7d59a2c9ff87cf9d8cb3ed0b45e34e2831545d28..a6ae4feec8df8f149a9ebbe1c3d2252db73135db 100644
|
||||
--- a/ui/views/linux_ui/linux_ui.h
|
||||
+++ b/ui/views/linux_ui/linux_ui.h
|
||||
@@ -170,7 +170,7 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory,
|
||||
// if transparency is unsupported and the frame should be rendered opaque.
|
||||
// The returned object is not owned by the caller and will remain alive until
|
||||
// the process ends.
|
||||
|
||||
@@ -29,7 +29,7 @@ index 1eb1d0fe4696f26e7de43fc8797c283e9e6db042..766f8d8df866ce7fbc337cecceb715cc
|
||||
objects_.clear();
|
||||
platform_representations_.clear();
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
index 96f5bf8b6b5f3ed5ab25e15845f0de455eb68e0b..e6718a893e1bc5c970245c8265c95dda5d5fa2ff 100644
|
||||
index c47909313da0d7cd8a2b3cd670327011af66e3fb..0d259c21507f38124dfa46aceeacfda76cfd4a38 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
@@ -84,6 +84,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index 5c03f1194643c6f7302131404f7d869502f1e18b..fa990e6a444d5321213d956b01ba89ef21d57bd2 100644
|
||||
index 1f6d9be10432416f591a616805494b5d78975df1..e73f70c62ac2e69c918bdf39bd53f74a47066f4e 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -659,6 +659,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -665,6 +665,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ index 5c03f1194643c6f7302131404f7d869502f1e18b..fa990e6a444d5321213d956b01ba89ef
|
||||
return is_active();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
|
||||
index dfefe47c77c723c1cfdc6abe0e8ff96bc5ec6ddd..8d195ec46b9a6ea830c1ff36ee740b3b8be2b341 100644
|
||||
index 3ccc771a82992ae70c770fa6d2dde92904aa17db..505091e9006f7d41fa8d02e603afef1d10b35bf4 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -138,6 +138,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
void EnablePreferredSizeMode() override;
|
||||
void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) const override;
|
||||
|
||||
@@ -34,7 +34,7 @@ index dfefe47c77c723c1cfdc6abe0e8ff96bc5ec6ddd..8d195ec46b9a6ea830c1ff36ee740b3b
|
||||
void SendRendererPreferencesToRenderer(
|
||||
const blink::RendererPreferences& preferences);
|
||||
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
|
||||
index 2e4af843d7d0bbef5b7e6357de73355068b38948..77c69de4a541c56389ae11330f67c5fb6bbc4d2a 100644
|
||||
index 4d2a4c6746e1dbfc619faf2e16eaa4948d74e372..6c9f190ff595234eca18ff20ca0655da4689b7a2 100644
|
||||
--- a/content/public/browser/render_view_host.h
|
||||
+++ b/content/public/browser/render_view_host.h
|
||||
@@ -77,6 +77,9 @@ class CONTENT_EXPORT RenderViewHost {
|
||||
@@ -47,23 +47,36 @@ index 2e4af843d7d0bbef5b7e6357de73355068b38948..77c69de4a541c56389ae11330f67c5fb
|
||||
private:
|
||||
// This interface should only be implemented inside content.
|
||||
friend class RenderViewHostImpl;
|
||||
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
|
||||
index 99978b33c294ebe37192baccb29f0a34a25aed17..ef6e9ae24979538b8746aca898d1f302827491d8 100644
|
||||
--- a/content/renderer/render_view_impl.h
|
||||
+++ b/content/renderer/render_view_impl.h
|
||||
@@ -151,6 +151,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
|
||||
static WindowOpenDisposition NavigationPolicyToDisposition(
|
||||
blink::WebNavigationPolicy policy);
|
||||
|
||||
+ void OnSetSchedulerThrottling(bool allowed);
|
||||
+
|
||||
// ---------------------------------------------------------------------------
|
||||
// ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
|
||||
// it in the same order in the .cc file as it was in the header.
|
||||
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
|
||||
index 6ff7c34463f3ce5011ea8711d23f9cd11da38d8b..2b8e313dfac2ea9fad0583bb5e98d0c385e8584a 100644
|
||||
index 39bfc2200e924d0c589cfd07f085f182ef6853a6..bddff6d5ad3f6d08c4dc48e66ebc5319b1a5ec28 100644
|
||||
--- a/third_party/blink/public/mojom/page/page.mojom
|
||||
+++ b/third_party/blink/public/mojom/page/page.mojom
|
||||
@@ -137,4 +137,7 @@ interface PageBroadcast {
|
||||
mojo_base.mojom.UnguessableToken devtools_frame_token,
|
||||
RemoteFrameInterfacesFromBrowser remote_frame_interfaces,
|
||||
RemoteMainFrameInterfaces remote_main_frame_interfaces);
|
||||
@@ -108,4 +108,7 @@ interface PageBroadcast {
|
||||
|
||||
// Sent to whole page, but should only be used by the main frame.
|
||||
SetPageBaseBackgroundColor(skia.mojom.SkColor? color);
|
||||
+
|
||||
+ // Whether to enable the Renderer scheduler background throttling.
|
||||
+ SetSchedulerThrottling(bool allowed);
|
||||
};
|
||||
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
|
||||
index 3af33a4d699b5bbfb0a1abac9408ad322a47a5ac..30bc8aa73fb46a0306ccc837a99cc4d58daef99d 100644
|
||||
index 5e4032ccf916f969cd669af7d983becddb57c72b..a858c9f2fa609ae756a2e70d0362f2de372dd5be 100644
|
||||
--- a/third_party/blink/public/web/web_view.h
|
||||
+++ b/third_party/blink/public/web/web_view.h
|
||||
@@ -366,6 +366,7 @@ class WebView {
|
||||
@@ -364,6 +364,7 @@ class WebView {
|
||||
// Scheduling -----------------------------------------------------------
|
||||
|
||||
virtual PageScheduler* Scheduler() const = 0;
|
||||
@@ -72,10 +85,10 @@ index 3af33a4d699b5bbfb0a1abac9408ad322a47a5ac..30bc8aa73fb46a0306ccc837a99cc4d5
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 231f76d07d8a0d3d060b30e0ff6eabe4aa33d755..40aa3b1a5c569e66b6f5d1630afe248c40d5715b 100644
|
||||
index 3f6460ceee1e3268db45fec668a5e75353643bcb..818394c235c3f71289218098c7db77e00d156d92 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -3787,6 +3787,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3727,6 +3727,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -89,7 +102,7 @@ index 231f76d07d8a0d3d060b30e0ff6eabe4aa33d755..40aa3b1a5c569e66b6f5d1630afe248c
|
||||
void WebViewImpl::SetVisibilityState(
|
||||
mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) {
|
||||
@@ -3798,7 +3805,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
@@ -3738,7 +3745,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
}
|
||||
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
|
||||
GetPage()->GetPageScheduler()->SetPageVisible(
|
||||
@@ -100,10 +113,10 @@ index 231f76d07d8a0d3d060b30e0ff6eabe4aa33d755..40aa3b1a5c569e66b6f5d1630afe248c
|
||||
|
||||
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index 08cc81481cbe4fe40a7df6316db765fa2eac7fda..c5dfefd84b44de5a2c28afb2b9bd8035647da12b 100644
|
||||
index 2f8e971ab224b36c6e464eb7524dd3d4c6b76f8c..4a9664d0ce5de431d9638e4145a21091cea78fd1 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -425,6 +425,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -418,6 +418,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
LocalDOMWindow* PagePopupWindow() const;
|
||||
|
||||
PageScheduler* Scheduler() const override;
|
||||
@@ -111,7 +124,7 @@ index 08cc81481cbe4fe40a7df6316db765fa2eac7fda..c5dfefd84b44de5a2c28afb2b9bd8035
|
||||
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) override;
|
||||
mojom::blink::PageVisibilityState GetVisibilityState() override;
|
||||
@@ -875,6 +876,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -865,6 +866,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
// If true, we send IPC messages when |preferred_size_| changes.
|
||||
bool send_preferred_size_changes_ = false;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user