mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
1 Commits
fix-sym-co
...
pr/47870
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71526af2fb |
50
.github/actions/build-electron/action.yml
vendored
50
.github/actions/build-electron/action.yml
vendored
@@ -60,28 +60,14 @@ runs:
|
||||
sudo launchctl limit maxfiles 65536 200000
|
||||
fi
|
||||
|
||||
if [ "${{ inputs.is-release }}" = "true" ]; then
|
||||
NINJA_SUMMARIZE_BUILD=1 e build --target electron:release_build
|
||||
else
|
||||
NINJA_SUMMARIZE_BUILD=1 e build --target electron:testing_build
|
||||
fi
|
||||
NINJA_SUMMARIZE_BUILD=1 e build
|
||||
cp out/Default/.ninja_log out/electron_ninja_log
|
||||
node electron/script/check-symlinks.js
|
||||
|
||||
# Upload build stats to Datadog
|
||||
if ! [ -z $DD_API_KEY ]; then
|
||||
if [ "$TARGET_PLATFORM" = "win" ]; then
|
||||
npx node electron/script/build-stats.mjs out/Default/siso.exe.INFO --upload-stats || true
|
||||
else
|
||||
npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true
|
||||
fi
|
||||
else
|
||||
echo "Skipping build-stats.mjs upload because DD_API_KEY is not set"
|
||||
fi
|
||||
- name: Verify dist.zip ${{ inputs.step-suffix }}
|
||||
- name: Build Electron dist.zip ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd src
|
||||
cd src
|
||||
e build --target electron:electron_dist_zip
|
||||
if [ "${{ inputs.is-asan }}" != "true" ]; then
|
||||
target_os=${{ inputs.target-platform == 'macos' && 'mac' || inputs.target-platform }}
|
||||
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
||||
@@ -89,10 +75,11 @@ runs:
|
||||
fi
|
||||
electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.${{ inputs.target-arch }}.manifest
|
||||
fi
|
||||
- name: Fixup Mksnapshot ${{ inputs.step-suffix }}
|
||||
- name: Build Mksnapshot ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd src
|
||||
e build --target electron:electron_mksnapshot_zip
|
||||
ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||
# Remove unused args from mksnapshot_args
|
||||
SEDOPTION="-i"
|
||||
@@ -144,6 +131,11 @@ runs:
|
||||
fi
|
||||
electron/script/zip_manifests/check-zip-manifest.py out/Default/chromedriver.zip electron/script/zip_manifests/chromedriver_zip.$target_os.${{ inputs.target-arch }}.manifest
|
||||
fi
|
||||
- name: Build Node.js headers ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd src
|
||||
e build --target electron:node_headers
|
||||
- name: Create installed_software.json ${{ inputs.step-suffix }}
|
||||
shell: powershell
|
||||
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
|
||||
@@ -163,11 +155,17 @@ runs:
|
||||
# Needed for msdia140.dll on 64-bit windows
|
||||
cd src
|
||||
export PATH="$PATH:$(pwd)/third_party/llvm-build/Release+Asserts/bin"
|
||||
- name: Zip Symbols ${{ inputs.step-suffix }}
|
||||
- name: Generate & Zip Symbols ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Generate breakpad symbols on release builds
|
||||
if [ "${{ inputs.generate-symbols }}" = "true" ]; then
|
||||
e build --target electron:electron_symbols
|
||||
fi
|
||||
cd src
|
||||
export BUILD_PATH="$(pwd)/out/Default"
|
||||
e build --target electron:licenses
|
||||
e build --target electron:electron_version_file
|
||||
if [ "${{ inputs.is-release }}" = "true" ]; then
|
||||
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
|
||||
else
|
||||
@@ -180,6 +178,18 @@ runs:
|
||||
cd src
|
||||
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true use_siso=true $GN_EXTRA_ARGS"
|
||||
e build --target electron:electron_ffmpeg_zip -C ../../out/ffmpeg
|
||||
- name: Generate Hunspell Dictionaries ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'linux' }}
|
||||
run: |
|
||||
e build --target electron:hunspell_dictionaries_zip
|
||||
- name: Generate Libcxx ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'linux' }}
|
||||
run: |
|
||||
e build --target electron:libcxx_headers_zip
|
||||
e build --target electron:libcxxabi_headers_zip
|
||||
e build --target electron:libcxx_objects_zip
|
||||
- name: Remove Clang problem matcher
|
||||
shell: bash
|
||||
run: echo "::remove-matcher owner=clang::"
|
||||
|
||||
43
.github/actions/free-space-macos/action.yml
vendored
43
.github/actions/free-space-macos/action.yml
vendored
@@ -17,30 +17,28 @@ runs:
|
||||
}
|
||||
|
||||
strip_universal_deep() {
|
||||
if [ -d "$1" ]; then
|
||||
opwd=$(pwd)
|
||||
cd $1
|
||||
f=$(find . -perm +111 -type f)
|
||||
for fp in $f
|
||||
do
|
||||
if [[ $(file "$fp") == *"universal binary"* ]]; then
|
||||
if [ "`arch`" == "arm64" ]; then
|
||||
if [[ $(file "$fp") == *"x86_64"* ]]; then
|
||||
sudo lipo -remove x86_64 "$fp" -o "$fp" || true
|
||||
fi
|
||||
else
|
||||
if [[ $(file "$fp") == *"arm64e)"* ]]; then
|
||||
sudo lipo -remove arm64e "$fp" -o "$fp" || true
|
||||
fi
|
||||
if [[ $(file "$fp") == *"arm64)"* ]]; then
|
||||
sudo lipo -remove arm64 "$fp" -o "$fp" || true
|
||||
fi
|
||||
opwd=$(pwd)
|
||||
cd $1
|
||||
f=$(find . -perm +111 -type f)
|
||||
for fp in $f
|
||||
do
|
||||
if [[ $(file "$fp") == *"universal binary"* ]]; then
|
||||
if [ "`arch`" == "arm64" ]; then
|
||||
if [[ $(file "$fp") == *"x86_64"* ]]; then
|
||||
sudo lipo -remove x86_64 "$fp" -o "$fp" || true
|
||||
fi
|
||||
else
|
||||
if [[ $(file "$fp") == *"arm64e)"* ]]; then
|
||||
sudo lipo -remove arm64e "$fp" -o "$fp" || true
|
||||
fi
|
||||
if [[ $(file "$fp") == *"arm64)"* ]]; then
|
||||
sudo lipo -remove arm64 "$fp" -o "$fp" || true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
cd $opwd
|
||||
fi
|
||||
cd $opwd
|
||||
}
|
||||
|
||||
tmpify /Library/Developer/CoreSimulator
|
||||
@@ -62,9 +60,10 @@ runs:
|
||||
|
||||
sudo rm -rf /Applications/Safari.app
|
||||
sudo rm -rf /Applications/Xcode_16.1.app
|
||||
sudo rm -rf /Applications/Xcode_16.2.app
|
||||
sudo rm -rf /Applications/Xcode_16.3.app
|
||||
sudo rm -rf /Applications/Xcode_16.2.app
|
||||
sudo rm -rf /Applications/Google Chrome.app
|
||||
sudo rm -rf /Applications/Xcode_16.4.app
|
||||
sudo rm -rf /Applications/Google Chrome for Testing.app
|
||||
sudo rm -rf /Applications/Firefox.app
|
||||
sudo rm -rf ~/project/src/third_party/catapult/tracing/test_data
|
||||
|
||||
@@ -15,7 +15,7 @@ runs:
|
||||
git config --global core.preloadindex true
|
||||
git config --global core.longpaths true
|
||||
fi
|
||||
export BUILD_TOOLS_SHA=a5d9f9052dcc36ee88bef5c8b13acbefd87b7d8d
|
||||
export BUILD_TOOLS_SHA=706147b2376f55078f718576b28129a0457f1795
|
||||
npm i -g @electron/build-tools
|
||||
# Update depot_tools to ensure python
|
||||
e d update_depot_tools
|
||||
|
||||
8
.github/workflows/archaeologist-dig.yml
vendored
8
.github/workflows/archaeologist-dig.yml
vendored
@@ -9,13 +9,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js/npm
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
|
||||
with:
|
||||
node-version: 22.21.x
|
||||
node-version: 20.19.x
|
||||
- name: Setting Up Dig Site
|
||||
run: |
|
||||
echo "remote: ${{ github.event.pull_request.head.repo.clone_url }}"
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
sha-file: .dig-old
|
||||
filename: electron.old.d.ts
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
|
||||
with:
|
||||
name: artifacts
|
||||
path: electron/artifacts
|
||||
|
||||
2
.github/workflows/audit-branch-ci.yml
vendored
2
.github/workflows/audit-branch-ci.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 22.17.x
|
||||
- run: npm install @actions/cache@4.0.3 @electron/fiddle-core@2.0.1
|
||||
|
||||
6
.github/workflows/build-git-cache.yml
vendored
6
.github/workflows/build-git-cache.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
TARGET_OS: 'win'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
@@ -54,7 +54,7 @@ jobs:
|
||||
build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
|
||||
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
@@ -63,10 +63,6 @@ jobs:
|
||||
filters: |
|
||||
docs:
|
||||
- 'docs/**'
|
||||
- README.md
|
||||
- SECURITY.md
|
||||
- CONTRIBUTING.md
|
||||
- CODE_OF_CONDUCT.md
|
||||
src:
|
||||
- '!docs/**'
|
||||
- name: Set Outputs for Build Image SHA & Docs Only
|
||||
@@ -115,7 +111,7 @@ jobs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -145,7 +141,7 @@ jobs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -175,7 +171,7 @@ jobs:
|
||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -193,7 +189,7 @@ jobs:
|
||||
with:
|
||||
target-platform: macos
|
||||
target-archs: x64 arm64
|
||||
check-runs-on: macos-15
|
||||
check-runs-on: macos-14
|
||||
gn-build-type: testing
|
||||
secrets: inherit
|
||||
|
||||
@@ -229,7 +225,7 @@ jobs:
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: checkout-macos
|
||||
with:
|
||||
build-runs-on: macos-15-xlarge
|
||||
build-runs-on: macos-14-xlarge
|
||||
test-runs-on: macos-15-large
|
||||
target-platform: macos
|
||||
target-arch: x64
|
||||
@@ -248,7 +244,7 @@ jobs:
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: checkout-macos
|
||||
with:
|
||||
build-runs-on: macos-15-xlarge
|
||||
build-runs-on: macos-14-xlarge
|
||||
test-runs-on: macos-15
|
||||
target-platform: macos
|
||||
target-arch: arm64
|
||||
|
||||
2
.github/workflows/issue-labeled.yml
vendored
2
.github/workflows/issue-labeled.yml
vendored
@@ -72,7 +72,7 @@ jobs:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
- name: Create comment
|
||||
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
|
||||
uses: actions-cool/issues-helper@9861779a695cf1898bd984c727f685f351cfc372 # v3.7.2
|
||||
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3.6.2
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
2
.github/workflows/issue-opened.yml
vendored
2
.github/workflows/issue-opened.yml
vendored
@@ -134,7 +134,7 @@ jobs:
|
||||
}
|
||||
- name: Create unsupported major comment
|
||||
if: ${{ steps.add-labels.outputs.unsupportedMajor }}
|
||||
uses: actions-cool/issues-helper@9861779a695cf1898bd984c727f685f351cfc372 # v3.7.2
|
||||
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3.6.2
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
2
.github/workflows/linux-publish.yml
vendored
2
.github/workflows/linux-publish.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
10
.github/workflows/macos-publish.yml
vendored
10
.github/workflows/macos-publish.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
needs: checkout-macos
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: macos-15-xlarge
|
||||
build-runs-on: macos-14-xlarge
|
||||
target-platform: macos
|
||||
target-arch: x64
|
||||
target-variant: darwin
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
needs: checkout-macos
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: macos-15-xlarge
|
||||
build-runs-on: macos-14-xlarge
|
||||
target-platform: macos
|
||||
target-arch: x64
|
||||
target-variant: mas
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
needs: checkout-macos
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: macos-15-xlarge
|
||||
build-runs-on: macos-14-xlarge
|
||||
target-platform: macos
|
||||
target-arch: arm64
|
||||
target-variant: darwin
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
needs: checkout-macos
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: macos-15-xlarge
|
||||
build-runs-on: macos-14-xlarge
|
||||
target-platform: macos
|
||||
target-arch: arm64
|
||||
target-variant: mas
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
with:
|
||||
target-platform: linux
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
2
.github/workflows/pipeline-electron-lint.yml
vendored
2
.github/workflows/pipeline-electron-lint.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -66,7 +66,6 @@ concurrency:
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
DD_API_KEY: ${{ secrets.DD_API_KEY }}
|
||||
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||
@@ -85,13 +84,12 @@ jobs:
|
||||
environment: ${{ inputs.environment }}
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
TARGET_PLATFORM: ${{ inputs.target-platform }}
|
||||
steps:
|
||||
- name: Create src dir
|
||||
run: |
|
||||
mkdir src
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -115,9 +113,9 @@ jobs:
|
||||
run: df -h
|
||||
- name: Setup Node.js/npm
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
|
||||
with:
|
||||
node-version: 22.21.x
|
||||
node-version: 20.19.x
|
||||
cache: yarn
|
||||
cache-dependency-path: src/electron/yarn.lock
|
||||
- name: Install Dependencies
|
||||
@@ -159,7 +157,7 @@ jobs:
|
||||
if: ${{ inputs.target-platform == 'linux' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.check-container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -111,7 +111,7 @@ jobs:
|
||||
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -68,12 +68,11 @@ jobs:
|
||||
if: ${{ inputs.target-arch == 'arm' && inputs.target-platform == 'linux' }}
|
||||
run: |
|
||||
cp $(which node) /mnt/runner-externals/node20/bin/
|
||||
cp $(which node) /mnt/runner-externals/node24/bin/
|
||||
- name: Setup Node.js/npm
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
|
||||
with:
|
||||
node-version: 22.21.x
|
||||
node-version: 20.19.x
|
||||
- name: Add TCC permissions on macOS
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: |
|
||||
@@ -118,7 +117,7 @@ jobs:
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -167,12 +166,12 @@ jobs:
|
||||
echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
|
||||
echo "IS_ASAN=true" >> $GITHUB_ENV
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
- name: Download Src Artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
||||
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
@@ -262,7 +261,7 @@ jobs:
|
||||
if: always() && !cancelled()
|
||||
- name: Upload Test Artifacts
|
||||
if: always() && !cancelled()
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: test_artifacts_${{ env.ARTIFACT_KEY }}_${{ matrix.shard }}
|
||||
path: src/electron/spec/artifacts
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.test-container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -61,12 +61,12 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
- name: Download Src Artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
container: ${{ fromJSON(inputs.test-container) }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
@@ -115,12 +115,12 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||
- name: Download Src Artifacts
|
||||
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||
|
||||
5
.github/workflows/pull-request-labeled.yml
vendored
5
.github/workflows/pull-request-labeled.yml
vendored
@@ -19,10 +19,7 @@ jobs:
|
||||
webhook-type: webhook-trigger
|
||||
payload: |
|
||||
{
|
||||
"base_ref": ${{ toJSON(github.event.pull_request.base.ref) }},
|
||||
"title": ${{ toJSON(github.event.pull_request.title) }},
|
||||
"url": ${{ toJSON(github.event.pull_request.html_url) }},
|
||||
"user": ${{ toJSON(github.event.pull_request.user.login) }}
|
||||
"url": "${{ github.event.pull_request.html_url }}"
|
||||
}
|
||||
pull-request-labeled-deprecation-review-complete:
|
||||
name: deprecation-review/complete label added
|
||||
|
||||
8
.github/workflows/scorecards.yml
vendored
8
.github/workflows/scorecards.yml
vendored
@@ -22,13 +22,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# This is a pre-submit / pre-release.
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@@ -50,6 +50,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5
|
||||
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
This issue has been automatically marked as stale. **If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the [latest version of Electron](https://www.electronjs.org/releases/stable) or in the [beta](https://www.electronjs.org/releases/beta)—please include it with your comment!
|
||||
close-issue-message: >
|
||||
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
|
||||
exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed,stale-exempt,upgrade-follow-up,tracking-upstream"
|
||||
exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed,stale-exempt,upgrade-follow-up"
|
||||
only-pr-labels: not-a-real-label
|
||||
pending-repro:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/windows-publish.yml
vendored
2
.github/workflows/windows-publish.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
build-image-sha: ${{ inputs.build-image-sha }}
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
|
||||
32
BUILD.gn
32
BUILD.gn
@@ -480,7 +480,6 @@ source_set("electron_lib") {
|
||||
"//device/bluetooth",
|
||||
"//device/bluetooth/public/cpp",
|
||||
"//gin",
|
||||
"//gpu/ipc/client",
|
||||
"//media/capture/mojom:video_capture",
|
||||
"//media/mojo/mojom",
|
||||
"//media/mojo/mojom:web_speech_recognition",
|
||||
@@ -587,13 +586,7 @@ source_set("electron_lib") {
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
# Disable C++ modules to resolve linking error when including MacOS SDK
|
||||
# headers from third_party/electron_node/deps/uv/include/uv/darwin.h
|
||||
# TODO(samuelmaddock): consider revisiting this in the future
|
||||
use_libcxx_modules = false
|
||||
|
||||
deps += [
|
||||
"//components/os_crypt/common:keychain_password_mac",
|
||||
"//components/remote_cocoa/app_shim",
|
||||
"//components/remote_cocoa/browser",
|
||||
"//content/browser:mac_helpers",
|
||||
@@ -762,13 +755,11 @@ source_set("electron_lib") {
|
||||
if (enable_pdf_viewer) {
|
||||
deps += [
|
||||
"//chrome/browser/resources/pdf:resources",
|
||||
"//chrome/browser/ui:browser_element_identifiers",
|
||||
"//components/pdf/browser",
|
||||
"//components/pdf/browser:interceptors",
|
||||
"//components/pdf/common:constants",
|
||||
"//components/pdf/common:util",
|
||||
"//components/pdf/renderer",
|
||||
"//components/user_education/webui",
|
||||
"//pdf",
|
||||
"//pdf:content_restriction",
|
||||
]
|
||||
@@ -1628,29 +1619,6 @@ group("node_headers") {
|
||||
public_deps = [ ":tar_node_headers" ]
|
||||
}
|
||||
|
||||
group("testing_build") {
|
||||
public_deps = [
|
||||
":electron_dist_zip",
|
||||
":electron_mksnapshot_zip",
|
||||
":node_headers",
|
||||
]
|
||||
}
|
||||
|
||||
group("release_build") {
|
||||
public_deps = [ ":testing_build" ]
|
||||
if (is_official_build) {
|
||||
public_deps += [ ":electron_symbols" ]
|
||||
}
|
||||
if (is_linux) {
|
||||
public_deps += [
|
||||
":hunspell_dictionaries_zip",
|
||||
":libcxx_headers_zip",
|
||||
":libcxx_objects_zip",
|
||||
":libcxxabi_headers_zip",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (is_linux && is_official_build) {
|
||||
strip_binary("strip_electron_binary") {
|
||||
binary_input = "$root_out_dir/$electron_project_name"
|
||||
|
||||
8
DEPS
8
DEPS
@@ -2,17 +2,17 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'144.0.7521.0',
|
||||
'142.0.7417.0',
|
||||
'node_version':
|
||||
'v24.11.0',
|
||||
'v22.20.0',
|
||||
'nan_version':
|
||||
'675cefebca42410733da8a454c8d9391fcebfbc2',
|
||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||
'squirrel.mac_version':
|
||||
'0e5d146ba13101a1302d59ea6e6e0b3cace4ae38',
|
||||
'reactiveobjc_version':
|
||||
'74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
|
||||
'mantle_version':
|
||||
'2a8e2123a3931038179ee06105c9e6ec336b12ea',
|
||||
'78d3966b3c331292ea29ec38661b25df0a245948',
|
||||
'engflow_reclient_configs_version':
|
||||
'955335c30a752e9ef7bff375baab5e0819b6c00d',
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ For more installation options and troubleshooting tips, see
|
||||
|
||||
Each Electron release provides binaries for macOS, Windows, and Linux.
|
||||
|
||||
* macOS (Monterey and up): Electron provides 64-bit Intel and Apple Silicon / ARM binaries for macOS.
|
||||
* macOS (Big Sur and up): Electron provides 64-bit Intel and Apple Silicon / ARM binaries for macOS.
|
||||
* Windows (Windows 10 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. Support for Windows 7, 8 and 8.1 was [removed in Electron 23, in line with Chromium's Windows deprecation policy](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice).
|
||||
* Linux: The prebuilt binaries of Electron are built on Ubuntu 22.04. They have also been verified to work on:
|
||||
* Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on:
|
||||
* Ubuntu 18.04 and newer
|
||||
* Fedora 32 and newer
|
||||
* Debian 10 and newer
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
||||
node_module_version = 143
|
||||
node_module_version = 140
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_embedder_string = "-electron.0"
|
||||
@@ -19,15 +19,15 @@ proprietary_codecs = true
|
||||
|
||||
enable_printing = true
|
||||
|
||||
# Refs https://chromium-review.googlesource.com/c/chromium/src/+/6986517
|
||||
# CI is using MacOS 15.5 which doesn't have the required modulemaps.
|
||||
use_clang_modules = false
|
||||
|
||||
# Removes DLLs from the build, which are only meant to be used for Chromium development.
|
||||
# See https://github.com/electron/electron/pull/17985
|
||||
angle_enable_vulkan_validation_layers = false
|
||||
dawn_enable_vulkan_validation_layers = false
|
||||
|
||||
# Removes dxc dll's that are only used experimentally.
|
||||
# See https://bugs.chromium.org/p/chromium/issues/detail?id=1474897
|
||||
dawn_use_built_dxc = false
|
||||
|
||||
# These are disabled because they cause the zip manifest to differ between
|
||||
# testing and release builds.
|
||||
# See https://chromium-review.googlesource.com/c/chromium/src/+/2774898.
|
||||
|
||||
@@ -383,8 +383,6 @@ static_library("chrome") {
|
||||
"//chrome/browser/pdf/chrome_pdf_stream_delegate.h",
|
||||
"//chrome/browser/pdf/pdf_extension_util.cc",
|
||||
"//chrome/browser/pdf/pdf_extension_util.h",
|
||||
"//chrome/browser/pdf/pdf_help_bubble_handler_factory.cc",
|
||||
"//chrome/browser/pdf/pdf_help_bubble_handler_factory.h",
|
||||
"//chrome/browser/pdf/pdf_viewer_stream_manager.cc",
|
||||
"//chrome/browser/pdf/pdf_viewer_stream_manager.h",
|
||||
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.cc",
|
||||
@@ -393,8 +391,6 @@ static_library("chrome") {
|
||||
deps += [
|
||||
"//components/pdf/browser",
|
||||
"//components/pdf/renderer",
|
||||
"//ui/base/interaction",
|
||||
"//ui/webui/resources/cr_components/help_bubble:mojo_bindings",
|
||||
]
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -421,7 +421,6 @@ Returns:
|
||||
* `oom` - Process ran out of memory
|
||||
* `launch-failed` - Process never successfully launched
|
||||
* `integrity-failure` - Windows code integrity checks failed
|
||||
* `memory-eviction` - Process proactively terminated to prevent a future out-of-memory (OOM) situation
|
||||
* `exitCode` number - The exit code for the process
|
||||
(e.g. status from waitpid if on POSIX, from GetExitCodeProcess on Windows).
|
||||
* `serviceName` string (optional) - The non-localized name of the process.
|
||||
@@ -565,9 +564,8 @@ and subscribing to the `ready` event if the app is not ready yet.
|
||||
* `steal` boolean _macOS_ - Make the receiver the active app even if another app is
|
||||
currently active.
|
||||
|
||||
On macOS, makes the application the active app. On Windows, focuses on the application's
|
||||
first window. On Linux, either focuses on the first visible window (X11) or requests
|
||||
focus but may instead show a notification or flash the app icon (Wayland).
|
||||
On Linux, focuses on the first visible window. On macOS, makes the application
|
||||
the active app. On Windows, focuses on the application's first window.
|
||||
|
||||
You should seek to use the `steal` option as sparingly as possible.
|
||||
|
||||
@@ -1216,13 +1214,6 @@ Disables hardware acceleration for current app.
|
||||
|
||||
This method can only be called before app is ready.
|
||||
|
||||
### `app.isHardwareAccelerationEnabled()`
|
||||
|
||||
Returns `boolean` - whether hardware acceleration is currently disabled.
|
||||
|
||||
> [!NOTE]
|
||||
> This information is only usable after the `gpu-info-update` event is emitted.
|
||||
|
||||
### `app.disableDomainBlockingFor3DAPIs()`
|
||||
|
||||
By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per
|
||||
@@ -1406,75 +1397,7 @@ details. Disabled by default.
|
||||
This API must be called after the `ready` event is emitted.
|
||||
|
||||
> [!NOTE]
|
||||
> Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default. Calling this method will enable the following accessibility support features: `nativeAPIs`, `webContents`, `inlineTextBoxes`, and `extendedProperties`.
|
||||
|
||||
### `app.getAccessibilitySupportFeatures()` _macOS_ _Windows_
|
||||
|
||||
Returns `string[]` - Array of strings naming currently enabled accessibility support components. Possible values:
|
||||
|
||||
* `nativeAPIs` - Native OS accessibility APIs integration enabled.
|
||||
* `webContents` - Web contents accessibility tree exposure enabled.
|
||||
* `inlineTextBoxes` - Inline text boxes (character bounding boxes) enabled.
|
||||
* `extendedProperties` - Extended accessibility properties enabled.
|
||||
* `screenReader` - Screen reader specific mode enabled.
|
||||
* `html` - HTML accessibility tree construction enabled.
|
||||
* `labelImages` - Accessibility support for automatic image annotations.
|
||||
* `pdfPrinting` - Accessibility support for PDF printing enabled.
|
||||
|
||||
Notes:
|
||||
|
||||
* The array may be empty if no accessibility modes are active.
|
||||
* Use `app.isAccessibilitySupportEnabled()` for the legacy boolean check;
|
||||
prefer this method for granular diagnostics or telemetry.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
if (app.getAccessibilitySupportFeatures().includes('screenReader')) {
|
||||
// Change some app UI to better work with Screen Readers.
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### `app.setAccessibilitySupportFeatures(features)` _macOS_ _Windows_
|
||||
|
||||
* `features` string[] - An array of the accessibility features to enable.
|
||||
|
||||
Possible values are:
|
||||
|
||||
* `nativeAPIs` - Native OS accessibility APIs integration enabled.
|
||||
* `webContents` - Web contents accessibility tree exposure enabled.
|
||||
* `inlineTextBoxes` - Inline text boxes (character bounding boxes) enabled.
|
||||
* `extendedProperties` - Extended accessibility properties enabled.
|
||||
* `screenReader` - Screen reader specific mode enabled.
|
||||
* `html` - HTML accessibility tree construction enabled.
|
||||
* `labelImages` - Accessibility support for automatic image annotations.
|
||||
* `pdfPrinting` - Accessibility support for PDF printing enabled.
|
||||
|
||||
To disable all supported features, pass an empty array `[]`.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
// Enable a subset of features:
|
||||
app.setAccessibilitySupportFeatures([
|
||||
'screenReader',
|
||||
'pdfPrinting',
|
||||
'webContents'
|
||||
])
|
||||
|
||||
// Other logic
|
||||
|
||||
// Some time later, disable all features:
|
||||
app.setAccessibilitySupportFeatures([])
|
||||
})
|
||||
```
|
||||
> Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
|
||||
|
||||
### `app.showAboutPanel()`
|
||||
|
||||
|
||||
@@ -1262,16 +1262,15 @@ Sets the properties for the window's taskbar button.
|
||||
|
||||
#### `win.setAccentColor(accentColor)` _Windows_
|
||||
|
||||
* `accentColor` boolean | string | null - The accent color for the window. By default, follows user preference in System Settings. To reset to system default, pass `null`.
|
||||
* `accentColor` boolean | string - The accent color for the window. By default, follows user preference in System Settings.
|
||||
|
||||
Sets the system accent color and highlighting of active window border.
|
||||
|
||||
The `accentColor` parameter accepts the following values:
|
||||
|
||||
* **Color string** - Like `true`, but sets a custom accent color using standard CSS color formats (Hex, RGB, RGBA, HSL, HSLA, or named colors). Alpha values in RGBA/HSLA formats are ignored and the color is treated as fully opaque.
|
||||
* **`true`** - Enable accent color highlighting for the window with the system accent color regardless of whether accent colors are enabled for windows in System `Settings.`
|
||||
* **`false`** - Disable accent color highlighting for the window regardless of whether accent colors are currently enabled for windows in System Settings.
|
||||
* **`null`** - Reset window accent color behavior to follow behavior set in System Settings.
|
||||
* **Color string** - Sets a custom accent color using standard CSS color formats (Hex, RGB, RGBA, HSL, HSLA, or named colors). Alpha values in RGBA/HSLA formats are ignored and the color is treated as fully opaque.
|
||||
* **`true`** - Uses the system's default accent color from user preferences in System Settings.
|
||||
* **`false`** - Explicitly disables accent color highlighting for the window.
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -1284,14 +1283,11 @@ win.setAccentColor('#ff0000')
|
||||
// RGB format (alpha ignored if present).
|
||||
win.setAccentColor('rgba(255,0,0,0.5)')
|
||||
|
||||
// Enable accent color, using the color specified in System Settings.
|
||||
// Use system accent color.
|
||||
win.setAccentColor(true)
|
||||
|
||||
// Disable accent color.
|
||||
win.setAccentColor(false)
|
||||
|
||||
// Reset window accent color behavior to follow behavior set in System Settings.
|
||||
win.setAccentColor(null)
|
||||
```
|
||||
|
||||
#### `win.getAccentColor()` _Windows_
|
||||
|
||||
@@ -140,10 +140,6 @@ state is `hidden` in order to minimize power consumption.
|
||||
move.
|
||||
* On Linux the type of modal windows will be changed to `dialog`.
|
||||
* On Linux many desktop environments do not support hiding a modal window.
|
||||
* On Wayland (Linux) it is generally not possible to programmatically resize windows
|
||||
after creation, or to position, move, focus, or blur windows without user input.
|
||||
If your app needs these capabilities, run it in Xwayland by appending the flag
|
||||
`--ozone-platform=x11`.
|
||||
|
||||
## Class: BrowserWindow extends `BaseWindow`
|
||||
|
||||
@@ -660,15 +656,10 @@ the [close event](#event-close).
|
||||
|
||||
Focuses on the window.
|
||||
|
||||
On Wayland (Linux), the desktop environment may show a notification or flash
|
||||
the app icon if the window or app is not already focused.
|
||||
|
||||
#### `win.blur()`
|
||||
|
||||
Removes focus from the window.
|
||||
|
||||
Not supported on Wayland (Linux).
|
||||
|
||||
#### `win.isFocused()`
|
||||
|
||||
Returns `boolean` - Whether the window is focused.
|
||||
@@ -685,8 +676,6 @@ Shows and gives focus to the window.
|
||||
|
||||
Shows the window but doesn't focus on it.
|
||||
|
||||
Not supported on Wayland (Linux).
|
||||
|
||||
#### `win.hide()`
|
||||
|
||||
Hides the window.
|
||||
@@ -835,8 +824,6 @@ Closes the currently open [Quick Look][quick-look] panel.
|
||||
|
||||
Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
|
||||
|
||||
On Wayland (Linux), has the same limitations as `setSize` and `setPosition`.
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
@@ -879,8 +866,6 @@ See [Setting `backgroundColor`](#setting-the-backgroundcolor-property).
|
||||
Resizes and moves the window's client area (e.g. the web page) to
|
||||
the supplied bounds.
|
||||
|
||||
On Wayland (Linux), has the same limitations as `setContentSize` and `setPosition`.
|
||||
|
||||
#### `win.getContentBounds()`
|
||||
|
||||
Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window's client area as `Object`.
|
||||
@@ -910,8 +895,6 @@ Returns `boolean` - whether the window is enabled.
|
||||
|
||||
Resizes the window to `width` and `height`. If `width` or `height` are below any set minimum size constraints the window will snap to its minimum size.
|
||||
|
||||
On Wayland (Linux), may not work as some window managers restrict programmatic window resizing.
|
||||
|
||||
#### `win.getSize()`
|
||||
|
||||
Returns `Integer[]` - Contains the window's width and height.
|
||||
@@ -924,8 +907,6 @@ Returns `Integer[]` - Contains the window's width and height.
|
||||
|
||||
Resizes the window's client area (e.g. the web page) to `width` and `height`.
|
||||
|
||||
On Wayland (Linux), may not work as some window managers restrict programmatic window resizing.
|
||||
|
||||
#### `win.getContentSize()`
|
||||
|
||||
Returns `Integer[]` - Contains the window's client area's width and height.
|
||||
@@ -1063,16 +1044,12 @@ this method throws an error.
|
||||
|
||||
#### `win.moveTop()`
|
||||
|
||||
Moves window to top(z-order) regardless of focus.
|
||||
|
||||
Not supported on Wayland (Linux).
|
||||
Moves window to top(z-order) regardless of focus
|
||||
|
||||
#### `win.center()`
|
||||
|
||||
Moves window to the center of the screen.
|
||||
|
||||
Not supported on Wayland (Linux).
|
||||
|
||||
#### `win.setPosition(x, y[, animate])`
|
||||
|
||||
* `x` Integer
|
||||
@@ -1081,8 +1058,6 @@ Not supported on Wayland (Linux).
|
||||
|
||||
Moves window to `x` and `y`.
|
||||
|
||||
Not supported on Wayland (Linux).
|
||||
|
||||
#### `win.getPosition()`
|
||||
|
||||
Returns `Integer[]` - Contains the window's current position.
|
||||
@@ -1467,16 +1442,15 @@ Sets the properties for the window's taskbar button.
|
||||
|
||||
#### `win.setAccentColor(accentColor)` _Windows_
|
||||
|
||||
* `accentColor` boolean | string | null - The accent color for the window. By default, follows user preference in System Settings. To reset to system default, pass `null`.
|
||||
* `accentColor` boolean | string - The accent color for the window. By default, follows user preference in System Settings.
|
||||
|
||||
Sets the system accent color and highlighting of active window border.
|
||||
|
||||
The `accentColor` parameter accepts the following values:
|
||||
|
||||
* **Color string** - Like `true`, but sets a custom accent color using standard CSS color formats (Hex, RGB, RGBA, HSL, HSLA, or named colors). Alpha values in RGBA/HSLA formats are ignored and the color is treated as fully opaque.
|
||||
* **`true`** - Enable accent color highlighting for the window with the system accent color regardless of whether accent colors are enabled for windows in System `Settings.`
|
||||
* **`false`** - Disable accent color highlighting for the window regardless of whether accent colors are currently enabled for windows in System Settings.
|
||||
* **`null`** - Reset window accent color behavior to follow behavior set in System Settings.
|
||||
* **Color string** - Sets a custom accent color using standard CSS color formats (Hex, RGB, RGBA, HSL, HSLA, or named colors). Alpha values in RGBA/HSLA formats are ignored and the color is treated as fully opaque.
|
||||
* **`true`** - Uses the system's default accent color from user preferences in System Settings.
|
||||
* **`false`** - Explicitly disables accent color highlighting for the window.
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -1489,14 +1463,11 @@ win.setAccentColor('#ff0000')
|
||||
// RGB format (alpha ignored if present).
|
||||
win.setAccentColor('rgba(255,0,0,0.5)')
|
||||
|
||||
// Enable accent color, using the color specified in System Settings.
|
||||
// Use system accent color.
|
||||
win.setAccentColor(true)
|
||||
|
||||
// Disable accent color.
|
||||
win.setAccentColor(false)
|
||||
|
||||
// Reset window accent color behavior to follow behavior set in System Settings.
|
||||
win.setAccentColor(null)
|
||||
```
|
||||
|
||||
#### `win.getAccentColor()` _Windows_
|
||||
|
||||
@@ -25,11 +25,6 @@ following properties:
|
||||
with which the request is associated. Defaults to the empty string. The
|
||||
`session` option supersedes `partition`. Thus if a `session` is explicitly
|
||||
specified, `partition` is ignored.
|
||||
* `bypassCustomProtocolHandlers` boolean (optional) - When set to `true`,
|
||||
custom protocol handlers registered for the request's URL scheme will not be
|
||||
called. This allows forwarding an intercepted request to the built-in
|
||||
handler. [webRequest](web-request.md) handlers will still be triggered
|
||||
when bypassing custom protocols. Defaults to `false`.
|
||||
* `credentials` string (optional) - Can be `include`, `omit` or
|
||||
`same-origin`. Whether to send
|
||||
[credentials](https://fetch.spec.whatwg.org/#credentials) with this
|
||||
|
||||
@@ -102,10 +102,6 @@ Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`Desktop
|
||||
|
||||
## Caveats
|
||||
|
||||
`desktopCapturer.getSources(options)` only returns a single source on Linux when using Pipewire.
|
||||
|
||||
PipeWire supports a single capture for both screens and windows. If you request the window and screen type, the selected source will be returned as a window capture.
|
||||
|
||||
`navigator.mediaDevices.getUserMedia` does not work on macOS for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a [signed kernel extension](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/KernelExtensions/KernelExtensions.html). Chromium, and by extension Electron, does not provide this.
|
||||
|
||||
It is possible to circumvent this limitation by capturing system audio with another macOS app like Soundflower and passing it through a virtual audio input device. This virtual device can then be queried with `navigator.mediaDevices.getUserMedia`.
|
||||
|
||||
@@ -186,3 +186,14 @@ the one downloaded by `npm install`. Usage:
|
||||
```sh
|
||||
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
|
||||
```
|
||||
|
||||
## Set By Electron
|
||||
|
||||
Electron sets some variables in your environment at runtime.
|
||||
|
||||
### `ORIGINAL_XDG_CURRENT_DESKTOP`
|
||||
|
||||
This variable is set to the value of `XDG_CURRENT_DESKTOP` that your application
|
||||
originally launched with. Electron sometimes modifies the value of `XDG_CURRENT_DESKTOP`
|
||||
to affect other logic within Chromium so if you want access to the _original_ value
|
||||
you should look up this environment variable instead.
|
||||
|
||||
@@ -202,7 +202,8 @@ Creates a new `NativeImage` instance from `dataUrl`, a base 64 encoded [Data URL
|
||||
Returns `NativeImage`
|
||||
|
||||
Creates a new `NativeImage` instance from the `NSImage` that maps to the
|
||||
given image name. See Apple's [`NSImageName`](https://developer.apple.com/documentation/appkit/nsimagename#2901388) documentation and [SF Symbols](https://developer.apple.com/sf-symbols/) for a list of possible values.
|
||||
given image name. See Apple's [`NSImageName`](https://developer.apple.com/documentation/appkit/nsimagename#2901388)
|
||||
documentation for a list of possible values.
|
||||
|
||||
The `hslShift` is applied to the image with the following rules:
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ The `session` module has the following properties:
|
||||
|
||||
### `session.defaultSession`
|
||||
|
||||
A `Session` object, the default session object of the app, available after `app.whenReady` is called.
|
||||
A `Session` object, the default session object of the app.
|
||||
|
||||
## Class: Session
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# sharedTexture
|
||||
|
||||
> Import shared textures into Electron and converts platform specific handles into [`VideoFrame`](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame). Supports all Web rendering systems, and can be transferred across Electron processes. Read [here](https://github.com/electron/electron/blob/main/shell/common/api/shared_texture/README.md) for more information.
|
||||
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
## Methods
|
||||
|
||||
The `sharedTexture` module has the following methods:
|
||||
|
||||
**Note:** Experimental APIs are marked as such and could be removed in the future.
|
||||
|
||||
### `sharedTexture.importSharedTexture(options)` _Experimental_
|
||||
|
||||
* `options` Object - Options for importing shared textures.
|
||||
* `textureInfo` [SharedTextureImportTextureInfo](structures/shared-texture-import-texture-info.md) - The information of the shared texture to import.
|
||||
* `allReferencesReleased` Function (optional) - Called when all references in all processes are released. You should keep the imported texture valid until this callback is called.
|
||||
|
||||
Imports the shared texture from the given options.
|
||||
|
||||
> [!NOTE]
|
||||
> This method is only available in the main process.
|
||||
|
||||
Returns `SharedTextureImported` - The imported shared texture.
|
||||
|
||||
### `sharedTexture.sendSharedTexture(options, ...args)` _Experimental_
|
||||
|
||||
* `options` Object - Options for sending shared texture.
|
||||
* `frame` [WebFrameMain](web-frame-main.md) - The target frame to transfer the shared texture to. For `WebContents`, you can pass `webContents.mainFrame`. If you provide a `webFrameMain` that is not a main frame, you'll need to enable `webPreferences.nodeIntegrationInSubFrames` for this, since this feature requires [IPC](https://www.electronjs.org/docs/latest/api/web-frame-main#frameipc-readonly) between main and the frame.
|
||||
* `importedSharedTexture` [SharedTextureImported](structures/shared-texture-imported.md) - The imported shared texture.
|
||||
* `...args` any[] - Additional arguments to pass to the renderer process.
|
||||
|
||||
Send the imported shared texture to a renderer process. You must register a receiver at renderer process before calling this method. This method has a 1000ms timeout. Ensure the receiver is set and the renderer process is alive before calling this method.
|
||||
|
||||
> [!NOTE]
|
||||
> This method is only available in the main process.
|
||||
|
||||
Returns `Promise<void>` - Resolves when the transfer is complete.
|
||||
|
||||
### `sharedTexture.setSharedTextureReceiver(callback)` _Experimental_
|
||||
|
||||
* `callback` Function\<Promise\<void\>\> - The function to receive the imported shared texture.
|
||||
* `receivedSharedTextureData` Object - The data received from the main process.
|
||||
* `importedSharedTexture` [SharedTextureImported](structures/shared-texture-imported.md) - The imported shared texture.
|
||||
* `...args` any[] - Additional arguments passed from the main process.
|
||||
|
||||
Set a callback to receive imported shared textures from the main process.
|
||||
|
||||
> [!NOTE]
|
||||
> This method is only available in the renderer process.
|
||||
|
||||
## Properties
|
||||
|
||||
The `sharedTexture` module has the following properties:
|
||||
|
||||
### `sharedTexture.subtle` _Experimental_
|
||||
|
||||
A [`SharedTextureSubtle`](structures/shared-texture-subtle.md) property, provides subtle APIs for interacting with shared texture for advanced users.
|
||||
@@ -102,10 +102,9 @@
|
||||
should have rounded corners. Default is `true`. Setting this property
|
||||
to `false` will prevent the window from being fullscreenable on macOS.
|
||||
On Windows versions older than Windows 11 Build 22000 this property has no effect, and frameless windows will not have rounded corners.
|
||||
* `thickFrame` boolean (optional) _Windows_ - Use `WS_THICKFRAME` style for
|
||||
frameless windows on Windows, which adds the standard window frame. Setting it
|
||||
to `false` will remove window shadow and window animations, and disable window
|
||||
resizing via dragging the window edges. Default is `true`.
|
||||
* `thickFrame` boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
|
||||
Windows, which adds standard window frame. Setting it to `false` will remove
|
||||
window shadow and window animations. Default is `true`.
|
||||
* `vibrancy` string (optional) _macOS_ - Add a type of vibrancy effect to
|
||||
the window, only on macOS. Can be `appearance-based`, `titlebar`, `selection`,
|
||||
`menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`,
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* `oom` - Process ran out of memory
|
||||
* `launch-failed` - Process never successfully launched
|
||||
* `integrity-failure` - Windows code integrity checks failed
|
||||
* `memory-eviction` - Process proactively terminated to prevent a future out-of-memory (OOM) situation
|
||||
* `exitCode` Integer - The exit code of the process, unless `reason` is
|
||||
`launch-failed`, in which case `exitCode` will be a platform-specific
|
||||
launch failure error code.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# SharedTextureImportTextureInfo Object
|
||||
|
||||
* `pixelFormat` string - The pixel format of the texture.
|
||||
* `bgra` - 32bpp BGRA (byte-order), 1 plane.
|
||||
* `rgba` - 32bpp RGBA (byte-order), 1 plane.
|
||||
* `rgbaf16` - Half float RGBA, 1 plane.
|
||||
* `colorSpace` [ColorSpace](color-space.md) (optional) - The color space of the texture.
|
||||
* `codedSize` [Size](size.md) - The full dimensions of the shared texture.
|
||||
* `visibleRect` [Rectangle](rectangle.md) (optional) - A subsection of [0, 0, codedSize.width, codedSize.height]. In common cases, it is the full section area.
|
||||
* `timestamp` number (optional) - A timestamp in microseconds that will be reflected to `VideoFrame`.
|
||||
* `handle` [SharedTextureHandle](shared-texture-handle.md) - The shared texture handle.
|
||||
@@ -1,9 +0,0 @@
|
||||
# SharedTextureImportedSubtle Object
|
||||
|
||||
* `getVideoFrame` Function\<[VideoFrame](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame)\> - Create a `VideoFrame` that uses the imported shared texture in the current process. You can call `VideoFrame.close()` once you've finished using the object. The underlying resources will wait for GPU finish internally.
|
||||
* `release` Function - Release the resources. If you transferred and get multiple `SharedTextureImported` objects, you have to `release` every one of them. The resource on the GPU process will be destroyed when the last one is released.
|
||||
* `callback` Function (optional) - Callback when the GPU command buffer finishes using this shared texture. It provides a precise event to safely release dependent resources. For example, if this object is created by `finishTransferSharedTexture`, you can use this callback to safely release the original one that called `startTransferSharedTexture` in other processes. You can also release the source shared texture that was used to `importSharedTexture` safely.
|
||||
* `startTransferSharedTexture` Function\<[SharedTextureTransfer](shared-texture-transfer.md)\> - Create a `SharedTextureTransfer` that can be serialized and transferred to other processes.
|
||||
* `getFrameCreationSyncToken` Function\<[SharedTextureSyncToken](shared-texture-sync-token.md)\> - This method is for advanced users. If used, it is typically called after `finishTransferSharedTexture`, and should be passed to the object which was called `startTransferSharedTexture` to prevent the source object release the underlying resource before the target object actually acquire the reference at gpu process asyncly.
|
||||
* `setReleaseSyncToken` Function - This method is for advanced users. If used, this object's underlying resource will not be released until the set sync token is fulfilled at gpu process. By using sync tokens, users are not required to use release callbacks for lifetime management.
|
||||
* `syncToken` [SharedTextureSyncToken](shared-texture-sync-token.md) - The sync token to set.
|
||||
@@ -1,6 +0,0 @@
|
||||
# SharedTextureImported Object
|
||||
|
||||
* `textureId` string - The unique identifier of the imported shared texture.
|
||||
* `getVideoFrame` Function\<[VideoFrame](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame)\> - Create a `VideoFrame` that uses the imported shared texture in the current process. You can call `VideoFrame.close()` once you've finished using the object. The underlying resources will wait for GPU finish internally.
|
||||
* `release` Function - Release this object's reference of the imported shared texture. The underlying resource will be alive until every reference is released.
|
||||
* `subtle` [SharedTextureImportedSubtle](shared-texture-imported-subtle.md) - Provides subtle APIs to interact with the imported shared texture for advanced users.
|
||||
@@ -1,6 +0,0 @@
|
||||
# SharedTextureSubtle Object
|
||||
|
||||
* `importSharedTexture` Function\<[SharedTextureImportedSubtle](shared-texture-imported-subtle.md)\> - Imports the shared texture from the given options. Returns the imported shared texture.
|
||||
* `textureInfo` [SharedTextureImportTextureInfo](shared-texture-import-texture-info.md) - The information of shared texture to import.
|
||||
* `finishTransferSharedTexture` Function\<[SharedTextureImportedSubtle](shared-texture-imported-subtle.md)\> - Finishes the transfer of the shared texture and gets the transferred shared texture. Returns the imported shared texture from the transfer object.
|
||||
* `transfer` [SharedTextureTransfer](shared-texture-transfer.md) - The transfer object of the shared texture.
|
||||
@@ -1,3 +0,0 @@
|
||||
# SharedTextureSyncToken Object
|
||||
|
||||
* `syncToken` string - The opaque data for sync token.
|
||||
@@ -1,10 +0,0 @@
|
||||
# SharedTextureTransfer Object
|
||||
|
||||
* `transfer` string _Readonly_ - The opaque transfer data of the shared texture. This can be transferred across Electron processes.
|
||||
* `syncToken` string _Readonly_ - The opaque sync token data for frame creation.
|
||||
* `pixelFormat` string _Readonly_ - The pixel format of the transferring texture.
|
||||
* `codedSize` [Size](size.md) _Readonly_ - The full dimensions of the shared texture.
|
||||
* `visibleRect` [Rectangle](rectangle.md) _Readonly_ - A subsection of [0, 0, codedSize.width(), codedSize.height()]. In common cases, it is the full section area.
|
||||
* `timestamp` number _Readonly_ - A timestamp in microseconds that will be reflected to `VideoFrame`.
|
||||
|
||||
Use `sharedTexture.subtle.finishTransferSharedTexture` to get [`SharedTextureImportedSubtle`](shared-texture-imported-subtle.md) back.
|
||||
@@ -21,9 +21,7 @@
|
||||
associated with the window, making it compatible with the Chromium
|
||||
OS-level sandbox and disabling the Node.js engine. This is not the same as
|
||||
the `nodeIntegration` option and the APIs available to the preload script
|
||||
are more limited. Default is `true` since Electron 20. The sandbox will
|
||||
automatically be disabled when `nodeIntegration` is set to `true`.
|
||||
Read more about the option [here](../../tutorial/sandbox.md).
|
||||
are more limited. Read more about the option [here](../../tutorial/sandbox.md).
|
||||
* `session` [Session](../session.md#class-session) (optional) - Sets the session used by the
|
||||
page. Instead of passing the Session object directly, you can also choose to
|
||||
use the `partition` option instead, which accepts a partition string. When
|
||||
|
||||
@@ -14,7 +14,7 @@ console.log(systemPreferences.getEffectiveAppearance())
|
||||
|
||||
The `systemPreferences` object emits the following events:
|
||||
|
||||
### Event: 'accent-color-changed' _Windows_ _Linux_
|
||||
### Event: 'accent-color-changed' _Windows_
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -182,7 +182,7 @@ Some popular `key` and `type`s are:
|
||||
Removes the `key` in `NSUserDefaults`. This can be used to restore the default
|
||||
or global value of a `key` previously set with `setUserDefault`.
|
||||
|
||||
### `systemPreferences.getAccentColor()`
|
||||
### `systemPreferences.getAccentColor()` _Windows_ _macOS_
|
||||
|
||||
Returns `string` - The users current system wide accent color preference in RGBA
|
||||
hexadecimal form.
|
||||
|
||||
@@ -41,21 +41,15 @@ webContents.setWindowOpenHandler((details) => {
|
||||
|
||||
When using shared texture offscreen rendering feature, the `paint` event now emits a more structured object.
|
||||
It moves the `sharedTextureHandle`, `planes`, `modifier` into a unified `handle` property.
|
||||
See the [OffscreenSharedTexture](./api/structures/offscreen-shared-texture.md) API structure for more details.
|
||||
See [here](https://www.electronjs.org/docs/latest/api/structures/offscreen-shared-texture) for more details.
|
||||
|
||||
## Planned Breaking API Changes (38.0)
|
||||
|
||||
### Removed: `ELECTRON_OZONE_PLATFORM_HINT` environment variable
|
||||
|
||||
The default value of the `--ozone-platform` flag [changed to `auto`](https://chromium-review.googlesource.com/c/chromium/src/+/6775426).
|
||||
The default value of the `--ozone-plaftform` flag [changed to `auto`](https://chromium-review.googlesource.com/c/chromium/src/+/6775426).
|
||||
|
||||
Electron now defaults to running as a native Wayland app when launched in a Wayland session (when `XDG_SESSION_TYPE=wayland`).
|
||||
Users can force XWayland by passing `--ozone-platform=x11`.
|
||||
|
||||
### Removed: `ORIGINAL_XDG_CURRENT_DESKTOP` environment variable
|
||||
|
||||
Previously, Electron changed the value of `XDG_CURRENT_DESKTOP` internally to `Unity`, and stored the original name of the desktop session
|
||||
in a separate variable. `XDG_CURRENT_DESKTOP` is no longer overriden and now reflects the actual desktop environment.
|
||||
You should use the `XDG_SESSION_TYPE=wayland` environment variable instead to use Wayland.
|
||||
|
||||
### Removed: macOS 11 support
|
||||
|
||||
|
||||
@@ -12,15 +12,6 @@ The ASAR format was created primarily to improve performance on Windows when
|
||||
reading large quantities of small files (e.g. when loading your app's JavaScript
|
||||
dependency tree from `node_modules`).
|
||||
|
||||
### ASAR integrity
|
||||
|
||||
ASAR integrity is an security feature that validates the contents of your app's
|
||||
ASAR archives at runtime. When enabled, your Electron app will verify the
|
||||
header hash of its ASAR archive on runtime. If no hash is present or if there is a mismatch in the
|
||||
hashes, the app will forcefully terminate.
|
||||
|
||||
See the [ASAR Integrity](./tutorial/asar-integrity.md) guide for more details.
|
||||
|
||||
### code signing
|
||||
|
||||
Code signing is a process where an app developer digitally signs their code to
|
||||
|
||||
@@ -5,7 +5,7 @@ slug: asar-integrity
|
||||
hide_title: false
|
||||
---
|
||||
|
||||
ASAR integrity is a security feature that validates the contents of your app's
|
||||
ASAR integrity is an experimental feature that validates the contents of your app's
|
||||
[ASAR archives](./asar-archives.md) at runtime.
|
||||
|
||||
## Version support
|
||||
@@ -77,7 +77,7 @@ on package time. The process of providing this packaged hash is different for ma
|
||||
### Using Electron tooling
|
||||
|
||||
Electron Forge and Electron Packager do this setup automatically for you with no additional
|
||||
configuration whenever `asar` is enabled. The minimum required versions for ASAR integrity are:
|
||||
configuration. The minimum required versions for ASAR integrity are:
|
||||
|
||||
* `@electron/packager@18.3.1`
|
||||
* `@electron/forge@7.4.0`
|
||||
|
||||
@@ -94,7 +94,7 @@ If the extension works on Chrome but not on Electron, file a bug in Electron's
|
||||
[issue tracker][issue-tracker] and describe which part
|
||||
of the extension is not working as expected.
|
||||
|
||||
[devtools-extension]: https://developer.chrome.com/docs/extensions/how-to/devtools/extend-devtools
|
||||
[devtools-extension]: https://developer.chrome.com/extensions/devtools
|
||||
[session]: ../api/session.md
|
||||
[react-devtools]: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
|
||||
[load-extension]: ../api/extensions-api.md#extensionsloadextensionpath-options
|
||||
|
||||
@@ -9,11 +9,10 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
|
||||
|
||||
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
|
||||
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
|
||||
| 40.0.0 | 2025-Oct-30 | 2025-Dec-03 | 2025-Oct-28 | 2026-Jun-30 | M144 | TBD | ✅ |
|
||||
| 39.0.0 | 2025-Sep-04 | 2025-Oct-01 | 2025-Oct-28 | 2026-May-05 | M142 | v22.20 | ✅ |
|
||||
| 39.0.0 | 2025-Sep-04 | 2025-Oct-01 | 2025-Oct-28 | 2026-May-05 | M142 | TBD | ✅ |
|
||||
| 38.0.0 | 2025-Jun-26 | 2025-Aug-06 | 2025-Sep-02 | 2026-Mar-10 | M140 | v22.18 | ✅ |
|
||||
| 37.0.0 | 2025-May-01 | 2025-May-28 | 2025-Jun-24 | 2026-Jan-13 | M138 | v22.16 | ✅ |
|
||||
| 36.0.0 | 2025-Mar-06 | 2025-Apr-02 | 2025-Apr-29 | 2025-Oct-28 | M136 | v22.14 | 🚫 |
|
||||
| 36.0.0 | 2025-Mar-06 | 2025-Apr-02 | 2025-Apr-29 | 2025-Oct-28 | M136 | v22.14 | ✅ |
|
||||
| 35.0.0 | 2025-Jan-16 | 2025-Feb-05 | 2025-Mar-04 | 2025-Sep-02 | M134 | v22.14 | 🚫 |
|
||||
| 34.0.0 | 2024-Oct-17 | 2024-Nov-13 | 2025-Jan-14 | 2025-Jun-24 | M132 | v20.18 | 🚫 |
|
||||
| 33.0.0 | 2024-Aug-22 | 2024-Sep-18 | 2024-Oct-15 | 2025-Apr-29 | M130 | v20.18 | 🚫 |
|
||||
@@ -122,3 +121,22 @@ and that number is reduced to two in major version 10, the three-argument versio
|
||||
continue to work until, at minimum, major version 12. Past the minimum two-version
|
||||
threshold, we will attempt to support backwards compatibility beyond two versions
|
||||
until the maintainers feel the maintenance burden is too high to continue doing so.
|
||||
|
||||
### End-of-life
|
||||
|
||||
When a release branch reaches the end of its support cycle, the series
|
||||
will be deprecated in NPM and a final end-of-support release will be
|
||||
made. This release will add a warning to inform that an unsupported
|
||||
version of Electron is in use.
|
||||
|
||||
These steps are to help app developers learn when a branch they're
|
||||
using becomes unsupported, but without being excessively intrusive
|
||||
to end users.
|
||||
|
||||
If an application has exceptional circumstances and needs to stay
|
||||
on an unsupported series of Electron, developers can silence the
|
||||
end-of-support warning by omitting the final release from the app's
|
||||
`package.json` `devDependencies`. For example, since the 1-6-x series
|
||||
ended with an end-of-support 1.6.18 release, developers could choose
|
||||
to stay in the 1-6-x series without warnings with `devDependency` of
|
||||
`"electron": 1.6.0 - 1.6.17`.
|
||||
|
||||
@@ -4,24 +4,11 @@
|
||||
|
||||
## What are fuses?
|
||||
|
||||
From a security perspective, it makes sense to disable certain unused Electron features
|
||||
that are powerful but may make your app's security posture weaker. For example, any app that doesn't
|
||||
use the `ELECTRON_RUN_AS_NODE` environment variable would want to disable the feature to prevent a
|
||||
subset of "living off the land" attacks.
|
||||
For a subset of Electron functionality it makes sense to disable certain features for an entire application. For example, 99% of apps don't make use of `ELECTRON_RUN_AS_NODE`, these applications want to be able to ship a binary that is incapable of using that feature. We also don't want Electron consumers building Electron from source as that is both a massive technical challenge and has a high cost of both time and money.
|
||||
|
||||
We also don't want Electron consumers forking to achieve this goal, as building from source and
|
||||
maintaining a fork is a massive technical challenge and costs a lot of time and money.
|
||||
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).
|
||||
|
||||
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 or 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
|
||||
(e.g. [Gatekeeper](https://support.apple.com/en-ca/guide/security/sec5599b66df/web) on macOS or
|
||||
[AppLocker](https://learn.microsoft.com/en-us/windows/security/application-security/application-control/app-control-for-business/applocker/applocker-overview)
|
||||
on Windows).
|
||||
|
||||
## Current fuses
|
||||
## Current Fuses
|
||||
|
||||
### `runAsNode`
|
||||
|
||||
@@ -29,11 +16,7 @@ on Windows).
|
||||
|
||||
**@electron/fuses:** `FuseV1Options.RunAsNode`
|
||||
|
||||
The `runAsNode` fuse toggles whether the [`ELECTRON_RUN_AS_NODE`](../api/environment-variables.md)
|
||||
environment variable is respected or not. With this fuse disabled, [`child_process.fork`](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options) in the main process will not function
|
||||
as expected, as it depends on this environment variable to function. Instead, we recommend that you
|
||||
use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a
|
||||
standalone Node.js process (e.g. a SQLite server process).
|
||||
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. Instead, we recommend that you use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).
|
||||
|
||||
### `cookieEncryption`
|
||||
|
||||
@@ -41,12 +24,7 @@ standalone Node.js process (e.g. a SQLite server process).
|
||||
|
||||
**@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 app's 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 subsequently disabling the fuse
|
||||
later will make your cookie store corrupt and useless. Most apps can safely enable this fuse.
|
||||
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`
|
||||
|
||||
@@ -54,11 +32,7 @@ later will make your cookie store corrupt and useless. Most apps can safely enab
|
||||
|
||||
**@electron/fuses:** `FuseV1Options.EnableNodeOptionsEnvironmentVariable`
|
||||
|
||||
The `nodeOptions` fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions)
|
||||
and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile)
|
||||
environment variables are respected. The `NODE_OPTIONS` 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.
|
||||
The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` 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`
|
||||
|
||||
@@ -66,9 +40,7 @@ Most apps can safely disable this fuse.
|
||||
|
||||
**@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.
|
||||
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`
|
||||
|
||||
@@ -76,12 +48,9 @@ inspector. Most apps can safely disable this fuse.
|
||||
|
||||
**@electron/fuses:** `FuseV1Options.EnableEmbeddedAsarIntegrityValidation`
|
||||
|
||||
The `embeddedAsarIntegrityValidation` fuse toggles a feature on macOS and Windows 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.
|
||||
Most apps can safely enable this fuse.
|
||||
The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS and Windows 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.
|
||||
For more information on how to use asar integrity validation please read the [Asar Integrity](asar-integrity.md) documentation.
|
||||
|
||||
### `onlyLoadAppFromAsar`
|
||||
|
||||
@@ -89,15 +58,7 @@ For more information on how to use ASAR integrity validation, please read the [A
|
||||
|
||||
**@electron/fuses:** `FuseV1Options.OnlyLoadAppFromAsar`
|
||||
|
||||
The `onlyLoadAppFromAsar` fuse changes the search system that Electron uses to locate your app code.
|
||||
By default, Electron will search for this code in the following order:
|
||||
|
||||
1. `app.asar`
|
||||
1. `app`
|
||||
1. `default_app.asar`
|
||||
|
||||
When this fuse is enabled, Electron will _only_ search for `app.asar`. When combined with the [`embeddedAsarIntegrityValidation`](#embeddedasarintegrityvalidation) fuse, this fuse ensures that
|
||||
it is impossible to load non-validated code.
|
||||
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`
|
||||
|
||||
@@ -105,17 +66,11 @@ it is impossible to load non-validated code.
|
||||
|
||||
**@electron/fuses:** `FuseV1Options.LoadBrowserProcessSpecificV8Snapshot`
|
||||
|
||||
V8 snapshots can be useful to improve app startup performance. V8 lets you take snapshots of
|
||||
initialized heaps and then load them back in to avoid the cost of initializing the heap.
|
||||
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.
|
||||
|
||||
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 main process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot.
|
||||
Other processes will use the V8 snapshot file that they normally do.
|
||||
V8 snapshots can be useful to improve app startup performance. V8 lets you take snapshots of initialized heaps and then load them back in to avoid the cost of initializing the heap.
|
||||
|
||||
Using separate snapshots for renderer processes and the main process can improve security, especially
|
||||
to make sure that the renderer doesn't use a snapshot with `nodeIntegration` enabled.
|
||||
See [electron/electron#35170](https://github.com/electron/electron/issues/35170) for details.
|
||||
Using separate snapshots for renderer processes and the main process can improve security, especially to make sure that the renderer doesn't use a snapshot with `nodeIntegration` enabled. See [#35170](https://github.com/electron/electron/issues/35170) for details.
|
||||
|
||||
### `grantFileProtocolExtraPrivileges`
|
||||
|
||||
@@ -123,25 +78,19 @@ See [electron/electron#35170](https://github.com/electron/electron/issues/35170)
|
||||
|
||||
**@electron/fuses:** `FuseV1Options.GrantFileProtocolExtraPrivileges`
|
||||
|
||||
The `grantFileProtocolExtraPrivileges` fuse changes whether pages loaded from the `file://` protocol
|
||||
are given privileges beyond what they would receive in a traditional web browser. This behavior was
|
||||
core to Electron apps in original versions of Electron, but is no longer required as apps should be
|
||||
[serving local files from custom protocols](./security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead.
|
||||
|
||||
If you aren't serving pages from `file://`, you should disable this fuse.
|
||||
The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](./security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse.
|
||||
|
||||
The extra privileges granted to the `file://` protocol by this fuse are incompletely documented below:
|
||||
|
||||
* `file://` protocol pages can use `fetch` to load other assets over `file://`
|
||||
* `file://` protocol pages can use service workers
|
||||
* `file://` protocol pages have universal access granted to child frames also running on `file://`
|
||||
protocols regardless of sandbox settings
|
||||
* `file://` protocol pages have universal access granted to child frames also running on `file://` protocols regardless of sandbox settings
|
||||
|
||||
## How do I flip fuses?
|
||||
## How do I flip the fuses?
|
||||
|
||||
### The easy way
|
||||
|
||||
[`@electron/fuses`](https://npmjs.com/package/@electron/fuses) is a JavaScript utility designed to make flipping these fuses easy. Check out the README of that module for more details on usage and potential error cases.
|
||||
We've made a handy module, [`@electron/fuses`](https://npmjs.com/package/@electron/fuses), to make flipping these fuses easy. Check out the README of that module for more details on usage and potential error cases.
|
||||
|
||||
```js @ts-nocheck
|
||||
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses')
|
||||
@@ -157,37 +106,29 @@ flipFuses(
|
||||
)
|
||||
```
|
||||
|
||||
You can validate the fuses that have been flipped or check the fuse status of an arbitrary Electron
|
||||
app using the `@electron/fuses` CLI.
|
||||
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
|
||||
```
|
||||
|
||||
>[!NOTE]
|
||||
> If you are using Electron Forge to distribute your application, you can flip fuses using
|
||||
> [`@electron-forge/plugin-fuses`](https://www.electronforge.io/config/plugins/fuses),
|
||||
> which comes pre-installed with all templates.
|
||||
|
||||
### The hard way
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Glossary:
|
||||
>
|
||||
> * **Fuse Wire**: A sequence of bytes in the Electron binary used to control the fuses
|
||||
> * **Sentinel**: A static known sequence of bytes you can use to locate the fuse wire
|
||||
> * **Fuse Schema**: The format/allowed values for the fuse wire
|
||||
#### Quick Glossary
|
||||
|
||||
Manually flipping fuses requires editing the Electron binary and modifying the fuse wire to be the
|
||||
sequence of bytes that represent the state of the fuses you want.
|
||||
* **Fuse Wire**: A sequence of bytes in the Electron binary used to control the fuses
|
||||
* **Sentinel**: A static known sequence of bytes you can use to locate the fuse wire
|
||||
* **Fuse Schema**: The format / allowed values for the fuse wire
|
||||
|
||||
Somewhere in the Electron binary, there will be a sequence of bytes that look like this:
|
||||
Manually flipping fuses requires editing the Electron binary and modifying the fuse wire to be the sequence of bytes that represent the state of the fuses you want.
|
||||
|
||||
Somewhere in the Electron binary there will be a sequence of bytes that look like this:
|
||||
|
||||
```text
|
||||
| ...binary | sentinel_bytes | fuse_version | fuse_wire_length | fuse_wire | ...binary |
|
||||
```
|
||||
|
||||
* `sentinel_bytes` is always this exact string: `dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX`
|
||||
* `sentinel_bytes` is always this exact string `dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX`
|
||||
* `fuse_version` is a single byte whose unsigned integer value represents the version of the fuse schema
|
||||
* `fuse_wire_length` is a single byte whose unsigned integer value represents the number of fuses in the following fuse wire
|
||||
* `fuse_wire` is a sequence of N bytes, each byte represents a single fuse and its state.
|
||||
@@ -195,6 +136,6 @@ Somewhere in the Electron binary, there will be a sequence of bytes that look li
|
||||
* "1" (0x31) indicates the fuse is enabled
|
||||
* "r" (0x72) indicates the fuse has been removed and changing the byte to either 1 or 0 will have no effect.
|
||||
|
||||
To flip a fuse, you find its position in the fuse wire and change it to "0" or "1" depending on the state you'd like.
|
||||
To flip a fuse you find its position in the fuse wire and change it to "0" or "1" depending on the state you'd like.
|
||||
|
||||
You can view the current schema [here](https://github.com/electron/electron/blob/main/build/fuses/fuses.json5).
|
||||
|
||||
@@ -110,10 +110,4 @@ the item is a Markdown file located in the root of the project:
|
||||
|
||||

|
||||
|
||||
## Dragging files into your app
|
||||
|
||||
You can use the standard
|
||||
[Drag and Drop web API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API)
|
||||
for dragging and dropping files into your app.
|
||||
|
||||
[`contextBridge`]: ../api/context-bridge.md
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
## Overview
|
||||
|
||||
Online and offline event detection can be implemented in both the main and renderer processes:
|
||||
|
||||
- **Renderer process**: Use the [`navigator.onLine`](http://html5index.org/Offline%20-%20NavigatorOnLine.html) attribute and [online/offline events](https://developer.mozilla.org/en-US/docs/Online_and_offline_events), part of standard HTML5 API.
|
||||
- **Main process**: Use the [`net.isOnline()`](../api/net.md#netisonline) method or the [`net.online`](../api/net.md#netonline-readonly) property.
|
||||
[Online and offline event](https://developer.mozilla.org/en-US/docs/Online_and_offline_events)
|
||||
detection can be implemented in the Renderer process using the
|
||||
[`navigator.onLine`](http://html5index.org/Offline%20-%20NavigatorOnLine.html)
|
||||
attribute, part of standard HTML5 API.
|
||||
|
||||
The `navigator.onLine` attribute returns:
|
||||
|
||||
- `false` if all network requests are guaranteed to fail (e.g. when disconnected from the network).
|
||||
- `true` in all other cases.
|
||||
* `false` if all network requests are guaranteed to fail (e.g. when disconnected from the network).
|
||||
* `true` in all other cases.
|
||||
|
||||
Since many cases return `true`, you should treat with care situations of
|
||||
getting false positives, as we cannot always assume that `true` value means
|
||||
@@ -19,27 +19,7 @@ is running a virtualization software that has virtual Ethernet adapters in "alwa
|
||||
connected" state. Therefore, if you want to determine the Internet access
|
||||
status of Electron, you should develop additional means for this check.
|
||||
|
||||
## Main Process Detection
|
||||
|
||||
In the main process, you can use the `net` module to detect online/offline status:
|
||||
|
||||
```js
|
||||
const { net } = require('electron')
|
||||
|
||||
// Method 1: Using net.isOnline()
|
||||
const isOnline = net.isOnline()
|
||||
console.log('Online status:', isOnline)
|
||||
|
||||
// Method 2: Using net.online property
|
||||
console.log('Online status:', net.online)
|
||||
```
|
||||
|
||||
Both `net.isOnline()` and `net.online` return the same boolean value with the same reliability characteristics as `navigator.onLine` - they provide a strong indicator when offline (`false`), but a `true` value doesn't guarantee successful internet connectivity.
|
||||
|
||||
> [!NOTE]
|
||||
> The `net` module is only available after the app emits the `ready` event.
|
||||
|
||||
## Renderer Process Example
|
||||
## Example
|
||||
|
||||
Starting with an HTML file `index.html`, this example will demonstrate how the `navigator.onLine` API can be used to build a connection status indicator.
|
||||
|
||||
@@ -104,4 +84,4 @@ After launching the Electron application, you should see the notification:
|
||||

|
||||
|
||||
> [!NOTE]
|
||||
> If you need to check the connection status in the main process, you can use [`net.isOnline()`](../api/net.md#netisonline) directly instead of communicating from the renderer process via [IPC](../api/ipc-renderer.md).
|
||||
> If you need to communicate the connection status to the main process, use the [IPC renderer](../api/ipc-renderer.md) API.
|
||||
|
||||
@@ -13,13 +13,7 @@ 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.
|
||||
|
||||
Sandboxing is tied to Node.js integration. _Enabling Node.js integration_ for a
|
||||
renderer process by setting `nodeIntegration: true` _disables the sandbox_ for the
|
||||
process.
|
||||
|
||||
If you want to disable the sandbox for a process, see the
|
||||
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.
|
||||
|
||||
@@ -104,8 +98,7 @@ 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
|
||||
or by providing the respective HTML boolean attribute for a `webview`.
|
||||
This can be done through the BrowserWindow constructor with the `nodeIntegration: true` flag.
|
||||
|
||||
```js title='main.js'
|
||||
app.whenReady().then(() => {
|
||||
@@ -118,10 +111,6 @@ app.whenReady().then(() => {
|
||||
})
|
||||
```
|
||||
|
||||
```html title='index.html (Renderer Process)'
|
||||
<webview nodeIntegration src="page.html"></webview>
|
||||
```
|
||||
|
||||
### Enabling the sandbox globally
|
||||
|
||||
If you want to force sandboxing for all renderers, you can also use the
|
||||
|
||||
@@ -98,7 +98,7 @@ either `process.env` or the `window` object.
|
||||
You should at least follow these steps to improve the security of your application:
|
||||
|
||||
1. [Only load secure content](#1-only-load-secure-content)
|
||||
2. [Do not enable Node.js integration for remote content](#2-do-not-enable-nodejs-integration-for-remote-content)
|
||||
2. [Disable the Node.js integration in all renderers that display remote content](#2-do-not-enable-nodejs-integration-for-remote-content)
|
||||
3. [Enable context isolation in all renderers](#3-enable-context-isolation)
|
||||
4. [Enable process sandboxing](#4-enable-process-sandboxing)
|
||||
5. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#5-handle-session-permission-requests-from-remote-content)
|
||||
@@ -118,6 +118,13 @@ You should at least follow these steps to improve the security of your applicati
|
||||
19. [Check which fuses you can change](#19-check-which-fuses-you-can-change)
|
||||
20. [Do not expose Electron APIs to untrusted web content](#20-do-not-expose-electron-apis-to-untrusted-web-content)
|
||||
|
||||
To automate the detection of misconfigurations and insecure patterns, it is
|
||||
possible to use
|
||||
[Electronegativity](https://github.com/doyensec/electronegativity). For
|
||||
additional details on potential weaknesses and implementation bugs when
|
||||
developing applications using Electron, please refer to this
|
||||
[guide for developers and auditors](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf).
|
||||
|
||||
### 1. Only load secure content
|
||||
|
||||
Any resources not included with your application should be loaded using a
|
||||
@@ -237,10 +244,6 @@ to enable this behavior.
|
||||
Even when `nodeIntegration: false` is used, to truly enforce strong isolation
|
||||
and prevent the use of Node primitives `contextIsolation` **must** also be used.
|
||||
|
||||
Beware that _disabling context isolation_ for a renderer process by setting
|
||||
`nodeIntegration: true` _also disables process sandboxing_ for that process.
|
||||
See section below.
|
||||
|
||||
:::info
|
||||
For more information on what `contextIsolation` is and how to enable it please
|
||||
see our dedicated [Context Isolation](context-isolation.md) document.
|
||||
@@ -248,16 +251,6 @@ see our dedicated [Context Isolation](context-isolation.md) document.
|
||||
|
||||
### 4. Enable process sandboxing
|
||||
|
||||
:::info
|
||||
This recommendation is the default behavior in Electron since 20.0.0.
|
||||
|
||||
Additionally, process sandboxing can be enforced for all renderer processes
|
||||
application wide: [Enabling the sandbox globally](sandbox.md#enabling-the-sandbox-globally)
|
||||
|
||||
_Disabling context isolation_ (see above) _also disables process sandboxing_,
|
||||
regardless of the default, `sandbox: false` or globally enabled sandboxing!
|
||||
:::
|
||||
|
||||
[Sandboxing](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/design/sandbox.md)
|
||||
is a Chromium feature that uses the operating system to
|
||||
significantly limit what renderer processes have access to. You should enable
|
||||
@@ -292,7 +285,7 @@ const { session } = require('electron')
|
||||
const { URL } = require('node:url')
|
||||
|
||||
session
|
||||
.defaultSession
|
||||
.fromPartition('some-partition')
|
||||
.setPermissionRequestHandler((webContents, permission, callback) => {
|
||||
const parsedUrl = new URL(webContents.getURL())
|
||||
|
||||
@@ -309,8 +302,6 @@ session
|
||||
})
|
||||
```
|
||||
|
||||
Note: `session.defaultSession` is only available after `app.whenReady` is called.
|
||||
|
||||
### 6. Do not disable `webSecurity`
|
||||
|
||||
:::info
|
||||
@@ -401,8 +392,6 @@ session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||
})
|
||||
```
|
||||
|
||||
Note: `session.defaultSession` is only available after `app.whenReady` is called.
|
||||
|
||||
#### CSP meta tag
|
||||
|
||||
CSP's preferred delivery mechanism is an HTTP header. However, it is not possible
|
||||
@@ -815,10 +804,10 @@ that your application might have the rights for.
|
||||
|
||||
#### How?
|
||||
|
||||
[`@electron/fuses`](https://npmjs.com/package/@electron/fuses) is a module we made to make
|
||||
We've made a module, [`@electron/fuses`](https://npmjs.com/package/@electron/fuses), to make
|
||||
flipping these fuses easy. Check out the README of that module for more details on usage and
|
||||
potential error cases, and refer to
|
||||
[How do I flip fuses?](./fuses.md#how-do-i-flip-fuses) in our documentation.
|
||||
[How do I flip the fuses?](./fuses.md#how-do-i-flip-the-fuses) in our documentation.
|
||||
|
||||
### 20. Do not expose Electron APIs to untrusted web content
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ auto_filenames = {
|
||||
"docs/api/service-workers.md",
|
||||
"docs/api/session.md",
|
||||
"docs/api/share-menu.md",
|
||||
"docs/api/shared-texture.md",
|
||||
"docs/api/shell.md",
|
||||
"docs/api/structures",
|
||||
"docs/api/system-preferences.md",
|
||||
@@ -146,12 +145,6 @@ auto_filenames = {
|
||||
"docs/api/structures/shared-dictionary-info.md",
|
||||
"docs/api/structures/shared-dictionary-usage-info.md",
|
||||
"docs/api/structures/shared-texture-handle.md",
|
||||
"docs/api/structures/shared-texture-import-texture-info.md",
|
||||
"docs/api/structures/shared-texture-imported-subtle.md",
|
||||
"docs/api/structures/shared-texture-imported.md",
|
||||
"docs/api/structures/shared-texture-subtle.md",
|
||||
"docs/api/structures/shared-texture-sync-token.md",
|
||||
"docs/api/structures/shared-texture-transfer.md",
|
||||
"docs/api/structures/shared-worker-info.md",
|
||||
"docs/api/structures/sharing-item.md",
|
||||
"docs/api/structures/shortcut-details.md",
|
||||
@@ -183,7 +176,6 @@ auto_filenames = {
|
||||
"lib/renderer/api/context-bridge.ts",
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/shared-texture.ts",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/api/web-utils.ts",
|
||||
"lib/renderer/common-init.ts",
|
||||
@@ -265,7 +257,6 @@ auto_filenames = {
|
||||
"lib/browser/api/service-worker-main.ts",
|
||||
"lib/browser/api/session.ts",
|
||||
"lib/browser/api/share-menu.ts",
|
||||
"lib/browser/api/shared-texture.ts",
|
||||
"lib/browser/api/system-preferences.ts",
|
||||
"lib/browser/api/touch-bar.ts",
|
||||
"lib/browser/api/tray.ts",
|
||||
@@ -321,7 +312,6 @@ auto_filenames = {
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/shared-texture.ts",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/api/web-utils.ts",
|
||||
"lib/renderer/common-init.ts",
|
||||
@@ -362,7 +352,6 @@ auto_filenames = {
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/shared-texture.ts",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/api/web-utils.ts",
|
||||
"lib/renderer/ipc-renderer-bindings.ts",
|
||||
|
||||
@@ -456,6 +456,7 @@ filenames = {
|
||||
"shell/browser/net/system_network_context_manager.h",
|
||||
"shell/browser/net/url_loader_network_observer.cc",
|
||||
"shell/browser/net/url_loader_network_observer.h",
|
||||
"shell/browser/net/web_request_api_interface.h",
|
||||
"shell/browser/network_hints_handler_impl.cc",
|
||||
"shell/browser/network_hints_handler_impl.h",
|
||||
"shell/browser/notifications/notification.cc",
|
||||
@@ -563,7 +564,6 @@ filenames = {
|
||||
"shell/common/api/electron_api_native_image.cc",
|
||||
"shell/common/api/electron_api_native_image.h",
|
||||
"shell/common/api/electron_api_net.cc",
|
||||
"shell/common/api/electron_api_shared_texture.cc",
|
||||
"shell/common/api/electron_api_shell.cc",
|
||||
"shell/common/api/electron_api_testing.cc",
|
||||
"shell/common/api/electron_api_url_loader.cc",
|
||||
@@ -580,7 +580,6 @@ filenames = {
|
||||
"shell/common/asar/asar_util.h",
|
||||
"shell/common/asar/scoped_temporary_file.cc",
|
||||
"shell/common/asar/scoped_temporary_file.h",
|
||||
"shell/common/callback_util.h",
|
||||
"shell/common/color_util.cc",
|
||||
"shell/common/color_util.h",
|
||||
"shell/common/crash_keys.cc",
|
||||
|
||||
@@ -7,17 +7,21 @@ hunspell_dictionaries = [
|
||||
"//third_party/hunspell_dictionaries/da-DK-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/de-DE-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/el-GR-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-AU-10-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-AU-10-1.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-CA-10-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-CA-10-1.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-GB-10-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-GB-10-1.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-GB-oxendict-10-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-GB-oxendict-10-1.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-US-10-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/en-US-10-1.bdic",
|
||||
"//third_party/hunspell_dictionaries/es-ES-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/et-EE-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/fa-IR-9-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/fo-FO-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/fr-FR-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/gl-1-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/he-IL-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/hi-IN-3-0.bdic",
|
||||
"//third_party/hunspell_dictionaries/hr-HR-3-0.bdic",
|
||||
@@ -55,7 +59,6 @@ hunspell_dictionaries = [
|
||||
hunspell_licenses = [
|
||||
"//third_party/hunspell_dictionaries/COPYING",
|
||||
"//third_party/hunspell_dictionaries/COPYING.Apache",
|
||||
"//third_party/hunspell_dictionaries/COPYING.GPL3",
|
||||
"//third_party/hunspell_dictionaries/COPYING.LESSER",
|
||||
"//third_party/hunspell_dictionaries/COPYING.LGPL",
|
||||
"//third_party/hunspell_dictionaries/COPYING.MIT",
|
||||
|
||||
@@ -217,7 +217,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__atomic/check_memory_order.h",
|
||||
"//third_party/libc++/src/include/__atomic/contention_t.h",
|
||||
"//third_party/libc++/src/include/__atomic/fence.h",
|
||||
"//third_party/libc++/src/include/__atomic/floating_point_helper.h",
|
||||
"//third_party/libc++/src/include/__atomic/is_always_lock_free.h",
|
||||
"//third_party/libc++/src/include/__atomic/kill_dependency.h",
|
||||
"//third_party/libc++/src/include/__atomic/memory_order.h",
|
||||
@@ -841,6 +840,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__cxx03/cmath",
|
||||
"//third_party/libc++/src/include/__cxx03/codecvt",
|
||||
"//third_party/libc++/src/include/__cxx03/complex",
|
||||
"//third_party/libc++/src/include/__cxx03/complex.h",
|
||||
"//third_party/libc++/src/include/__cxx03/condition_variable",
|
||||
"//third_party/libc++/src/include/__cxx03/csetjmp",
|
||||
"//third_party/libc++/src/include/__cxx03/csignal",
|
||||
@@ -853,20 +853,25 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__cxx03/cstring",
|
||||
"//third_party/libc++/src/include/__cxx03/ctgmath",
|
||||
"//third_party/libc++/src/include/__cxx03/ctime",
|
||||
"//third_party/libc++/src/include/__cxx03/ctype.h",
|
||||
"//third_party/libc++/src/include/__cxx03/cuchar",
|
||||
"//third_party/libc++/src/include/__cxx03/cwchar",
|
||||
"//third_party/libc++/src/include/__cxx03/cwctype",
|
||||
"//third_party/libc++/src/include/__cxx03/deque",
|
||||
"//third_party/libc++/src/include/__cxx03/errno.h",
|
||||
"//third_party/libc++/src/include/__cxx03/exception",
|
||||
"//third_party/libc++/src/include/__cxx03/experimental/__config",
|
||||
"//third_party/libc++/src/include/__cxx03/experimental/utility",
|
||||
"//third_party/libc++/src/include/__cxx03/ext/__hash",
|
||||
"//third_party/libc++/src/include/__cxx03/ext/hash_map",
|
||||
"//third_party/libc++/src/include/__cxx03/ext/hash_set",
|
||||
"//third_party/libc++/src/include/__cxx03/fenv.h",
|
||||
"//third_party/libc++/src/include/__cxx03/float.h",
|
||||
"//third_party/libc++/src/include/__cxx03/forward_list",
|
||||
"//third_party/libc++/src/include/__cxx03/fstream",
|
||||
"//third_party/libc++/src/include/__cxx03/functional",
|
||||
"//third_party/libc++/src/include/__cxx03/future",
|
||||
"//third_party/libc++/src/include/__cxx03/inttypes.h",
|
||||
"//third_party/libc++/src/include/__cxx03/iomanip",
|
||||
"//third_party/libc++/src/include/__cxx03/ios",
|
||||
"//third_party/libc++/src/include/__cxx03/iosfwd",
|
||||
@@ -893,8 +898,11 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__cxx03/sstream",
|
||||
"//third_party/libc++/src/include/__cxx03/stack",
|
||||
"//third_party/libc++/src/include/__cxx03/stdatomic.h",
|
||||
"//third_party/libc++/src/include/__cxx03/stdbool.h",
|
||||
"//third_party/libc++/src/include/__cxx03/stddef.h",
|
||||
"//third_party/libc++/src/include/__cxx03/stdexcept",
|
||||
"//third_party/libc++/src/include/__cxx03/stdint.h",
|
||||
"//third_party/libc++/src/include/__cxx03/stdio.h",
|
||||
"//third_party/libc++/src/include/__cxx03/stdlib.h",
|
||||
"//third_party/libc++/src/include/__cxx03/streambuf",
|
||||
"//third_party/libc++/src/include/__cxx03/string",
|
||||
@@ -902,6 +910,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__cxx03/string_view",
|
||||
"//third_party/libc++/src/include/__cxx03/strstream",
|
||||
"//third_party/libc++/src/include/__cxx03/system_error",
|
||||
"//third_party/libc++/src/include/__cxx03/tgmath.h",
|
||||
"//third_party/libc++/src/include/__cxx03/thread",
|
||||
"//third_party/libc++/src/include/__cxx03/type_traits",
|
||||
"//third_party/libc++/src/include/__cxx03/typeindex",
|
||||
@@ -914,6 +923,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__cxx03/vector",
|
||||
"//third_party/libc++/src/include/__cxx03/version",
|
||||
"//third_party/libc++/src/include/__cxx03/wchar.h",
|
||||
"//third_party/libc++/src/include/__cxx03/wctype.h",
|
||||
"//third_party/libc++/src/include/__debug_utils/randomize_range.h",
|
||||
"//third_party/libc++/src/include/__debug_utils/sanitizers.h",
|
||||
"//third_party/libc++/src/include/__debug_utils/strict_weak_ordering_check.h",
|
||||
@@ -1105,7 +1115,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__locale_dir/support/freebsd.h",
|
||||
"//third_party/libc++/src/include/__locale_dir/support/fuchsia.h",
|
||||
"//third_party/libc++/src/include/__locale_dir/support/linux.h",
|
||||
"//third_party/libc++/src/include/__locale_dir/support/netbsd.h",
|
||||
"//third_party/libc++/src/include/__locale_dir/support/no_locale/characters.h",
|
||||
"//third_party/libc++/src/include/__locale_dir/support/no_locale/strtonum.h",
|
||||
"//third_party/libc++/src/include/__locale_dir/support/windows.h",
|
||||
@@ -1359,6 +1368,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__tuple/sfinae_helpers.h",
|
||||
"//third_party/libc++/src/include/__tuple/tuple_element.h",
|
||||
"//third_party/libc++/src/include/__tuple/tuple_like.h",
|
||||
"//third_party/libc++/src/include/__tuple/tuple_like_ext.h",
|
||||
"//third_party/libc++/src/include/__tuple/tuple_like_no_subrange.h",
|
||||
"//third_party/libc++/src/include/__tuple/tuple_size.h",
|
||||
"//third_party/libc++/src/include/__tuple/tuple_types.h",
|
||||
@@ -1415,7 +1425,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__type_traits/is_floating_point.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_function.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_fundamental.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_generic_transparent_comparator.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_implicit_lifetime.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_implicitly_default_constructible.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_integral.h",
|
||||
@@ -1454,12 +1463,10 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__type_traits/is_valid_expansion.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_void.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_volatile.h",
|
||||
"//third_party/libc++/src/include/__type_traits/is_within_lifetime.h",
|
||||
"//third_party/libc++/src/include/__type_traits/lazy.h",
|
||||
"//third_party/libc++/src/include/__type_traits/make_32_64_or_128_bit.h",
|
||||
"//third_party/libc++/src/include/__type_traits/make_const_lvalue_ref.h",
|
||||
"//third_party/libc++/src/include/__type_traits/make_signed.h",
|
||||
"//third_party/libc++/src/include/__type_traits/make_transparent.h",
|
||||
"//third_party/libc++/src/include/__type_traits/make_unsigned.h",
|
||||
"//third_party/libc++/src/include/__type_traits/maybe_const.h",
|
||||
"//third_party/libc++/src/include/__type_traits/nat.h",
|
||||
|
||||
@@ -25,32 +25,13 @@ Menu.prototype._isCommandIdChecked = function (id) {
|
||||
};
|
||||
|
||||
Menu.prototype._isCommandIdEnabled = function (id) {
|
||||
const item = this.commandsMap[id];
|
||||
if (!item) return false;
|
||||
|
||||
const focusedWindow = BaseWindow.getFocusedWindow();
|
||||
|
||||
if (item.role === 'minimize' && focusedWindow) {
|
||||
return focusedWindow.isMinimizable();
|
||||
}
|
||||
|
||||
if (item.role === 'togglefullscreen' && focusedWindow) {
|
||||
return focusedWindow.isFullScreenable();
|
||||
}
|
||||
|
||||
if (item.role === 'close' && focusedWindow) {
|
||||
return focusedWindow.isClosable();
|
||||
}
|
||||
|
||||
return item.enabled;
|
||||
return this.commandsMap[id] ? this.commandsMap[id].enabled : false;
|
||||
};
|
||||
|
||||
Menu.prototype._shouldCommandIdWorkWhenHidden = function (id) {
|
||||
return this.commandsMap[id]?.acceleratorWorksWhenHidden ?? false;
|
||||
return this.commandsMap[id] ? !!this.commandsMap[id].acceleratorWorksWhenHidden : false;
|
||||
};
|
||||
|
||||
Menu.prototype._isCommandIdVisible = function (id) {
|
||||
return this.commandsMap[id]?.visible ?? false;
|
||||
return this.commandsMap[id] ? this.commandsMap[id].visible : false;
|
||||
};
|
||||
|
||||
Menu.prototype._getAcceleratorForCommandId = function (id, useDefaultAccelerator) {
|
||||
@@ -61,12 +42,12 @@ Menu.prototype._getAcceleratorForCommandId = function (id, useDefaultAccelerator
|
||||
};
|
||||
|
||||
Menu.prototype._shouldRegisterAcceleratorForCommandId = function (id) {
|
||||
return this.commandsMap[id]?.registerAccelerator ?? false;
|
||||
return this.commandsMap[id] ? this.commandsMap[id].registerAccelerator : false;
|
||||
};
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
Menu.prototype._getSharingItemForCommandId = function (id) {
|
||||
return this.commandsMap[id]?.sharingItem ?? null;
|
||||
return this.commandsMap[id] ? this.commandsMap[id].sharingItem : null;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'screen', loader: () => require('./screen') },
|
||||
{ name: 'ServiceWorkerMain', loader: () => require('./service-worker-main') },
|
||||
{ name: 'session', loader: () => require('./session') },
|
||||
{ name: 'sharedTexture', loader: () => require('./shared-texture') },
|
||||
{ name: 'ShareMenu', loader: () => require('./share-menu') },
|
||||
{ name: 'systemPreferences', loader: () => require('./system-preferences') },
|
||||
{ name: 'TouchBar', loader: () => require('./touch-bar') },
|
||||
|
||||
@@ -119,10 +119,7 @@ export function fetchWithSession (input: RequestInfo, init: (RequestInit & {bypa
|
||||
p.reject(err);
|
||||
});
|
||||
|
||||
// pipeTo expects a WritableStream<Uint8Array>. Node.js' Writable.toWeb returns WritableStream<any>,
|
||||
// which causes a TS structural mismatch.
|
||||
const writable = Writable.toWeb(r as unknown as Writable) as unknown as WritableStream<Uint8Array>;
|
||||
if (!req.body?.pipeTo(writable).then(() => r.end())) { r.end(); }
|
||||
if (!req.body?.pipeTo(Writable.toWeb(r as unknown as Writable)).then(() => r.end())) { r.end(); }
|
||||
|
||||
return p.promise;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import { createReadStream } from 'fs';
|
||||
import { Readable } from 'stream';
|
||||
import { ReadableStream } from 'stream/web';
|
||||
|
||||
import type { ReadableStreamDefaultReader } from 'stream/web';
|
||||
|
||||
// Global protocol APIs.
|
||||
const { registerSchemesAsPrivileged, getStandardSchemes, Protocol } = process._linkedBinding('electron_browser_protocol');
|
||||
|
||||
@@ -14,7 +12,7 @@ const ERR_UNEXPECTED = -9;
|
||||
|
||||
const isBuiltInScheme = (scheme: string) => ['http', 'https', 'file'].includes(scheme);
|
||||
|
||||
function makeStreamFromPipe (pipe: any): ReadableStream<Uint8Array> {
|
||||
function makeStreamFromPipe (pipe: any): ReadableStream {
|
||||
const buf = new Uint8Array(1024 * 1024 /* 1 MB */);
|
||||
return new ReadableStream({
|
||||
async pull (controller) {
|
||||
@@ -40,26 +38,21 @@ function makeStreamFromFileInfo ({
|
||||
filePath: string;
|
||||
offset?: number;
|
||||
length?: number;
|
||||
}): ReadableStream<Uint8Array> {
|
||||
// Node's Readable.toWeb produces a WHATWG ReadableStream whose chunks are Uint8Array.
|
||||
}): ReadableStream {
|
||||
return Readable.toWeb(createReadStream(filePath, {
|
||||
start: offset,
|
||||
end: length >= 0 ? offset + length : undefined
|
||||
})) as ReadableStream<Uint8Array>;
|
||||
}));
|
||||
}
|
||||
|
||||
function convertToRequestBody (uploadData: ProtocolRequest['uploadData']): RequestInit['body'] {
|
||||
if (!uploadData) return null;
|
||||
// Optimization: skip creating a stream if the request is just a single buffer.
|
||||
if (uploadData.length === 1 && (uploadData[0] as any).type === 'rawData') {
|
||||
return uploadData[0].bytes as any;
|
||||
}
|
||||
if (uploadData.length === 1 && (uploadData[0] as any).type === 'rawData') return uploadData[0].bytes;
|
||||
|
||||
const chunks = [...uploadData] as any[]; // TODO: refine ProtocolRequest types
|
||||
// Use Node's web stream types explicitly to avoid DOM lib vs Node lib structural mismatches.
|
||||
// Generic <Uint8Array> ensures reader.read() returns value?: Uint8Array consistent with enqueue.
|
||||
let current: ReadableStreamDefaultReader<Uint8Array> | null = null;
|
||||
return new ReadableStream<Uint8Array>({
|
||||
const chunks = [...uploadData] as any[]; // TODO: types are wrong
|
||||
let current: ReadableStreamDefaultReader | null = null;
|
||||
return new ReadableStream({
|
||||
async pull (controller) {
|
||||
if (current) {
|
||||
const { done, value } = await current.read();
|
||||
@@ -74,7 +67,7 @@ function convertToRequestBody (uploadData: ProtocolRequest['uploadData']): Reque
|
||||
if (!chunks.length) { return controller.close(); }
|
||||
const chunk = chunks.shift()!;
|
||||
if (chunk.type === 'rawData') {
|
||||
controller.enqueue(chunk.bytes as Uint8Array);
|
||||
controller.enqueue(chunk.bytes);
|
||||
} else if (chunk.type === 'file') {
|
||||
current = makeStreamFromFileInfo(chunk).getReader();
|
||||
return this.pull!(controller);
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
import ipcMain from '@electron/internal/browser/api/ipc-main';
|
||||
import * as ipcMainInternalUtils from '@electron/internal/browser/ipc-main-internal-utils';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
const transferTimeout = 1000;
|
||||
const sharedTextureNative = process._linkedBinding('electron_common_shared_texture');
|
||||
const managedSharedTextures = new Map<string, SharedTextureImportedWrapper>();
|
||||
|
||||
type AllReleasedCallback = (imported: Electron.SharedTextureImported) => void;
|
||||
|
||||
type SharedTextureImportedWrapper = {
|
||||
texture: Electron.SharedTextureImported;
|
||||
allReferencesReleased: AllReleasedCallback | undefined;
|
||||
mainReference: boolean;
|
||||
rendererFrameReferences: Map<number, { count: number, reference: Electron.WebFrameMain }>;
|
||||
}
|
||||
|
||||
ipcMain.handle(IPC_MESSAGES.IMPORT_SHARED_TEXTURE_RELEASE_RENDERER_TO_MAIN, (event: Electron.IpcMainInvokeEvent, textureId: string) => {
|
||||
const frameTreeNodeId = event.frameTreeNodeId ?? event.sender.mainFrame.frameTreeNodeId;
|
||||
wrapperReleaseFromRenderer(textureId, frameTreeNodeId);
|
||||
});
|
||||
|
||||
let checkManagedSharedTexturesInterval: NodeJS.Timeout | null = null;
|
||||
|
||||
function scheduleCheckManagedSharedTextures () {
|
||||
if (checkManagedSharedTexturesInterval === null) {
|
||||
checkManagedSharedTexturesInterval = setInterval(checkManagedSharedTextures, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function unscheduleCheckManagedSharedTextures () {
|
||||
if (checkManagedSharedTexturesInterval !== null) {
|
||||
clearInterval(checkManagedSharedTexturesInterval);
|
||||
checkManagedSharedTexturesInterval = null;
|
||||
}
|
||||
}
|
||||
|
||||
function checkManagedSharedTextures () {
|
||||
const texturesToRemoveTracking = new Set<string>();
|
||||
for (const [, wrapper] of managedSharedTextures) {
|
||||
for (const [frameTreeNodeId, entry] of wrapper.rendererFrameReferences) {
|
||||
const frame = entry.reference;
|
||||
if (!frame || frame.isDestroyed()) {
|
||||
console.error(`The imported shared texture ${wrapper.texture.textureId} is referenced by a destroyed webContent/webFrameMain, this means a imported shared texture in renderer process is not released before the process is exited. Releasing that dangling reference now.`);
|
||||
wrapper.rendererFrameReferences.delete(frameTreeNodeId);
|
||||
}
|
||||
}
|
||||
|
||||
if (wrapper.rendererFrameReferences.size === 0 && !wrapper.mainReference) {
|
||||
texturesToRemoveTracking.add(wrapper.texture.textureId);
|
||||
wrapper.texture.subtle.release(() => {
|
||||
wrapper.allReferencesReleased?.(wrapper.texture);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
for (const id of texturesToRemoveTracking) {
|
||||
managedSharedTextures.delete(id);
|
||||
}
|
||||
|
||||
if (managedSharedTextures.size === 0) {
|
||||
unscheduleCheckManagedSharedTextures();
|
||||
}
|
||||
}
|
||||
|
||||
function wrapperReleaseFromRenderer (id: string, frameTreeNodeId: number) {
|
||||
const wrapper = managedSharedTextures.get(id);
|
||||
if (!wrapper) {
|
||||
throw new Error(`Shared texture with id ${id} not found`);
|
||||
}
|
||||
|
||||
const entry = wrapper.rendererFrameReferences.get(frameTreeNodeId);
|
||||
if (!entry) {
|
||||
throw new Error(`Shared texture ${id} is not referenced by renderer frame ${frameTreeNodeId}`);
|
||||
}
|
||||
|
||||
entry.count -= 1;
|
||||
if (entry.count === 0) {
|
||||
wrapper.rendererFrameReferences.delete(frameTreeNodeId);
|
||||
} else {
|
||||
wrapper.rendererFrameReferences.set(frameTreeNodeId, entry);
|
||||
}
|
||||
|
||||
// Actually release the texture if no one is referencing it
|
||||
if (wrapper.rendererFrameReferences.size === 0 && !wrapper.mainReference) {
|
||||
managedSharedTextures.delete(id);
|
||||
wrapper.texture.subtle.release(() => {
|
||||
wrapper.allReferencesReleased?.(wrapper.texture);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function wrapperReleaseFromMain (id: string) {
|
||||
const wrapper = managedSharedTextures.get(id);
|
||||
if (!wrapper) {
|
||||
throw new Error(`Shared texture with id ${id} not found`);
|
||||
}
|
||||
|
||||
// Actually release the texture if no one is referencing it
|
||||
wrapper.mainReference = false;
|
||||
if (wrapper.rendererFrameReferences.size === 0) {
|
||||
managedSharedTextures.delete(id);
|
||||
wrapper.texture.subtle.release(() => {
|
||||
wrapper.allReferencesReleased?.(wrapper.texture);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function sendSharedTexture (options: Electron.SendSharedTextureOptions, ...args: any[]) {
|
||||
const imported = options.importedSharedTexture;
|
||||
const transfer = imported.subtle.startTransferSharedTexture();
|
||||
|
||||
let timeoutHandle: NodeJS.Timeout | null = null;
|
||||
const timeoutPromise = new Promise<never>((resolve, reject) => {
|
||||
timeoutHandle = setTimeout(() => {
|
||||
reject(new Error(`transfer shared texture timed out after ${transferTimeout}ms, ensure you have registered receiver at renderer process.`));
|
||||
}, transferTimeout);
|
||||
});
|
||||
|
||||
const targetFrame: Electron.WebFrameMain | undefined = options.frame;
|
||||
if (!targetFrame) {
|
||||
throw new Error('`frame` should be provided');
|
||||
}
|
||||
|
||||
const invokePromise: Promise<Electron.SharedTextureSyncToken> = ipcMainInternalUtils.invokeInWebFrameMain<Electron.SharedTextureSyncToken>(
|
||||
targetFrame,
|
||||
IPC_MESSAGES.IMPORT_SHARED_TEXTURE_TRANSFER_MAIN_TO_RENDERER,
|
||||
transfer,
|
||||
imported.textureId,
|
||||
...args
|
||||
);
|
||||
|
||||
try {
|
||||
const syncToken = await Promise.race([invokePromise, timeoutPromise]);
|
||||
imported.subtle.setReleaseSyncToken(syncToken);
|
||||
|
||||
const wrapper = managedSharedTextures.get(imported.textureId);
|
||||
if (!wrapper) {
|
||||
throw new Error(`Shared texture with id ${imported.textureId} not found`);
|
||||
}
|
||||
|
||||
const key = targetFrame.frameTreeNodeId;
|
||||
const existing = wrapper.rendererFrameReferences.get(key);
|
||||
if (existing) {
|
||||
existing.count += 1;
|
||||
wrapper.rendererFrameReferences.set(key, existing);
|
||||
} else {
|
||||
wrapper.rendererFrameReferences.set(key, { count: 1, reference: targetFrame });
|
||||
}
|
||||
} finally {
|
||||
if (timeoutHandle) {
|
||||
clearTimeout(timeoutHandle);
|
||||
}
|
||||
}
|
||||
|
||||
// Schedule a check to see if any texture is referenced by any dangling renderer
|
||||
scheduleCheckManagedSharedTextures();
|
||||
}
|
||||
|
||||
function importSharedTexture (options: Electron.ImportSharedTextureOptions) {
|
||||
const id = randomUUID();
|
||||
const imported = sharedTextureNative.importSharedTexture(Object.assign(options.textureInfo, { id }));
|
||||
const ret: Electron.SharedTextureImported = {
|
||||
textureId: id,
|
||||
subtle: imported,
|
||||
getVideoFrame: imported.getVideoFrame,
|
||||
release: () => {
|
||||
wrapperReleaseFromMain(id);
|
||||
}
|
||||
};
|
||||
|
||||
const wrapper: SharedTextureImportedWrapper = {
|
||||
texture: ret,
|
||||
allReferencesReleased: options.allReferencesReleased,
|
||||
mainReference: true,
|
||||
rendererFrameReferences: new Map()
|
||||
};
|
||||
managedSharedTextures.set(id, wrapper);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const sharedTexture = {
|
||||
subtle: sharedTextureNative,
|
||||
importSharedTexture,
|
||||
sendSharedTexture
|
||||
};
|
||||
|
||||
export default sharedTexture;
|
||||
@@ -40,7 +40,7 @@ process.on('uncaughtException', function (error) {
|
||||
// Emit 'exit' event on quit.
|
||||
const { app } = require('electron');
|
||||
|
||||
app.on('quit', (_event: any, exitCode: number) => {
|
||||
app.on('quit', (_event, exitCode) => {
|
||||
process.emit('exit', exitCode);
|
||||
});
|
||||
|
||||
@@ -162,6 +162,27 @@ require('@electron/internal/browser/api/web-contents-view');
|
||||
// Set main startup script of the app.
|
||||
const mainStartupScript = packageJson.main || 'index.js';
|
||||
|
||||
const KNOWN_XDG_DESKTOP_VALUES = new Set(['Pantheon', 'Unity:Unity7', 'pop:GNOME']);
|
||||
|
||||
function currentPlatformSupportsAppIndicator () {
|
||||
if (process.platform !== 'linux') return false;
|
||||
const currentDesktop = process.env.XDG_CURRENT_DESKTOP;
|
||||
|
||||
if (!currentDesktop) return false;
|
||||
if (KNOWN_XDG_DESKTOP_VALUES.has(currentDesktop)) return true;
|
||||
// ubuntu based or derived session (default ubuntu one, communitheme…) supports
|
||||
// indicator too.
|
||||
if (/ubuntu/ig.test(currentDesktop)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Workaround for electron/electron#5050 and electron/electron#9046
|
||||
process.env.ORIGINAL_XDG_CURRENT_DESKTOP = process.env.XDG_CURRENT_DESKTOP;
|
||||
if (currentPlatformSupportsAppIndicator()) {
|
||||
process.env.XDG_CURRENT_DESKTOP = 'Unity';
|
||||
}
|
||||
|
||||
// Quit when all windows are closed and no other one is listening to this.
|
||||
app.on('window-all-closed', () => {
|
||||
if (app.listenerCount('window-all-closed') === 1) {
|
||||
|
||||
@@ -36,27 +36,3 @@ export function invokeInWebContents<T> (sender: Electron.WebContents, command: s
|
||||
sender._sendInternal(command, requestId, ...args);
|
||||
});
|
||||
}
|
||||
|
||||
export function invokeInWebFrameMain<T> (sender: Electron.WebFrameMain, command: string, ...args: any[]) {
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
const requestId = ++nextId;
|
||||
const channel = `${command}_RESPONSE_${requestId}`;
|
||||
const frameTreeNodeId = sender.frameTreeNodeId;
|
||||
ipcMainInternal.on(channel, function handler (event, error: Error, result: any) {
|
||||
if (event.type === 'frame' && event.frameTreeNodeId !== frameTreeNodeId) {
|
||||
console.error(`Reply to ${command} sent by unexpected WebFrameMain (${event.frameTreeNodeId})`);
|
||||
return;
|
||||
}
|
||||
|
||||
ipcMainInternal.removeListener(channel, handler);
|
||||
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
|
||||
sender._sendInternal(command, requestId, ...args);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -289,8 +289,7 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
|
||||
referrerPolicy: options.referrerPolicy,
|
||||
cache: options.cache,
|
||||
allowNonHttpProtocols: Object.hasOwn(options, kAllowNonHttpProtocols),
|
||||
priority: options.priority,
|
||||
bypassCustomProtocolHandlers: options.bypassCustomProtocolHandlers
|
||||
priority: options.priority
|
||||
};
|
||||
if ('priorityIncremental' in options) {
|
||||
urlLoaderOptions.priorityIncremental = options.priorityIncremental;
|
||||
@@ -428,8 +427,9 @@ export class ClientRequest extends Writable implements Electron.ClientRequest {
|
||||
this._started = true;
|
||||
const stringifyValues = (obj: Record<string, { name: string, value: string | string[] }>) => {
|
||||
const ret: Record<string, string> = {};
|
||||
for (const { name, value } of Object.values(obj)) {
|
||||
ret[name] = value.toString();
|
||||
for (const k of Object.keys(obj)) {
|
||||
const kv = obj[k];
|
||||
ret[kv.name] = kv.value.toString();
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,4 @@ export const enum IPC_MESSAGES {
|
||||
INSPECTOR_CONFIRM = 'INSPECTOR_CONFIRM',
|
||||
INSPECTOR_CONTEXT_MENU = 'INSPECTOR_CONTEXT_MENU',
|
||||
INSPECTOR_SELECT_FILE = 'INSPECTOR_SELECT_FILE',
|
||||
|
||||
IMPORT_SHARED_TEXTURE_TRANSFER_MAIN_TO_RENDERER = 'IMPORT_SHARED_TEXTURE_TRANSFER_MAIN_TO_RENDERER',
|
||||
IMPORT_SHARED_TEXTURE_RELEASE_RENDERER_TO_MAIN = 'IMPORT_SHARED_TEXTURE_RELEASE_RENDERER_TO_MAIN',
|
||||
}
|
||||
|
||||
@@ -746,7 +746,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
|
||||
context.readdirResults.push(dirent);
|
||||
if (dirent!.isDirectory() || stat === 1) {
|
||||
context.pathsQueue.push(path.join(dirent!.parentPath, dirent!.name));
|
||||
context.pathsQueue.push(path.join(dirent!.path, dirent!.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ export const rendererModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'contextBridge', loader: () => require('./context-bridge') },
|
||||
{ name: 'crashReporter', loader: () => require('./crash-reporter') },
|
||||
{ name: 'ipcRenderer', loader: () => require('./ipc-renderer') },
|
||||
{ name: 'sharedTexture', loader: () => require('./shared-texture') },
|
||||
{ name: 'webFrame', loader: () => require('./web-frame') },
|
||||
{ name: 'webUtils', loader: () => require('./web-utils') }
|
||||
];
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
import ipcRenderer from '@electron/internal/renderer/api/ipc-renderer';
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
|
||||
const sharedTextureNative = process._linkedBinding('electron_common_shared_texture');
|
||||
const transferChannelName = IPC_MESSAGES.IMPORT_SHARED_TEXTURE_TRANSFER_MAIN_TO_RENDERER;
|
||||
|
||||
type SharedTextureReceiverCallback = (data: Electron.ReceivedSharedTextureData, ...args: any[]) => Promise<void>;
|
||||
let sharedTextureReceiverCallback: SharedTextureReceiverCallback | null = null;
|
||||
|
||||
ipcRendererInternal.on(transferChannelName, async (event, requestId, ...args) => {
|
||||
const replyChannel = `${transferChannelName}_RESPONSE_${requestId}`;
|
||||
try {
|
||||
const transfer = args[0] as Electron.SharedTextureTransfer;
|
||||
const textureId = args[1] as string;
|
||||
const imported = sharedTextureNative.finishTransferSharedTexture(Object.assign(transfer, { id: textureId }));
|
||||
const syncToken = imported.getFrameCreationSyncToken();
|
||||
event.sender.send(replyChannel, null, syncToken);
|
||||
|
||||
const wrapper: Electron.SharedTextureImported = {
|
||||
textureId,
|
||||
subtle: imported,
|
||||
getVideoFrame: imported.getVideoFrame,
|
||||
release: () => {
|
||||
imported.release(async () => {
|
||||
await ipcRenderer.invoke(IPC_MESSAGES.IMPORT_SHARED_TEXTURE_RELEASE_RENDERER_TO_MAIN, textureId);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const data: Electron.ReceivedSharedTextureData = { importedSharedTexture: wrapper };
|
||||
await sharedTextureReceiverCallback?.(data, ...args.slice(2));
|
||||
} catch (error) {
|
||||
event.sender.send(replyChannel, error);
|
||||
}
|
||||
});
|
||||
|
||||
const sharedTexture = {
|
||||
subtle: sharedTextureNative,
|
||||
setSharedTextureReceiver: (callback: SharedTextureReceiverCallback) => {
|
||||
sharedTextureReceiverCallback = callback;
|
||||
}
|
||||
};
|
||||
|
||||
export default sharedTexture;
|
||||
@@ -15,10 +15,6 @@ export const moduleList: ElectronInternal.ModuleEntry[] = [
|
||||
name: 'nativeImage',
|
||||
loader: () => require('@electron/internal/common/api/native-image')
|
||||
},
|
||||
{
|
||||
name: 'sharedTexture',
|
||||
loader: () => require('@electron/internal/renderer/api/shared-texture')
|
||||
},
|
||||
{
|
||||
name: 'webFrame',
|
||||
loader: () => require('@electron/internal/renderer/api/web-frame')
|
||||
|
||||
@@ -5,9 +5,7 @@ const proc = require('child_process');
|
||||
const electron = require('./');
|
||||
|
||||
const child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit', windowsHide: false });
|
||||
let childClosed = false;
|
||||
child.on('close', function (code, signal) {
|
||||
childClosed = true;
|
||||
if (code === null) {
|
||||
console.error(electron, 'exited with signal', signal);
|
||||
process.exit(1);
|
||||
@@ -17,7 +15,7 @@ child.on('close', function (code, signal) {
|
||||
|
||||
const handleTerminationSignal = function (signal) {
|
||||
process.on(signal, function signalHandler () {
|
||||
if (!childClosed) {
|
||||
if (!child.killed) {
|
||||
child.kill(signal);
|
||||
}
|
||||
});
|
||||
@@ -25,4 +23,3 @@ const handleTerminationSignal = function (signal) {
|
||||
|
||||
handleTerminationSignal('SIGINT');
|
||||
handleTerminationSignal('SIGTERM');
|
||||
handleTerminationSignal('SIGUSR2');
|
||||
|
||||
@@ -44,7 +44,7 @@ downloadArtifact({
|
||||
artifactName: 'electron',
|
||||
force: process.env.force_no_cache === 'true',
|
||||
cacheRoot: process.env.electron_config_cache,
|
||||
checksums: (process.env.electron_use_remote_checksums || process.env.npm_config_electron_use_remote_checksums) ? undefined : require('./checksums.json'),
|
||||
checksums: process.env.electron_use_remote_checksums ?? process.env.npm_config_electron_use_remote_checksums ? undefined : require('./checksums.json'),
|
||||
platform,
|
||||
arch
|
||||
}).then(extractFile).catch(err => {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/get": "^2.0.0",
|
||||
"@types/node": "^24.9.0",
|
||||
"@types/node": "^22.7.7",
|
||||
"extract-zip": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
10
package.json
10
package.json
@@ -5,16 +5,16 @@
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
"@azure/storage-blob": "^12.28.0",
|
||||
"@electron/asar": "^4.0.1",
|
||||
"@electron/asar": "^3.2.13",
|
||||
"@electron/docs-parser": "^2.0.0",
|
||||
"@electron/fiddle-core": "^1.3.4",
|
||||
"@electron/github-app-auth": "^2.2.1",
|
||||
"@electron/lint-roller": "^3.1.2",
|
||||
"@electron/typescript-definitions": "^9.1.5",
|
||||
"@electron/typescript-definitions": "^9.1.2",
|
||||
"@octokit/rest": "^20.1.2",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
"@types/minimist": "^1.2.5",
|
||||
"@types/node": "^24.9.0",
|
||||
"@types/node": "^22.7.7",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/stream-json": "^1.7.8",
|
||||
"@types/temp": "^0.9.4",
|
||||
@@ -52,10 +52,10 @@
|
||||
"timers-browserify": "1.4.2",
|
||||
"ts-loader": "^8.0.2",
|
||||
"ts-node": "6.2.0",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript": "^5.6.2",
|
||||
"url": "^0.11.4",
|
||||
"webpack": "^5.95.0",
|
||||
"webpack-cli": "^6.0.1",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"wrapper-webpack-plugin": "^2.2.0"
|
||||
},
|
||||
"private": true,
|
||||
|
||||
1
patches/Mantle/.patches
Normal file
1
patches/Mantle/.patches
Normal file
@@ -0,0 +1 @@
|
||||
remove_mtlmanagedobjectadapter_h.patch
|
||||
22
patches/Mantle/remove_mtlmanagedobjectadapter_h.patch
Normal file
22
patches/Mantle/remove_mtlmanagedobjectadapter_h.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 7 Dec 2020 17:34:08 -0800
|
||||
Subject: Remove MTLManagedObjectAdapter.h
|
||||
|
||||
We are using an outdated version of Mantle which leverages NSConfinementConcurrencyType,
|
||||
an enum which has been deprecated with no replacement as of macOS 10.11.
|
||||
The actual solution to this problem is to upgrade Mantle, but for now
|
||||
we just stop building the offending adapter.
|
||||
|
||||
diff --git a/Mantle/Mantle.h b/Mantle/Mantle.h
|
||||
index ebd74e7e435ef008ef29e94d406246c1f7b07a12..81abff872bd597ce6d21bb43be4d19ddc7253088 100644
|
||||
--- a/Mantle/Mantle.h
|
||||
+++ b/Mantle/Mantle.h
|
||||
@@ -15,7 +15,6 @@ FOUNDATION_EXPORT double MantleVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char MantleVersionString[];
|
||||
|
||||
#import <Mantle/MTLJSONAdapter.h>
|
||||
-#import <Mantle/MTLManagedObjectAdapter.h>
|
||||
#import <Mantle/MTLModel.h>
|
||||
#import <Mantle/MTLModel+NSCoding.h>
|
||||
#import <Mantle/MTLValueTransformer.h>
|
||||
1
patches/angle/.patches
Normal file
1
patches/angle/.patches
Normal file
@@ -0,0 +1 @@
|
||||
cherry-pick-2f564f1ca07b.patch
|
||||
125
patches/angle/cherry-pick-2f564f1ca07b.patch
Normal file
125
patches/angle/cherry-pick-2f564f1ca07b.patch
Normal file
@@ -0,0 +1,125 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Mentovai <mark@chromium.org>
|
||||
Date: Tue, 16 Sep 2025 16:46:36 -0400
|
||||
Subject: mac: handle Metal toolchain being unbundled from Xcode 26
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The Metal toolchain was formerly part of Xcode, but in Xcode 26, it has
|
||||
been unbundled and is now a separate install. Attempting to use the
|
||||
Metal toolchain without installing it results in a build error, such as:
|
||||
|
||||
error: error: cannot execute tool 'metal' due to missing Metal
|
||||
Toolchain; use: xcodebuild -downloadComponent MetalToolchain
|
||||
|
||||
By running the suggested command, the Metal toolchain can be installed,
|
||||
but the existing angle build does not know how to find it correctly.
|
||||
|
||||
For system Xcode installations, tools from the Metal toolchain (`metal`
|
||||
and `metallib`) can be run via `xcrun`. This construct should work
|
||||
equally well for older Xcode versions, for situations where it’s still
|
||||
in use.
|
||||
|
||||
For the hermetic toolchain, we’ll continue splicing the Metal toolchain
|
||||
into the location it had previously been avialable (see
|
||||
https://chromium-review.googlesource.com/c/6950738), although this is
|
||||
subject to change in the future.
|
||||
|
||||
Bug: chromium:423933062, chromium:445400016
|
||||
Change-Id: I139eca51938f7cecfec9b90fd488947160ef4ec9
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6955000
|
||||
Auto-Submit: Mark Mentovai <mark@chromium.org>
|
||||
Commit-Queue: Mark Mentovai <mark@chromium.org>
|
||||
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
||||
|
||||
diff --git a/src/libANGLE/renderer/metal/BUILD.gn b/src/libANGLE/renderer/metal/BUILD.gn
|
||||
index 96e9ee8420810f6a3ca9a0c290d4a654200eb7b9..50ac42a5b9a0f7c8b3b161af40c598cb34ff132a 100644
|
||||
--- a/src/libANGLE/renderer/metal/BUILD.gn
|
||||
+++ b/src/libANGLE/renderer/metal/BUILD.gn
|
||||
@@ -24,20 +24,56 @@ config("angle_metal_backend_config") {
|
||||
}
|
||||
|
||||
if (metal_internal_shader_compilation_supported) {
|
||||
+ template("run_metal_tool") {
|
||||
+ action(target_name) {
|
||||
+ forward_variables_from(invoker,
|
||||
+ [
|
||||
+ "deps",
|
||||
+ "sources",
|
||||
+ "outputs",
|
||||
+ "metal_tool",
|
||||
+ ])
|
||||
+ script = "shaders/metal_wrapper.py"
|
||||
+ if (use_system_xcode) {
|
||||
+ # System Xcode: run metal and metallib via xcrun. Since Xcode 26.0, the
|
||||
+ # Metal toolchain has been unbundled from Xcode, and must be installed
|
||||
+ # separately by running `xcodebuild -downloadComponent MetalToolchain`.
|
||||
+ # There is a vestigial metal executable in mac_bin_path, but it’s
|
||||
+ # incapable of running successfuly without the
|
||||
+ # rest of the Metal toolchain surrounding it. `xcrun` is able to find
|
||||
+ # and run the correct Metal toolchain when properly installed.
|
||||
+ #
|
||||
+ # If you’re using system Xcode and your build fails with this message:
|
||||
+ # error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain
|
||||
+ # then do what the error message suggests, and then retry your build.
|
||||
+ args = [
|
||||
+ "xcrun",
|
||||
+ metal_tool,
|
||||
+ ]
|
||||
+ } else {
|
||||
+ # Hermetic Xcode: at least for now, the Metal toolchain is
|
||||
+ # “spliced” into the location in the hermetic toolchain where it lived
|
||||
+ # before Xcode 26.0, so it can be run directly from there.
|
||||
+ args = [ mac_bin_path + metal_tool ]
|
||||
+ }
|
||||
+
|
||||
+ args += invoker.args
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
_metal_internal_shaders_air_file =
|
||||
"$root_gen_dir/angle/mtl_internal_shaders_autogen.air"
|
||||
|
||||
- action("angle_metal_internal_shaders_to_air") {
|
||||
- script = "shaders/metal_wrapper.py"
|
||||
-
|
||||
- outputs = [ _metal_internal_shaders_air_file ]
|
||||
-
|
||||
+ run_metal_tool("angle_metal_internal_shaders_to_air") {
|
||||
_metal_internal_shaders_metal_source =
|
||||
"shaders/mtl_internal_shaders_autogen.metal"
|
||||
sources = [ _metal_internal_shaders_metal_source ]
|
||||
|
||||
+ outputs = [ _metal_internal_shaders_air_file ]
|
||||
+
|
||||
+ metal_tool = "metal"
|
||||
+
|
||||
args = [
|
||||
- mac_bin_path + "metal",
|
||||
"-c",
|
||||
rebase_path(_metal_internal_shaders_metal_source, root_build_dir),
|
||||
"-o",
|
||||
@@ -60,17 +96,16 @@ if (metal_internal_shader_compilation_supported) {
|
||||
_metal_internal_shaders_metallib_file =
|
||||
"$root_gen_dir/angle/mtl_internal_shaders_autogen.metallib"
|
||||
|
||||
- action("angle_metal_internal_shaders_to_mtllib") {
|
||||
- script = "shaders/metal_wrapper.py"
|
||||
-
|
||||
- outputs = [ _metal_internal_shaders_metallib_file ]
|
||||
+ run_metal_tool("angle_metal_internal_shaders_to_mtllib") {
|
||||
+ deps = [ ":angle_metal_internal_shaders_to_air" ]
|
||||
|
||||
sources = [ _metal_internal_shaders_air_file ]
|
||||
|
||||
- deps = [ ":angle_metal_internal_shaders_to_air" ]
|
||||
+ outputs = [ _metal_internal_shaders_metallib_file ]
|
||||
+
|
||||
+ metal_tool = "metallib"
|
||||
|
||||
args = [
|
||||
- mac_bin_path + "metallib",
|
||||
rebase_path(_metal_internal_shaders_air_file, root_build_dir),
|
||||
"-o",
|
||||
rebase_path(_metal_internal_shaders_metallib_file, root_build_dir),
|
||||
@@ -1,2 +1,3 @@
|
||||
expose_ripemd160.patch
|
||||
revert_track_ssl_error_zero_return_explicitly.patch
|
||||
feat_expose_several_extra_cipher_functions.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ this patch is required to provide ripemd160 support in the nodejs crypto
|
||||
module.
|
||||
|
||||
diff --git a/crypto/digest/digest_extra.cc b/crypto/digest/digest_extra.cc
|
||||
index ea1709ae6b50faedc786c0eaeb5f9002fd0db7d8..5b0ed4dc6aaf3fafad034e9ecc62cd47b9e3034f 100644
|
||||
index 345c94f6e26e88aac77b9feb92bd8d6665234981..8ef2ab8987da63f321d1dbb79f2eded8b8209bfc 100644
|
||||
--- a/crypto/digest/digest_extra.cc
|
||||
+++ b/crypto/digest/digest_extra.cc
|
||||
@@ -47,6 +47,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = {
|
||||
@@ -22,7 +22,7 @@ index ea1709ae6b50faedc786c0eaeb5f9002fd0db7d8..5b0ed4dc6aaf3fafad034e9ecc62cd47
|
||||
// hash function when given a signature OID. To avoid unintended lax parsing
|
||||
// of hash OIDs, this is no longer supported for lookup by OID or NID.
|
||||
diff --git a/crypto/fipsmodule/digest/digests.cc.inc b/crypto/fipsmodule/digest/digests.cc.inc
|
||||
index 3a3bfd3f0560fcd7b5fdbdf4cc29a56e0346b90a..a7335ca03b5b3b918c4321d890b45649679d772b 100644
|
||||
index 99e3a66c0a47818ccb039f8ccc41ea50e529a16d..dc50fd05bed6cb40bffe1c0f6f3019d25d351ba2 100644
|
||||
--- a/crypto/fipsmodule/digest/digests.cc.inc
|
||||
+++ b/crypto/fipsmodule/digest/digests.cc.inc
|
||||
@@ -18,6 +18,7 @@
|
||||
@@ -62,27 +62,27 @@ index 3a3bfd3f0560fcd7b5fdbdf4cc29a56e0346b90a..a7335ca03b5b3b918c4321d890b45649
|
||||
+
|
||||
#undef CHECK
|
||||
diff --git a/decrepit/evp/evp_do_all.cc b/decrepit/evp/evp_do_all.cc
|
||||
index feaf17c72cecb8099bc11ac10747fbad719ddca9..891a73f229e3f0838cb2fa99b8fb24fdeac1962b 100644
|
||||
index e04b80cd6a1a215fc87f8fd8d750c3d258c3974f..8fdf1c624794f568bfc77b7b6b0c510b23905a4d 100644
|
||||
--- a/decrepit/evp/evp_do_all.cc
|
||||
+++ b/decrepit/evp/evp_do_all.cc
|
||||
@@ -79,6 +79,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
|
||||
callback(EVP_sha384(), "SHA384", nullptr, arg);
|
||||
callback(EVP_sha512(), "SHA512", nullptr, arg);
|
||||
callback(EVP_sha512_256(), "SHA512-256", nullptr, arg);
|
||||
+ callback(EVP_ripemd160(), "ripemd160", nullptr, arg);
|
||||
callback(EVP_sha384(), "SHA384", NULL, arg);
|
||||
callback(EVP_sha512(), "SHA512", NULL, arg);
|
||||
callback(EVP_sha512_256(), "SHA512-256", NULL, arg);
|
||||
+ callback(EVP_ripemd160(), "ripemd160", NULL, arg);
|
||||
|
||||
callback(EVP_md4(), "md4", nullptr, arg);
|
||||
callback(EVP_md5(), "md5", nullptr, arg);
|
||||
callback(EVP_md4(), "md4", NULL, arg);
|
||||
callback(EVP_md5(), "md5", NULL, arg);
|
||||
@@ -88,6 +89,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,
|
||||
callback(EVP_sha384(), "sha384", nullptr, arg);
|
||||
callback(EVP_sha512(), "sha512", nullptr, arg);
|
||||
callback(EVP_sha512_256(), "sha512-256", nullptr, arg);
|
||||
+ callback(EVP_ripemd160(), "ripemd160", nullptr, arg);
|
||||
callback(EVP_sha384(), "sha384", NULL, arg);
|
||||
callback(EVP_sha512(), "sha512", NULL, arg);
|
||||
callback(EVP_sha512_256(), "sha512-256", NULL, arg);
|
||||
+ callback(EVP_ripemd160(), "ripemd160", NULL, arg);
|
||||
}
|
||||
|
||||
void EVP_MD_do_all(void (*callback)(const EVP_MD *cipher, const char *name,
|
||||
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
|
||||
index a86c18926e7798a3b0aae70c53870e03b5acd0ab..f4f27f9e803533d8db50d89e7a0125384a025a46 100644
|
||||
index b604aba00c1c6cea8002b6dc298ea5fe979589b1..1c123aa1dca09ae60c31be2a6dab9a64748eac17 100644
|
||||
--- a/include/openssl/digest.h
|
||||
+++ b/include/openssl/digest.h
|
||||
@@ -48,6 +48,9 @@ OPENSSL_EXPORT const EVP_MD *EVP_blake2b256(void);
|
||||
|
||||
@@ -64,64 +64,64 @@ index 6513df01c4b3e4d33fc6b521d9aae78ec5499e73..52eb7fea420e3d81d274fd5c1e21e4da
|
||||
|
||||
const EVP_CIPHER *EVP_get_cipherbynid(int nid) {
|
||||
diff --git a/decrepit/evp/evp_do_all.cc b/decrepit/evp/evp_do_all.cc
|
||||
index 891a73f229e3f0838cb2fa99b8fb24fdeac1962b..f7d0c5dc66f016eb9338c15e7f5ef59e6de2969d 100644
|
||||
index 8fdf1c624794f568bfc77b7b6b0c510b23905a4d..2e40c031e8c681fe921331b26dbf63f4df2fcf71 100644
|
||||
--- a/decrepit/evp/evp_do_all.cc
|
||||
+++ b/decrepit/evp/evp_do_all.cc
|
||||
@@ -20,8 +20,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
|
||||
const char *unused, void *arg),
|
||||
void *arg) {
|
||||
callback(EVP_aes_128_cbc(), "AES-128-CBC", nullptr, arg);
|
||||
+ callback(EVP_aes_128_cfb128(), "AES-128-CFB", nullptr, arg);
|
||||
callback(EVP_aes_192_cbc(), "AES-192-CBC", nullptr, arg);
|
||||
callback(EVP_aes_256_cbc(), "AES-256-CBC", nullptr, arg);
|
||||
+ callback(EVP_aes_256_cfb128(), "AES-256-CFB", nullptr, arg);
|
||||
callback(EVP_aes_128_ctr(), "AES-128-CTR", nullptr, arg);
|
||||
callback(EVP_aes_192_ctr(), "AES-192-CTR", nullptr, arg);
|
||||
callback(EVP_aes_256_ctr(), "AES-256-CTR", nullptr, arg);
|
||||
callback(EVP_aes_128_cbc(), "AES-128-CBC", NULL, arg);
|
||||
+ callback(EVP_aes_128_cfb128(), "AES-128-CFB", NULL, arg);
|
||||
callback(EVP_aes_192_cbc(), "AES-192-CBC", NULL, arg);
|
||||
callback(EVP_aes_256_cbc(), "AES-256-CBC", NULL, arg);
|
||||
+ callback(EVP_aes_256_cfb128(), "AES-256-CFB", NULL, arg);
|
||||
callback(EVP_aes_128_ctr(), "AES-128-CTR", NULL, arg);
|
||||
callback(EVP_aes_192_ctr(), "AES-192-CTR", NULL, arg);
|
||||
callback(EVP_aes_256_ctr(), "AES-256-CTR", NULL, arg);
|
||||
@@ -34,9 +36,13 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
|
||||
callback(EVP_aes_128_gcm(), "AES-128-GCM", nullptr, arg);
|
||||
callback(EVP_aes_192_gcm(), "AES-192-GCM", nullptr, arg);
|
||||
callback(EVP_aes_256_gcm(), "AES-256-GCM", nullptr, arg);
|
||||
+ callback(EVP_bf_cbc(), "BF-CBC", nullptr, arg);
|
||||
+ callback(EVP_bf_cfb(), "BF-CFB", nullptr, arg);
|
||||
+ callback(EVP_bf_ecb(), "BF-ECB", nullptr, arg);
|
||||
callback(EVP_des_cbc(), "DES-CBC", nullptr, arg);
|
||||
callback(EVP_des_ecb(), "DES-ECB", nullptr, arg);
|
||||
callback(EVP_des_ede(), "DES-EDE", nullptr, arg);
|
||||
+ callback(EVP_des_ede3(), "DES-EDE3", nullptr, arg);
|
||||
callback(EVP_des_ede_cbc(), "DES-EDE-CBC", nullptr, arg);
|
||||
callback(EVP_des_ede3_cbc(), "DES-EDE3-CBC", nullptr, arg);
|
||||
callback(EVP_rc2_cbc(), "RC2-CBC", nullptr, arg);
|
||||
callback(EVP_aes_128_gcm(), "AES-128-GCM", NULL, arg);
|
||||
callback(EVP_aes_192_gcm(), "AES-192-GCM", NULL, arg);
|
||||
callback(EVP_aes_256_gcm(), "AES-256-GCM", NULL, arg);
|
||||
+ callback(EVP_bf_cbc(), "BF-CBC", NULL, arg);
|
||||
+ callback(EVP_bf_cfb(), "BF-CFB", NULL, arg);
|
||||
+ callback(EVP_bf_ecb(), "BF-ECB", NULL, arg);
|
||||
callback(EVP_des_cbc(), "DES-CBC", NULL, arg);
|
||||
callback(EVP_des_ecb(), "DES-ECB", NULL, arg);
|
||||
callback(EVP_des_ede(), "DES-EDE", NULL, arg);
|
||||
+ callback(EVP_des_ede3(), "DES-EDE3", NULL, arg);
|
||||
callback(EVP_des_ede_cbc(), "DES-EDE-CBC", NULL, arg);
|
||||
callback(EVP_des_ede3_cbc(), "DES-EDE3-CBC", NULL, arg);
|
||||
callback(EVP_rc2_cbc(), "RC2-CBC", NULL, arg);
|
||||
@@ -44,8 +50,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
|
||||
|
||||
// OpenSSL returns everything twice, the second time in lower case.
|
||||
callback(EVP_aes_128_cbc(), "aes-128-cbc", nullptr, arg);
|
||||
+ callback(EVP_aes_128_cfb128(), "aes-128-cfb", nullptr, arg);
|
||||
callback(EVP_aes_192_cbc(), "aes-192-cbc", nullptr, arg);
|
||||
callback(EVP_aes_256_cbc(), "aes-256-cbc", nullptr, arg);
|
||||
+ callback(EVP_aes_256_cfb128(), "aes-256-cfb", nullptr, arg);
|
||||
callback(EVP_aes_128_ctr(), "aes-128-ctr", nullptr, arg);
|
||||
callback(EVP_aes_192_ctr(), "aes-192-ctr", nullptr, arg);
|
||||
callback(EVP_aes_256_ctr(), "aes-256-ctr", nullptr, arg);
|
||||
callback(EVP_aes_128_cbc(), "aes-128-cbc", NULL, arg);
|
||||
+ callback(EVP_aes_128_cfb128(), "aes-128-cfb", NULL, arg);
|
||||
callback(EVP_aes_192_cbc(), "aes-192-cbc", NULL, arg);
|
||||
callback(EVP_aes_256_cbc(), "aes-256-cbc", NULL, arg);
|
||||
+ callback(EVP_aes_256_cfb128(), "aes-256-cfb", NULL, arg);
|
||||
callback(EVP_aes_128_ctr(), "aes-128-ctr", NULL, arg);
|
||||
callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg);
|
||||
callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg);
|
||||
@@ -58,9 +66,13 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,
|
||||
callback(EVP_aes_128_gcm(), "aes-128-gcm", nullptr, arg);
|
||||
callback(EVP_aes_192_gcm(), "aes-192-gcm", nullptr, arg);
|
||||
callback(EVP_aes_256_gcm(), "aes-256-gcm", nullptr, arg);
|
||||
+ callback(EVP_bf_cbc(), "bf-cbc", nullptr, arg);
|
||||
+ callback(EVP_bf_cfb(), "bf-cfb", nullptr, arg);
|
||||
+ callback(EVP_bf_ecb(), "bf-ecb", nullptr, arg);
|
||||
callback(EVP_des_cbc(), "des-cbc", nullptr, arg);
|
||||
callback(EVP_des_ecb(), "des-ecb", nullptr, arg);
|
||||
callback(EVP_des_ede(), "des-ede", nullptr, arg);
|
||||
+ callback(EVP_des_ede3(), "des-ede3", nullptr, arg);
|
||||
callback(EVP_des_ede_cbc(), "des-ede-cbc", nullptr, arg);
|
||||
callback(EVP_des_ede3_cbc(), "des-ede3-cbc", nullptr, arg);
|
||||
callback(EVP_rc2_cbc(), "rc2-cbc", nullptr, arg);
|
||||
callback(EVP_aes_128_gcm(), "aes-128-gcm", NULL, arg);
|
||||
callback(EVP_aes_192_gcm(), "aes-192-gcm", NULL, arg);
|
||||
callback(EVP_aes_256_gcm(), "aes-256-gcm", NULL, arg);
|
||||
+ callback(EVP_bf_cbc(), "bf-cbc", NULL, arg);
|
||||
+ callback(EVP_bf_cfb(), "bf-cfb", NULL, arg);
|
||||
+ callback(EVP_bf_ecb(), "bf-ecb", NULL, arg);
|
||||
callback(EVP_des_cbc(), "des-cbc", NULL, arg);
|
||||
callback(EVP_des_ecb(), "des-ecb", NULL, arg);
|
||||
callback(EVP_des_ede(), "des-ede", NULL, arg);
|
||||
+ callback(EVP_des_ede3(), "des-ede3", NULL, arg);
|
||||
callback(EVP_des_ede_cbc(), "des-ede-cbc", NULL, arg);
|
||||
callback(EVP_des_ede3_cbc(), "des-ede3-cbc", NULL, arg);
|
||||
callback(EVP_rc2_cbc(), "rc2-cbc", NULL, arg);
|
||||
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
|
||||
index 8b473699eb502cdd151a641d9ff242a7edcb42e8..a0a26d7c984a3d0f18d9fdf0424ced22580784a9 100644
|
||||
index 13e68ad20ac08a462bb577d7f99e2c6f167579fa..4960d0eeb8f31bec4347ed2a1b63beba530de700 100644
|
||||
--- a/include/openssl/cipher.h
|
||||
+++ b/include/openssl/cipher.h
|
||||
@@ -552,6 +552,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
|
||||
@@ -448,6 +448,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
|
||||
|
||||
// EVP_aes_128_cfb128 is only available in decrepit.
|
||||
OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 6 Sep 2022 09:42:52 +0200
|
||||
Subject: revert: track SSL_ERROR_ZERO_RETURN explicitly.
|
||||
|
||||
This reverts commit ebd8b8965c74ab06bb91f7a00b23822e1f1f26ca.
|
||||
|
||||
It is causing significant TLS failures in Node.js.
|
||||
|
||||
diff --git a/ssl/ssl_buffer.cc b/ssl/ssl_buffer.cc
|
||||
index 2cdcbc346175eeee69402ecee7f169e61c655199..f7226fe711e4214b216ea2c5173a02124b80f9ef 100644
|
||||
--- a/ssl/ssl_buffer.cc
|
||||
+++ b/ssl/ssl_buffer.cc
|
||||
@@ -230,7 +230,6 @@ int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret,
|
||||
return 1;
|
||||
|
||||
case ssl_open_record_close_notify:
|
||||
- ssl->s3->rwstate = SSL_ERROR_ZERO_RETURN;
|
||||
return 0;
|
||||
|
||||
case ssl_open_record_error:
|
||||
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
|
||||
index 2e0db357135d54bc416bc94f4e3849267932c3b4..35f0430b5d1c1ed1676ea7a9e7e94e820126607b 100644
|
||||
--- a/ssl/ssl_lib.cc
|
||||
+++ b/ssl/ssl_lib.cc
|
||||
@@ -1211,7 +1211,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
}
|
||||
|
||||
if (ret_code == 0) {
|
||||
- if (ssl->s3->rwstate == SSL_ERROR_ZERO_RETURN) {
|
||||
+ if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) {
|
||||
return SSL_ERROR_ZERO_RETURN;
|
||||
}
|
||||
// An EOF was observed which violates the protocol, and the underlying
|
||||
@@ -2602,13 +2602,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
|
||||
}
|
||||
|
||||
-int SSL_want(const SSL *ssl) {
|
||||
- // Historically, OpenSSL did not track |SSL_ERROR_ZERO_RETURN| as an |rwstate|
|
||||
- // value. We do, but map it back to |SSL_ERROR_NONE| to preserve the original
|
||||
- // behavior.
|
||||
- return ssl->s3->rwstate == SSL_ERROR_ZERO_RETURN ? SSL_ERROR_NONE
|
||||
- : ssl->s3->rwstate;
|
||||
-}
|
||||
+int SSL_want(const SSL *ssl) { return ssl->s3->rwstate; }
|
||||
|
||||
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
|
||||
RSA *(*cb)(SSL *ssl, int is_export,
|
||||
@@ -59,6 +59,7 @@ webview_fullscreen.patch
|
||||
extend_apply_webpreferences.patch
|
||||
build_libc_as_static_library.patch
|
||||
build_do_not_depend_on_packed_resource_integrity.patch
|
||||
refactor_restore_base_adaptcallbackforrepeating.patch
|
||||
logging_win32_only_create_a_console_if_logging_to_stderr.patch
|
||||
fix_media_key_usage_with_globalshortcuts.patch
|
||||
feat_expose_raw_response_headers_from_urlloader.patch
|
||||
@@ -109,6 +110,7 @@ fix_getcursorscreenpoint_wrongly_returns_0_0.patch
|
||||
fix_add_support_for_skipping_first_2_no-op_refreshes_in_thumb_cap.patch
|
||||
refactor_expose_file_system_access_blocklist.patch
|
||||
feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch
|
||||
fix_font_face_resolution_when_renderer_is_blocked.patch
|
||||
feat_enable_passing_exit_code_on_service_process_crash.patch
|
||||
chore_remove_reference_to_chrome_browser_themes.patch
|
||||
feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
|
||||
@@ -130,6 +132,7 @@ chore_grandfather_in_electron_views_and_delegates.patch
|
||||
refactor_patch_electron_permissiontypes_into_blink.patch
|
||||
revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch
|
||||
build_partial_revert_mac_fullscreen_top_chrome_mouse_events.patch
|
||||
build_set_mac_sdk_minimum_to_10.patch
|
||||
fix_add_macos_memory_query_fallback_to_avoid_crash.patch
|
||||
fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch
|
||||
feat_add_support_for_embedder_snapshot_validation.patch
|
||||
@@ -138,7 +141,6 @@ chore_add_electron_objects_to_wrappablepointertag.patch
|
||||
chore_expose_isolate_parameter_in_script_lifecycle_observers.patch
|
||||
revert_partial_remove_unused_prehandlemouseevent.patch
|
||||
allow_electron_to_depend_on_components_os_crypt_sync.patch
|
||||
disable_nsautofillheuristiccontroller_on_macos_26.patch
|
||||
expose_referrerscriptinfo_hostdefinedoptionsindex.patch
|
||||
chore_disable_protocol_handler_dcheck.patch
|
||||
fix_check_for_file_existence_before_setting_mtime.patch
|
||||
fix_linux_tray_id.patch
|
||||
inspectorpageagent_provisional_frame_speculative_fix.patch
|
||||
|
||||
@@ -53,19 +53,19 @@ index 5ad9332dd27ceda7d67cd3f571b12218a4415a40..ffe083836c39fb60b4bff1f9fbdd6ceb
|
||||
}
|
||||
|
||||
diff --git a/ui/base/accelerators/accelerator.h b/ui/base/accelerators/accelerator.h
|
||||
index 666ecbc118bec6d51465644ae4e573846c33610b..5f578ea153477379bac69e48fbd4f41a9a24885e 100644
|
||||
index e7d5adfac920c97df8bab9bf4ed69a835ee314a9..9aeea7cb4c48d1ccc27304fa99238151b2811c87 100644
|
||||
--- a/ui/base/accelerators/accelerator.h
|
||||
+++ b/ui/base/accelerators/accelerator.h
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/component_export.h"
|
||||
+#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "base/time/time.h"
|
||||
#include "build/blink_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/events/event_constants.h"
|
||||
#include "ui/events/keycodes/keyboard_codes.h"
|
||||
|
||||
@@ -199,6 +200,8 @@ class COMPONENT_EXPORT(UI_BASE) Accelerator {
|
||||
<< 18); // masked to 6 bits
|
||||
@@ -189,6 +190,8 @@ class COMPONENT_EXPORT(UI_BASE) Accelerator {
|
||||
return interrupted_by_mouse_event_;
|
||||
}
|
||||
|
||||
+ absl::optional<char16_t> shifted_char;
|
||||
|
||||
@@ -10,10 +10,10 @@ 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 30cc1d4a179f9da59824cb98415baed8493fc843..2272eaa7e0e3306201e5e32226a0115f6f6636e5 100644
|
||||
index a827f072e72d76dd52378cca4368932a4b2f4f3d..cc1b6cca3009e876f84f48df942df02fddd91e80 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -272,6 +272,10 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
@@ -273,6 +273,10 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
// to the GpuProcessHost once the GpuServiceImpl has started.
|
||||
viz::GpuLogMessageManager::GetInstance()->InstallPreInitializeLogHandler();
|
||||
|
||||
@@ -24,7 +24,7 @@ index 30cc1d4a179f9da59824cb98415baed8493fc843..2272eaa7e0e3306201e5e32226a0115f
|
||||
// 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
|
||||
@@ -381,7 +385,6 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
@@ -382,7 +386,6 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
#endif
|
||||
const bool dead_on_arrival = !init_success;
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ 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 5196f155cdc641b66c4faa77d8b00097145a1290..bbfac47a74f989482343c222b78f187b70297e4e 100644
|
||||
index 284da783658bec333be748941784d43b13f6f244..18714ce8fc27c8d56c5deac27ba335078c452d0a 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -141,6 +141,8 @@ class CONTENT_EXPORT RenderFrameObserver {
|
||||
@@ -139,6 +139,8 @@ class CONTENT_EXPORT RenderFrameObserver {
|
||||
virtual void DidHandleOnloadEvents() {}
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
@@ -23,10 +23,10 @@ index 5196f155cdc641b66c4faa77d8b00097145a1290..bbfac47a74f989482343c222b78f187b
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 1999b88df0cf82921eb74b7167bf119ff9bbc23a..f0a6a03efe20bf674a6fb2d4ad33de4a829cef53 100644
|
||||
index a0aa3ec64b54b99508d1ba9cd52e2fe0e53ed56c..f337d61906651359eeb5228c112ad948f4f7a752 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4662,6 +4662,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4678,6 +4678,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 1999b88df0cf82921eb74b7167bf119ff9bbc23a..f0a6a03efe20bf674a6fb2d4ad33de4a
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 19c5dab00dd9355736c6040868b320483b780afb..621cd9ae7f43470ed4414a48d62330b36c7058e9 100644
|
||||
index 2950a6f600aab24226ef59acabddc74c9b67cac8..f0f4335aa815ea50dbf9b720b41e4eb31f27fb90 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -603,6 +603,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -602,6 +602,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index 19c5dab00dd9355736c6040868b320483b780afb..621cd9ae7f43470ed4414a48d62330b3
|
||||
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 5c1d0c1581b7ef6214f3dde6a4053a23c8673b74..4520c9edccf63bdb9e35bf3a99a8ddb39170da24 100644
|
||||
index 101e727b3a97bc764315eb694dc3975f9a408f9c..52e8828d8fffaba8ab05436cb4d727595f18238a 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -667,6 +667,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -661,6 +661,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -67,10 +67,10 @@ index 5c1d0c1581b7ef6214f3dde6a4053a23c8673b74..4520c9edccf63bdb9e35bf3a99a8ddb3
|
||||
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 3ce1ef340780075951fb8c1b65f2ec90569f34ef..898d7caac98727210ac5780b576526a71ec5a5aa 100644
|
||||
index b963abd8c4bf6ffaea1930a8d1f647a8a8c266bc..2e8653654686f4fc775288f059ff27daa38e02d5 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
|
||||
@@ -217,6 +217,7 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -216,6 +216,7 @@ void LocalWindowProxy::Initialize() {
|
||||
}
|
||||
|
||||
InstallConditionalFeatures();
|
||||
@@ -92,11 +92,11 @@ index 36baf908d3be8aed44ff60b8de2cffe2eee15efe..8d73ddb12013ce195026b9f63050cf33
|
||||
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 019445e625257f909875adffdc5e967fb65a3728..11475d1a22054a884f2f1e7e5c933e9ae8d3379f 100644
|
||||
index b02b60ff5f6650332c54ecc66f6fdb274b737aa7..1aacf6f66b543a4ede6ab5d885143dd4a0821e8a 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
|
||||
@@ -300,6 +300,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
}
|
||||
@@ -295,6 +295,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
+void LocalFrameClientImpl::DidInstallConditionalFeatures(
|
||||
@@ -123,10 +123,10 @@ index fcc0928abbc454281b022e0451d993651ecba42f..16066fe34ee0335a0dabe00b6890e584
|
||||
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 b1677488cb64d2ad83f231b4cbe74bc4f56149b4..80ee0065d1b16520389b6809402438f087430fa3 100644
|
||||
index 769b08ca081fe83c50babb2743fde6e8961b65ff..d8f3b11c98fd58baa9995762a29847b9fd760c84 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -426,6 +426,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -420,6 +420,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -7,12 +7,12 @@ Ensure that licenses for the dependencies introduced by Electron
|
||||
are included in `LICENSES.chromium.html`
|
||||
|
||||
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
|
||||
index 514be069768cc1bbd39f2b261cefb1a9f267f89f..0a1ab64914cfaa087e4000fb81bfafd18aa1b98b 100755
|
||||
index b0807ee3d8ebcf34f0d740362aa46c8631562d38..118d200b74953c0068ad59300ccc0e3041d77a10 100755
|
||||
--- a/tools/licenses/licenses.py
|
||||
+++ b/tools/licenses/licenses.py
|
||||
@@ -357,6 +357,31 @@ SPECIAL_CASES = {
|
||||
@@ -337,6 +337,31 @@ SPECIAL_CASES = {
|
||||
"License": "Apache 2.0",
|
||||
"License File": ["//third_party/sample3/the_license"],
|
||||
"License File": ["//third_party/dawn/third_party/khronos/LICENSE"],
|
||||
},
|
||||
+ os.path.join('third_party', 'electron_node'): {
|
||||
+ "Name": "Node.js",
|
||||
|
||||
@@ -8,10 +8,10 @@ was removed as part of the Raw Clipboard API scrubbing.
|
||||
https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
|
||||
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
index e104f4d7814b6f6a0e1f5cf49ae24d5571e30fb1..cc7e9064b21f8f2c45690454805901c0c56e2aa1 100644
|
||||
index 2d612b3a8ceb61f02fbd96023140bc2c702db589..bb5b17fc884b78aa65c3885e11309a9c50f8e786 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
@@ -244,6 +244,16 @@ void ScopedClipboardWriter::WriteData(std::u16string_view format,
|
||||
@@ -246,6 +246,16 @@ void ScopedClipboardWriter::WriteData(std::u16string_view format,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ usage of BrowserList and Browser as we subclass related methods and use our
|
||||
WindowList.
|
||||
|
||||
diff --git a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3b33c3777 100644
|
||||
index 8f425bd66fac7b36cee201c3e23c126dd14edf07..6216ad30ed15f11501e1d154258862f57941969e 100644
|
||||
--- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
@@ -48,6 +48,7 @@
|
||||
@@ -21,16 +21,16 @@ index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#include "ui/accessibility/ax_mode.h"
|
||||
#include "ui/accessibility/ax_updates_and_events.h"
|
||||
@@ -179,7 +180,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
@@ -178,7 +179,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
rvh->GetRoutingID(), accessibility_mode);
|
||||
}
|
||||
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
+#if 0
|
||||
base::Value::Dict BuildTargetDescriptor(BrowserWindowInterface* browser) {
|
||||
base::Value::Dict BuildTargetDescriptor(Browser* browser) {
|
||||
base::Value::Dict target_data;
|
||||
target_data.Set(kSessionIdField, browser->GetSessionID().id());
|
||||
@@ -226,7 +227,7 @@ void HandleAccessibilityRequestCallback(
|
||||
target_data.Set(kSessionIdField, browser->session_id().id());
|
||||
@@ -224,7 +225,7 @@ void HandleAccessibilityRequestCallback(
|
||||
auto& browser_accessibility_state =
|
||||
*content::BrowserAccessibilityState::GetInstance();
|
||||
base::Value::Dict data;
|
||||
@@ -39,7 +39,7 @@ index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3
|
||||
ui::AXMode mode = browser_accessibility_state.GetAccessibilityMode();
|
||||
bool native = mode.has_mode(ui::AXMode::kNativeAPIs);
|
||||
bool web = mode.has_mode(ui::AXMode::kWebContents);
|
||||
@@ -287,7 +288,7 @@ void HandleAccessibilityRequestCallback(
|
||||
@@ -285,7 +286,7 @@ void HandleAccessibilityRequestCallback(
|
||||
data.Set(kIsScreenReaderActive, is_screen_reader_active);
|
||||
|
||||
std::string pref_api_type =
|
||||
@@ -48,23 +48,21 @@ index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3
|
||||
bool pref_api_type_supported = false;
|
||||
|
||||
std::vector<ui::AXApiType::Type> supported_api_types =
|
||||
@@ -355,13 +356,13 @@ void HandleAccessibilityRequestCallback(
|
||||
@@ -353,11 +354,11 @@ void HandleAccessibilityRequestCallback(
|
||||
data.Set(kPagesField, std::move(page_list));
|
||||
|
||||
base::Value::List browser_list;
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
+#if 0
|
||||
ForEachCurrentBrowserWindowInterfaceOrderedByActivation(
|
||||
[&browser_list](BrowserWindowInterface* browser) {
|
||||
browser_list.Append(BuildTargetDescriptor(browser));
|
||||
return true;
|
||||
});
|
||||
for (Browser* browser : *BrowserList::GetInstance()) {
|
||||
browser_list.Append(BuildTargetDescriptor(browser));
|
||||
}
|
||||
-#endif // !BUILDFLAG(IS_ANDROID)
|
||||
+#endif
|
||||
data.Set(kBrowsersField, std::move(browser_list));
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
@@ -848,7 +849,8 @@ void AccessibilityUIMessageHandler::SetGlobalString(
|
||||
@@ -844,7 +845,8 @@ void AccessibilityUIMessageHandler::SetGlobalString(
|
||||
const std::string value = CheckJSValue(data.FindString(kValueField));
|
||||
|
||||
if (string_name == kApiTypeField) {
|
||||
@@ -74,7 +72,7 @@ index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3
|
||||
pref->SetString(prefs::kShownAccessibilityApiType, value);
|
||||
}
|
||||
}
|
||||
@@ -902,7 +904,8 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
|
||||
@@ -898,7 +900,8 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
|
||||
AXPropertyFilter::ALLOW_EMPTY);
|
||||
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
|
||||
|
||||
@@ -84,25 +82,23 @@ index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3
|
||||
ui::AXApiType::Type api_type =
|
||||
ui::AXApiType::From(pref->GetString(prefs::kShownAccessibilityApiType));
|
||||
std::string accessibility_contents =
|
||||
@@ -922,7 +925,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
@@ -925,6 +928,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
AXPropertyFilter::ALLOW_EMPTY);
|
||||
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
|
||||
|
||||
AllowJavascript();
|
||||
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
+#if 0
|
||||
std::vector<AXPropertyFilter> property_filters;
|
||||
AddPropertyFilters(property_filters, allow, AXPropertyFilter::ALLOW);
|
||||
AddPropertyFilters(property_filters, allow_empty,
|
||||
@@ -949,7 +952,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
if (found) {
|
||||
return;
|
||||
for (Browser* browser : *BrowserList::GetInstance()) {
|
||||
if (browser->session_id().id() == session_id) {
|
||||
base::Value::Dict result = BuildTargetDescriptor(browser);
|
||||
@@ -937,6 +941,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
return;
|
||||
}
|
||||
}
|
||||
-#endif // !BUILDFLAG(IS_ANDROID)
|
||||
+#endif
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
// No browser with the specified |session_id| was found.
|
||||
base::Value::Dict result;
|
||||
result.Set(kSessionIdField, session_id);
|
||||
@@ -992,11 +995,13 @@ void AccessibilityUIMessageHandler::StopRecording(
|
||||
@@ -980,11 +985,13 @@ void AccessibilityUIMessageHandler::StopRecording(
|
||||
}
|
||||
|
||||
ui::AXApiType::Type AccessibilityUIMessageHandler::GetRecordingApiType() {
|
||||
@@ -119,7 +115,7 @@ index 3a9f87d82212bfeab23b312a593fb855df344780..83b4a7fe7149f2b195e53fcb05f77da3
|
||||
// Check to see if it is in the supported types list.
|
||||
if (std::find(supported_types.begin(), supported_types.end(), api_type) ==
|
||||
supported_types.end()) {
|
||||
@@ -1066,10 +1071,13 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
|
||||
@@ -1054,10 +1061,13 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
|
||||
// static
|
||||
void AccessibilityUIMessageHandler::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
|
||||
@@ -6,11 +6,11 @@ Subject: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
index ab916b56116e911af3cf6655cdd68ce139e260b9..f148ce57ae6c75f6635fca487d9493199b79a9f3 100644
|
||||
index 318031e17f212b0e9a651dcc0e86e16af957ed8e..e68dcdc8039217ec59a60ef02c27b4f80f661d2a 100644
|
||||
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
@@ -167,6 +167,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
(bool supports_draggable_regions),
|
||||
@@ -168,6 +168,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
(std::optional<blink::NoiseToken> canvas_noise_token),
|
||||
(override));
|
||||
|
||||
+ MOCK_METHOD(
|
||||
@@ -23,10 +23,10 @@ index ab916b56116e911af3cf6655cdd68ce139e260b9..f148ce57ae6c75f6635fca487d949319
|
||||
return receiver_.BindNewEndpointAndPassDedicatedRemote();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index 357dc106e4c53122e87ea09a780f7976ad37f25e..5209b85dc285f5e177377bd06e36b8b175581cbb 100644
|
||||
index 270750b9180a8ddab4f3cd2508fd398e07bf6377..20b2ae081a3710443ec919f1487dfbfe8f15de11 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -767,6 +767,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -785,6 +785,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -51,25 +51,25 @@ index 7944fe64e0da112fc670358b75506bb199bb5e4a..0e3c16c6af2a078943e9f39808134ab2
|
||||
void SendRendererPreferencesToRenderer(
|
||||
const blink::RendererPreferences& preferences);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 84899b5208f036bd58ba51513820404b6c5a24b9..87fd5aa4fab7ddd0b444a3c8473ae35066c87054 100644
|
||||
index e95a313945397c6eff5514932ce15c5d4b6a8e1f..edb2638deb85dfd37651a00d4c370e51d94fcc6a 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -632,8 +632,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
@@ -578,8 +578,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
// OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
|
||||
// which updates `visibility_`, unless the host is hidden. Make sure no update
|
||||
// is needed.
|
||||
- CHECK(host_->IsHidden() || visibility_ == Visibility::VISIBLE);
|
||||
- CHECK(host_->is_hidden() || visibility_ == Visibility::VISIBLE);
|
||||
- OnShowWithPageVisibility(page_visibility);
|
||||
+ if (host_->IsHidden() || visibility_ == Visibility::VISIBLE)
|
||||
+ if (host_->is_hidden() || visibility_ == Visibility::VISIBLE)
|
||||
+ OnShowWithPageVisibility(page_visibility);
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewAura::EnsurePlatformVisibility(
|
||||
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
|
||||
index 782bed0fdc08d57eceb059f398f253fab9233b1b..f1ab5b981ea68af1b11313e67f2c5060f0a640b1 100644
|
||||
index a599bc306198de0e172134ce4623b32b8fcd72fa..4960c518d49f98b39873d166597bfb4b5619ee02 100644
|
||||
--- a/content/public/browser/render_view_host.h
|
||||
+++ b/content/public/browser/render_view_host.h
|
||||
@@ -73,6 +73,9 @@ class CONTENT_EXPORT RenderViewHost {
|
||||
@@ -74,6 +74,9 @@ class CONTENT_EXPORT RenderViewHost {
|
||||
virtual void WriteIntoTrace(
|
||||
perfetto::TracedProto<TraceProto> context) const = 0;
|
||||
|
||||
@@ -80,34 +80,34 @@ index 782bed0fdc08d57eceb059f398f253fab9233b1b..f1ab5b981ea68af1b11313e67f2c5060
|
||||
// This interface should only be implemented inside content.
|
||||
friend class RenderViewHostImpl;
|
||||
diff --git a/content/test/test_page_broadcast.h b/content/test/test_page_broadcast.h
|
||||
index 4c8d44cdb2fde8e174b78aee7defb980651da18e..f8bf421b5b32af4cd197cbf23f4bd281c3a12514 100644
|
||||
index 82ae7ab6279427e492ead6d1d386608eb9d3d844..2b79149bfcc0de968ffb45e310d697c5393f0d43 100644
|
||||
--- a/content/test/test_page_broadcast.h
|
||||
+++ b/content/test/test_page_broadcast.h
|
||||
@@ -52,6 +52,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
void UpdateColorProviders(
|
||||
@@ -53,6 +53,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
const blink::ColorProviderColorMaps& color_provider_colors) override;
|
||||
void SetSupportsDraggableRegions(bool supports_draggable_regions) override;
|
||||
void UpdateCanvasNoiseToken(
|
||||
std::optional<blink::NoiseToken> canvas_noise_token) override;
|
||||
+ void SetSchedulerThrottling(bool allowed) override {}
|
||||
|
||||
mojo::AssociatedReceiver<blink::mojom::PageBroadcast> receiver_;
|
||||
};
|
||||
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
|
||||
index b00bc8a8a5044fbf46f627f9db56cea7f09d7ef6..114c3a4522d11c1348f681af500c487ccd97eea9 100644
|
||||
index e7be05ec6dc5f517b4a6f849a262d12dc6c1ca3d..5f4f425c77c8aadf269edfaec658a8d2ad74b2cd 100644
|
||||
--- a/third_party/blink/public/mojom/page/page.mojom
|
||||
+++ b/third_party/blink/public/mojom/page/page.mojom
|
||||
@@ -180,4 +180,7 @@ interface PageBroadcast {
|
||||
// Indicates that the page's main frame should collect draggable regions set
|
||||
// using the app-region CSS property.
|
||||
SetSupportsDraggableRegions(bool supports_draggable_regions);
|
||||
@@ -182,4 +182,7 @@ interface PageBroadcast {
|
||||
// the noise token at ReadyToCommit time and update blink::WebViews that
|
||||
// were made at request time.
|
||||
UpdateCanvasNoiseToken(blink.mojom.NoiseToken? canvas_noise_token);
|
||||
+
|
||||
+ // 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 7f995dc1fab7a1b5319f6fe9bb4d37b3851dbf87..58c93c5acf9f63eb3391fafe2904b20284381a85 100644
|
||||
index 9c0fe6ad62872f05cfb1179b4b979139008976d2..6aca43e61ef7f1caea74c30e5c3ce4496d4c4188 100644
|
||||
--- a/third_party/blink/public/web/web_view.h
|
||||
+++ b/third_party/blink/public/web/web_view.h
|
||||
@@ -361,6 +361,7 @@ class BLINK_EXPORT WebView {
|
||||
@@ -366,6 +366,7 @@ class BLINK_EXPORT WebView {
|
||||
// Scheduling -----------------------------------------------------------
|
||||
|
||||
virtual PageScheduler* Scheduler() const = 0;
|
||||
@@ -116,10 +116,10 @@ index 7f995dc1fab7a1b5319f6fe9bb4d37b3851dbf87..58c93c5acf9f63eb3391fafe2904b202
|
||||
// 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 48a7bc14663edceaca00a397e528c50a96f7613f..1ba451388e2c8a702a3709d82456c32e6423c9b0 100644
|
||||
index cd57d63a452cb4444d5d0b11b06c65c5bc11f5f1..68a102327e22302587f7cc402cb26ef2f02b261e 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2511,6 +2511,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -2504,6 +2504,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
|
||||
"old_state", old_state, "new_state", new_state);
|
||||
|
||||
@@ -130,7 +130,7 @@ index 48a7bc14663edceaca00a397e528c50a96f7613f..1ba451388e2c8a702a3709d82456c32e
|
||||
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
|
||||
!old_state->is_in_back_forward_cache;
|
||||
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
|
||||
@@ -4021,10 +4025,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -4012,10 +4016,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -155,10 +155,10 @@ index 48a7bc14663edceaca00a397e528c50a96f7613f..1ba451388e2c8a702a3709d82456c32e
|
||||
// Do not throttle if the page should be painting.
|
||||
bool is_visible =
|
||||
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 973f9acb6186a24aeb6343ac4d868883e98cdf52..a3860649929fc0cff9680191ed9367fc68462fd3 100644
|
||||
index 7879bd064e9ef324e12b5c2f522f9c8a4fa29ad5..950df20815a607b678e0e67a19d22d37b579b85d 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -447,6 +447,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -450,6 +450,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
LocalDOMWindow* PagePopupWindow() const;
|
||||
|
||||
PageScheduler* Scheduler() const override;
|
||||
@@ -166,7 +166,7 @@ index 973f9acb6186a24aeb6343ac4d868883e98cdf52..a3860649929fc0cff9680191ed9367fc
|
||||
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) override;
|
||||
mojom::blink::PageVisibilityState GetVisibilityState() override;
|
||||
@@ -941,6 +942,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -943,6 +944,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
// If true, we send IPC messages when |preferred_size_| changes.
|
||||
bool send_preferred_size_changes_ = false;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ so we can remove this patch once we migrate our code to use
|
||||
os_crypt async.
|
||||
|
||||
diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn
|
||||
index 23aa391aaf380f87310fb295277809f8b105d6e8..bb308187837371ecfa2482affaf35ac7ed98c1f3 100644
|
||||
index 81fc444043b67858371142075f98ad9aff162fc3..7ab1c6d1422e19afa603d9b3eeeb30044fb9c7b3 100644
|
||||
--- a/components/os_crypt/sync/BUILD.gn
|
||||
+++ b/components/os_crypt/sync/BUILD.gn
|
||||
@@ -10,6 +10,7 @@ import("//components/os_crypt/sync/features.gni")
|
||||
@@ -19,5 +19,5 @@ index 23aa391aaf380f87310fb295277809f8b105d6e8..bb308187837371ecfa2482affaf35ac7
|
||||
visibility = [
|
||||
+ "//electron:*",
|
||||
"//chrome/browser",
|
||||
"//chrome/test:test_support",
|
||||
"//components/os_crypt/async/browser:dpapi_key_provider",
|
||||
"//chrome/browser/prefs:impl",
|
||||
"//chrome/browser/ui",
|
||||
|
||||
@@ -8,10 +8,10 @@ WebPreferences of in-process child windows, rather than relying on
|
||||
process-level command line switches, as before.
|
||||
|
||||
diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
index 11e6b9d984eb95adfeb8675d487002fa1ac851bd..081cf9d03cb9db13113b604af104afbe9030e5c8 100644
|
||||
index c0362530043cdaffc008d0c90d55cb9522db1557..3eb37d797feccdbb2a9d4b4f26e222b6f837b802 100644
|
||||
--- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
+++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
@@ -150,6 +150,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -148,6 +148,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
out->v8_cache_options = data.v8_cache_options();
|
||||
out->record_whole_document = data.record_whole_document();
|
||||
out->stylus_handwriting_enabled = data.stylus_handwriting_enabled();
|
||||
@@ -32,7 +32,7 @@ index 11e6b9d984eb95adfeb8675d487002fa1ac851bd..081cf9d03cb9db13113b604af104afbe
|
||||
out->accelerated_video_decode_enabled =
|
||||
data.accelerated_video_decode_enabled();
|
||||
diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
index 1ba0466171963503d412b8aeb37d5953b3bbda9d..34654a186c0dc1715ac217d4c1480e6c36897e93 100644
|
||||
index 30572628d5d221e58159391f6bfd8e01525291bd..6020cce84810b9515298b65880091ebb97559688 100644
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -43,8 +43,8 @@ index 1ba0466171963503d412b8aeb37d5953b3bbda9d..34654a186c0dc1715ac217d4c1480e6c
|
||||
#include "build/build_config.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -466,6 +467,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
bool should_screenshot_on_mainframe_same_doc_navigation = true;
|
||||
@@ -464,6 +465,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
bool increment_local_surface_id_for_mainframe_same_doc_navigation = true;
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
+ // Begin Electron-specific WebPreferences.
|
||||
@@ -64,7 +64,7 @@ index 1ba0466171963503d412b8aeb37d5953b3bbda9d..34654a186c0dc1715ac217d4c1480e6c
|
||||
// chrome, except for the cases where it would require lots of extra work for
|
||||
// the embedder to use the same default value.
|
||||
diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
index 53cfdb6a2739aedef3c72fc2e43709dd5a673c79..045b43f48a619234a8c0c4c76aea1025c10f193d 100644
|
||||
index ccba9b7353c87d2e2bced7770920c976865c0d65..4d93ef8c1976cf533c32bc9c17dbf6b81f2b59c6 100644
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
@@ -8,6 +8,7 @@
|
||||
@@ -75,7 +75,7 @@ index 53cfdb6a2739aedef3c72fc2e43709dd5a673c79..045b43f48a619234a8c0c4c76aea1025
|
||||
#include "mojo/public/cpp/bindings/struct_traits.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -439,6 +440,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -434,6 +435,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
return r.stylus_handwriting_enabled;
|
||||
}
|
||||
|
||||
@@ -129,18 +129,22 @@ index 53cfdb6a2739aedef3c72fc2e43709dd5a673c79..045b43f48a619234a8c0c4c76aea1025
|
||||
return r.cookie_enabled;
|
||||
}
|
||||
diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
index 58b674f1848a5a70d08323d6f734794218d6ea8e..7011b1b7a754bfc2be30cf4eb07a32134d218359 100644
|
||||
index 9827715ad3cd306a0ec18fb6b2936ecf8677af21..66cbaf3a5b19a38295cad04d0e978de417984370 100644
|
||||
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
module blink.mojom;
|
||||
|
||||
@@ -8,9 +8,11 @@ import "third_party/blink/public/mojom/css/preferred_color_scheme.mojom";
|
||||
import "third_party/blink/public/mojom/css/preferred_contrast.mojom";
|
||||
import "third_party/blink/public/mojom/v8_cache_options.mojom";
|
||||
import "url/mojom/url.mojom";
|
||||
+import "mojo/public/mojom/base/file_path.mojom";
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "skia/public/mojom/skcolor.mojom";
|
||||
import "third_party/blink/public/mojom/css/preferred_color_scheme.mojom";
|
||||
@@ -224,6 +225,19 @@ struct WebPreferences {
|
||||
|
||||
+
|
||||
enum PointerType {
|
||||
kPointerNone = 1, // 1 << 0
|
||||
kPointerFirstType = kPointerNone,
|
||||
@@ -217,6 +219,19 @@ struct WebPreferences {
|
||||
// If true, stylus handwriting recognition to text input will be available in
|
||||
// editable input fields which are non-password type.
|
||||
bool stylus_handwriting_enabled;
|
||||
|
||||
@@ -15,7 +15,7 @@ Refs changes in:
|
||||
This patch reverts the changes to fix associated crashes in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
|
||||
index 2670ea1361ccd8a9e3bac507e94dd25b7205ecf9..c12f78d925e4ccb4ac2fd3851a9c61e87058dc75 100644
|
||||
index cdb5b9246087b5678cf6a0f2713f6238dafc13de..7efbe7524c5ddd3785fff0e2d8901f931f024f48 100644
|
||||
--- a/third_party/blink/renderer/core/frame/frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/frame.cc
|
||||
@@ -134,14 +134,6 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
@@ -49,10 +49,10 @@ index 2670ea1361ccd8a9e3bac507e94dd25b7205ecf9..c12f78d925e4ccb4ac2fd3851a9c61e8
|
||||
// its owning reference back to our owning LocalFrame.
|
||||
client_->Detached(type);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index ad61f3b044e8ce7591cfe7484af8e3b0c7705673..f42b5f8c7676cda5d73ee035e18165acabb186f3 100644
|
||||
index 72f642cb098bb6bbb445b49823663a7deb316842..902f472c8c52dd4fe52f46fbb97034b041153f65 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -747,10 +747,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -751,10 +751,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
DCHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -63,7 +63,7 @@ index ad61f3b044e8ce7591cfe7484af8e3b0c7705673..f42b5f8c7676cda5d73ee035e18165ac
|
||||
if (!Client())
|
||||
return false;
|
||||
|
||||
@@ -804,6 +800,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -808,6 +804,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
DCHECK(!view_->IsAttached());
|
||||
Client()->WillBeDetached();
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us
|
||||
to introduce a new Electron category for Electron-specific tracing.
|
||||
|
||||
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
|
||||
index 404faaae45884e2347fb3a7a2d77c7b95c7f6b43..e63bfce2d65a2015993de91630928029288738f4 100644
|
||||
index 67b5911d7815b47aafe1df1030c96a903e495df1..4813b0dc361219ad30a7e745a7906fa396c3950c 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -131,6 +131,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
|
||||
@@ -128,6 +128,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
|
||||
perfetto::Category("drm"),
|
||||
perfetto::Category("drmcursor"),
|
||||
perfetto::Category("dwrite"),
|
||||
|
||||
@@ -10,10 +10,10 @@ Needed for:
|
||||
2) //electron/shell/common:web_contents_utility
|
||||
|
||||
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn
|
||||
index 49f3360c3d5ff66ebbc7d6164de3f7ff7244b1fe..ec9018d38520dfca461e9dbb041566b0b3400133 100644
|
||||
index 8e91c465c68bec818253820ecaeeb7c3feb180a2..fea8bb9f87c007775a2bb6e1abe1ec498a8b19b4 100644
|
||||
--- a/content/public/common/BUILD.gn
|
||||
+++ b/content/public/common/BUILD.gn
|
||||
@@ -362,6 +362,8 @@ mojom("interfaces") {
|
||||
@@ -371,6 +371,8 @@ mojom("interfaces") {
|
||||
"//content/common/*",
|
||||
"//extensions/common:mojom",
|
||||
"//extensions/common:mojom_blink",
|
||||
|
||||
@@ -11,7 +11,7 @@ This patch can (and should) be removed when we can prevent those symbols
|
||||
from being stripped in the release build.
|
||||
|
||||
diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
|
||||
index 2cf6def300d9d92d476ca4ca792347a49bafc26a..8e54f1d3e50a2c56b0cf35a8e56f97f6622401d5 100644
|
||||
index 21bd22896d7bca4d4a133677286f7f8ad1b224f2..53654e4467fa4ae57ce42bd971b1be3a11654aaf 100644
|
||||
--- a/build/config/compiler/compiler.gni
|
||||
+++ b/build/config/compiler/compiler.gni
|
||||
@@ -85,7 +85,7 @@ declare_args() {
|
||||
|
||||
@@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
|
||||
patch.
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index 606b3bd43179a5b4179a6ec9f58e531d55c1acb5..4d503a53290b4deaea016bb6867f3c07920f4055 100644
|
||||
index e648bb4ed2ff72441faa8773e449e0b6174f5af5..fd2c1d3ac575d10de7d5c09e4418d17217a43b77 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -196,11 +196,16 @@ if (!is_android && !is_mac) {
|
||||
@@ -195,11 +195,16 @@ if (!is_android && !is_mac) {
|
||||
"common/crash_keys.h",
|
||||
]
|
||||
|
||||
@@ -33,10 +33,10 @@ index 606b3bd43179a5b4179a6ec9f58e531d55c1acb5..4d503a53290b4deaea016bb6867f3c07
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 1b6ba974b641ba9f352cf15e311fa93e1268b06c..f26b6e92617a6df6f8adb1bce51f26f06e66c701 100644
|
||||
index 790764062094479f25b33a0dfa3e143472e0a077..a9997872138b2d58d279103e4cac3c92f2091f0a 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4825,7 +4825,7 @@ static_library("browser") {
|
||||
@@ -4807,7 +4807,7 @@ static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 1b6ba974b641ba9f352cf15e311fa93e1268b06c..f26b6e92617a6df6f8adb1bce51f26f0
|
||||
# than here in :chrome_dll.
|
||||
deps += [ "//chrome:packed_resources_integrity_header" ]
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index f99c95ff5d2bab35f4976c1bb9d39fc83de2494a..f124fc3885e509df46e8d8653ffb97f8b0b25060 100644
|
||||
index 8bcc85cfd507f23c9651ea0a006fd6464ecd134f..92e88e0c8f764a779d7c899b423b589a0302b4bd 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7595,9 +7595,12 @@ test("unit_tests") {
|
||||
@@ -7516,9 +7516,12 @@ test("unit_tests") {
|
||||
"//chrome/notification_helper",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index f99c95ff5d2bab35f4976c1bb9d39fc83de2494a..f124fc3885e509df46e8d8653ffb97f8
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -8539,6 +8542,10 @@ test("unit_tests") {
|
||||
@@ -8430,6 +8433,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index f99c95ff5d2bab35f4976c1bb9d39fc83de2494a..f124fc3885e509df46e8d8653ffb97f8
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8595,7 +8602,6 @@ test("unit_tests") {
|
||||
@@ -8486,7 +8493,6 @@ test("unit_tests") {
|
||||
# TODO(crbug.com/417513088): Maybe merge with the non-android `deps` declaration above?
|
||||
deps += [
|
||||
"../browser/screen_ai:screen_ai_install_state",
|
||||
|
||||
@@ -7,7 +7,7 @@ These are variables we add to the root BUILDCONFIG so that they're available
|
||||
everywhere, without having to import("//electron/.../flags.gni").
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index 749662ebf2e8f271400f4015f5503378f42ef2b4..f974d8048ca21371865bcae56e8e687529e0be4b 100644
|
||||
index 24a1d143954ae05ae0b79b0994b76ef9218fb848..5c9b2ed8ba48a1056560ca1cd1d5b976aee4815c 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user