mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
203 Commits
roller/chr
...
v36.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b822478057 | ||
|
|
366daf192a | ||
|
|
7779b6a4ad | ||
|
|
695448e142 | ||
|
|
fdc322c93f | ||
|
|
13fe994d0d | ||
|
|
7240a14126 | ||
|
|
3f23f01762 | ||
|
|
5223225fb5 | ||
|
|
5045ba29a5 | ||
|
|
c27bd7bb3c | ||
|
|
aada99e53d | ||
|
|
1b596f6261 | ||
|
|
bac01a33cd | ||
|
|
bb4ab67e52 | ||
|
|
17e1ff2675 | ||
|
|
1687b95849 | ||
|
|
3d4a4b9343 | ||
|
|
c24f330b45 | ||
|
|
ee65ab75f5 | ||
|
|
77b945dd0a | ||
|
|
643b35503f | ||
|
|
98380468bb | ||
|
|
069ca16b9e | ||
|
|
dcd8224c15 | ||
|
|
65081e8939 | ||
|
|
6bb07bf277 | ||
|
|
698bff0efa | ||
|
|
34adb976b6 | ||
|
|
5c2f70c1d5 | ||
|
|
3981c173ef | ||
|
|
61d6872dcf | ||
|
|
1a797beeea | ||
|
|
66f55ead4e | ||
|
|
108fdac02c | ||
|
|
d52670c749 | ||
|
|
5dab95335b | ||
|
|
c4302ab58c | ||
|
|
197444181d | ||
|
|
02e4e109d5 | ||
|
|
08a4c333a3 | ||
|
|
5a4ef1cc33 | ||
|
|
4e8c09f46a | ||
|
|
fc319e0ea3 | ||
|
|
2629b31c19 | ||
|
|
11c820c537 | ||
|
|
07a7ebb714 | ||
|
|
b0d4c12247 | ||
|
|
8f40f8126e | ||
|
|
b821cf1adc | ||
|
|
3f8340d9f3 | ||
|
|
0e30f5e2a1 | ||
|
|
fdc6a3b108 | ||
|
|
3348ac08b4 | ||
|
|
e8188ef271 | ||
|
|
2960f93ea5 | ||
|
|
361753f61f | ||
|
|
ec75ddd715 | ||
|
|
301f7b4e64 | ||
|
|
7b66361ca8 | ||
|
|
f8a55100cc | ||
|
|
c785b40703 | ||
|
|
339e0040ef | ||
|
|
e825107f8a | ||
|
|
53633fcaeb | ||
|
|
285d347b51 | ||
|
|
a2ee5547e0 | ||
|
|
b518e4ad36 | ||
|
|
9d3696e4b3 | ||
|
|
22b6eefc50 | ||
|
|
70fd706ea4 | ||
|
|
8b3c52f242 | ||
|
|
33fafd508c | ||
|
|
28eb0e6f3d | ||
|
|
b234733555 | ||
|
|
ffb4f0f812 | ||
|
|
33964528e1 | ||
|
|
4f54c91ee2 | ||
|
|
3fdcd38b8b | ||
|
|
feaa9ec5b9 | ||
|
|
de933233e6 | ||
|
|
1046842f73 | ||
|
|
2dd4b77ae0 | ||
|
|
5942ac580b | ||
|
|
ec34d8ee49 | ||
|
|
64c9afcf77 | ||
|
|
4392cb9434 | ||
|
|
c3b5e5527f | ||
|
|
31e3c84843 | ||
|
|
42514326ca | ||
|
|
7be433c0b7 | ||
|
|
c92412761d | ||
|
|
4e3baa4d8e | ||
|
|
10fb533bc3 | ||
|
|
3d8df7684b | ||
|
|
5a6ed32592 | ||
|
|
99c3728a93 | ||
|
|
e0a24f08a1 | ||
|
|
0cb42911ea | ||
|
|
8fec7adfa6 | ||
|
|
30ccda8ba0 | ||
|
|
3acd5774da | ||
|
|
a0ac690881 | ||
|
|
7299dd1501 | ||
|
|
92b03cb91f | ||
|
|
01ce103ae1 | ||
|
|
58b2c2e651 | ||
|
|
4db5a2a2b2 | ||
|
|
6126cc2bfe | ||
|
|
33eff16e9a | ||
|
|
e2b9cedf0f | ||
|
|
75e44e5f05 | ||
|
|
71e53c925e | ||
|
|
17487df08d | ||
|
|
6b1d1bf893 | ||
|
|
8327ed0eea | ||
|
|
7e80e8f610 | ||
|
|
33df588e8e | ||
|
|
45c78deff8 | ||
|
|
b647c8935d | ||
|
|
11c35626da | ||
|
|
f78a66d988 | ||
|
|
200550da3c | ||
|
|
cb7335b4f0 | ||
|
|
b4fc140f1a | ||
|
|
c89bebdee1 | ||
|
|
4df1063e30 | ||
|
|
8b05b6e59b | ||
|
|
71f17fcf5b | ||
|
|
bf87315ae8 | ||
|
|
dde045db9c | ||
|
|
3ff5c4ea5f | ||
|
|
32c352bff5 | ||
|
|
3e2aa2f443 | ||
|
|
12d11c09a1 | ||
|
|
06ad763412 | ||
|
|
5b9f71602d | ||
|
|
bb882b4f3d | ||
|
|
9efacb6147 | ||
|
|
5cddcdf190 | ||
|
|
25e5055065 | ||
|
|
6f3c9fcf99 | ||
|
|
7ee88bbdcb | ||
|
|
96197d9597 | ||
|
|
7d2c27c83e | ||
|
|
32a341288c | ||
|
|
2466232460 | ||
|
|
a5579fb71f | ||
|
|
76fa5b7af1 | ||
|
|
e1b2b8ef0c | ||
|
|
243016b31e | ||
|
|
5f0be2e153 | ||
|
|
6d2c7c2ab3 | ||
|
|
c4e0cae3ee | ||
|
|
7e0d84f19c | ||
|
|
dea35330c0 | ||
|
|
7f85c85b71 | ||
|
|
4b0d49898f | ||
|
|
6927f649ee | ||
|
|
33bde96d73 | ||
|
|
3772e267c3 | ||
|
|
b7a28f31d8 | ||
|
|
1ba56c8696 | ||
|
|
cee2c2ceeb | ||
|
|
b3526da28e | ||
|
|
d23aaadcd5 | ||
|
|
ef22986d1d | ||
|
|
b0d207e384 | ||
|
|
1424da9131 | ||
|
|
29ead1bc25 | ||
|
|
859cff24ec | ||
|
|
0ba2441963 | ||
|
|
7ea2daf456 | ||
|
|
bc9389df9a | ||
|
|
9716b6623e | ||
|
|
56fced3d0d | ||
|
|
3faedae91c | ||
|
|
463e0d0ab7 | ||
|
|
c5310fff80 | ||
|
|
4b72738b41 | ||
|
|
585075d776 | ||
|
|
c87fd357fc | ||
|
|
a1ec212049 | ||
|
|
a3af41674f | ||
|
|
5c73799f52 | ||
|
|
8275f7e402 | ||
|
|
0ea8decb0a | ||
|
|
515f5847e1 | ||
|
|
1fc3a60655 | ||
|
|
3e5cabde39 | ||
|
|
98adbbb593 | ||
|
|
c62db7d49d | ||
|
|
313aee6cbb | ||
|
|
9f0fb54918 | ||
|
|
c39683b2cb | ||
|
|
0e8300399d | ||
|
|
ca91235c51 | ||
|
|
f90de88c63 | ||
|
|
d41ed8a118 | ||
|
|
daa37826f8 | ||
|
|
e74e1ab4c5 | ||
|
|
7d0f24420f | ||
|
|
d1663a5ac6 |
@@ -2,7 +2,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
buildtools:
|
||||
image: ghcr.io/electron/devcontainer:77262e58c37631ab082482f42c33cdf68c6c394b
|
||||
image: ghcr.io/electron/devcontainer:424eedbf277ad9749ffa9219068aa72ed4a5e373
|
||||
|
||||
volumes:
|
||||
- ..:/workspaces/gclient/src/electron:cached
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -13,7 +13,7 @@ Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.
|
||||
- [ ] PR description included and stakeholders cc'd
|
||||
- [ ] `npm test` passes
|
||||
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
|
||||
- [ ] relevant documentation, tutorials, templates and examples are changed or added
|
||||
- [ ] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
|
||||
- [ ] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).
|
||||
|
||||
#### Release Notes
|
||||
|
||||
64
.github/actions/checkout/action.yml
vendored
64
.github/actions/checkout/action.yml
vendored
@@ -9,6 +9,8 @@ inputs:
|
||||
description: 'Whether to persist the cache to the shared drive'
|
||||
required: false
|
||||
default: 'true'
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
@@ -18,40 +20,34 @@ runs:
|
||||
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Get Depot Tools
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ ! -d depot_tools ]]; then
|
||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
fi
|
||||
- name: Add Depot Tools to PATH
|
||||
shell: bash
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Generate DEPS Hash
|
||||
shell: bash
|
||||
run: |
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
echo "DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||
DEPSHASH="v1-src-cache-$(cat src/electron/.depshash)"
|
||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||
echo "CACHE_FILE=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
echo "CACHE_DRIVE=/mnt/win-cache" >> $GITHUB_ENV
|
||||
else
|
||||
echo "CACHE_DRIVE=/mnt/cross-instance-cache" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: Generate SAS Key
|
||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$DEPSHASH.tar" > sas-token
|
||||
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$CACHE_FILE?platform=${{ inputs.target-platform }}" > sas-token
|
||||
- name: Save SAS Key
|
||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
|
||||
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||
with:
|
||||
path: |
|
||||
sas-token
|
||||
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
path: sas-token
|
||||
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Check If Cache Exists
|
||||
id: check-cache
|
||||
shell: bash
|
||||
@@ -60,7 +56,7 @@ runs:
|
||||
echo "Not using cache this time..."
|
||||
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
cache_path=$CACHE_DRIVE/$CACHE_FILE
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking for cache in: $cache_path"
|
||||
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
||||
@@ -76,8 +72,8 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
# if there is less than 35 GB free space then creating the cache might fail so exit early
|
||||
freespace=`df -m /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
||||
freespace_human=`df -h /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
||||
freespace=`df -m $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
|
||||
freespace_human=`df -h $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
|
||||
if [ $freespace -le 35000 ]; then
|
||||
echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
|
||||
exit 1
|
||||
@@ -99,7 +95,7 @@ runs:
|
||||
fi
|
||||
|
||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vv
|
||||
if [ "${{ inputs.is-release }}" != "true" && -n "${{ env.PATCH_UP_APP_CREDS }}" ]; then
|
||||
if [[ "${{ inputs.is-release }}" != "true" ]]; then
|
||||
# Re-export all the patches to check if there were changes.
|
||||
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||
cd src/electron
|
||||
@@ -128,6 +124,8 @@ runs:
|
||||
cat ../../patches/update-patches.patch
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "No changes to patches detected"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -165,14 +163,14 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
|
||||
tar -cf $DEPSHASH.tar src
|
||||
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
|
||||
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
|
||||
tar -cf $CACHE_FILE src
|
||||
echo "Compressed src to $(du -sh $CACHE_FILE | cut -f1 -d' ')"
|
||||
cp ./$CACHE_FILE $CACHE_DRIVE/
|
||||
- name: Persist Src Cache
|
||||
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
final_cache_path=$CACHE_DRIVE/$CACHE_FILE
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking path: $final_cache_path"
|
||||
if [ ! -f "$final_cache_path" ]; then
|
||||
@@ -181,3 +179,11 @@ runs:
|
||||
else
|
||||
echo "Cache key persisted in $final_cache_path"
|
||||
fi
|
||||
- name: Wait for active SSH sessions
|
||||
shell: bash
|
||||
if: always() && !cancelled()
|
||||
run: |
|
||||
while [ -f /var/.ssh-lock ]
|
||||
do
|
||||
sleep 60
|
||||
done
|
||||
|
||||
40
.github/actions/cipd-install/action.yml
vendored
Normal file
40
.github/actions/cipd-install/action.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: 'CIPD install'
|
||||
description: 'Installs the specified CIPD package'
|
||||
inputs:
|
||||
cipd-root-prefix-path:
|
||||
description: 'Path to prepend to installation directory'
|
||||
default: ''
|
||||
dependency:
|
||||
description: 'Name of dependency to install'
|
||||
deps-file:
|
||||
description: 'Location of DEPS file that defines the dependency'
|
||||
installation-dir:
|
||||
description: 'Location to install dependency'
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
package:
|
||||
description: 'Package to install'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Delete wrong ${{ inputs.dependency }}
|
||||
shell: bash
|
||||
run : |
|
||||
rm -rf ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }}
|
||||
- name: Create ensure file for ${{ inputs.dependency }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo '${{ inputs.package }}' `e d gclient getdep --deps-file=${{ inputs.deps-file }} -r '${{ inputs.installation-dir }}:${{ inputs.package }}'` > ${{ inputs.dependency }}_ensure_file
|
||||
cat ${{ inputs.dependency }}_ensure_file
|
||||
- name: CIPD installation of ${{ inputs.dependency }} (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "ensuring ${{ inputs.dependency }} on macOS"
|
||||
e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
|
||||
- name: CIPD installation of ${{ inputs.dependency }} (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
echo "ensuring ${{ inputs.dependency }} on Windows"
|
||||
e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
|
||||
61
.github/actions/fix-sync-macos/action.yml
vendored
61
.github/actions/fix-sync-macos/action.yml
vendored
@@ -1,61 +0,0 @@
|
||||
name: 'Fix Sync macOS'
|
||||
description: 'Checks out Electron and stores it in the AKS Cache'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Fix Sync
|
||||
shell: bash
|
||||
# This step is required to correct for differences between "gclient sync"
|
||||
# on Linux and the expected state on macOS. This requires:
|
||||
# 1. Fixing Clang Install (wrong binary)
|
||||
# 2. Fixing esbuild (wrong binary)
|
||||
# 3. Fixing rustc (wrong binary)
|
||||
# 4. Fixing gn (wrong binary)
|
||||
# 5. Fix reclient (wrong binary)
|
||||
# 6. Fixing dsymutil (wrong binary)
|
||||
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
||||
# 8. Fixing angle (wrong remote)
|
||||
run : |
|
||||
SEDOPTION="-i ''"
|
||||
rm -rf src/third_party/llvm-build
|
||||
python3 src/tools/clang/scripts/update.py
|
||||
|
||||
echo 'infra/3pp/tools/esbuild/${platform}' `gclient getdep --deps-file=src/third_party/devtools-frontend/src/DEPS -r 'third_party/esbuild:infra/3pp/tools/esbuild/${platform}'` > esbuild_ensure_file
|
||||
# Remove extra output from calling gclient getdep which always calls update_depot_tools
|
||||
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
|
||||
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
|
||||
|
||||
rm -rf src/third_party/rust-toolchain
|
||||
python3 src/tools/rust/update_rust.py
|
||||
|
||||
# Prevent calling gclient getdep which always calls update_depot_tools
|
||||
echo 'gn/gn/mac-${arch}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/mac:gn/gn/mac-${arch}'` > gn_ensure_file
|
||||
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
||||
cipd ensure --root src/buildtools/mac -ensure-file gn_ensure_file
|
||||
|
||||
# Prevent calling gclient getdep which always calls update_depot_tools
|
||||
echo 'infra/rbe/client/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/reclient:infra/rbe/client/${platform}'` > gn_ensure_file
|
||||
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
||||
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
|
||||
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
||||
|
||||
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
||||
else
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
||||
fi
|
||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
||||
|
||||
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
|
||||
sed $SEDOPTION "s/Updating depot_tools... //g" ninja_ensure_file
|
||||
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
|
||||
|
||||
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
||||
|
||||
cd src/third_party/angle
|
||||
rm -f .git/objects/info/alternates
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
cp .git/config .git/config.backup
|
||||
git remote remove origin
|
||||
mv .git/config.backup .git/config
|
||||
git fetch
|
||||
120
.github/actions/fix-sync/action.yml
vendored
Normal file
120
.github/actions/fix-sync/action.yml
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
name: 'Fix Sync'
|
||||
description: 'Ensures proper binaries are in place'
|
||||
# This action is required to correct for differences between "gclient sync"
|
||||
# on Linux and the expected state on macOS/windows. This requires:
|
||||
# 1. Fixing Clang Install (wrong binary)
|
||||
# 2. Fixing esbuild (wrong binary)
|
||||
# 3. Fixing rustc (wrong binary)
|
||||
# 4. Fixing gn (wrong binary)
|
||||
# 5. Fix reclient (wrong binary)
|
||||
# 6. Fixing dsymutil (wrong binary)
|
||||
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
||||
# 8. Fixing angle (wrong remote)
|
||||
# 9. Install windows toolchain on Windows
|
||||
# 10. Fix node binary on Windows
|
||||
# 11. Fix rc binary on Windows
|
||||
inputs:
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Fix clang
|
||||
shell: bash
|
||||
run : |
|
||||
rm -rf src/third_party/llvm-build
|
||||
python3 src/tools/clang/scripts/update.py
|
||||
- name: Fix esbuild
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
cipd-root-prefix-path: src/third_party/devtools-frontend/src/
|
||||
dependency: esbuild
|
||||
deps-file: src/third_party/devtools-frontend/src/DEPS
|
||||
installation-dir: third_party/esbuild
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: infra/3pp/tools/esbuild/${platform}
|
||||
- name: Fix rustc
|
||||
shell: bash
|
||||
run : |
|
||||
rm -rf src/third_party/rust-toolchain
|
||||
python3 src/tools/rust/update_rust.py
|
||||
- name: Fix gn (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: gn
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/buildtools/mac
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: gn/gn/mac-${arch}
|
||||
- name: Fix gn (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: gn
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/buildtools/win
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: gn/gn/windows-amd64
|
||||
- name: Fix reclient
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: reclient
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/buildtools/reclient
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: infra/rbe/client/${platform}
|
||||
- name: Configure reclient configs
|
||||
shell: bash
|
||||
run : |
|
||||
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
||||
- name: Fix dsymutil (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
run : |
|
||||
# Fix dsymutil
|
||||
if [ "${{ inputs.target-platform }}" = "macos" ]; then
|
||||
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
||||
else
|
||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
||||
fi
|
||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
||||
fi
|
||||
- name: Fix ninja
|
||||
uses: ./src/electron/.github/actions/cipd-install
|
||||
with:
|
||||
dependency: ninja
|
||||
deps-file: src/DEPS
|
||||
installation-dir: src/third_party/ninja
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
package: infra/3pp/tools/ninja/${platform}
|
||||
- name: Set ninja in path
|
||||
shell: bash
|
||||
run : |
|
||||
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
||||
- name: Fixup angle git
|
||||
shell: bash
|
||||
run : |
|
||||
cd src/third_party/angle
|
||||
rm -f .git/objects/info/alternates
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
cp .git/config .git/config.backup
|
||||
git remote remove origin
|
||||
mv .git/config.backup .git/config
|
||||
git fetch
|
||||
- name: Get Windows toolchain
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: e d vpython3 src\build\vs_toolchain.py update --force
|
||||
- name: Download nodejs
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
$nodedeps = e d gclient getdep --deps-file=src/DEPS -r src/third_party/node/win | ConvertFrom-JSON
|
||||
python3 src\third_party\depot_tools\download_from_google_storage.py --no_resume --no_auth --bucket chromium-nodejs -o src\third_party\node\win\node.exe $nodedeps.object_name
|
||||
- name: Install rc
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: bash
|
||||
run: |
|
||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1
|
||||
@@ -10,11 +10,16 @@ runs:
|
||||
git config --global core.filemode false
|
||||
git config --global core.autocrlf false
|
||||
git config --global branch.autosetuprebase always
|
||||
git config --global core.fscache true
|
||||
git config --global core.preloadindex true
|
||||
fi
|
||||
export BUILD_TOOLS_SHA=8246e57791b0af4ae5975eb96f09855f9269b1cd
|
||||
export BUILD_TOOLS_SHA=6e8526315ea3b4828882497e532b8340e64e053c
|
||||
npm i -g @electron/build-tools
|
||||
e auto-update disable
|
||||
e d auto-update disable
|
||||
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||
e d cipd.bat --version
|
||||
cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
|
||||
fi
|
||||
echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH
|
||||
echo "$HOME/.electron_build_tools/third_party/depot_tools/python-bin" >> $GITHUB_PATH
|
||||
|
||||
10
.github/actions/restore-cache-aks/action.yml
vendored
10
.github/actions/restore-cache-aks/action.yml
vendored
@@ -1,12 +1,20 @@
|
||||
name: 'Restore Cache AKS'
|
||||
description: 'Restores Electron src cache via AKS'
|
||||
inputs:
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Restore and Ensure Src Cache
|
||||
shell: bash
|
||||
run: |
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
cache_path=/mnt/win-cache/$DEPSHASH.tar
|
||||
else
|
||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||
fi
|
||||
|
||||
echo "Using cache key: $DEPSHASH"
|
||||
echo "Checking for cache in: $cache_path"
|
||||
if [ ! -f "$cache_path" ]; then
|
||||
|
||||
75
.github/actions/restore-cache-azcopy/action.yml
vendored
75
.github/actions/restore-cache-azcopy/action.yml
vendored
@@ -1,22 +1,25 @@
|
||||
name: 'Restore Cache AZCopy'
|
||||
description: 'Restores Electron src cache via AZCopy'
|
||||
inputs:
|
||||
target-platform:
|
||||
description: 'Target platform, should be linux, win, macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Obtain SAS Key
|
||||
continue-on-error: true
|
||||
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||
with:
|
||||
path: |
|
||||
sas-token
|
||||
key: sas-key-${{ github.run_number }}-1
|
||||
path: sas-token
|
||||
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-1
|
||||
enableCrossOsArchive: true
|
||||
- name: Obtain SAS Key
|
||||
continue-on-error: true
|
||||
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||
with:
|
||||
path: |
|
||||
sas-token
|
||||
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
path: sas-token
|
||||
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Download Src Cache from AKS
|
||||
# The cache will always exist here as a result of the checkout job
|
||||
# Either it was uploaded to Azure in the checkout job for this commit
|
||||
@@ -26,21 +29,30 @@ runs:
|
||||
timeout_minutes: 30
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
shell: bash
|
||||
command: |
|
||||
sas_token=$(cat sas-token)
|
||||
if [ -z $sas-token ]; then
|
||||
echo "SAS Token not found; exiting src cache download early..."
|
||||
exit 1
|
||||
else
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
azcopy copy --log-level=ERROR \
|
||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_WIN_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||
else
|
||||
azcopy copy --log-level=ERROR \
|
||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||
fi
|
||||
fi
|
||||
azcopy copy --log-level=ERROR \
|
||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||
env:
|
||||
AZURE_AKS_CACHE_STORAGE_ACCOUNT: f723719aa87a34622b5f7f3
|
||||
AZURE_AKS_CACHE_SHARE_NAME: pvc-f6a4089f-b082-4bee-a3f9-c3e1c0c02d8f
|
||||
AZURE_AKS_WIN_CACHE_SHARE_NAME: pvc-71dec4f2-0d44-4fd1-a2c3-add049d70bdf
|
||||
- name: Clean SAS Key
|
||||
shell: bash
|
||||
run: rm -f sas-token
|
||||
- name: Unzip and Ensure Src Cache
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Downloaded cache is $(du -sh $DEPSHASH.tar | cut -f1)"
|
||||
@@ -68,4 +80,45 @@ runs:
|
||||
fi
|
||||
|
||||
echo "Wiping Electron Directory"
|
||||
rm -rf src/electron
|
||||
rm -rf src/electron
|
||||
|
||||
- name: Unzip and Ensure Src Cache (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
$src_cache = "$env:DEPSHASH.tar"
|
||||
$cache_size = $(Get-Item $src_cache).length
|
||||
Write-Host "Downloaded cache is $cache_size"
|
||||
if ($cache_size -eq 0) {
|
||||
Write-Host "Cache is empty - exiting"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$TEMP_DIR=New-Item -ItemType Directory -Path temp-cache
|
||||
$TEMP_DIR_PATH = $TEMP_DIR.FullName
|
||||
C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH"
|
||||
|
||||
- name: Move Src Cache (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
|
||||
with:
|
||||
timeout_minutes: 30
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
shell: powershell
|
||||
command: |
|
||||
if (Test-Path "temp-cache\src") {
|
||||
Write-Host "Relocating Cache"
|
||||
Remove-Item -Recurse -Force src
|
||||
Move-Item temp-cache\src src
|
||||
|
||||
Write-Host "Deleting zip file"
|
||||
Remove-Item -Force $src_cache
|
||||
}
|
||||
if (-Not (Test-Path "src\third_party\blink")) {
|
||||
Write-Host "Cache was not correctly restored - exiting"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Wiping Electron Directory"
|
||||
Remove-Item -Recurse -Force src\electron
|
||||
|
||||
36
.github/actions/set-chromium-cookie/action.yml
vendored
36
.github/actions/set-chromium-cookie/action.yml
vendored
@@ -4,9 +4,14 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set the git cookie from chromium.googlesource.com (Unix)
|
||||
if: ${{ runner.os != 'Windows' && env.CHROMIUM_GIT_COOKIE }}
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ -z "${{ env.CHROMIUM_GIT_COOKIE }}" ]]; then
|
||||
echo "CHROMIUM_GIT_COOKIE is not set - cannot authenticate."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null
|
||||
touch ~/.gitcookies
|
||||
chmod 0600 ~/.gitcookies
|
||||
@@ -17,10 +22,37 @@ runs:
|
||||
${{ env.CHROMIUM_GIT_COOKIE }}
|
||||
__END__
|
||||
eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null
|
||||
|
||||
RESPONSE=$(curl -s -b ~/.gitcookies https://chromium-review.googlesource.com/a/accounts/self)
|
||||
if [[ $RESPONSE == ")]}'"* ]]; then
|
||||
# Extract account email for verification
|
||||
EMAIL=$(echo "$RESPONSE" | tail -c +5 | jq -r '.email // "No email found"')
|
||||
echo "Cookie authentication successful - authenticated as: $EMAIL"
|
||||
else
|
||||
echo "Cookie authentication failed - ensure CHROMIUM_GIT_COOKIE is set correctly"
|
||||
echo $RESPONSE
|
||||
fi
|
||||
- name: Set the git cookie from chromium.googlesource.com (Windows)
|
||||
if: ${{ runner.os == 'Windows' && env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
shell: cmd
|
||||
run: |
|
||||
if "%CHROMIUM_GIT_COOKIE_WINDOWS_STRING%"=="" (
|
||||
echo CHROMIUM_GIT_COOKIE_WINDOWS_STRING is not set - cannot authenticate.
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
|
||||
powershell -noprofile -nologo -command Write-Output "${{ env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}" >>"%USERPROFILE%\.gitcookies"
|
||||
|
||||
curl -s -b "%USERPROFILE%\.gitcookies" https://chromium-review.googlesource.com/a/accounts/self > response.txt
|
||||
|
||||
findstr /B /C:")]}'" response.txt > nul
|
||||
if %ERRORLEVEL% EQU 0 (
|
||||
echo Cookie authentication successful
|
||||
powershell -NoProfile -Command "& {$content = Get-Content -Raw response.txt; $content = $content.Substring(4); try { $json = ConvertFrom-Json $content; if($json.email) { Write-Host 'Authenticated as:' $json.email } else { Write-Host 'No email found in response' } } catch { Write-Host 'Error parsing JSON:' $_ }}"
|
||||
) else (
|
||||
echo Cookie authentication failed - ensure CHROMIUM_GIT_COOKIE_WINDOWS_STRING is set correctly
|
||||
type response.txt
|
||||
)
|
||||
|
||||
del response.txt
|
||||
|
||||
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
||||
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||
required: true
|
||||
skip-macos:
|
||||
type: boolean
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
id: set-output
|
||||
run: |
|
||||
if [ -z "${{ inputs.build-image-sha }}" ]; then
|
||||
echo "build-image-sha=bc2f48b2415a670de18d13605b1cf0eb5fdbaae1" >> "$GITHUB_OUTPUT"
|
||||
echo "build-image-sha=424eedbf277ad9749ffa9219068aa72ed4a5e373" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
@@ -115,6 +115,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: macos
|
||||
|
||||
checkout-linux:
|
||||
needs: setup
|
||||
@@ -150,7 +151,8 @@ jobs:
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /mnt/win-cache:/mnt/win-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
@@ -168,6 +170,9 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: win
|
||||
|
||||
# GN Check Jobs
|
||||
macos-gn-check:
|
||||
@@ -198,7 +203,7 @@ jobs:
|
||||
target-platform: win
|
||||
target-archs: x64 x86 arm64
|
||||
check-runs-on: electron-arc-linux-amd64-8core
|
||||
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/win-cache:/mnt/win-cache"]}'
|
||||
gn-build-type: testing
|
||||
secrets: inherit
|
||||
|
||||
@@ -326,7 +331,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
needs: checkout-windows
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
@@ -345,7 +350,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
needs: checkout-windows
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
@@ -364,7 +369,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: setup
|
||||
needs: checkout-windows
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-windows-amd64-16core
|
||||
|
||||
4
.github/workflows/clean-src-cache.yml
vendored
4
.github/workflows/clean-src-cache.yml
vendored
@@ -16,6 +16,7 @@ jobs:
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /mnt/win-cache:/mnt/win-cache
|
||||
steps:
|
||||
- name: Cleanup Source Cache
|
||||
shell: bash
|
||||
@@ -23,3 +24,6 @@ jobs:
|
||||
df -h /mnt/cross-instance-cache
|
||||
find /mnt/cross-instance-cache -type f -mtime +15 -delete
|
||||
df -h /mnt/cross-instance-cache
|
||||
df -h /mnt/win-cache
|
||||
find /mnt/win-cache -type f -mtime +15 -delete
|
||||
df -h /mnt/win-cache
|
||||
|
||||
3
.github/workflows/linux-publish.yml
vendored
3
.github/workflows/linux-publish.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
||||
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||
upload-to-storage:
|
||||
description: 'Uploads to Azure storage'
|
||||
required: false
|
||||
@@ -27,6 +27,7 @@ jobs:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
|
||||
4
.github/workflows/macos-publish.yml
vendored
4
.github/workflows/macos-publish.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
||||
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||
required: true
|
||||
upload-to-storage:
|
||||
description: 'Uploads to Azure storage'
|
||||
@@ -28,6 +28,7 @@ jobs:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
@@ -39,6 +40,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: macos
|
||||
|
||||
publish-x64-darwin:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||
|
||||
@@ -129,24 +129,8 @@ jobs:
|
||||
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
|
||||
SEDOPTION="-i"
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
SEDOPTION="-i ''"
|
||||
fi
|
||||
|
||||
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
||||
sed $SEDOPTION '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
||||
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Generate DEPS Hash
|
||||
run: |
|
||||
node src/electron/script/generate-deps-hash.js
|
||||
@@ -154,24 +138,26 @@ jobs:
|
||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||
- name: Restore src cache via AZCopy
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
if: ${{ inputs.target-platform != 'linux' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
- name: Restore src cache via AKS
|
||||
if: ${{ inputs.target-platform == 'linux' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
- name: Checkout src via gclient sync
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
use-cache: 'false'
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Fix Sync
|
||||
if: ${{ inputs.target-platform != 'linux' }}
|
||||
uses: ./src/electron/.github/actions/fix-sync
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
env:
|
||||
ELECTRON_DEPOT_TOOLS_DISABLE_LOG: true
|
||||
- name: Init Build Tools
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
@@ -184,9 +170,6 @@ jobs:
|
||||
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||
- name: Fix Sync (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/fix-sync-macos
|
||||
- name: Setup Number of Ninja Processes
|
||||
run: |
|
||||
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
|
||||
|
||||
@@ -65,7 +65,9 @@ jobs:
|
||||
sudo rm -rf $TMPDIR/del-target
|
||||
- name: Check disk space after freeing up space
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
run: df -h
|
||||
run: df -h
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Enable windows toolchain
|
||||
@@ -81,9 +83,13 @@ jobs:
|
||||
- name: Restore src cache via AZCopy
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
- name: Restore src cache via AKS
|
||||
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'win' }}
|
||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||
with:
|
||||
target-platform: ${{ inputs.target-platform }}
|
||||
- name: Run Electron Only Hooks
|
||||
run: |
|
||||
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||
|
||||
@@ -134,6 +134,8 @@ jobs:
|
||||
git config --global core.filemode false
|
||||
git config --global core.autocrlf false
|
||||
git config --global branch.autosetuprebase always
|
||||
git config --global core.fscache true
|
||||
git config --global core.preloadindex true
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
|
||||
@@ -51,6 +51,8 @@ jobs:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
@@ -58,17 +60,6 @@ jobs:
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
@@ -114,6 +105,8 @@ jobs:
|
||||
path: src/electron
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Install Build Tools
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
@@ -121,17 +114,6 @@ jobs:
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
|
||||
- name: Install Dependencies
|
||||
uses: ./src/electron/.github/actions/install-dependencies
|
||||
- name: Set Chromium Git Cookie
|
||||
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
# Ensure depot_tools does not update.
|
||||
test -d depot_tools && cd depot_tools
|
||||
touch .disable_auto_update
|
||||
- name: Add Depot Tools to PATH
|
||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||
- name: Download Generated Artifacts
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
|
||||
with:
|
||||
|
||||
9
.github/workflows/windows-publish.yml
vendored
9
.github/workflows/windows-publish.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
||||
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||
required: true
|
||||
upload-to-storage:
|
||||
description: 'Uploads to Azure storage'
|
||||
@@ -25,8 +25,10 @@ jobs:
|
||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
- /mnt/win-cache:/mnt/win-cache
|
||||
- /var/run/sas:/var/run/sas
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||
TARGET_OS: 'win'
|
||||
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||
@@ -40,6 +42,9 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- name: Checkout & Sync & Save
|
||||
uses: ./src/electron/.github/actions/checkout
|
||||
with:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: win
|
||||
|
||||
publish-x64-win:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||
|
||||
2
BUILD.gn
2
BUILD.gn
@@ -1246,7 +1246,7 @@ if (is_mac) {
|
||||
"//components/crash/core/app:run_as_crashpad_handler",
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
ldflags = [ "/DELAYLOAD:ffmpeg.dll" ]
|
||||
|
||||
libs = [
|
||||
"comctl32.lib",
|
||||
|
||||
4
DEPS
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'135.0.7049.5',
|
||||
'136.0.7103.49',
|
||||
'node_version':
|
||||
'v22.14.0',
|
||||
'v22.15.0',
|
||||
'nan_version':
|
||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -96,8 +96,9 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||
* [Chrome Extensions Support](api/extensions.md)
|
||||
* [Breaking API Changes](breaking-changes.md)
|
||||
|
||||
### Custom DOM Elements:
|
||||
### Custom Web Features:
|
||||
|
||||
* [`-electron-corner-smoothing` CSS Rule](api/corner-smoothing-css.md)
|
||||
* [`<webview>` Tag](api/webview-tag.md)
|
||||
* [`window.open` Function](api/window-open.md)
|
||||
|
||||
|
||||
@@ -1110,6 +1110,11 @@ indicates success while any other value indicates failure according to Chromium
|
||||
resolver will attempt to use the system's DNS settings to do DNS lookups
|
||||
itself. Enabled by default on macOS, disabled by default on Windows and
|
||||
Linux.
|
||||
* `enableHappyEyeballs` boolean (optional) - Whether the
|
||||
[Happy Eyeballs V3][happy-eyeballs-v3] algorithm should be used in creating
|
||||
network connections. When enabled, hostnames resolving to multiple IP
|
||||
addresses will be attempted in parallel to have a chance at establishing a
|
||||
connection more quickly.
|
||||
* `secureDnsMode` string (optional) - Can be 'off', 'automatic' or 'secure'.
|
||||
Configures the DNS-over-HTTP mode. When 'off', no DoH lookups will be
|
||||
performed. When 'automatic', DoH lookups will be performed first if DoH is
|
||||
@@ -1485,7 +1490,7 @@ and internal requests made by the runtime (ex: geolocation queries).
|
||||
|
||||
This method can only be called after app is ready.
|
||||
|
||||
#### `app.resolveProxy(url)`
|
||||
### `app.resolveProxy(url)`
|
||||
|
||||
* `url` URL
|
||||
|
||||
@@ -1559,8 +1564,8 @@ command line arguments that Chromium uses.
|
||||
|
||||
### `app.dock` _macOS_ _Readonly_
|
||||
|
||||
A [`Dock`](./dock.md) `| undefined` object that allows you to perform actions on your app icon in the user's
|
||||
dock on macOS.
|
||||
A `Dock | undefined` property ([`Dock`](./dock.md) on macOS, `undefined` on all other
|
||||
platforms) that allows you to perform actions on your app icon in the user's dock.
|
||||
|
||||
### `app.isPackaged` _Readonly_
|
||||
|
||||
@@ -1579,6 +1584,7 @@ A `boolean` property that returns `true` if the app is packaged, `false` otherw
|
||||
[Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
|
||||
[JumpListBeginListMSDN]: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-beginlist
|
||||
[about-panel-options]: https://developer.apple.com/reference/appkit/nsapplication/1428479-orderfrontstandardaboutpanelwith?language=objc
|
||||
[happy-eyeballs-v3]: https://datatracker.ietf.org/doc/draft-pauly-happy-happyeyeballs-v3/
|
||||
|
||||
### `app.name`
|
||||
|
||||
|
||||
@@ -342,12 +342,12 @@ Emitted when the window has closed a sheet.
|
||||
|
||||
Emitted when the native new tab button is clicked.
|
||||
|
||||
#### Event: 'system-context-menu' _Windows_
|
||||
#### Event: 'system-context-menu' _Windows_ _Linux_
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `point` [Point](structures/point.md) - The screen coordinates the context menu was triggered at
|
||||
* `point` [Point](structures/point.md) - The screen coordinates where the context menu was triggered.
|
||||
|
||||
Emitted when the system context menu is triggered on the window, this is
|
||||
normally only triggered when the user right clicks on the non-client area
|
||||
@@ -356,6 +356,8 @@ as `-webkit-app-region: drag` in a frameless window.
|
||||
|
||||
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||
|
||||
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows).
|
||||
|
||||
### Static Methods
|
||||
|
||||
The `BaseWindow` class has the following static methods:
|
||||
@@ -396,7 +398,7 @@ A `View` property for the content view of the window.
|
||||
|
||||
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
|
||||
|
||||
#### `win.autoHideMenuBar`
|
||||
#### `win.autoHideMenuBar` _Linux_ _Windows_
|
||||
|
||||
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
|
||||
|
||||
@@ -511,6 +513,10 @@ A `string` property that defines an alternative title provided only to
|
||||
accessibility tools such as screen readers. This string is not directly
|
||||
visible to users.
|
||||
|
||||
#### `win.snapped` _Windows_ _Readonly_
|
||||
|
||||
A `boolean` property that indicates whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||
|
||||
### Instance Methods
|
||||
|
||||
Objects created with `new BaseWindow` have the following instance methods:
|
||||
@@ -1264,6 +1270,13 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
||||
|
||||
Returns `boolean` - Whether the menu bar is visible.
|
||||
|
||||
#### `win.isSnapped()` _Windows_
|
||||
|
||||
Returns `boolean` - whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||
|
||||
The window is snapped via buttons shown when the mouse is hovered over window
|
||||
maximize button, or by dragging it to the edges of the screen.
|
||||
|
||||
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
|
||||
|
||||
* `visible` boolean
|
||||
|
||||
@@ -421,12 +421,12 @@ Emitted when the window has closed a sheet.
|
||||
|
||||
Emitted when the native new tab button is clicked.
|
||||
|
||||
#### Event: 'system-context-menu' _Windows_
|
||||
#### Event: 'system-context-menu' _Windows_ _Linux_
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `point` [Point](structures/point.md) - The screen coordinates the context menu was triggered at
|
||||
* `point` [Point](structures/point.md) - The screen coordinates where the context menu was triggered.
|
||||
|
||||
Emitted when the system context menu is triggered on the window, this is
|
||||
normally only triggered when the user right clicks on the non-client area
|
||||
@@ -435,6 +435,8 @@ as `-webkit-app-region: drag` in a frameless window.
|
||||
|
||||
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||
|
||||
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows).
|
||||
|
||||
### Static Methods
|
||||
|
||||
The `BrowserWindow` class has the following static methods:
|
||||
@@ -497,7 +499,7 @@ A `Integer` property representing the unique ID of the window. Each ID is unique
|
||||
|
||||
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
|
||||
|
||||
#### `win.autoHideMenuBar`
|
||||
#### `win.autoHideMenuBar` _Linux_ _Windows_
|
||||
|
||||
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
|
||||
|
||||
@@ -611,6 +613,10 @@ A `string` property that defines an alternative title provided only to
|
||||
accessibility tools such as screen readers. This string is not directly
|
||||
visible to users.
|
||||
|
||||
#### `win.snapped` _Windows_ _Readonly_
|
||||
|
||||
A `boolean` property that indicates whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||
|
||||
### Instance Methods
|
||||
|
||||
Objects created with `new BrowserWindow` have the following instance methods:
|
||||
@@ -1445,6 +1451,13 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
||||
|
||||
Returns `boolean` - Whether the menu bar is visible.
|
||||
|
||||
#### `win.isSnapped()` _Windows_
|
||||
|
||||
Returns `boolean` - whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||
|
||||
The window is snapped via buttons shown when the mouse is hovered over window
|
||||
maximize button, or by dragging it to the edges of the screen.
|
||||
|
||||
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
|
||||
|
||||
* `visible` boolean
|
||||
|
||||
@@ -20,45 +20,87 @@ document.
|
||||
|
||||
#### `commandLine.appendSwitch(switch[, value])`
|
||||
|
||||
* `switch` string - A command-line switch, without the leading `--`
|
||||
* `value` string (optional) - A value for the given switch
|
||||
* `switch` string - A command-line switch, without the leading `--`.
|
||||
* `value` string (optional) - A value for the given switch.
|
||||
|
||||
Append a switch (with optional `value`) to Chromium's command line.
|
||||
|
||||
**Note:** This will not affect `process.argv`. The intended usage of this function is to
|
||||
control Chromium's behavior.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||
```
|
||||
|
||||
#### `commandLine.appendArgument(value)`
|
||||
|
||||
* `value` string - The argument to append to the command line
|
||||
* `value` string - The argument to append to the command line.
|
||||
|
||||
Append an argument to Chromium's command line. The argument will be quoted
|
||||
correctly. Switches will precede arguments regardless of appending order.
|
||||
|
||||
If you're appending an argument like `--switch=value`, consider using `appendSwitch('switch', 'value')` instead.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.commandLine.appendArgument('--enable-experimental-web-platform-features')
|
||||
```
|
||||
|
||||
**Note:** This will not affect `process.argv`. The intended usage of this function is to
|
||||
control Chromium's behavior.
|
||||
|
||||
#### `commandLine.hasSwitch(switch)`
|
||||
|
||||
* `switch` string - A command-line switch
|
||||
* `switch` string - A command-line switch.
|
||||
|
||||
Returns `boolean` - Whether the command-line switch is present.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||
const hasPort = app.commandLine.hasSwitch('remote-debugging-port')
|
||||
console.log(hasPort) // true
|
||||
```
|
||||
|
||||
#### `commandLine.getSwitchValue(switch)`
|
||||
|
||||
* `switch` string - A command-line switch
|
||||
* `switch` string - A command-line switch.
|
||||
|
||||
Returns `string` - The command-line switch value.
|
||||
|
||||
This function is meant to obtain Chromium command line switches. It is not
|
||||
meant to be used for application-specific command line arguments. For the
|
||||
latter, please use `process.argv`.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||
const portValue = app.commandLine.getSwitchValue('remote-debugging-port')
|
||||
console.log(portValue) // '8315'
|
||||
```
|
||||
|
||||
**Note:** When the switch is not present or has no value, it returns empty string.
|
||||
|
||||
#### `commandLine.removeSwitch(switch)`
|
||||
|
||||
* `switch` string - A command-line switch
|
||||
* `switch` string - A command-line switch.
|
||||
|
||||
Removes the specified switch from Chromium's command line.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||
console.log(app.commandLine.hasSwitch('remote-debugging-port')) // true
|
||||
|
||||
app.commandLine.removeSwitch('remote-debugging-port')
|
||||
console.log(app.commandLine.hasSwitch('remote-debugging-port')) // false
|
||||
```
|
||||
|
||||
**Note:** This will not affect `process.argv`. The intended usage of this function is to
|
||||
control Chromium's behavior.
|
||||
|
||||
78
docs/api/corner-smoothing-css.md
Normal file
78
docs/api/corner-smoothing-css.md
Normal file
@@ -0,0 +1,78 @@
|
||||
## CSS Rule: `-electron-corner-smoothing`
|
||||
|
||||
> Smoothes out the corner rounding of the `border-radius` CSS rule.
|
||||
|
||||
The rounded corners of elements with [the `border-radius` CSS rule](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius) can be smoothed out using the `-electron-corner-smoothing` CSS rule. This smoothness is very similar to Apple's "continuous" rounded corners in SwiftUI and Figma's "corner smoothing" control on design elements.
|
||||
|
||||

|
||||
|
||||
Integrating with the operating system and its design language is important to many desktop applications. The shape of a rounded corner can be a subtle detail to many users. However, aligning closely to the system's design language that users are familiar with makes the application's design feel familiar too. Beyond matching the design language of macOS, designers may decide to use smoother round corners for many other reasons.
|
||||
|
||||
`-electron-corner-smoothing` affects the shape of borders, outlines, and shadows on the target element. Mirroring the behavior of `border-radius`, smoothing will gradually back off if an element's size is too small for the chosen value.
|
||||
|
||||
The `-electron-corner-smoothing` CSS rule is **only implemented for Electron** and has no effect in browsers. Avoid using this rule outside of Electron. This CSS rule is considered experimental and may require migration in the future if replaced by a CSS standard.
|
||||
|
||||
### Example
|
||||
|
||||
The following example shows the effect of corner smoothing at different percents.
|
||||
|
||||
```css
|
||||
.box {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
background-color: cornflowerblue;
|
||||
border-radius: 24px;
|
||||
-electron-corner-smoothing: var(--percent); /* Column header in table below. */
|
||||
}
|
||||
```
|
||||
|
||||
| 0% | 30% | 60% | 100% |
|
||||
| --- | --- | --- | --- |
|
||||
|  |  |  |  |
|
||||
|
||||
### Matching the system UI
|
||||
|
||||
Use the `system-ui` keyword to match the smoothness to the OS design language.
|
||||
|
||||
```css
|
||||
.box {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
background-color: cornflowerblue;
|
||||
border-radius: 24px;
|
||||
-electron-corner-smoothing: system-ui; /* Match the system UI design. */
|
||||
}
|
||||
```
|
||||
|
||||
| OS: | macOS | Windows, Linux |
|
||||
| --- | --- | --- |
|
||||
| Value: | `60%` | `0%` |
|
||||
| Example: |  |  |
|
||||
|
||||
### Controlling availibility
|
||||
|
||||
This CSS rule can be disabled by setting [the `cornerSmoothingCSS` web preference](./structures/web-preferences.md) to `false`.
|
||||
|
||||
```js
|
||||
const myWindow = new BrowserWindow({
|
||||
// [...]
|
||||
webPreferences: {
|
||||
enableCornerSmoothingCSS: false // Disables the `-electron-corner-smoothing` CSS rule
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
The CSS rule will still parse, but will have no visual effect.
|
||||
|
||||
### Formal reference
|
||||
|
||||
* **Initial value**: `0%`
|
||||
* **Inherited**: No
|
||||
* **Animatable**: No
|
||||
* **Computed value**: As specified
|
||||
|
||||
```css
|
||||
-electron-corner-smoothing =
|
||||
<percentage [0,100]> |
|
||||
system-ui
|
||||
```
|
||||
@@ -9,7 +9,7 @@ The following example shows how to bounce your icon on the dock.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
app.dock.bounce()
|
||||
app.dock?.bounce()
|
||||
```
|
||||
|
||||
### Instance Methods
|
||||
|
||||
@@ -73,6 +73,8 @@ The `menu` object has the following instance methods:
|
||||
|
||||
* `options` Object (optional)
|
||||
* `window` [BaseWindow](base-window.md) (optional) - Default is the focused window.
|
||||
* `frame` [WebFrameMain](web-frame-main.md) (optional) - Provide the relevant frame
|
||||
if you want certain OS-level features such as Writing Tools on macOS to function correctly. Typically, this should be `params.frame` from the [`context-menu` event](web-contents.md#event-context-menu) on a WebContents, or the [`focusedFrame` property](web-contents.md#contentsfocusedframe-readonly) of a WebContents.
|
||||
* `x` number (optional) - Default is the current mouse cursor position.
|
||||
Must be declared if `y` is declared.
|
||||
* `y` number (optional) - Default is the current mouse cursor position.
|
||||
|
||||
@@ -142,8 +142,8 @@ Note: The Windows implementation will ignore `size.height` and scale the height
|
||||
|
||||
Returns `NativeImage`
|
||||
|
||||
Creates a new `NativeImage` instance from a file located at `path`. This method
|
||||
returns an empty image if the `path` does not exist, cannot be read, or is not
|
||||
Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG) located at `path`.
|
||||
This method returns an empty image if the `path` does not exist, cannot be read, or is not
|
||||
a valid image.
|
||||
|
||||
```js
|
||||
@@ -271,16 +271,12 @@ changes:
|
||||
|
||||
Returns `string` - The [Data URL][data-url] of the image.
|
||||
|
||||
#### `image.getBitmap([options])`
|
||||
#### `image.getBitmap([options])` _Deprecated_
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.
|
||||
|
||||
The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does not
|
||||
copy the bitmap data, so you have to use the returned Buffer immediately in
|
||||
current event loop tick; otherwise the data might be changed or destroyed.
|
||||
Legacy alias for `image.toBitmap()`.
|
||||
|
||||
#### `image.getNativeHandle()` _macOS_
|
||||
|
||||
|
||||
@@ -63,6 +63,14 @@ Your application should then always use `shouldUseDarkColors` to determine what
|
||||
A `boolean` for if the OS / Chromium currently has high-contrast mode enabled
|
||||
or is being instructed to show a high-contrast UI.
|
||||
|
||||
### `nativeTheme.shouldUseDarkColorsForSystemIntegratedUI` _macOS_ _Windows_ _Readonly_
|
||||
|
||||
A `boolean` property indicating whether or not the system theme has been set to dark or light.
|
||||
|
||||
On Windows this property distinguishes between system and app light/dark theme, returning
|
||||
`true` if the system theme is set to dark theme and `false` otherwise. On macOS the return
|
||||
value will be the same as `nativeTheme.shouldUseDarkColors`.
|
||||
|
||||
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_
|
||||
|
||||
A `boolean` for if the OS / Chromium currently has an inverted color scheme
|
||||
|
||||
@@ -46,4 +46,7 @@ See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-regi
|
||||
### `pushNotifications.unregisterForAPNSNotifications()` _macOS_
|
||||
|
||||
Unregisters the app from notifications received from APNS.
|
||||
|
||||
Apps unregistered through this method can always reregister.
|
||||
|
||||
See: https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc
|
||||
|
||||
@@ -651,7 +651,7 @@ Clears the session’s HTTP cache.
|
||||
`shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not
|
||||
specified, clear all storage types.
|
||||
* `quotas` string[] (optional) - The types of quotas to clear, can be
|
||||
`temporary`, `syncable`. If not specified, clear all quotas.
|
||||
`temporary`. If not specified, clear all quotas.
|
||||
|
||||
Returns `Promise<void>` - resolves when the storage data has been cleared.
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
`false` on macOS. This option is not configurable on other platforms.
|
||||
* `disableAutoHideCursor` boolean (optional) - Whether to hide cursor when typing.
|
||||
Default is `false`.
|
||||
* `autoHideMenuBar` boolean (optional) - Auto hide the menu bar unless the `Alt`
|
||||
key is pressed. Default is `false`.
|
||||
* `autoHideMenuBar` boolean (optional) _Linux_ _Windows_ - Auto hide the menu bar
|
||||
unless the `Alt` key is pressed. Default is `false`.
|
||||
* `enableLargerThanScreen` boolean (optional) _macOS_ - Enable the window to
|
||||
be resized larger than screen. Only relevant for macOS, as other OSes
|
||||
allow larger-than-screen windows by default. Default is `false`.
|
||||
@@ -93,7 +93,7 @@
|
||||
**Note:** This option is currently experimental.
|
||||
* `titleBarOverlay` Object | Boolean (optional) - When using a frameless window in conjunction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Default is `false`.
|
||||
* `color` String (optional) _Windows_ _Linux_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color.
|
||||
* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
|
||||
* `symbolColor` String (optional) _Windows_ _Linux_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
|
||||
* `height` Integer (optional) - The height of the title bar and Window Controls Overlay in pixels. Default is system height.
|
||||
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
|
||||
Set a custom position for the traffic light buttons in frameless windows.
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
`pointerDown`, `pointerUp`, `pointerMove`, `pointerRawUpdate`,
|
||||
`pointerCancel` or `pointerCausedUaAction`.
|
||||
* `modifiers` string[] (optional) - An array of modifiers of the event, can
|
||||
be `shift`, `control`, `ctrl`, `alt`, `meta`, `command`, `cmd`, `isKeypad`,
|
||||
`isAutoRepeat`, `leftButtonDown`, `middleButtonDown`, `rightButtonDown`,
|
||||
`capsLock`, `numLock`, `left`, `right`.
|
||||
be `shift`, `control`, `ctrl`, `alt`, `meta`, `command`, `cmd`, `iskeypad`,
|
||||
`isautorepeat`, `leftbuttondown`, `middlebuttondown`, `rightbuttondown`,
|
||||
`capslock`, `numlock`, `left`, `right`.
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
`WebContents` when the preferred size changes. Default is `false`.
|
||||
* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
|
||||
* `enableDeprecatedPaste` boolean (optional) _Deprecated_ - Whether to enable the `paste` [execCommand](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand). Default is `false`.
|
||||
* `enableCornerSmoothingCSS` boolean (optional) _Experimental_ - Whether the [`-electron-corner-smoothing` CSS rule](../corner-smoothing-css.md) is enabled. Default is `true`.
|
||||
|
||||
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
|
||||
[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
|
||||
@@ -238,7 +238,7 @@ Sets the `image` associated with this tray icon when pressed on macOS.
|
||||
|
||||
* `toolTip` string
|
||||
|
||||
Sets the hover text for this tray icon.
|
||||
Sets the hover text for this tray icon. Setting the text to an empty string will remove the tooltip.
|
||||
|
||||
#### `tray.setTitle(title[, options])` _macOS_
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ Process: [Main](../glossary.md#main-process)<br />
|
||||
|
||||
Returns [`UtilityProcess`](utility-process.md#class-utilityprocess)
|
||||
|
||||
**Note:** `utilityProcess.fork` can only be called after the `ready` event has been emitted on `App`.
|
||||
|
||||
## Class: UtilityProcess
|
||||
|
||||
> Instances of the `UtilityProcess` represent the Chromium spawned child process
|
||||
|
||||
@@ -887,7 +887,7 @@ const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow({ webPreferences: { offscreen: true } })
|
||||
win.webContents.on('paint', (event, dirty, image) => {
|
||||
// updateBitmap(dirty, image.getBitmap())
|
||||
// updateBitmap(dirty, image.toBitmap())
|
||||
})
|
||||
win.loadURL('https://github.com')
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@ Returns `string` - The file system path that this `File` object points to. In th
|
||||
|
||||
This method superseded the previous augmentation to the `File` object with the `path` property. An example is included below.
|
||||
|
||||
```js
|
||||
```js @ts-nocheck
|
||||
// Before
|
||||
const oldPath = document.querySelector('input').files[0].path
|
||||
|
||||
|
||||
@@ -12,6 +12,34 @@ This document uses the following convention to categorize breaking changes:
|
||||
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
|
||||
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
|
||||
|
||||
## Planned Breaking API Changes (37.0)
|
||||
|
||||
### Behavior Changed: `BrowserWindow.IsVisibleOnAllWorkspaces()` on Linux
|
||||
|
||||
`BrowserWindow.IsVisibleOnAllWorkspaces()` will now return false on Linux if the
|
||||
window is not currently visible.
|
||||
|
||||
### Behavior Changes: `app.commandLine`
|
||||
|
||||
`app.commandLine` will convert upper-cases switches and arguments to lowercase.
|
||||
|
||||
`app.commandLine` was only meant to handle chromium switches (which aren't case-sensitive) and switches passed via `app.commandLine` will not be passed down to any of the child processes.
|
||||
|
||||
If you were using `app.commandLine` to control the behavior of the main process, you should do this via `process.argv`.
|
||||
|
||||
### Deprecated: `NativeImage.getBitmap()`
|
||||
|
||||
`NativeImage.toBitmap()` returns a newly-allocated copy of the bitmap. `NativeImage.getBitmap()` was originally an alternative function that returned the original instead of a copy. This changed when sandboxing was introduced, so both return a copy and are functionally equivalent.
|
||||
|
||||
Client code should call `NativeImage.toBitmap()` instead:
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
bitmap = image.getBitmap()
|
||||
// Use this instead
|
||||
bitmap = image.toBitmap()
|
||||
```
|
||||
|
||||
## Planned Breaking API Changes (36.0)
|
||||
|
||||
### Removed:`isDefault` and `status` properties on `PrinterInfo`
|
||||
@@ -19,6 +47,29 @@ This document uses the following convention to categorize breaking changes:
|
||||
These properties have been removed from the PrinterInfo Object
|
||||
because they have been removed from upstream Chromium.
|
||||
|
||||
### Removed: `quota` type `syncable` in `Session.clearStorageData(options)`
|
||||
|
||||
When calling `Session.clearStorageData(options)`, the `options.quota` type
|
||||
`syncable` is no longer supported because it has been
|
||||
[removed](https://chromium-review.googlesource.com/c/chromium/src/+/6309405)
|
||||
from upstream Chromium.
|
||||
|
||||
### Deprecated: `quota` property in `Session.clearStorageData(options)`
|
||||
|
||||
When calling `Session.clearStorageData(options)`, the `options.quota`
|
||||
property is deprecated. Since the `syncable` type was removed, there
|
||||
is only type left -- `'temporary'` -- so specifying it is unnecessary.
|
||||
|
||||
### Deprecated: `null` value for `session` property in `ProtocolResponse`
|
||||
|
||||
Previously, setting the ProtocolResponse.session property to `null`
|
||||
Would create a random independent session. This is no longer supported.
|
||||
|
||||
Using single-purpose sessions here is discouraged due to overhead costs;
|
||||
however, old code that needs to preserve this behavior can emulate it by
|
||||
creating a random session with `session.fromPartition(some_random_string)`
|
||||
and then using it in `ProtocolResponse.session`.
|
||||
|
||||
### Deprecated: Extension methods and events on `session`
|
||||
|
||||
`session.loadExtension`, `session.removeExtension`, `session.getExtension`,
|
||||
@@ -33,6 +84,24 @@ It has been always returning `true` since Electron 23, which only supports Windo
|
||||
|
||||
https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw#disabling-dwm-composition-windows7-and-earlier
|
||||
|
||||
### Changed: GTK 4 is default when running GNOME
|
||||
|
||||
After an [upstream change](https://chromium-review.googlesource.com/c/chromium/src/+/6310469), GTK 4 is now the default when running GNOME.
|
||||
|
||||
In rare cases, this may cause some applications or configurations to [error](https://github.com/electron/electron/issues/46538) with the following message:
|
||||
|
||||
```stderr
|
||||
Gtk-ERROR **: 11:30:38.382: GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported
|
||||
```
|
||||
|
||||
Affected users can work around this by specifying the `gtk-version` command-line flag:
|
||||
|
||||
```shell
|
||||
$ electron --gtk-version=3 # or --gtk-version=2
|
||||
```
|
||||
|
||||
The same can be done with the [`app.commandLine.appendSwitch`](https://www.electronjs.org/docs/latest/api/command-line#commandlineappendswitchswitch-value) function.
|
||||
|
||||
## Planned Breaking API Changes (35.0)
|
||||
|
||||
### Behavior Changed: Dialog API's `defaultPath` option on Linux
|
||||
|
||||
@@ -65,7 +65,7 @@ Verify that the Pull Request is correct and make a corresponding entry in the
|
||||
API History:
|
||||
|
||||
> [!NOTE]
|
||||
> Refer to the [API History section of `styleguide.md`](../styleguide.md#api-history)
|
||||
> Refer to the [API History section of `style-guide.md`](./style-guide.md#api-history)
|
||||
for information on how to create API History blocks.
|
||||
|
||||
`````markdown
|
||||
|
||||
@@ -195,7 +195,7 @@ required[, optional]
|
||||
More detailed information on each of the arguments is noted in an unordered list
|
||||
below the method. The type of argument is notated by either JavaScript primitives
|
||||
(e.g. `string`, `Promise`, or `Object`), a custom API structure like Electron's
|
||||
[`Cookie`](api/structures/cookie.md), or the wildcard `any`.
|
||||
[`Cookie`](../api/structures/cookie.md), or the wildcard `any`.
|
||||
|
||||
If the argument is of type `Array`, use `[]` shorthand with the type of value
|
||||
inside the array (for example,`any[]` or `string[]`).
|
||||
@@ -290,7 +290,7 @@ The purpose of the API History block is to describe when/where/how/why an API wa
|
||||
Each API change listed in the block should include a link to the
|
||||
PR where that change was made along with an optional short description of the
|
||||
change. If applicable, include the [heading id](https://gist.github.com/asabaylus/3071099)
|
||||
for that change from the [breaking changes documentation](./breaking-changes.md).
|
||||
for that change from the [breaking changes documentation](../breaking-changes.md).
|
||||
|
||||
The [API History linting script][api-history-linting-script] (`lint:api-history`)
|
||||
validates API History blocks in the Electron documentation against the schema and
|
||||
@@ -24,9 +24,7 @@ const dockMenu = Menu.buildFromTemplate([
|
||||
])
|
||||
|
||||
app.whenReady().then(() => {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.setMenu(dockMenu)
|
||||
}
|
||||
app.dock?.setMenu(dockMenu)
|
||||
}).then(createWindow)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
||||
3
docs/images/corner-smoothing-example-0.svg
Normal file
3
docs/images/corner-smoothing-example-0.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="192" height="192" viewBox="0 0 192 192" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 48C0 21.4903 21.4903 0 48 0H144C170.51 0 192 21.4903 192 48V144C192 170.51 170.51 192 144 192H48C21.4903 192 0 170.51 0 144V48Z" fill="#6495ED"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 265 B |
3
docs/images/corner-smoothing-example-100.svg
Normal file
3
docs/images/corner-smoothing-example-100.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="192" height="192" viewBox="0 0 192 192" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 96C0 50.7452 0 28.1177 14.0589 14.0589C28.1177 0 50.7452 0 96 0C141.255 0 163.882 0 177.941 14.0589C192 28.1177 192 50.7452 192 96C192 141.255 192 163.882 177.941 177.941C163.882 192 141.255 192 96 192C50.7452 192 28.1177 192 14.0589 177.941C0 163.882 0 141.255 0 96Z" fill="#6495ED"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 405 B |
3
docs/images/corner-smoothing-example-30.svg
Normal file
3
docs/images/corner-smoothing-example-30.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="192" height="192" viewBox="0 0 192 192" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 62.4C0 49.0126 0 42.3188 1.32624 36.7946C5.5399 19.2435 19.2435 5.5399 36.7946 1.32624C42.3188 0 49.0126 0 62.4 0H129.6C142.987 0 149.681 0 155.205 1.32624C172.757 5.5399 186.46 19.2435 190.674 36.7946C192 42.3188 192 49.0126 192 62.4V129.6C192 142.987 192 149.681 190.674 155.205C186.46 172.757 172.757 186.46 155.205 190.674C149.681 192 142.987 192 129.6 192H62.4C49.0126 192 42.3188 192 36.7946 190.674C19.2435 186.46 5.5399 172.757 1.32624 155.205C0 149.681 0 142.987 0 129.6V62.4Z" fill="#6495ED"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 623 B |
3
docs/images/corner-smoothing-example-60.svg
Normal file
3
docs/images/corner-smoothing-example-60.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="192" height="192" viewBox="0 0 192 192" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 76.8C0 49.9175 0 36.4762 5.23169 26.2085C9.83361 17.1767 17.1767 9.83361 26.2085 5.23169C36.4762 0 49.9175 0 76.8 0H115.2C142.083 0 155.524 0 165.792 5.23169C174.823 9.83361 182.166 17.1767 186.768 26.2085C192 36.4762 192 49.9175 192 76.8V115.2C192 142.083 192 155.524 186.768 165.792C182.166 174.823 174.823 182.166 165.792 186.768C155.524 192 142.083 192 115.2 192H76.8C49.9175 192 36.4762 192 26.2085 186.768C17.1767 182.166 9.83361 174.823 5.23169 165.792C0 155.524 0 142.083 0 115.2V76.8Z" fill="#6495ED"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 631 B |
15
docs/images/corner-smoothing-summary.svg
Normal file
15
docs/images/corner-smoothing-summary.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<svg width="1024" height="512" viewBox="0 0 1024 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="1024" height="512" fill="#EEEEEE"/>
|
||||
<rect x="32" y="128" width="256" height="256" fill="white"/>
|
||||
<rect x="64" y="160" width="192" height="192" rx="48" stroke="#444444" stroke-width="4"/>
|
||||
<rect x="320" y="64" width="384" height="384" fill="white"/>
|
||||
<mask id="mask0_1_2" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="320" y="64" width="384" height="384">
|
||||
<rect x="320" y="64" width="384" height="384" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_1_2)">
|
||||
<rect x="85" y="171" width="512" height="512" rx="128" stroke="#444444" stroke-width="8"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M340.677 167H341.323C401.39 167 446.862 167 481.984 171.722C517.284 176.468 542.726 186.05 562.338 205.662C581.95 225.274 591.532 250.716 596.278 286.016C601 321.138 601 366.61 601 426.677V427.323C601 487.39 601 532.862 596.278 567.984C591.532 603.284 581.95 628.726 562.338 648.338C542.726 667.95 517.284 677.532 481.984 682.278C446.862 687 401.39 687 341.323 687H340.677C280.61 687 235.138 687 200.016 682.278C164.716 677.532 139.274 667.95 119.662 648.338C100.05 628.726 90.4679 603.284 85.722 567.984C81 532.862 81 487.39 81 427.323V426.677C81 366.61 81 321.138 85.722 286.016C90.4679 250.716 100.05 225.274 119.662 205.662C139.274 186.05 164.716 176.468 200.016 171.722C235.138 167 280.61 167 340.677 167ZM201.082 179.651C166.67 184.277 143.197 193.441 125.319 211.319C107.441 229.197 98.2773 252.67 93.6506 287.082C89.0085 321.61 89 366.547 89 427C89 487.453 89.0085 532.39 93.6506 566.918C98.2773 601.33 107.441 624.803 125.319 642.681C143.197 660.559 166.67 669.723 201.082 674.349C235.61 678.992 280.547 679 341 679C401.453 679 446.39 678.992 480.918 674.349C515.33 669.723 538.803 660.559 556.681 642.681C574.559 624.803 583.723 601.33 588.349 566.918C592.992 532.39 593 487.453 593 427C593 366.547 592.992 321.61 588.349 287.082C583.723 252.67 574.559 229.197 556.681 211.319C538.803 193.441 515.33 184.277 480.918 179.651C446.39 175.008 401.453 175 341 175C280.547 175 235.61 175.008 201.082 179.651Z" fill="#2A90D9"/>
|
||||
</g>
|
||||
<rect x="731" y="128" width="256" height="256" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M863.839 158H864.161C886.652 158 903.732 158 916.936 159.775C930.228 161.562 939.892 165.182 947.355 172.645C954.818 180.108 958.438 189.772 960.225 203.064C962 216.268 962 233.348 962 255.839V256.161C962 278.652 962 295.732 960.225 308.936C958.438 322.228 954.818 331.892 947.355 339.355C939.892 346.818 930.228 350.438 916.936 352.225C903.732 354 886.652 354 864.161 354H863.839C841.348 354 824.268 354 811.064 352.225C797.772 350.438 788.108 346.818 780.645 339.355C773.182 331.892 769.562 322.228 767.775 308.936C766 295.732 766 278.652 766 256.161V255.839C766 233.348 766 216.268 767.775 203.064C769.562 189.772 773.182 180.108 780.645 172.645C788.108 165.182 797.772 161.562 811.064 159.775C824.268 158 841.348 158 863.839 158ZM811.597 163.74C798.748 165.467 790.069 168.877 783.473 175.473C776.877 182.069 773.467 190.748 771.74 203.597C770.004 216.504 770 233.316 770 256C770 278.684 770.004 295.496 771.74 308.403C773.467 321.252 776.877 329.931 783.473 336.527C790.069 343.123 798.748 346.533 811.597 348.26C824.504 349.996 841.316 350 864 350C886.684 350 903.496 349.996 916.403 348.26C929.252 346.533 937.931 343.123 944.527 336.527C951.123 329.931 954.533 321.252 956.26 308.403C957.996 295.496 958 278.684 958 256C958 233.316 957.996 216.504 956.26 203.597C954.533 190.748 951.123 182.069 944.527 175.473C937.931 168.877 929.252 165.467 916.403 163.74C903.496 162.004 886.684 162 864 162C841.316 162 824.504 162.004 811.597 163.74Z" fill="#2A90D9"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -37,7 +37,6 @@ the illusion of a circular window.
|
||||
open on the user's system).
|
||||
* The window will not be transparent when DevTools is opened.
|
||||
* On _Windows_:
|
||||
* Transparent windows will not work when DWM is disabled.
|
||||
* Transparent windows can not be maximized using the Windows system menu or by double
|
||||
clicking the title bar. The reasoning behind this can be seen on
|
||||
PR [#28207](https://github.com/electron/electron/pull/28207).
|
||||
|
||||
@@ -9,10 +9,11 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
|
||||
|
||||
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
|
||||
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
|
||||
| 36.0.0 | 2025-Mar-06 | 2025-Apr-02 | 2025-Apr-29 | 2025-Oct-28 | M136 | TBD | ✅ |
|
||||
| 37.0.0 | 2025-May-01 | 2025-May-28 | 2025-Jun-24 | 2026-Jan-13 | M138 | TBD | ✅ |
|
||||
| 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 | ✅ |
|
||||
| 33.0.0 | 2024-Aug-22 | 2024-Sep-18 | 2024-Oct-15 | 2025-Apr-29 | M130 | v20.18 | 🚫 |
|
||||
| 32.0.0 | 2024-Jun-14 | 2024-Jul-24 | 2024-Aug-20 | 2025-Mar-04 | M128 | v20.16 | 🚫 |
|
||||
| 31.0.0 | 2024-Apr-18 | 2024-May-15 | 2024-Jun-11 | 2025-Jan-14 | M126 | v20.14 | 🚫 |
|
||||
| 30.0.0 | 2024-Feb-22 | 2024-Mar-20 | 2024-Apr-16 | 2024-Oct-15 | M124 | v20.11 | 🚫 |
|
||||
|
||||
@@ -50,9 +50,7 @@ const dockMenu = Menu.buildFromTemplate([
|
||||
])
|
||||
|
||||
app.whenReady().then(() => {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.setMenu(dockMenu)
|
||||
}
|
||||
app.dock?.setMenu(dockMenu)
|
||||
}).then(createWindow)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
||||
1346
docs/tutorial/native-code-and-electron-cpp-win32.md
Normal file
1346
docs/tutorial/native-code-and-electron-cpp-win32.md
Normal file
File diff suppressed because it is too large
Load Diff
1152
docs/tutorial/native-code-and-electron-objc-macos.md
Normal file
1152
docs/tutorial/native-code-and-electron-objc-macos.md
Normal file
File diff suppressed because it is too large
Load Diff
380
docs/tutorial/native-code-and-electron.md
Normal file
380
docs/tutorial/native-code-and-electron.md
Normal file
@@ -0,0 +1,380 @@
|
||||
# Native Code and Electron
|
||||
|
||||
One of Electron's most powerful features is the ability to combine web technologies with native code - both for compute-intensive logic as well as for the occasional native user interface, where desired.
|
||||
|
||||
Electron does so by building on top of "Native Node.js Addons". You've probably already come across a few of them - packages like the famous [sqlite](https://www.npmjs.com/package/sqlite3) use native code to combine JavaScript and native technologies. You can use this feature to extend your Electron application with anything a fully native application can do:
|
||||
|
||||
* Access native platform APIs not available in JavaScript. Any macOS, Windows, or Linux operating system API is available to you.
|
||||
* Create UI components that interact with native desktop frameworks.
|
||||
* Integrate with existing native libraries.
|
||||
* Implement performance-critical code that runs faster than JavaScript.
|
||||
|
||||
Native Node.js addons are dynamically-linked shared objects (on Unix-like systems) or DLL files (on Windows) that can be loaded into Node.js or Electron using the `require()` or `import` functions. They behave just like regular JavaScript modules but provide an interface to code written in C++, Rust, or other languages that can compile to native code.
|
||||
|
||||
# Tutorial: Creating a Native Node.js Addon for Electron
|
||||
|
||||
This tutorial will walk you through building a basic Node.js native addon that can be used in Electron applications. We'll focus on concepts common to all platforms, using C++ as the implementation language. Once you complete this tutorial common to all native Node.js addons, you can move on to one of our platform-specific tutorials.
|
||||
|
||||
## Requirements
|
||||
|
||||
This tutorial assumes you have Node.js and npm installed, as well as the basic tools necessary for compiling code on your platform (like Visual Studio on Windows, Xcode on macOS, or GCC/Clang on Linux). You can find detailed instructions in the [`node-gyp` readme](https://github.com/nodejs/node-gyp?tab=readme-ov-file).
|
||||
|
||||
### Requirements: macOS
|
||||
|
||||
To build native Node.js addons on macOS, you'll need the Xcode Command Line Tools. These provide the necessary compilers and build tools (namely, `clang`, `clang++`, and `make`). The following command will prompt you to install the Command Line Tools if they aren't already installed.
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
### Requirements: Windows
|
||||
|
||||
The official Node.js installer offers the optional installation of "Tools for Native Modules", which installs everything required for the basic compilation of C++ modules - specifically, Python 3 and the "Visual Studio Desktop development with C++" workload. Alternatively, you can use `chocolatey`, `winget`, or the Windows Store.
|
||||
|
||||
### Requirements: Linux
|
||||
|
||||
* [A supported version of Python](https://devguide.python.org/versions/)
|
||||
* `make`
|
||||
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
|
||||
|
||||
## 1) Creating a package
|
||||
|
||||
First, create a new Node.js package that will contain your native addon:
|
||||
|
||||
```sh
|
||||
mkdir my-native-addon
|
||||
cd my-native-addon
|
||||
npm init -y
|
||||
```
|
||||
|
||||
This creates a basic `package.json` file. Next, we'll install the necessary dependencies:
|
||||
|
||||
```sh
|
||||
npm install node-addon-api bindings
|
||||
```
|
||||
|
||||
* `node-addon-api`: This is a C++ wrapper for the low-level Node.js API that makes it easier to build addons. It provides a C++ object-oriented API that's more convenient and safer to use than the raw C-style API.
|
||||
* `bindings`: A helper module that simplifies the process of loading your compiled native addon. It handles finding your compiled `.node` file automatically.
|
||||
|
||||
Now, let's update our `package.json` to include the appropriate build scripts. We will explain what these specifically do further below.
|
||||
|
||||
```json title='package.json'
|
||||
{
|
||||
"name": "my-native-addon",
|
||||
"version": "1.0.0",
|
||||
"description": "A native addon for Electron",
|
||||
"main": "js/index.js",
|
||||
"scripts": {
|
||||
"clean": "node -e \"require('fs').rmSync('build', { recursive: true, force: true })\"",
|
||||
"build": "node-gyp configure && node-gyp build"
|
||||
},
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"node-addon-api": "^8.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"node-gyp": "^11.1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
These scripts will:
|
||||
|
||||
* `clean`: Remove the build directory, allowing for a fresh build
|
||||
* `build`: Run the standard node-gyp build process to compile your addon
|
||||
|
||||
## 2) Setting up the build system
|
||||
|
||||
Node.js addons use a build system called `node-gyp`, which is a cross-platform command-line tool written in Node.js. It compiles native addon modules for Node.js using platform-specific build tools behind the scenes:
|
||||
|
||||
* On Windows: Visual Studio
|
||||
* On macOS: Xcode or command-line tools
|
||||
* On Linux: GCC or similar compilers
|
||||
|
||||
### Configuring `node-gyp`
|
||||
|
||||
The `binding.gyp` file is a JSON-like configuration file that tells node-gyp how to build your native addon. It's similar to a make file or a project file but in a platform-independent format. Let's create a basic `binding.gyp` file:
|
||||
|
||||
```json title='binding.gyp'
|
||||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "my_addon",
|
||||
"sources": [
|
||||
"src/my_addon.cc",
|
||||
"src/cpp_code.cc"
|
||||
],
|
||||
"include_dirs": [
|
||||
"<!@(node -p \"require('node-addon-api').include\")",
|
||||
"include"
|
||||
],
|
||||
"dependencies": [
|
||||
"<!(node -p \"require('node-addon-api').gyp\")"
|
||||
],
|
||||
"defines": [
|
||||
"NODE_ADDON_API_CPP_EXCEPTIONS"
|
||||
],
|
||||
"cflags!": ["-fno-exceptions"],
|
||||
"cflags_cc!": ["-fno-exceptions"],
|
||||
"xcode_settings": {
|
||||
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
||||
"CLANG_CXX_LIBRARY": "libc++",
|
||||
"MACOSX_DEPLOYMENT_TARGET": "10.14"
|
||||
},
|
||||
"msvs_settings": {
|
||||
"VCCLCompilerTool": {
|
||||
"ExceptionHandling": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Let's break down this configuration:
|
||||
|
||||
* `target_name`: The name of your addon. This determines the filename of the compiled module (my_addon.node).
|
||||
* `sources`: List of source files to compile. We'll have two files: the main addon file and our actual C++ implementation.
|
||||
* `include_dirs`: Directories to search for header files. The cryptic-looking line `<!@(node -p \"require('node-addon-api').include\")` runs a Node.js command to get the path to the node-addon-api include directory.
|
||||
* `dependencies`: The `node-addon-api` dependency. Similar to the include dirs, this executes a Node.js command to get the proper configuration.
|
||||
* `defines`: Preprocessor definitions. Here we're enabling C++ exceptions for node-addon-api.
|
||||
Platform-specific settings:
|
||||
* `cflags`! and cflags_cc!: Compiler flags for Unix-like systems
|
||||
* `xcode_settings`: Settings specific to macOS/Xcode compiler
|
||||
* `msvs_settings`: Settings specific to Microsoft Visual Studio on Windows
|
||||
|
||||
Now, create the directory structure for our project:
|
||||
|
||||
```sh
|
||||
mkdir src
|
||||
mkdir include
|
||||
mkdir js
|
||||
```
|
||||
|
||||
This creates:
|
||||
|
||||
* `src/`: Where our source files will go
|
||||
* `include/`: For header files
|
||||
* `js/`: For our JavaScript wrapper
|
||||
|
||||
## 3) "Hello World" from C++
|
||||
|
||||
Let's start by defining our C++ interface in a header file. Create `include/cpp_code.h`:
|
||||
|
||||
```cpp
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
namespace cpp_code {
|
||||
// A simple function that takes a string input and returns a string
|
||||
std::string hello_world(const std::string& input);
|
||||
} // namespace cpp_code
|
||||
```
|
||||
|
||||
The `#pragma once` directive is a header guard that prevents the file from being included multiple times in the same compilation unit. The actual function declaration is inside a namespace to avoid potential name conflicts.
|
||||
|
||||
Next, let's implement the function in `src/cpp_code.cc`:
|
||||
|
||||
```cpp title='src/cpp_code.cc'
|
||||
#include <string>
|
||||
#include "../include/cpp_code.h"
|
||||
|
||||
namespace cpp_code {
|
||||
std::string hello_world(const std::string& input) {
|
||||
// Simply concatenate strings and return
|
||||
return "Hello from C++! You said: " + input;
|
||||
}
|
||||
} // namespace cpp_code
|
||||
```
|
||||
|
||||
This is a simple implementation that just adds some text to the input string and returns it.
|
||||
|
||||
Now, let's create the addon code that bridges our C++ code with the Node.js/JavaScript world. Create `src/my_addon.cc`:
|
||||
|
||||
```cpp title='src/my_addon.cc'
|
||||
#include <napi.h>
|
||||
#include <string>
|
||||
#include "../include/cpp_code.h"
|
||||
|
||||
// Create a class that will be exposed to JavaScript
|
||||
class MyAddon : public Napi::ObjectWrap<MyAddon> {
|
||||
public:
|
||||
// This static method defines the class for JavaScript
|
||||
static Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
||||
// Define the JavaScript class with method(s)
|
||||
Napi::Function func = DefineClass(env, "MyAddon", {
|
||||
InstanceMethod("helloWorld", &MyAddon::HelloWorld)
|
||||
});
|
||||
|
||||
// Create a persistent reference to the constructor
|
||||
Napi::FunctionReference* constructor = new Napi::FunctionReference();
|
||||
*constructor = Napi::Persistent(func);
|
||||
env.SetInstanceData(constructor);
|
||||
|
||||
// Set the constructor on the exports object
|
||||
exports.Set("MyAddon", func);
|
||||
return exports;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
MyAddon(const Napi::CallbackInfo& info)
|
||||
: Napi::ObjectWrap<MyAddon>(info) {}
|
||||
|
||||
private:
|
||||
// Method that will be exposed to JavaScript
|
||||
Napi::Value HelloWorld(const Napi::CallbackInfo& info) {
|
||||
Napi::Env env = info.Env();
|
||||
|
||||
// Validate arguments (expecting one string)
|
||||
if (info.Length() < 1 || !info[0].IsString()) {
|
||||
Napi::TypeError::New(env, "Expected string argument").ThrowAsJavaScriptException();
|
||||
return env.Null();
|
||||
}
|
||||
|
||||
// Convert JavaScript string to C++ string
|
||||
std::string input = info[0].As<Napi::String>();
|
||||
|
||||
// Call our C++ function
|
||||
std::string result = cpp_code::hello_world(input);
|
||||
|
||||
// Convert C++ string back to JavaScript string and return
|
||||
return Napi::String::New(env, result);
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize the addon
|
||||
Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
||||
return MyAddon::Init(env, exports);
|
||||
}
|
||||
|
||||
// Register the initialization function
|
||||
NODE_API_MODULE(my_addon, Init)
|
||||
```
|
||||
|
||||
Let's break down this code:
|
||||
|
||||
1. We define a `MyAddon` class that inherits from `Napi::ObjectWrap<MyAddon>`, which handles wrapping our C++ class for JavaScript.
|
||||
2. The `Init` static method:
|
||||
2.1 Defines a JavaScript class with a method called `helloWorld`
|
||||
2.2 Creates a persistent reference to the constructor (to prevent garbage collection)
|
||||
2.3 Exports the class constructor
|
||||
3. The constructor simply passes its arguments to the parent class.
|
||||
4. The `HelloWorld` method:
|
||||
4.1 Gets the Napi environment
|
||||
4.2 Validates input arguments (expecting a string)
|
||||
4.3 Converts the JavaScript string to a C++ string
|
||||
4.4 Calls our C++ function
|
||||
4.5 Converts the result back to a JavaScript string and returns it
|
||||
5. We define an initialization function and register it with NODE_API_MODULE macro, which makes our module loadable by Node.js.
|
||||
|
||||
Now, let's create a JavaScript wrapper to make the addon easier to use. Create `js/index.js`:
|
||||
|
||||
```js title='js/index.js' @ts-expect-error=[5]
|
||||
const EventEmitter = require('events')
|
||||
|
||||
// Load the native addon using the 'bindings' module
|
||||
// This will look for the compiled .node file in various places
|
||||
const bindings = require('bindings')
|
||||
const native = bindings('my_addon')
|
||||
|
||||
// Create a nice JavaScript wrapper
|
||||
class MyNativeAddon extends EventEmitter {
|
||||
constructor () {
|
||||
super()
|
||||
|
||||
// Create an instance of our C++ class
|
||||
this.addon = new native.MyAddon()
|
||||
}
|
||||
|
||||
// Wrap the C++ method with a nicer JavaScript API
|
||||
helloWorld (input = '') {
|
||||
if (typeof input !== 'string') {
|
||||
throw new TypeError('Input must be a string')
|
||||
}
|
||||
return this.addon.helloWorld(input)
|
||||
}
|
||||
}
|
||||
|
||||
// Export a singleton instance
|
||||
if (process.platform === 'win32' || process.platform === 'darwin' || process.platform === 'linux') {
|
||||
module.exports = new MyNativeAddon()
|
||||
} else {
|
||||
// Provide a fallback for unsupported platforms
|
||||
console.warn('Native addon not supported on this platform')
|
||||
|
||||
module.exports = {
|
||||
helloWorld: (input) => `Hello from JS! You said: ${input}`
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This JavaScript wrapper:
|
||||
|
||||
1. Uses `bindings` to load our compiled native addon
|
||||
1. Creates a class that extends EventEmitter (useful for future extensions that might emit events)
|
||||
1. Instantiates our C++ class and provides a simpler API
|
||||
1. Adds some input validation on the JavaScript side
|
||||
1. Exports a singleton instance of our wrapper
|
||||
1. Handles unsupported platforms gracefully
|
||||
|
||||
### Building and testing the addon
|
||||
|
||||
Now we can build our native addon:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
This will run `node-gyp configure` and `node-gyp build` to compile our C++ code into a `.node` file.
|
||||
Let's create a simple test script to verify everything works. Create `test.js` in the project root:
|
||||
|
||||
```js title='test.js' @ts-expect-error=[2]
|
||||
// Load our addon
|
||||
const myAddon = require('./js')
|
||||
|
||||
// Try the helloWorld function
|
||||
const result = myAddon.helloWorld('This is a test')
|
||||
|
||||
// Should print: "Hello from C++! You said: This is a test"
|
||||
console.log(result)
|
||||
```
|
||||
|
||||
Run the test:
|
||||
|
||||
```sh
|
||||
node test.js
|
||||
```
|
||||
|
||||
If everything works correctly, you should see:
|
||||
|
||||
```txt
|
||||
Hello from C++! You said: This is a test
|
||||
```
|
||||
|
||||
### Using the addon in Electron
|
||||
|
||||
To use this addon in an Electron application, you would:
|
||||
|
||||
1. Include it as a dependency in your Electron project
|
||||
1. Build it targeting your specific Electron version. `electron-forge` handles this step automatically for you - for more details, see [Native Node Modules](./using-native-node-modules.md).
|
||||
1. Import and use it just like any other module in a process that has Node.js enabled.
|
||||
|
||||
```js @ts-expect-error=[2]
|
||||
// In your main process
|
||||
const myAddon = require('my-native-addon')
|
||||
console.log(myAddon.helloWorld('Electron'))
|
||||
```
|
||||
|
||||
## References and further learning
|
||||
|
||||
Native addon development can be written in several languages beyond C++. Rust can be used with crates like [`napi-rs`](https://github.com/napi-rs/napi-rs), [`neon`](https://neon-rs.dev/), or [`node-bindgen`](https://github.com/infinyon/node-bindgen). Objective-C/Swift can be used through Objective-C++ on macOS.
|
||||
|
||||
The specific implementation details differ significantly by platform, especially when accessing platform-specific APIs or UI frameworks, like Windows' Win32 API, COM components, UWP/WinRT - or macOS's Cocoa, AppKit, or ObjectiveC runtime.
|
||||
|
||||
This means that you'll likely use two groups of references for your native code: First, on the Node.js side, use the [N-API documentation](https://nodejs.org/api/n-api.html) to learn about creating and exposing complex structures to JavaScript - like asynchronous thread-safe function calls or creating JavaScript-native objects (`error`, `promise`, etc). Secondly, on the side of the technology you're working with, you'll likely be looking at their lower-level documentation:
|
||||
|
||||
* [Microsoft C++, C, and Assembler documentation](https://learn.microsoft.com/en-us/cpp/?view=msvc-170)
|
||||
* [C++/WinRT](https://learn.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/)
|
||||
* [MSVC-170 C++ Documentation](https://learn.microsoft.com/en-us/cpp/cpp/?view=msvc-170)
|
||||
* [Apple Developer Documentation](https://developer.apple.com/documentation)
|
||||
* [Programming with Objective-C](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011210)
|
||||
@@ -21,6 +21,7 @@
|
||||
-base/
|
||||
-chrome/
|
||||
-components/
|
||||
-content/browser/indexed_db
|
||||
-device/
|
||||
-extensions/
|
||||
-google_apis/
|
||||
|
||||
@@ -14,6 +14,7 @@ auto_filenames = {
|
||||
"docs/api/content-tracing.md",
|
||||
"docs/api/context-bridge.md",
|
||||
"docs/api/cookies.md",
|
||||
"docs/api/corner-smoothing-css.md",
|
||||
"docs/api/crash-reporter.md",
|
||||
"docs/api/debugger.md",
|
||||
"docs/api/desktop-capturer.md",
|
||||
|
||||
@@ -35,6 +35,7 @@ filenames = {
|
||||
"shell/browser/relauncher_linux.cc",
|
||||
"shell/browser/ui/electron_desktop_window_tree_host_linux.cc",
|
||||
"shell/browser/ui/file_dialog_linux.cc",
|
||||
"shell/browser/ui/file_dialog_linux_portal.cc",
|
||||
"shell/browser/ui/gtk/menu_gtk.cc",
|
||||
"shell/browser/ui/gtk/menu_gtk.h",
|
||||
"shell/browser/ui/gtk/menu_util.cc",
|
||||
@@ -125,6 +126,7 @@ filenames = {
|
||||
"shell/browser/animation_util.h",
|
||||
"shell/browser/animation_util_mac.mm",
|
||||
"shell/browser/api/electron_api_app_mac.mm",
|
||||
"shell/browser/api/electron_api_base_window_mac.mm",
|
||||
"shell/browser/api/electron_api_menu_mac.h",
|
||||
"shell/browser/api/electron_api_menu_mac.mm",
|
||||
"shell/browser/api/electron_api_native_theme_mac.mm",
|
||||
@@ -453,8 +455,6 @@ 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/url_pipe_loader.cc",
|
||||
"shell/browser/net/url_pipe_loader.h",
|
||||
"shell/browser/net/web_request_api_interface.h",
|
||||
"shell/browser/network_hints_handler_impl.cc",
|
||||
"shell/browser/network_hints_handler_impl.h",
|
||||
@@ -720,6 +720,8 @@ filenames = {
|
||||
"shell/renderer/electron_renderer_client.h",
|
||||
"shell/renderer/electron_sandboxed_renderer_client.cc",
|
||||
"shell/renderer/electron_sandboxed_renderer_client.h",
|
||||
"shell/renderer/electron_smooth_round_rect.cc",
|
||||
"shell/renderer/electron_smooth_round_rect.h",
|
||||
"shell/renderer/preload_realm_context.cc",
|
||||
"shell/renderer/preload_realm_context.h",
|
||||
"shell/renderer/preload_utils.cc",
|
||||
|
||||
@@ -1390,6 +1390,8 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__flat_map/sorted_equivalent.h",
|
||||
"//third_party/libc++/src/include/__flat_map/sorted_unique.h",
|
||||
"//third_party/libc++/src/include/__flat_map/utils.h",
|
||||
"//third_party/libc++/src/include/__flat_set/flat_set.h",
|
||||
"//third_party/libc++/src/include/__flat_set/ra_iterator.h",
|
||||
"//third_party/libc++/src/include/__format/buffer.h",
|
||||
"//third_party/libc++/src/include/__format/concepts.h",
|
||||
"//third_party/libc++/src/include/__format/container_adaptor.h",
|
||||
@@ -1460,12 +1462,14 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__fwd/get.h",
|
||||
"//third_party/libc++/src/include/__fwd/ios.h",
|
||||
"//third_party/libc++/src/include/__fwd/istream.h",
|
||||
"//third_party/libc++/src/include/__fwd/map.h",
|
||||
"//third_party/libc++/src/include/__fwd/mdspan.h",
|
||||
"//third_party/libc++/src/include/__fwd/memory.h",
|
||||
"//third_party/libc++/src/include/__fwd/memory_resource.h",
|
||||
"//third_party/libc++/src/include/__fwd/ostream.h",
|
||||
"//third_party/libc++/src/include/__fwd/pair.h",
|
||||
"//third_party/libc++/src/include/__fwd/queue.h",
|
||||
"//third_party/libc++/src/include/__fwd/set.h",
|
||||
"//third_party/libc++/src/include/__fwd/span.h",
|
||||
"//third_party/libc++/src/include/__fwd/sstream.h",
|
||||
"//third_party/libc++/src/include/__fwd/stack.h",
|
||||
@@ -1888,6 +1892,8 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__type_traits/negation.h",
|
||||
"//third_party/libc++/src/include/__type_traits/promote.h",
|
||||
"//third_party/libc++/src/include/__type_traits/rank.h",
|
||||
"//third_party/libc++/src/include/__type_traits/reference_constructs_from_temporary.h",
|
||||
"//third_party/libc++/src/include/__type_traits/reference_converts_from_temporary.h",
|
||||
"//third_party/libc++/src/include/__type_traits/remove_all_extents.h",
|
||||
"//third_party/libc++/src/include/__type_traits/remove_const.h",
|
||||
"//third_party/libc++/src/include/__type_traits/remove_const_ref.h",
|
||||
@@ -2012,6 +2018,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/fenv.h",
|
||||
"//third_party/libc++/src/include/filesystem",
|
||||
"//third_party/libc++/src/include/flat_map",
|
||||
"//third_party/libc++/src/include/flat_set",
|
||||
"//third_party/libc++/src/include/float.h",
|
||||
"//third_party/libc++/src/include/format",
|
||||
"//third_party/libc++/src/include/forward_list",
|
||||
|
||||
@@ -54,7 +54,7 @@ BrowserWindow.prototype._init = function (this: BWT) {
|
||||
});
|
||||
this.on('close', (event) => {
|
||||
queueMicrotask(() => {
|
||||
if (!unresponsiveEvent && !event.defaultPrevented) {
|
||||
if (!unresponsiveEvent && !event?.defaultPrevented) {
|
||||
unresponsiveEvent = setTimeout(emitUnresponsiveEvent, 5000);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -78,7 +78,9 @@ export const roleList: Record<RoleId, Role> = {
|
||||
minimize: {
|
||||
label: 'Minimize',
|
||||
accelerator: 'CommandOrControl+M',
|
||||
windowMethod: w => w.minimize()
|
||||
windowMethod: w => {
|
||||
if (w.minimizable) w.minimize();
|
||||
}
|
||||
},
|
||||
paste: {
|
||||
label: 'Paste',
|
||||
|
||||
@@ -93,7 +93,7 @@ Menu.prototype.popup = function (options = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
this.popupAt(window as unknown as BaseWindow, x, y, positioningItem, sourceType, callback);
|
||||
this.popupAt(window as unknown as BaseWindow, options.frame, x, y, positioningItem, sourceType, callback);
|
||||
return { browserWindow: window, x, y, position: positioningItem };
|
||||
};
|
||||
|
||||
|
||||
@@ -263,8 +263,17 @@ WebContents.prototype.print = function (options: ElectronInternal.WebContentsPri
|
||||
throw new TypeError('webContents.print(): Invalid print settings specified.');
|
||||
}
|
||||
|
||||
const pageSize = options.pageSize ?? 'A4';
|
||||
if (typeof pageSize === 'object') {
|
||||
const { pageSize } = options;
|
||||
if (typeof pageSize === 'string' && PDFPageSizes[pageSize]) {
|
||||
const mediaSize = PDFPageSizes[pageSize];
|
||||
options.mediaSize = {
|
||||
...mediaSize,
|
||||
imageable_area_left_microns: 0,
|
||||
imageable_area_bottom_microns: 0,
|
||||
imageable_area_right_microns: mediaSize.width_microns,
|
||||
imageable_area_top_microns: mediaSize.height_microns
|
||||
};
|
||||
} else if (typeof pageSize === 'object') {
|
||||
if (!pageSize.height || !pageSize.width) {
|
||||
throw new Error('height and width properties are required for pageSize');
|
||||
}
|
||||
@@ -286,16 +295,7 @@ WebContents.prototype.print = function (options: ElectronInternal.WebContentsPri
|
||||
imageable_area_right_microns: width,
|
||||
imageable_area_top_microns: height
|
||||
};
|
||||
} else if (typeof pageSize === 'string' && PDFPageSizes[pageSize]) {
|
||||
const mediaSize = PDFPageSizes[pageSize];
|
||||
options.mediaSize = {
|
||||
...mediaSize,
|
||||
imageable_area_left_microns: 0,
|
||||
imageable_area_bottom_microns: 0,
|
||||
imageable_area_right_microns: mediaSize.width_microns,
|
||||
imageable_area_top_microns: mediaSize.height_microns
|
||||
};
|
||||
} else {
|
||||
} else if (pageSize !== undefined) {
|
||||
throw new Error(`Unsupported pageSize: ${pageSize}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,6 @@ if (packagePath) {
|
||||
} else {
|
||||
// Call appCodeLoaded before just for safety, it doesn't matter here as _load is synchronous
|
||||
appCodeLoaded!();
|
||||
process._firstFileName = Module._resolveFilename(path.join(packagePath, mainStartupScript), null, false);
|
||||
Module._load(path.join(packagePath, mainStartupScript), Module, true);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -667,10 +667,10 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
return p(pathArgument, options);
|
||||
};
|
||||
|
||||
const { readFileSync } = fs;
|
||||
fs.readFileSync = function (pathArgument: string, options: any) {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readFileSync.apply(this, arguments);
|
||||
function readFileFromArchiveSync (
|
||||
pathInfo: { asarPath: string; filePath: string },
|
||||
options: any
|
||||
): ReturnType<typeof readFileSync> {
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
|
||||
const archive = getOrCreateArchive(asarPath);
|
||||
@@ -704,6 +704,14 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
fs.readSync(fd, buffer, 0, info.size, info.offset);
|
||||
validateBufferIntegrity(buffer, info.integrity);
|
||||
return (encoding) ? buffer.toString(encoding) : buffer;
|
||||
}
|
||||
|
||||
const { readFileSync } = fs;
|
||||
fs.readFileSync = function (pathArgument: string, options: any) {
|
||||
const pathInfo = splitPath(pathArgument);
|
||||
if (!pathInfo.isAsar) return readFileSync.apply(this, arguments);
|
||||
|
||||
return readFileFromArchiveSync(pathInfo, options);
|
||||
};
|
||||
|
||||
type ReaddirOptions = { encoding: BufferEncoding | null; withFileTypes?: false, recursive?: false } | undefined | null;
|
||||
@@ -980,25 +988,19 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
||||
};
|
||||
|
||||
const modBinding = internalBinding('modules');
|
||||
const { readPackageJSON } = modBinding;
|
||||
internalBinding('modules').readPackageJSON = (
|
||||
jsonPath: string,
|
||||
isESM: boolean,
|
||||
base: undefined | string,
|
||||
specifier: undefined | string
|
||||
) => {
|
||||
modBinding.overrideReadFileSync((jsonPath: string): Buffer | false | undefined => {
|
||||
const pathInfo = splitPath(jsonPath);
|
||||
if (!pathInfo.isAsar) return readPackageJSON(jsonPath, isESM, base, specifier);
|
||||
const { asarPath, filePath } = pathInfo;
|
||||
|
||||
const archive = getOrCreateArchive(asarPath);
|
||||
if (!archive) return undefined;
|
||||
// Fallback to Node.js internal implementation
|
||||
if (!pathInfo.isAsar) return undefined;
|
||||
|
||||
const realPath = archive.copyFileOut(filePath);
|
||||
if (!realPath) return undefined;
|
||||
|
||||
return readPackageJSON(realPath, isESM, base, specifier);
|
||||
};
|
||||
try {
|
||||
return readFileFromArchiveSync(pathInfo, undefined);
|
||||
} catch {
|
||||
// Not found
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
const { internalModuleStat } = binding;
|
||||
internalBinding('fs').internalModuleStat = (receiver: unknown, pathArgument: string) => {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"@electron/fiddle-core": "^1.3.4",
|
||||
"@electron/github-app-auth": "^2.2.1",
|
||||
"@electron/lint-roller": "^2.4.0",
|
||||
"@electron/typescript-definitions": "^9.0.0",
|
||||
"@electron/typescript-definitions": "^9.1.2",
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@primer/octicons": "^10.0.0",
|
||||
"@types/minimist": "^1.2.5",
|
||||
|
||||
@@ -82,7 +82,7 @@ index e04b80cd6a1a215fc87f8fd8d750c3d258c3974f..8fdf1c624794f568bfc77b7b6b0c510b
|
||||
|
||||
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 5ddc2d3b4cfb8a87eb22fb707230f56dcb7ccb3e..dea3c5b3adf49e1b4aab197e822744c80964afac 100644
|
||||
index b36c5885a31ff3242ac3104e6d875a008c7c39e4..8fe32508a00263295313e77992e2c208459ca42c 100644
|
||||
--- a/include/openssl/digest.h
|
||||
+++ b/include/openssl/digest.h
|
||||
@@ -48,6 +48,9 @@ OPENSSL_EXPORT const EVP_MD *EVP_blake2b256(void);
|
||||
|
||||
@@ -118,7 +118,7 @@ index 8fdf1c624794f568bfc77b7b6b0c510b23905a4d..2e40c031e8c681fe921331b26dbf63f4
|
||||
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 6bb135801326bc1cbe2b93f02e561e38c90abeca..06bcba4451456c72b168266859482343af76a931 100644
|
||||
index 13e68ad20ac08a462bb577d7f99e2c6f167579fa..4960d0eeb8f31bec4347ed2a1b63beba530de700 100644
|
||||
--- a/include/openssl/cipher.h
|
||||
+++ b/include/openssl/cipher.h
|
||||
@@ -448,6 +448,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
|
||||
|
||||
@@ -20,10 +20,10 @@ index 2cdcbc346175eeee69402ecee7f169e61c655199..f7226fe711e4214b216ea2c5173a0212
|
||||
|
||||
case ssl_open_record_error:
|
||||
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
|
||||
index c859ea612ce2e6be80c6351d85fae230ca5bc2dd..5f4ffedb3b19dee4eef62e2033b0000847167111 100644
|
||||
index d228b1c3b517e21fb8022c1927b0bc522f46bf78..4a94410d0ea4daabde1397c78c5e5de113398ddf 100644
|
||||
--- a/ssl/ssl_lib.cc
|
||||
+++ b/ssl/ssl_lib.cc
|
||||
@@ -1196,7 +1196,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
@@ -1205,7 +1205,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
||||
}
|
||||
|
||||
if (ret_code == 0) {
|
||||
@@ -32,7 +32,7 @@ index c859ea612ce2e6be80c6351d85fae230ca5bc2dd..5f4ffedb3b19dee4eef62e2033b00008
|
||||
return SSL_ERROR_ZERO_RETURN;
|
||||
}
|
||||
// An EOF was observed which violates the protocol, and the underlying
|
||||
@@ -2563,13 +2563,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
@@ -2572,13 +2572,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
||||
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
|
||||
disable_freezing_flags_after_init_in_node.patch
|
||||
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
|
||||
chore_add_electron_deps_to_gitignores.patch
|
||||
chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
|
||||
chore_modify_chromium_handling_of_mouse_events.patch
|
||||
add_electron_deps_to_license_credits_file.patch
|
||||
fix_crash_loading_non-standard_schemes_in_iframes.patch
|
||||
create_browser_v8_snapshot_file_name_fuse.patch
|
||||
@@ -131,13 +131,20 @@ osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch
|
||||
feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch
|
||||
chore_partial_revert_of.patch
|
||||
fix_software_compositing_infinite_loop.patch
|
||||
fix_add_method_which_disables_headless_mode_on_native_widget.patch
|
||||
fix_adjust_headless_mode_handling_in_native_widget.patch
|
||||
refactor_unfilter_unresponsive_events.patch
|
||||
build_disable_thin_lto_mac.patch
|
||||
feat_corner_smoothing_css_rule_and_blink_painting.patch
|
||||
build_add_public_config_simdutf_config.patch
|
||||
fix_multiple_scopedpumpmessagesinprivatemodes_instances.patch
|
||||
revert_code_health_clean_up_stale_macwebcontentsocclusion.patch
|
||||
ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch
|
||||
ignore_parse_errors_for_resolveshortcutproperties.patch
|
||||
feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch
|
||||
feat_separate_content_settings_callback_for_sync_and_async_clipboard.patch
|
||||
fix_win32_synchronous_spellcheck.patch
|
||||
chore_remove_conflicting_allow_unsafe_libc_calls.patch
|
||||
fix_linter_error.patch
|
||||
revert_enable_crel_for_arm32_targets.patch
|
||||
mac_fix_check_on_ime_reconversion_due_to_invalid_replacement_range.patch
|
||||
fix_osr_stutter_fix_backport_for_electron.patch
|
||||
do_not_check_the_order_of_display_id_order_on_windows.patch
|
||||
|
||||
@@ -23,10 +23,10 @@ index 44da0544b778d6ff4c14b6f4e8463cb8260d2f0d..8ae8939af4141a684b7a6d50a43e1abb
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index e995c76b1ecc50502c47862607408d0663e91738..9d675b45688572d3b38d29e7d2074e0fb4b737ac 100644
|
||||
index b78c7f64fd5e21a8d89318791bf639ab367d2d48..e8850312da428bcb9ec45b7c8605be1e516b22de 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4787,6 +4787,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4800,6 +4800,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index e995c76b1ecc50502c47862607408d0663e91738..9d675b45688572d3b38d29e7d2074e0f
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 398676cc0642115ff825beb1a593c3d14d4a5531..cc7cd3c73d72e933807b8d6f4e9e4ac43cbea00d 100644
|
||||
index a072319de5d16d8004cb33792b2275320627fe6a..f52aa0470ca53c9997961c398d2c79d25967562e 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -654,6 +654,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -653,6 +653,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 398676cc0642115ff825beb1a593c3d14d4a5531..cc7cd3c73d72e933807b8d6f4e9e4ac4
|
||||
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 d0d0ccafdd25cbac7fa7daa8e615b8ca1018a68b..6bf6b6b8a2847d4677383b9ee4574ebe6894c287 100644
|
||||
index fade7618e12889da5a1c3cbe465dec0869634407..53aaf91fe5e68465c9ec8b181e33b5ee95a5a5aa 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -665,6 +665,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -664,6 +664,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -92,10 +92,10 @@ index 8bb6b0465069529f79aaec21792e8b159535b3e9..f9782531c639d07002dda07732750a00
|
||||
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 cfcabe9a443adae146c816419e0845cb6fc18404..717587c2cfe0b0228ae40adce04139cb54a34d0e 100644
|
||||
index 66cc44003157657c68e90d295f877789395eca8d..19cd8460711d5d5b1b76c9e4cb82ed7fc71b410c 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
|
||||
@@ -296,6 +296,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -295,6 +295,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@ index 4c7375a27a22f04694e14fecc17d633734d4cccc..ea2a32b151aaf07b5704e463d01714eb
|
||||
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 6b967bd0b430732732ef30fb404e615a55c7c364..6bba885bca8f65744bcd03efcb98725649687856 100644
|
||||
index 286d95397da7b90ba28b4c4faaae26d6ab71a496..23fd67571152897b3bc93fde8e98e1d554cce275 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -415,6 +415,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -417,6 +417,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -7,10 +7,10 @@ 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 1368fae3346175c0fdd652d74f882eca26dd7aa2..7f2ca2366ea188bfb0a6e846a519b9cf790ec56a 100755
|
||||
index 7b948007755d306babea73498c17031c437ae6dc..adcfad8931c314f86d26347ccda438af452b8167 100755
|
||||
--- a/tools/licenses/licenses.py
|
||||
+++ b/tools/licenses/licenses.py
|
||||
@@ -336,6 +336,31 @@ SPECIAL_CASES = {
|
||||
@@ -337,6 +337,31 @@ SPECIAL_CASES = {
|
||||
"License": "Apache 2.0",
|
||||
"License File": ["//third_party/dawn/third_party/khronos/LICENSE"],
|
||||
},
|
||||
|
||||
@@ -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 fd162a607424bd4d0b324ccc7270522eb3b6a991..df1d5564a52ef67b447bbc222ceb1f864eb3dd81 100644
|
||||
index 8064a2c27d747d4862503526496a65987df7dc35..c92596713c6d3884be3f63bf78d9117b7ad3ec90 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
@@ -230,6 +230,16 @@ void ScopedClipboardWriter::WriteData(std::u16string_view format,
|
||||
@@ -237,6 +237,16 @@ void ScopedClipboardWriter::WriteData(std::u16string_view format,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index fd162a607424bd4d0b324ccc7270522eb3b6a991..df1d5564a52ef67b447bbc222ceb1f86
|
||||
objects_.clear();
|
||||
raw_objects_.clear();
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
index d8fd611e88c22f2c1319da769dcd14cc218f9c90..f17304e1e9fd202dc4e1b7724031dc4c333a4baf 100644
|
||||
index 939a99b2a086d5373f82fe96da73dabe02f6f9d8..fccc200b1b11076c8fcffde071a53598ffba9a12 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
@@ -87,6 +87,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
|
||||
|
||||
@@ -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 ff25e6eb48deb339ab92152eb09ad856068fd589..4a1f81429f0857e129e31103b026079de13fd826 100644
|
||||
index 628fe5557f963c52cbe0c5b24c6e06aaa81f9677..868f5eb60c35dfaa0a4e33e7f175743848e0cc2e 100644
|
||||
--- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
|
||||
@@ -48,6 +48,7 @@
|
||||
@@ -38,7 +38,7 @@ index ff25e6eb48deb339ab92152eb09ad856068fd589..4a1f81429f0857e129e31103b026079d
|
||||
+ PrefService* pref = static_cast<electron::ElectronBrowserContext*>(current_context)->prefs();
|
||||
ui::AXMode mode =
|
||||
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
|
||||
bool is_native_enabled = content::BrowserAccessibilityState::GetInstance()
|
||||
bool is_a11y_allowed = content::BrowserAccessibilityState::GetInstance()
|
||||
@@ -221,7 +222,7 @@ void HandleAccessibilityRequestCallback(
|
||||
data.Set(kPDFPrinting, pdf_printing ? kOn : kOff);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ index 6c679ef877067297ec3bf1a23af6c03a2af8dcf5..1ac93433189580c13b69cd52ce62681a
|
||||
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 a387789fe4270739408a9beb32a5ad1a8e51e5f6..43c108bd6b51d293e0f8b1b5393c76c5d167ccef 100644
|
||||
index 6c1e46e58d975137eee6c0fd7b01d2ae970a2e10..5ca29616369e76e298eb03188e18ca545c76a162 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -765,6 +765,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -39,7 +39,7 @@ index a387789fe4270739408a9beb32a5ad1a8e51e5f6..43c108bd6b51d293e0f8b1b5393c76c5
|
||||
return is_active();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
|
||||
index 5fb8a3dc69dc5fc5bfa08e01d8f03707a23c9274..41774b60b8cb7e0a22cedc597dc07ad15c96988c 100644
|
||||
index 56e52f079d1ad7c7a22764b976f0c8b2cc48dff2..1231fe522ad103e94d3c30ad7d5e5d23df9b3554 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -51,7 +51,7 @@ index 5fb8a3dc69dc5fc5bfa08e01d8f03707a23c9274..41774b60b8cb7e0a22cedc597dc07ad1
|
||||
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 92085aca6bd0c95a73b98e4173c0128d596b77f4..9503beefcbcfe7d99674582ece10a7e551fae96d 100644
|
||||
index d719b546b8c3c59003698b26dead065da7d76341..95a52f1cc2024e4a9cd694429d5304a5860a1c1e 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -579,8 +579,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
@@ -116,10 +116,10 @@ index b1689844282d6917b9750fbc6a875848ddf84b70..f1cc159b7c3448a33a6d9e213f8fbd3b
|
||||
// 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 c6a4f97c483667eaae354d8b99a01a6a3e765700..e4ab513573c7e327627b1ebd5b263f389098727a 100644
|
||||
index 1af1fa035b3da8967526d704e362ddbc5c3194ac..f470ada1bf84938427fb89f4508e5f56aaeebc1f 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2468,6 +2468,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -2466,6 +2466,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
|
||||
"old_state", old_state, "new_state", new_state);
|
||||
|
||||
@@ -130,7 +130,7 @@ index c6a4f97c483667eaae354d8b99a01a6a3e765700..e4ab513573c7e327627b1ebd5b263f38
|
||||
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 &&
|
||||
@@ -3994,10 +3998,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3989,10 +3993,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 f17c7ae24086ab0112bd1245291f6f512a74e223..a1a23d263e4842996c0f8dde4dca8d8b35802fda 100644
|
||||
index 2612e54a2b0d3c71bd8efe9340bc58c795500140..e590387effc958ba7215e75ea1e2a8173f624d02 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
|
||||
@@ -147,6 +147,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 f17c7ae24086ab0112bd1245291f6f512a74e223..a1a23d263e4842996c0f8dde4dca8d8b
|
||||
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 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d6d962747 100644
|
||||
index 85f312a9ea1eca0ff7ba4c679fabb3156aabbc0b..a9dc007a93003610d68e3118b4a47a86d4e16f6e 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,9 +43,9 @@ index 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d
|
||||
#include "build/build_config.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -442,6 +443,20 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
// when feature DynamicSafeAreaInsets is enabled.
|
||||
bool dynamic_safe_area_insets_enabled = false;
|
||||
@@ -451,6 +452,20 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
// WebView and by `kWebPayments` feature flag everywhere.
|
||||
bool payment_request_enabled = false;
|
||||
|
||||
+ // Begin Electron-specific WebPreferences.
|
||||
+ bool context_isolation = false;
|
||||
@@ -65,18 +65,18 @@ index 95e6b4c64bca410586378c88df288ef2bb0c6992..783c44be399a3bcf251b52c47340c26d
|
||||
// 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 68f936bc7103accc4521da0a12e5e0fad05cc86c..24f209d5694cdf7128a8fb58af4957f0905058a0 100644
|
||||
index 9b7bc55a0e61de85688b2370012e14f8b47c43ab..63b035046ac3d565e5ee1f3a3c559da88d81f059 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
|
||||
@@ -6,6 +6,7 @@
|
||||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_WEB_PREFERENCES_WEB_PREFERENCES_MOJOM_TRAITS_H_
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#include "mojo/public/cpp/base/file_path_mojom_traits.h"
|
||||
#include "mojo/public/cpp/bindings/struct_traits.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -434,6 +435,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -437,6 +438,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
return r.stylus_handwriting_enabled;
|
||||
}
|
||||
|
||||
@@ -130,18 +130,22 @@ index 68f936bc7103accc4521da0a12e5e0fad05cc86c..24f209d5694cdf7128a8fb58af4957f0
|
||||
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 f3f00b8430d131627191e0e689ab54256600e852..c88a348b9b991081609d5085890a0c2538555569 100644
|
||||
index e7c3bc263844c0ddeb9011440e2c0fd8f848ca27..142dae3834fe96f120727ef9ffe1250607bcadec 100644
|
||||
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
@@ -9,6 +9,7 @@ import "third_party/blink/public/mojom/css/preferred_contrast.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/string16.mojom";
|
||||
+import "mojo/public/mojom/base/file_path.mojom";
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "skia/public/mojom/skcolor.mojom";
|
||||
|
||||
+
|
||||
enum PointerType {
|
||||
kPointerNone = 1, // 1 << 0
|
||||
@@ -217,6 +218,19 @@ struct WebPreferences {
|
||||
kPointerFirstType = kPointerNone,
|
||||
@@ -218,6 +220,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 fb943cbe362b560d36f31076cf28c56eeb32c9d1..d29a28b96a5ed7152512382ed7001fc9e348aea8 100644
|
||||
index 2072f6b14289b1f3a76dbccc98f29aa178c1c35c..d7017437a7e7e6ac130677e52731d0482bf20664 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 fb943cbe362b560d36f31076cf28c56eeb32c9d1..d29a28b96a5ed7152512382ed7001fc9
|
||||
// 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 401679f818e7bba02be454f9aa3424e84d36c4af..4da759d7ab6d6fb6b6d4d1648da0e62d7629ad5c 100644
|
||||
index 84ce7a810816d8229f15b23a2f8bf36c00989378..f721051f30f517c863a935765d5dcd4760ab461e 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -746,10 +746,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -750,10 +750,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
DCHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -63,7 +63,7 @@ index 401679f818e7bba02be454f9aa3424e84d36c4af..4da759d7ab6d6fb6b6d4d1648da0e62d
|
||||
if (!Client())
|
||||
return false;
|
||||
|
||||
@@ -803,6 +799,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -807,6 +803,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
DCHECK(!view_->IsAttached());
|
||||
Client()->WillBeDetached();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: boringssl BUILD.gn
|
||||
Build BoringSSL with some extra functions that nodejs needs.
|
||||
|
||||
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
|
||||
index 12b2fb63dd3ff8c3d29d915a7d0f84a9d26c6e0a..c9fd2c069473b1c21ca8610afb246337c412e0be 100644
|
||||
index b962901a7db8e6e50155dabbb1371124b12f9b26..b01e197ae2e411a376ffa28b9058d62a16abf23b 100644
|
||||
--- a/third_party/boringssl/BUILD.gn
|
||||
+++ b/third_party/boringssl/BUILD.gn
|
||||
@@ -48,6 +48,21 @@ all_sources = bcm_internal_headers + bcm_sources + crypto_internal_headers +
|
||||
|
||||
@@ -8,7 +8,7 @@ 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 c428a5f8d79e826077ab05fb6c56ae8e0e4ff609..c5fd8782fc1343f04f9e2c2c0414245d20696193 100644
|
||||
index 19e3f2fc7b3e08f690eb8c3b56c5b5222f645691..b0b7af16b6719a08ab7908ab4d96a5d2c3ea0340 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -91,6 +91,7 @@ PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
|
||||
|
||||
@@ -11,7 +11,7 @@ To accomplish this, we need to make simdutf's config public here
|
||||
for use by third_party/electron_node.
|
||||
|
||||
diff --git a/third_party/simdutf/BUILD.gn b/third_party/simdutf/BUILD.gn
|
||||
index d88fe7e43ac2a8129702e58bd2cd2aea094452e3..3cbeb89587f37b0ebc3622258fea0161ebf1d7b2 100644
|
||||
index 5fbce38841f04dad38f202f529ae84c609c6a8de..9f5ef9bceade8e30bbd2be616b9143e9708fefd8 100644
|
||||
--- a/third_party/simdutf/BUILD.gn
|
||||
+++ b/third_party/simdutf/BUILD.gn
|
||||
@@ -6,9 +6,14 @@ source_set("header") {
|
||||
|
||||
@@ -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 dee8a4413f62ac5535f4bce504ff0dc934db743a..064a62b40679f05feac3c81f9d6e6c2c90972727 100644
|
||||
index 55921115094f7437ce10db1cac1debe9adc10ea9..7040d83af340f052f5cab4437433e3dd0a688390 100644
|
||||
--- a/content/public/common/BUILD.gn
|
||||
+++ b/content/public/common/BUILD.gn
|
||||
@@ -380,6 +380,8 @@ mojom("interfaces") {
|
||||
@@ -379,6 +379,8 @@ mojom("interfaces") {
|
||||
"//content/common/*",
|
||||
"//extensions/common:mojom",
|
||||
"//extensions/common:mojom_blink",
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: build: allow electron to use exec_script
|
||||
This is similar to the //build usecase so we're OK adding ourselves here
|
||||
|
||||
diff --git a/.gn b/.gn
|
||||
index 3f6571828197301361ebde2e19e8e3138597c276..9effa81a564c3d2afae3eb2bb7438635e45f124a 100644
|
||||
index 54d2631ec203207f44038a36439613709fec1669..d7e197dc75dd711b1b2eb179a58de9030bde0465 100644
|
||||
--- a/.gn
|
||||
+++ b/.gn
|
||||
@@ -172,4 +172,26 @@ exec_script_allowlist =
|
||||
@@ -173,4 +173,27 @@ exec_script_allowlist =
|
||||
|
||||
"//tools/grit/grit_rule.gni",
|
||||
"//tools/gritsettings/BUILD.gn",
|
||||
@@ -34,5 +34,6 @@ index 3f6571828197301361ebde2e19e8e3138597c276..9effa81a564c3d2afae3eb2bb7438635
|
||||
+ "//third_party/electron_node/deps/sqlite/unofficial.gni",
|
||||
+ "//third_party/electron_node/deps/uv/unofficial.gni",
|
||||
+ "//third_party/electron_node/deps/uvwasi/unofficial.gni",
|
||||
+ "//third_party/electron_node/deps/zstd/unofficial.gni",
|
||||
+ "//third_party/electron_node/src/inspector/unofficial.gni",
|
||||
]
|
||||
|
||||
@@ -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 bdf6d5865fb0069f4df368613167069d2fb50c86..93a126365406badf911d938dde2dcd8b140b7f6f 100644
|
||||
index 95c73dcb082999d0a85d82f1fe330d27c88055ca..64cd976eba849435779b280b2941f9150b5d1d36 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -196,11 +196,16 @@ if (!is_android && !is_mac) {
|
||||
@@ -200,11 +200,16 @@ if (!is_android && !is_mac) {
|
||||
"common/crash_keys.h",
|
||||
]
|
||||
|
||||
@@ -33,10 +33,10 @@ index bdf6d5865fb0069f4df368613167069d2fb50c86..93a126365406badf911d938dde2dcd8b
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 0c9c08fe6c1303bc624464582857eb05b422f14c..adb35ecb5ba8fa69b2f20a6b4fd6a154a792bee3 100644
|
||||
index b5783087429ee651d21e04f6f5f11f5cb6f015a8..dae1cca8cee4fccfed3183aca1ba7cc32652ea58 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4565,7 +4565,7 @@ static_library("browser") {
|
||||
@@ -4599,7 +4599,7 @@ static_library("browser") {
|
||||
[ "//chrome/browser/ui/webui/signin:profile_impl" ]
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 0c9c08fe6c1303bc624464582857eb05b422f14c..adb35ecb5ba8fa69b2f20a6b4fd6a154
|
||||
# than here in :chrome_dll.
|
||||
deps += [ "//chrome:packed_resources_integrity_header" ]
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 77056dcfa38390f5e047a9a9fea2e86357c33237..9c9f2c4bd3de71928e63ee8ea8f33a51c3404302 100644
|
||||
index a1338c3f145e3ae0ca0acbe20ffcec35c3cc5ba1..39d0efc3367b80b18cf3a4ef8756f147807ad79b 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7052,9 +7052,12 @@ test("unit_tests") {
|
||||
@@ -7096,9 +7096,12 @@ test("unit_tests") {
|
||||
"//chrome/notification_helper",
|
||||
]
|
||||
|
||||
@@ -63,7 +63,7 @@ index 77056dcfa38390f5e047a9a9fea2e86357c33237..9c9f2c4bd3de71928e63ee8ea8f33a51
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/app:win_unit_tests",
|
||||
@@ -8015,6 +8018,10 @@ test("unit_tests") {
|
||||
@@ -8067,6 +8070,10 @@ test("unit_tests") {
|
||||
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
|
||||
]
|
||||
|
||||
@@ -74,7 +74,7 @@ index 77056dcfa38390f5e047a9a9fea2e86357c33237..9c9f2c4bd3de71928e63ee8ea8f33a51
|
||||
sources += [
|
||||
# The importer code is not used on Android.
|
||||
"../common/importer/firefox_importer_utils_unittest.cc",
|
||||
@@ -8070,7 +8077,6 @@ test("unit_tests") {
|
||||
@@ -8122,7 +8129,6 @@ test("unit_tests") {
|
||||
# Non-android deps for "unit_tests" target.
|
||||
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 b5c5cb75e5fe2c58b1ee9051a9fe8cc082b88efa..8bf8d75205e984878219dcc5016b8665b9f65577 100644
|
||||
index a9d2caeb1c92e102daa9a8bd5bdc5a55af418cf4..efb5bf91722d4b18ae704ebf7355a13f253bef20 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
@@ -7,10 +7,10 @@ Build libc++ as static library to compile and pass
|
||||
nan tests
|
||||
|
||||
diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
|
||||
index 3f437d2b9c193285bdc200c2781b13de75ba993d..d9493066ddc7d7198acc76f345c726be021d8fce 100644
|
||||
index 29e8bbcb5e7ee2fb310ce00b0c20913424adc9c8..649330dde1e2b717e0af5a15834bf96ae4e19245 100644
|
||||
--- a/buildtools/third_party/libc++/BUILD.gn
|
||||
+++ b/buildtools/third_party/libc++/BUILD.gn
|
||||
@@ -204,7 +204,11 @@ libcxx_modules("std_wctype_h") {
|
||||
@@ -269,7 +269,11 @@ libcxx_modules("std_wctype_h") {
|
||||
if (libcxx_is_shared) {
|
||||
_libcxx_target_type = "shared_library"
|
||||
} else {
|
||||
@@ -23,7 +23,7 @@ index 3f437d2b9c193285bdc200c2781b13de75ba993d..d9493066ddc7d7198acc76f345c726be
|
||||
}
|
||||
|
||||
target(_libcxx_target_type, "libc++") {
|
||||
@@ -213,6 +217,7 @@ target(_libcxx_target_type, "libc++") {
|
||||
@@ -278,6 +282,7 @@ target(_libcxx_target_type, "libc++") {
|
||||
# need to explicitly depend on libc++.
|
||||
visibility = [
|
||||
"//build/config:common_deps",
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index d7f1dc68e780f08af438c6ce67a3c856ef31daef..09752e9cda20f0020976015d58f73f320031d11e 100644
|
||||
index d9be4e90a7c43a8a7dec829304856daddcc58dc0..f6f98ea0824896e7e0a27e672480660b0671d146 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -9612,6 +9612,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -9652,6 +9652,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
@@ -21,10 +21,10 @@ index d7f1dc68e780f08af438c6ce67a3c856ef31daef..09752e9cda20f0020976015d58f73f32
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index c3e88374849c6062195fb78072123f05e1929fe8..79bc1f7a5c44a0dd255b5ca676d95c9fa9c31496 100644
|
||||
index 2896b2b15d9c22e27c37719867c20213b9983984..83c5918c1bc0417ed3c744828b9f93e7c00d22c3 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -5032,6 +5032,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5101,6 +5101,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params,
|
||||
opener);
|
||||
|
||||
@@ -37,7 +37,7 @@ index c3e88374849c6062195fb78072123f05e1929fe8..79bc1f7a5c44a0dd255b5ca676d95c9f
|
||||
// If the new frame has a name, make sure any SiteInstances that can find
|
||||
// this named frame have proxies for it. Must be called after
|
||||
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
|
||||
@@ -5073,12 +5079,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5142,12 +5148,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ index c3e88374849c6062195fb78072123f05e1929fe8..79bc1f7a5c44a0dd255b5ca676d95c9f
|
||||
new_contents_impl, opener, params.target_url,
|
||||
params.referrer.To<Referrer>(), params.disposition,
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index 91dcf6c9c4a2d840fb50cb329fe3ef1bba9103c3..cbc887a3034605a93468e73a310e9ca6838b32d8 100644
|
||||
index 55bb4ae3bab4cdf20b3e1dde9450a5c0e4e62b37..fe444c7fa140166a1b65c7a8a2676e2de7c4e0fc 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -621,6 +621,10 @@ struct CreateNewWindowParams {
|
||||
// The navigation initiator's user activation and ad status.
|
||||
blink.mojom.NavigationInitiatorActivationAndAdStatus
|
||||
initiator_activation_and_ad_status;
|
||||
@@ -646,6 +646,10 @@ struct CreateNewWindowParams {
|
||||
pending_associated_remote<blink.mojom.Widget> widget;
|
||||
pending_associated_receiver<blink.mojom.FrameWidgetHost> frame_widget_host;
|
||||
pending_associated_remote<blink.mojom.FrameWidget> frame_widget;
|
||||
+
|
||||
+ // Extra fields added by Electron.
|
||||
+ string raw_features;
|
||||
@@ -66,10 +66,10 @@ index 91dcf6c9c4a2d840fb50cb329fe3ef1bba9103c3..cbc887a3034605a93468e73a310e9ca6
|
||||
|
||||
// Operation result when the renderer asks the browser to create a new window.
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index eacc673508fded48288c90920f424e93f99f96cd..7eb3bb261a66b3bf8e5eaaea82962838376f3765 100644
|
||||
index e2382e9769cb79d676715187a2b8b00392e5445c..22400e44369b8ffb4b3fd886c981afea7a90da02 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -805,6 +805,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -820,6 +820,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -79,7 +79,7 @@ index eacc673508fded48288c90920f424e93f99f96cd..7eb3bb261a66b3bf8e5eaaea82962838
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index cafc62e4b6da45e63cb77d27de9794d4b34cb408..da93d31b658577bd4817b2dcfe366d444dbc2e92 100644
|
||||
index 9b75a6c3c222a93319e0f26f351aed3dbe6ead28..8a7ea32eb4ea4a78662b96a2eef5a0de4229d214 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -199,6 +199,7 @@ class NetworkService;
|
||||
@@ -90,7 +90,7 @@ index cafc62e4b6da45e63cb77d27de9794d4b34cb408..da93d31b658577bd4817b2dcfe366d44
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -1357,6 +1358,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -1376,6 +1377,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -100,7 +100,7 @@ index cafc62e4b6da45e63cb77d27de9794d4b34cb408..da93d31b658577bd4817b2dcfe366d44
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
|
||||
index ac4deeb6acebf79987591756320e2406d74d7a1e..f688e6d1e6c11f0dd80f498e6361fa822e8c2eb8 100644
|
||||
index b390356721fa226c348923f33601c4a1a2d9702d..97a3ea6f292563a41fd41f812ac72526a96d8471 100644
|
||||
--- a/content/public/browser/web_contents_delegate.cc
|
||||
+++ b/content/public/browser/web_contents_delegate.cc
|
||||
@@ -32,6 +32,17 @@ namespace content {
|
||||
@@ -122,7 +122,7 @@ index ac4deeb6acebf79987591756320e2406d74d7a1e..f688e6d1e6c11f0dd80f498e6361fa82
|
||||
WebContents* source,
|
||||
const OpenURLParams& params,
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index ac2e7cdceb13ce07966a908fab3ff8feff969484..96cb58b1a88499cf8f78d748dc5a1cc1c6b6a128 100644
|
||||
index da319cb20733150366d85bee95609f0f2d9def7f..8a18958035cc1dd26be558349f64f7727570c4ba 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -18,6 +18,7 @@
|
||||
@@ -133,7 +133,7 @@ index ac2e7cdceb13ce07966a908fab3ff8feff969484..96cb58b1a88499cf8f78d748dc5a1cc1
|
||||
#include "content/public/browser/eye_dropper.h"
|
||||
#include "content/public/browser/fullscreen_types.h"
|
||||
#include "content/public/browser/invalidate_type.h"
|
||||
@@ -375,6 +376,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -376,6 +377,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
const StoragePartitionConfig& partition_config,
|
||||
SessionStorageNamespace* session_storage_namespace);
|
||||
|
||||
@@ -148,10 +148,10 @@ index ac2e7cdceb13ce07966a908fab3ff8feff969484..96cb58b1a88499cf8f78d748dc5a1cc1
|
||||
// typically happens when popups are created.
|
||||
virtual void WebContentsCreated(WebContents* source_contents,
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index d7f25fd51ce82e20146d2df0978644deb6297fbb..e995c76b1ecc50502c47862607408d0663e91738 100644
|
||||
index b46ceca2998e6f3706aff3705b9639948eebf60b..b78c7f64fd5e21a8d89318791bf639ab367d2d48 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -6908,6 +6908,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
@@ -6925,6 +6925,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
|
||||
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
|
||||
GetWebFrame()->IsAdScriptInStack());
|
||||
|
||||
@@ -210,10 +210,10 @@ index 82e9d3dfb5f7da76d89fe15ae61d379fa46e177d..fd035512099a54dff6cc951a2226c23a
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
index b44f0db98f89befc33430bcf275bffcfae9e7171..66f92d1e975a74720af12662447ea214ac210248 100644
|
||||
index f4a1ed78679c5efaea6494a4aa8b22fff31cba1b..afa637807b0a5bdef126031f219115ecee8d478d 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
@@ -2270,6 +2270,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
@@ -2272,6 +2272,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
WebWindowFeatures window_features =
|
||||
GetWindowFeaturesFromString(features, entered_window);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: chore: add electron deps to gitignores
|
||||
Makes things like "git status" quicker when developing electron locally
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 375db3d02ce2837ba69e3e93c38cde7153ba079f..fc3f4f71c43facf695d326f0bc64e0ad920aa9ac 100644
|
||||
index 0a0f0118d5c1a5a2f3ad28b068bebb849eba7246..5ca6d03b709ef119ccd6482b2f305f8a3aeb7438 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -217,6 +217,7 @@ vs-chromium-project.txt
|
||||
|
||||
@@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
|
||||
of explicitly adding ScopedAllowBlocking calls as friends.
|
||||
|
||||
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
|
||||
index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e0f597937 100644
|
||||
index d97240a7b0dcf63737808850b6ef83852155b794..4a58b1f3e8c2bee32084be82977239e911598077 100644
|
||||
--- a/base/threading/thread_restrictions.h
|
||||
+++ b/base/threading/thread_restrictions.h
|
||||
@@ -132,6 +132,7 @@ class KeyStorageLinux;
|
||||
@@ -18,7 +18,7 @@ index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e
|
||||
class Profile;
|
||||
class ProfileImpl;
|
||||
class ScopedAllowBlockingForProfile;
|
||||
@@ -278,6 +279,9 @@ class BackendImpl;
|
||||
@@ -277,6 +278,9 @@ class BackendImpl;
|
||||
class InFlightIO;
|
||||
bool CleanupDirectorySync(const base::FilePath&);
|
||||
} // namespace disk_cache
|
||||
@@ -36,7 +36,7 @@ index 56ddbc2d4fa336bcdbe9aaacd4bf8bbaa3573239..7859ce547dc00c2842fe1aa3699cf20e
|
||||
friend class ::ProfileImpl;
|
||||
friend class ::ScopedAllowBlockingForProfile;
|
||||
friend class ::StartupTabProviderImpl;
|
||||
@@ -615,6 +620,7 @@ class BASE_EXPORT ScopedAllowBlocking {
|
||||
@@ -614,6 +619,7 @@ class BASE_EXPORT ScopedAllowBlocking {
|
||||
friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
|
||||
friend class drive::FakeDriveService;
|
||||
friend class extensions::DesktopAndroidExtensionSystem;
|
||||
|
||||
@@ -1,16 +1,43 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Fri, 29 Jul 2022 00:29:35 +0900
|
||||
Subject: chore: allow chromium to handle synthetic mouse events for touch
|
||||
Subject: chore: modify chromium handling of mouse events
|
||||
|
||||
With WCO, allow chromium to handle synthetic mouse events generated for touch
|
||||
This patch does the following:
|
||||
|
||||
1. When Windows Control Overlay is enabled, it allows chromium to handle synthetic mouse events generated for touch
|
||||
actions in the non-client caption area.
|
||||
2. It calls HandleMouseEvent on the delegate earlier in HandleMouseEventInternal, so that Electron can selectively disable
|
||||
draggable regions to allow events to propagate to the underlying renderer.
|
||||
|
||||
diff --git a/ui/events/event.h b/ui/events/event.h
|
||||
index 39b5a8fdd165efd74b00256552b51b5413107958..bfc4ef4f50efff4a77f2aef64335bb7e34c69f34 100644
|
||||
--- a/ui/events/event.h
|
||||
+++ b/ui/events/event.h
|
||||
@@ -587,6 +587,9 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
|
||||
const PointerDetails& pointer_details() const { return pointer_details_; }
|
||||
|
||||
+ bool is_system_menu() const { return is_system_menu_; }
|
||||
+ void set_is_system_menu(bool is_menu) { is_system_menu_ = is_menu; }
|
||||
+
|
||||
// Event:
|
||||
std::string ToString() const override;
|
||||
std::unique_ptr<Event> Clone() const override;
|
||||
@@ -619,6 +622,8 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
|
||||
|
||||
// Structure for holding pointer details for implementing PointerEvents API.
|
||||
PointerDetails pointer_details_;
|
||||
+
|
||||
+ bool is_system_menu_ = false;
|
||||
};
|
||||
|
||||
class ScrollEvent;
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
index 2d05856687cd9669f72553d33c8033fd9083b4f8..645b7dd2cc20ce64ffa541c74930f541f083f931 100644
|
||||
index 1d298f66a2c2a0f02668af797b3a421fe5578d56..4780229a4453ad5ca2c89b786459f64c58bf2272 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
@@ -1357,6 +1357,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
|
||||
@@ -1386,6 +1386,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
|
||||
window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds);
|
||||
}
|
||||
|
||||
@@ -22,10 +49,10 @@ index 2d05856687cd9669f72553d33c8033fd9083b4f8..645b7dd2cc20ce64ffa541c74930f541
|
||||
DesktopWindowTreeHostWin::GetSingletonDesktopNativeCursorManager() {
|
||||
return new DesktopNativeCursorManagerWin();
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
|
||||
index 932351e288f37fd09ae1a43f44e8b51fb0caa4b8..4a0616bc210d234e51e564daabdd2ebd5ac9fc16 100644
|
||||
index 2ee5e4b4673f4f18880dddecc48118c89823fd3f..37109b8d3d439073b5c9e2ea3597c36f32de5704 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
|
||||
@@ -267,6 +267,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin : public DesktopWindowTreeHost,
|
||||
@@ -268,6 +268,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin : public DesktopWindowTreeHost,
|
||||
void HandleWindowSizeUnchanged() override;
|
||||
void HandleWindowScaleFactorChanged(float window_scale_factor) override;
|
||||
void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) override;
|
||||
@@ -34,10 +61,10 @@ index 932351e288f37fd09ae1a43f44e8b51fb0caa4b8..4a0616bc210d234e51e564daabdd2ebd
|
||||
// Overridden from WidgetObserver.
|
||||
void OnWidgetThemeChanged(Widget* widget) override;
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 2bd015be3178ab8dea012d6b1f71d13dd0548c14..759f00dd4e674d1dfca690b82e6e1820900ebf0c 100644
|
||||
index 701f89b053674be1bad0a1a3612340a65c1ccfe7..ac7e189f26da75f6f8b40e69cf4bfee94acddd38 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3144,15 +3144,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
@@ -3186,15 +3186,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
}
|
||||
// We must let Windows handle the caption buttons if it's drawing them, or
|
||||
// they won't work.
|
||||
@@ -59,8 +86,35 @@ index 2bd015be3178ab8dea012d6b1f71d13dd0548c14..759f00dd4e674d1dfca690b82e6e1820
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3217,6 +3221,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
// handle alt-space, or in the frame itself.
|
||||
is_right_mouse_pressed_on_caption_ = false;
|
||||
ReleaseCapture();
|
||||
+
|
||||
// |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu()
|
||||
// expect screen coordinates.
|
||||
POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
|
||||
@@ -3224,7 +3229,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
|
||||
w_param = static_cast<WPARAM>(SendMessage(
|
||||
hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)));
|
||||
if (w_param == HTCAPTION || w_param == HTSYSMENU) {
|
||||
- ShowSystemMenuAtScreenPixelLocation(hwnd(), gfx::Point(screen_point));
|
||||
+ LONG message_time = GetMessageTime();
|
||||
+ CHROME_MSG msg = {hwnd(),
|
||||
+ message,
|
||||
+ w_param,
|
||||
+ l_param,
|
||||
+ static_cast<DWORD>(message_time),
|
||||
+ {CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param)}};
|
||||
+ ui::MouseEvent event(msg);
|
||||
+ event.set_is_system_menu(true);
|
||||
+ if (!delegate_->HandleMouseEvent(&event))
|
||||
+ ShowSystemMenuAtScreenPixelLocation(hwnd(), gfx::Point(screen_point));
|
||||
return 0;
|
||||
}
|
||||
} else if (message == WM_NCLBUTTONDOWN &&
|
||||
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
index 04dea68d74ea4f559db60f716c919e555db9ec80..2f8bd1a3c156bb6c04663c74b7279bb59926fc3d 100644
|
||||
index 83c26bf2b4bc11c0e3d839093eea56eed1bf581b..075e456e851bbde2b0174ca0cc34428cc32b6966 100644
|
||||
--- a/ui/views/win/hwnd_message_handler_delegate.h
|
||||
+++ b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
@@ -255,6 +255,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
|
||||
@@ -14,10 +14,10 @@ track down the source of this problem & figure out if we can fix it
|
||||
by changing something in Electron.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 86a1a0244a3744d0571c046d3e6fc9413c9fbbf0..1396f371c8ae82a1ce52096c176a135cf02b2d65 100644
|
||||
index 5465e9d42a5c4eed3b6f819418a7b0ab92c7eae2..54ff9675fef009c5bb79becb59146436508ad835 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4951,7 +4951,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -5020,7 +5020,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
: IsGuest();
|
||||
// While some guest types do not have a guest SiteInstance, the ones that
|
||||
// don't all override WebContents creation above.
|
||||
|
||||
@@ -14,7 +14,7 @@ This change patches it out to prevent the DCHECK.
|
||||
It can be removed once/if we see a better solution to the problem.
|
||||
|
||||
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
||||
index d4dd73e7fa1e550d0d13b4c09da0ce6899894494..679a59db98261eca3fbbd7ddb20516ab4f618cfb 100644
|
||||
index adaa1cd426c138972b088d0d0093b0e1653af231..be4684c94ba2214255c5dbe9cdcf1ea316c60c06 100644
|
||||
--- a/content/browser/site_instance_impl.cc
|
||||
+++ b/content/browser/site_instance_impl.cc
|
||||
@@ -229,7 +229,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
|
||||
|
||||
@@ -9,7 +9,7 @@ Electron does not support Profiles, so this Profile::FromBrowserContext()
|
||||
call is not needed and will not link. This change patches it out.
|
||||
|
||||
diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
|
||||
index 9774ed3e55c0d78f21bb0cb0b2607cc07eaf78e0..f58c3946130fa469f2775d8bae773e5bbfc71a96 100644
|
||||
index e3b9f14a4cf2167064ce6716053e663adffa1542..65f13a4607c8145858fd47d81cb9960c44272d79 100644
|
||||
--- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
|
||||
+++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
|
||||
@@ -45,6 +45,7 @@ namespace {
|
||||
|
||||
@@ -80,10 +80,10 @@ index 4fd8dff1089cd6afa6a66dc185734d7671657281..0a1f4268ea771a3d5d4a2668928c6e5d
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params,
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index fafd84d08e33622aee01f1792c043180a13dd48d..4490915e0b5c8e93255c6d526d5f37eb6f6b362d 100644
|
||||
index d45f8f1713c875f2d430f9155f0cbe626a5f233f..00c7db5afa636d5d1da4e5d2cb01ebcbec70304b 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -2222,12 +2222,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -2289,12 +2289,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -99,10 +99,10 @@ index fafd84d08e33622aee01f1792c043180a13dd48d..4490915e0b5c8e93255c6d526d5f37eb
|
||||
|
||||
WebContents* Browser::CreateCustomWebContents(
|
||||
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
|
||||
index 8fda0dfbe8e10a3830bd03a994e7d39817584d36..baf24bbeb9f57fe2609a1af51a6ee4f5abd86ce2 100644
|
||||
index ce1e404e45a60e43de9580fe8d60fa72ec90b8f4..9267e93fdd03fad3848a45a1c6d090566cac317c 100644
|
||||
--- a/chrome/browser/ui/browser.h
|
||||
+++ b/chrome/browser/ui/browser.h
|
||||
@@ -980,8 +980,7 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -1005,8 +1005,7 @@ class Browser : public TabStripModelObserver,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -141,10 +141,10 @@ index ca72b324bf7c3b81ac94b53f0ff454d2df177950..d60ef3075d126e2bbd50c8469f2bf67c
|
||||
// The profile used for the presentation.
|
||||
raw_ptr<Profile, DanglingUntriaged> otr_profile_;
|
||||
diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
|
||||
index 83a0a538fef0da1d3674293d20dac7b8a252273f..155c8a0af46e20f68f8b028c056092b404062861 100644
|
||||
index 1085003ab18d471d5c018ac68041924d458fcec7..4aac70febec9f0abadd1ecb96d9066e6c270efca 100644
|
||||
--- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
|
||||
+++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
|
||||
@@ -99,8 +99,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
|
||||
@@ -100,8 +100,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -155,10 +155,10 @@ index 83a0a538fef0da1d3674293d20dac7b8a252273f..155c8a0af46e20f68f8b028c056092b4
|
||||
}
|
||||
content::WebContents* CreateCustomWebContents(
|
||||
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
index fb08ed752db063c5a295c479bc5ad990826104cd..659e642cb660263a1cba9bb485ed3f67c2939c0f 100644
|
||||
index e0264aff5b60bb5e76ac7687222403dfba516e66..915abd2475f6be95d973f827522f7ef12052a81c 100644
|
||||
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
@@ -188,14 +188,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
|
||||
@@ -189,14 +189,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -176,7 +176,7 @@ index fb08ed752db063c5a295c479bc5ad990826104cd..659e642cb660263a1cba9bb485ed3f67
|
||||
java_gurl);
|
||||
}
|
||||
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.h b/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
index 45d0fc1b9dbeb1c1b5a28a07fb8cf26d3388bfd9..d311ea8dc016659ee8355bc4e7742b4e3ebc413c 100644
|
||||
index 67a01b48ae88c7e25aeb5c5103b26afa037f4f97..0ceb539c9c3051b5521236cf866ccb107727c8a9 100644
|
||||
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
@@ -82,8 +82,7 @@ class WebContentsDelegateAndroid : public content::WebContentsDelegate {
|
||||
@@ -218,10 +218,10 @@ index c6838c83ef971b88769b1f3fba8095025ae25464..2da6a4e08340e72ba7de5d03444c2f17
|
||||
content::WebContents* AddNewContents(
|
||||
content::WebContents* source,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 9f18308873306e841bbc15d9ba36c93ba5603a15..9d6ad368980202f74d36785623d27354beef3f03 100644
|
||||
index d13c38de7a2e69565020ab92c874bf1289d63833..d7ec62c6761bcc8d4bb5889e873e22c4a27e7f17 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4914,8 +4914,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4983,8 +4983,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
// TODO(crbug.com/40202416): Support a way for MPArch guests to support this.
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -232,7 +232,7 @@ index 9f18308873306e841bbc15d9ba36c93ba5603a15..9d6ad368980202f74d36785623d27354
|
||||
static_cast<WebContentsImpl*>(delegate_->CreateCustomWebContents(
|
||||
opener, source_site_instance, is_new_browsing_instance,
|
||||
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
|
||||
index f688e6d1e6c11f0dd80f498e6361fa822e8c2eb8..dc47ebfd61f16901b7f8e0e4c30c79eaf5d0710e 100644
|
||||
index 97a3ea6f292563a41fd41f812ac72526a96d8471..b299dd5659100d317a3574e902bf2c29c5defd2c 100644
|
||||
--- a/content/public/browser/web_contents_delegate.cc
|
||||
+++ b/content/public/browser/web_contents_delegate.cc
|
||||
@@ -159,8 +159,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
|
||||
@@ -246,10 +246,10 @@ index f688e6d1e6c11f0dd80f498e6361fa822e8c2eb8..dc47ebfd61f16901b7f8e0e4c30c79ea
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index 96cb58b1a88499cf8f78d748dc5a1cc1c6b6a128..8ff56b56da764c8af14c40babc529ee4cb089c7e 100644
|
||||
index 8a18958035cc1dd26be558349f64f7727570c4ba..7d9c9b06bcc57ef5eb0a2ca74ee20632a1393f9e 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -354,8 +354,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -355,8 +355,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
SiteInstance* source_site_instance,
|
||||
mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -324,7 +324,7 @@ index e39031afd8fff7cb6e278555cc58a48d86407d65..f67f6a5603c1fa9e66ccdde9b601df9a
|
||||
content::RenderFrameHost* opener,
|
||||
content::SiteInstance* source_site_instance,
|
||||
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
index 16babdc7affdaef1af24850cf35494b8b4fe1479..1e77b091d94457c892788f7a441a83e7a96a49cc 100644
|
||||
index 60de0d74ee40fedcbae96e5049e21dc238bf33bf..c568d4d08f772e1d381820bed826a0b64a631449 100644
|
||||
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
@@ -452,8 +452,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
|
||||
@@ -380,7 +380,7 @@ index 1012a909ef1fcae51c218ae519fe7e0db65ab087..127b1ae940bc9313aecb635e2b01bb6f
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
|
||||
index 62be493c74423875af45a92c98b2ffceb928189f..ec82d8e47bf0a33f832b8ca242f395fe59a1bbee 100644
|
||||
index 7ca1e83ba1fd2dc5ea7c7ce644c3b7c54b9999f9..c1639653714d6973bcb5a0b37cb7028db8406742 100644
|
||||
--- a/headless/lib/browser/headless_web_contents_impl.cc
|
||||
+++ b/headless/lib/browser/headless_web_contents_impl.cc
|
||||
@@ -206,8 +206,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
|
||||
|
||||
@@ -32,7 +32,7 @@ index 7d5d0106a3675b3fa21b0e00a755f5c0ed11c87b..d26c645d70b54b31815c8140954ee6d0
|
||||
// (netwerk/cookie/src/nsCookieService.cpp)
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
|
||||
index 813f2f7f274bf02b6679b9321ae83948ab634697..2c61297669ba7d513f8493dfb6f478245f5c7c58 100644
|
||||
index 11572f927d97da20627dec498b92e445b5db4589..9b02d35a19d8610ade71b96c11551a1050847b49 100644
|
||||
--- a/net/http/http_response_headers.cc
|
||||
+++ b/net/http/http_response_headers.cc
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
@@ -7,10 +7,10 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
|
||||
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 054f38d683280638c7ac618d2ff8f7aef1a0def0..6e9d8d9a043cf8b67e26f70b3a904abcfc3c1a61 100644
|
||||
index 7550d3eb796059aeb108f25071c8028bddebb100..db59a147bd6b4fb596170d9b86c5e71a20b62abc 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -271,8 +271,13 @@ void AsanProcessInfoCB(const char*, bool*) {
|
||||
@@ -273,8 +273,13 @@ void AsanProcessInfoCB(const char*, bool*) {
|
||||
}
|
||||
#endif // defined(ADDRESS_SANITIZER)
|
||||
|
||||
@@ -25,7 +25,7 @@ index 054f38d683280638c7ac618d2ff8f7aef1a0def0..6e9d8d9a043cf8b67e26f70b3a904abc
|
||||
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
base::FileDescriptorStore& file_descriptor_store =
|
||||
base::FileDescriptorStore::GetInstance();
|
||||
@@ -301,11 +306,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
|
||||
@@ -303,11 +308,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
|
||||
|
||||
#endif // V8_USE_EXTERNAL_STARTUP_DATA
|
||||
|
||||
@@ -40,7 +40,7 @@ index 054f38d683280638c7ac618d2ff8f7aef1a0def0..6e9d8d9a043cf8b67e26f70b3a904abc
|
||||
#endif // V8_USE_EXTERNAL_STARTUP_DATA
|
||||
}
|
||||
|
||||
@@ -978,7 +984,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
@@ -980,7 +986,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
return TerminateForFatalInitializationError();
|
||||
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
|
||||
|
||||
@@ -50,19 +50,18 @@ index 054f38d683280638c7ac618d2ff8f7aef1a0def0..6e9d8d9a043cf8b67e26f70b3a904abc
|
||||
blink::TrialTokenValidator::SetOriginTrialPolicyGetter(
|
||||
base::BindRepeating([]() -> blink::OriginTrialPolicy* {
|
||||
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
|
||||
index 8194fc8b036482eedb162ff92bb82165cdf3c8d0..f038620516d7783170bc82b3b14dde4e01f3975d 100644
|
||||
index 8b02f553e2fc29da88c3e14c05a7ee82210eab51..14f2e66d5ecda6e860724a3ab946eaaffba33d6d 100644
|
||||
--- a/content/public/app/content_main_delegate.cc
|
||||
+++ b/content/public/app/content_main_delegate.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "content/public/app/content_main_delegate.h"
|
||||
|
||||
#include <variant>
|
||||
+#include <string_view>
|
||||
+
|
||||
|
||||
#include "base/check.h"
|
||||
#include "base/notreached.h"
|
||||
#include "build/build_config.h"
|
||||
@@ -72,6 +74,10 @@ std::optional<int> ContentMainDelegate::PostEarlyInitialization(
|
||||
@@ -74,6 +75,10 @@ std::optional<int> ContentMainDelegate::PostEarlyInitialization(
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -74,13 +73,13 @@ index 8194fc8b036482eedb162ff92bb82165cdf3c8d0..f038620516d7783170bc82b3b14dde4e
|
||||
return new ContentClient();
|
||||
}
|
||||
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
|
||||
index 801bfd401ea4a8e72417d88efaa718cc6fb60883..663fec68d0c2855cdf83bb259b85c22910a67464 100644
|
||||
index db611d99a6c0f18f39967b38791822fda7d175b5..cc150475de655d5ef20a107ae3ef80c08af8c7fb 100644
|
||||
--- a/content/public/app/content_main_delegate.h
|
||||
+++ b/content/public/app/content_main_delegate.h
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
+#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
@@ -95,10 +94,10 @@ index 801bfd401ea4a8e72417d88efaa718cc6fb60883..663fec68d0c2855cdf83bb259b85c229
|
||||
friend class ContentClientCreator;
|
||||
friend class ContentClientInitializer;
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index e72331d0821a14507e3c973f07889adcf45d3bdf..3acfc0d49787579d0250703eed3d6e31b79c567a 100644
|
||||
index 11cafc3e1588cce52b76cc2f09f66b3e451fb087..e07bdaeccecc8015462e35d5cf4606335e2e962c 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -657,8 +657,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
@@ -660,8 +660,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
|
||||
|
||||
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
||||
|
||||
@@ -108,7 +107,7 @@ index e72331d0821a14507e3c973f07889adcf45d3bdf..3acfc0d49787579d0250703eed3d6e31
|
||||
if (g_mapped_snapshot) {
|
||||
// TODO(crbug.com/40558459): Confirm not loading different type of snapshot
|
||||
// files in a process.
|
||||
@@ -667,10 +666,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
@@ -670,10 +669,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
|
||||
|
||||
base::MemoryMappedFile::Region file_region;
|
||||
base::File file =
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling
|
||||
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 943e3b8875c68178e84ae79c241c7a31e9305c6c..6055992c0f61348a95823b64c73574ca6b24904b 100644
|
||||
index 1a726fb4a9e8173dc7da6901eb1632c7f326358e..ae8a4117db2f6bac1d62981e7c0e35cf1eee68da 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -560,7 +560,11 @@
|
||||
@@ -561,7 +561,11 @@
|
||||
return;
|
||||
|
||||
host()->WasHidden();
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 79a679ac59c3ebe4dc1180389cf7073560e843e6..8aa812aa9bb3de4c7bc58192baf45c90402d6ff4 100644
|
||||
index 573269ba54150d5350e5c3589217c5e7f41d560d..20fcda4eb20459b69247003c51c2a3ed37c7b1e8 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -832,6 +832,10 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -21,10 +21,10 @@ index 79a679ac59c3ebe4dc1180389cf7073560e843e6..8aa812aa9bb3de4c7bc58192baf45c90
|
||||
// Prompts should remain open and functional across tab switches.
|
||||
if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
index 068b8036ad91357a5bb274f377ffb44f939d87be..c636170388f81f5afdcd3e86f85ec9f2ec944bb0 100644
|
||||
index c201cff9e5c3b286389a5eb74e1a9ebd86edfef9..949f6a7867758e35c24897add9a4d47a641357b2 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -1018,6 +1018,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
@@ -1012,6 +1012,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
// Requests a commit and forced redraw in the renderer compositor.
|
||||
void ForceRedrawForTesting();
|
||||
|
||||
@@ -35,7 +35,7 @@ index 068b8036ad91357a5bb274f377ffb44f939d87be..c636170388f81f5afdcd3e86f85ec9f2
|
||||
// |routing_id| must not be MSG_ROUTING_NONE.
|
||||
// If this object outlives |delegate|, DetachDelegate() must be called when
|
||||
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 1d08f25b91496dbafc3a164e7fb3e66d1a48557b..92085aca6bd0c95a73b98e4173c0128d596b77f4 100644
|
||||
index 5867fc3e77326991f30d835d08d3cfafe2b6687c..d719b546b8c3c59003698b26dead065da7d76341 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -643,7 +643,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mitsuru Oshima <oshima@chromium.org>
|
||||
Date: Thu, 17 Apr 2025 16:49:21 -0700
|
||||
Subject: Do not check the order of Display ID order on Windows
|
||||
|
||||
Id is generated by Windows side logic so this rule isn't applicable.
|
||||
|
||||
Bug: 394622418
|
||||
Change-Id: I79c7f91103c6b752b6a7a123aacd3573a9ab815f
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6471333
|
||||
Reviewed-by: Vincent Chiang <vincentchiang@chromium.org>
|
||||
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1448671}
|
||||
|
||||
diff --git a/ui/display/display_layout.cc b/ui/display/display_layout.cc
|
||||
index 0d3746d8174868b743990b5ab10b3506819ef0ea..85d5c06851148576ab4dd272918215335292b4aa 100644
|
||||
--- a/ui/display/display_layout.cc
|
||||
+++ b/ui/display/display_layout.cc
|
||||
@@ -500,6 +500,7 @@ void DisplayLayout::ApplyToDisplayList(Displays* display_list,
|
||||
if (!DisplayLayout::Validate(DisplayListToDisplayIdList(*display_list),
|
||||
*this)) {
|
||||
// Prevent invalid and non-relevant display layouts.
|
||||
+ LOG(ERROR) << "Invalid Display Layout";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -549,15 +550,19 @@ bool DisplayLayout::Validate(const DisplayIdList& list,
|
||||
|
||||
bool has_primary_as_parent = false;
|
||||
// The placement list must be sorted by the first 8 bits of the display IDs.
|
||||
+#if BUILDFLAG(IS_CHROMEOS)
|
||||
int64_t prev_id = std::numeric_limits<int8_t>::min();
|
||||
+#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
for (const auto& placement : layout.placement_list) {
|
||||
- // Placements are sorted by display_id.
|
||||
+#if BUILDFLAG(IS_CHROMEOS)
|
||||
+ // Placements are sorted by display_id on ChromeOS.
|
||||
if (prev_id >= (placement.display_id & 0xFF)) {
|
||||
DISPLAY_LOG(ERROR) << "PlacementList must be sorted by first 8 bits of"
|
||||
<< " display_id ";
|
||||
return false;
|
||||
}
|
||||
prev_id = (placement.display_id & 0xFF);
|
||||
+#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
if (placement.display_id == kInvalidDisplayId) {
|
||||
DISPLAY_LOG(ERROR) << "display_id is not initialized";
|
||||
return false;
|
||||
diff --git a/ui/display/display_layout_unittest.cc b/ui/display/display_layout_unittest.cc
|
||||
index 68327c8a6b71853a0f1bf3c0351e38865bcbe054..4ea830ef086eb009c692a0b90b100eaaed303fd0 100644
|
||||
--- a/ui/display/display_layout_unittest.cc
|
||||
+++ b/ui/display/display_layout_unittest.cc
|
||||
@@ -122,6 +122,7 @@ TEST(DisplayLayoutTest, SwapPrimaryDisplayThreeDisplays) {
|
||||
EXPECT_EQ(Position::RIGHT, layout->placement_list[1].position);
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Makes sure that only the least significant 8 bits of the display IDs in the
|
||||
// placement lists are used to validate their sort order.
|
||||
TEST(DisplayLayoutTest, PlacementSortOrder) {
|
||||
@@ -148,6 +149,8 @@ TEST(DisplayLayoutTest, PlacementSortOrder) {
|
||||
EXPECT_TRUE(DisplayLayout::Validate({456, 0x0504, 0x0605, 0x0406}, *layout));
|
||||
}
|
||||
|
||||
+#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
+
|
||||
namespace {
|
||||
|
||||
class TwoDisplays
|
||||
@@ -6,10 +6,10 @@ Subject: feat: enable setting aspect ratio to 0
|
||||
Make SetAspectRatio accept 0 as valid input, which would reset to null.
|
||||
|
||||
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
index 88d8d9985c6b4c7051f00cba9dfa51b3fcfa524b..2d05856687cd9669f72553d33c8033fd9083b4f8 100644
|
||||
index 82e6f7c91bac6e8a973947dace1a33de8078a86b..1d298f66a2c2a0f02668af797b3a421fe5578d56 100644
|
||||
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
|
||||
@@ -637,7 +637,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
|
||||
@@ -636,7 +636,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
|
||||
void DesktopWindowTreeHostWin::SetAspectRatio(
|
||||
const gfx::SizeF& aspect_ratio,
|
||||
const gfx::Size& excluded_margin) {
|
||||
@@ -19,10 +19,10 @@ index 88d8d9985c6b4c7051f00cba9dfa51b3fcfa524b..2d05856687cd9669f72553d33c8033fd
|
||||
excluded_margin);
|
||||
}
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index b3dc46c34f2aff45b3bd8ea041f2e55ba61d50f9..a802f4b710b6f8fa154d11846c061720a91e15e4 100644
|
||||
index a183cfe07b357e0b17e3781e85b79f7c371cbea8..ea67a60d78f4adec960bb4954486420bce423c14 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -988,8 +988,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
|
||||
@@ -1010,8 +1010,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
|
||||
|
||||
void HWNDMessageHandler::SetAspectRatio(float aspect_ratio,
|
||||
const gfx::Size& excluded_margin) {
|
||||
|
||||
@@ -9,7 +9,7 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead
|
||||
of the default V8 allocator. This probably can't be usptreamed.
|
||||
|
||||
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
|
||||
index c34f34146d0aab681318b64ac33081bdc21ce7d6..11cdf6c34d8f79fcf293f59785e586dc8363b983 100644
|
||||
index 9dac402705385087ced2df2db757a07246984a94..cb49b4f085026658e920699ed285d524119d6aad 100644
|
||||
--- a/gin/public/v8_platform.h
|
||||
+++ b/gin/public/v8_platform.h
|
||||
@@ -32,6 +32,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
|
||||
@@ -21,10 +21,10 @@ index c34f34146d0aab681318b64ac33081bdc21ce7d6..11cdf6c34d8f79fcf293f59785e586dc
|
||||
ThreadIsolatedAllocator* GetThreadIsolatedAllocator() override;
|
||||
#endif
|
||||
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
|
||||
index fa799a4cc32950ce03c154bc7791341d96a17f67..b8ec81b79b6129a7e26a2ffecf535fdedea8ed6c 100644
|
||||
index 698b29e9c31a2695cac30bf85c97a216ff8a6257..dbc38d0d87803496ce122da62e639f2a0334e0f6 100644
|
||||
--- a/gin/v8_platform.cc
|
||||
+++ b/gin/v8_platform.cc
|
||||
@@ -204,6 +204,10 @@ ThreadIsolatedAllocator* V8Platform::GetThreadIsolatedAllocator() {
|
||||
@@ -205,6 +205,10 @@ ThreadIsolatedAllocator* V8Platform::GetThreadIsolatedAllocator() {
|
||||
}
|
||||
#endif // PA_BUILDFLAG(ENABLE_THREAD_ISOLATION)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user