Compare commits

...

177 Commits

Author SHA1 Message Date
David Sanders
efb3fd98c6 build: lint commits on Chromium roller branches (#49655)
* build: lint commits on Chromium roller branches

Assisted-By: Claude Opus 4.5

* chore: add ability to skip linting CLs by adding #nolint

* chore: only exit with non-zero exit code in CI
2026-02-18 20:45:44 -08:00
Shelley Vohr
9ca9311b73 docs: note required windows in 'new-window-for-tab' event (#49851)
docs: note required windows in new-window-for-tab
2026-02-18 19:30:43 -08:00
Samuel Attard
8b05717661 docs: clarify ASAR integrity is supported in MAS builds (#49852)
* docs: clarify ASAR integrity is supported in MAS builds

Add a note to the ASAR integrity documentation explicitly stating
that this feature is fully supported and recommended in Mac App
Store builds. While MAS-installed apps have system-level protections,
ASAR integrity provides an additional security layer and is important
for MAS builds distributed outside the Mac App Store.

Slack thread: https://electronhq.slack.com/archives/CB6CG54DB/p1771449093872419?thread_ts=1771446183.473289&cid=CB6CG54DB

https://claude.ai/code/session_01A97nfiqHUVxLNaQyHVXS7j

* docs: clarify ASAR integrity support for MAS builds

Updates the ASAR integrity documentation to explicitly mention that
it is supported and recommended in Mac App Store builds. Clarifies
that while MAS-installed apps have system-level protections (Resources
folder owned by root), ASAR integrity is especially important when
distributing MAS builds through other channels like direct download,
since those installations won't have the read-only protections.

https://claude.ai/code/session_012mBNZQW34h91NRcdFaLxNh

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-18 14:14:00 -08:00
John Kleinschmidt
be45b5f8e7 ci: fixup build stats upload on Windows (#49845) 2026-02-18 15:00:30 -05:00
dependabot[bot]
87597a99de build(deps-dev): bump webpack from 5.95.0 to 5.104.1 in the npm_and_yarn group across 1 directory (#49779)
build(deps-dev): bump webpack

Bumps the npm_and_yarn group with 1 update in the / directory: [webpack](https://github.com/webpack/webpack).


Updates `webpack` from 5.95.0 to 5.104.1
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack/compare/v5.95.0...v5.104.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.104.1
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-18 14:22:25 -05:00
Shelley Vohr
3ed52a3ded build: roll sysroots (#49844) 2026-02-18 13:24:29 -05:00
Shelley Vohr
dfdf04976e fix: draggable region position with docked DevTools (#49822) 2026-02-18 11:49:18 -05:00
Shelley Vohr
f4ba25a3da fix: frameless window resize in MAS builds (#49780) 2026-02-18 10:35:10 -05:00
Robo
05061544ab feat: enable WASM trap handlers in all Node.js processes (#48983)
fix: enable WASM trap handlers in all Node.js processes

```
Original reason for revert:

Some apps started throwing exception on startup
https://github.com/electron/electron/issues/48956
```

We now move the trap handler registeration before
any user script execution. Add a fuse to support
disabling the feature is application needs to run
in memory constrained environments.
2026-02-18 12:08:03 +09:00
Sam Maddock
10566c2d5f test: MAS for private API usage (#49712) 2026-02-17 15:29:21 -05:00
Mitchell Cohen
931c257de7 fix: accurate window sizing and support for content sizing on Linux/Wayland with CSD (#49209)
* fix window sizing and content sizing on Linux when CSD is in use

* fixed size constraints

* simplify min/max size calculation

* use base window size for min/max

* moved windows min/max size overrides

* remove unnecessary checks for client frame

* cleanup
2026-02-17 15:23:54 -05:00
Ronald Eddy Jr
459a88f788 docs: fix typos across tutorial documentation (#49736) 2026-02-17 14:47:45 -05:00
electron-roller[bot]
c98cf69f40 chore: bump chromium to 147.0.7687.0 (main) (#49782)
* chore: bump chromium in DEPS to 147.0.7683.0

* fix(patch): constant moved to header

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7536483

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(patch): occlusion simplification upstream

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7563790

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: remove upstreamed patches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update patches (trivial only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: bump chromium in DEPS to 147.0.7685.0

* fix(patch): V1 Keychain removal

Upstream deleted the V1 Keychain API. Removed V1 hunks and adapted

keychain_password_mac.mm to use KeychainV2 APIs.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7540447

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update patches (trivial only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 7535923: Rename ozone buildflags

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7535923

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 7528398: [LNA] Rename PNA-named files to LNA-named files

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7528398

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 7534194: Convert some functions in ui::Clipboard to async

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7534194

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 7544580: [DevTools] Add command to restart Chrome to DevTools UI bindings

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7544580

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: bump chromium in DEPS to 147.0.7687.0

* chore: update patches (trivial only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: incorporate learnings into claude skill

I asked Claude to reflect on our upgrade session, consider what it learned and should know in the future, and to update its skill documents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:25:21 -05:00
John Kleinschmidt
0da0c3a47e build: use spawn instead of spawnSync for build (#49774) 2026-02-17 13:24:19 -05:00
John Kleinschmidt
f19cfce430 chore: add Copilot CLI instructions (#49784)
chore: add copilot-instructions
2026-02-17 09:49:59 -05:00
dependabot[bot]
ca61f2d7df build(deps): bump actions-cool/issues-helper from 3.7.5 to 3.7.6 (#49813)
Bumps [actions-cool/issues-helper](https://github.com/actions-cool/issues-helper) from 3.7.5 to 3.7.6.
- [Release notes](https://github.com/actions-cool/issues-helper/releases)
- [Changelog](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md)
- [Commits](e2ff99831a...71b62d7da7)

---
updated-dependencies:
- dependency-name: actions-cool/issues-helper
  dependency-version: 3.7.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 11:24:20 +01:00
dependabot[bot]
1322bee878 build(deps): bump github/codeql-action from 4.32.2 to 4.32.3 (#49814)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.2 to 4.32.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](45cbd0c69e...9e907b5e64)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-17 11:24:06 +01:00
Samuel Attard
dda71a464c chore: add PR Notes section requirement to CLAUDE.md (#49816)
docs: add PR Notes section requirement to CLAUDE.md

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 01:02:52 -08:00
Shelley Vohr
a056c63fd8 fix: excise abort_report_np usage in MAS (#49726)
* fix: excise abort_report_np usage in MAS

* chore: fix it harder
2026-02-16 12:23:53 +01:00
reito
bf3eb098bd fix: missing shared texture docs (#49797) 2026-02-16 10:51:31 +01:00
Shelley Vohr
67cced1270 build: remove *.star files (#49796) 2026-02-16 10:49:39 +01:00
Shelley Vohr
eb29568e45 feat: introduce os_crypt_async in safeStorage (#49054)
* feat: support Freedesktop Secret Service OSCrypt client

Refs https://issues.chromium.org/issues/40086962
Refs https://issues.chromium.org/issues/447372315

* chore: rework to async interface

* refactor: allow customizing freedesktop config

* docs: add more async impl info

* refactor: reject when temporarily unavailable

* chore: feedback from review

* chore: push_back => emplace_back
2026-02-15 19:54:50 +01:00
Shelley Vohr
dcdbb0397e feat: allow defaulting to printer default page size (#49523)
Co-authored-by: Edvan de Matos <edvan.santos@querodelivery.com>
2026-02-13 07:40:14 -05:00
electron-roller[bot]
3a5f9e0a33 chore: bump node to v24.13.1 (main) (#49744)
* chore: bump node in DEPS to v24.13.1

* chore: fixup patches

refs:
* https://github.com/nodejs/node/pull/60425
* https://github.com/nodejs/node/pull/61270
* https://github.com/nodejs/node/pull/61044

* fix: generate_config_gypi needs to generate valid JSON

https://github.com/nodejs/node/pull/60794

* doc: align Buffer.concat documentation with behavior

https://github.com/nodejs/node/pull/60405

* src: fix off-thread cert loading in bundled cert mode

https://github.com/nodejs/node/pull/60764

* build: fix extraneous includes

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-02-13 09:48:05 +01:00
Keeley Hammond
f90e35cb45 chore: cherry-pick e045399a1ecb from chromium (#49788)
* chore: cherry-pick e045399a1ecb from chromium

* chore: update patch
2026-02-12 19:24:19 -08:00
Shelley Vohr
74fd10450f feat: improve Windows Toast actions support (#48132)
* feat: improve Windows Toast actions support

* fix: ensure MSIX compatibility

* test: add bad clsid format test
2026-02-12 17:25:20 -05:00
electron-roller[bot]
a65cfed500 chore: bump chromium to 146.0.7666.0 (main) (#49528)
* chore: bump chromium in DEPS to 146.0.7652.0

* fix(patch-conflict): update mas_avoid_private_macos_api_usage context for constrainFrameRect method

The upstream CL added a new constrainFrameRect:toScreen: method override to
NativeWidgetMacNSWindow as part of headless mode window zoom implementation.
The MAS patch's #endif for frameViewClassForStyleMask now correctly appears
after that method, since constrainFrameRect is a public API override that
doesn't need to be guarded.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7487666

* fix(patch-conflict): update printing.patch for base::DictValue rename

Updated printing.patch to use the new base::DictValue type name instead of
base::Value::Dict following Chromium's type renaming change. This affects
CompleteUpdatePrintSettings() signature and related code.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509820

* fix(patch-conflict): update accessibility_ui patch for base::DictValue/ListValue rename

Updated adjust_accessibility_ui_for_electron.patch to use the new
base::DictValue and base::ListValue type names instead of base::Value::Dict
and base::Value::List following Chromium's type renaming change.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509820

* chore: update patches

* 6625736: Rename DURABLE_STORAGE to PERSISTENT_STORAGE for consistency | https://chromium-review.googlesource.com/c/chromium/src/+/6625736

* chore: bump chromium in DEPS to 146.0.7653.0

* chore: update patches

* 7000847: add type tag to v8::External for gin_helper function templates

The upstream gin function templates now use v8::ExternalPointerTypeTag
for type safety when using v8::External. Updated Electron's forked
gin_helper function template to use the same kGinInternalCallbackHolderBaseTag
that Chromium's gin uses.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7000847

* fix(patch-update): extend V8 Object API deprecation patch for Node.js

Extended the existing patch to cover additional files that use
GetAlignedPointerFromInternalField and SetAlignedPointerInInternalField:
- src/stream_base-inl.h
- src/udp_wrap.cc
- src/js_udp_wrap.cc
- src/node_process_methods.cc
- src/node_snapshotable.cc
- src/base_object.cc

These APIs now require an EmbedderDataTypeTag parameter.

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7087956

* 7000847: add type tag to v8::External calls in shared_texture

Updated v8::External::New and v8::External::Value calls to use the
kExternalPointerTypeTagDefault tag as required by the V8 API change
that deprecates the tagless versions.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7000847

* 7508687: use ChildProcessId for file permission APIs

The ChildProcessSecurityPolicy::CanReadFile and GrantReadFile APIs
now require ChildProcessId instead of int. Updated to use GetID()
instead of GetDeprecatedID() for these specific calls.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7508687

* 7000847: add type tag to v8::External calls in callback and osr_converter

The v8::External API now requires an EmbedderPointerTypeTag parameter
for both New() and Value() methods to improve V8 sandbox type safety.

Updated calls in:
- callback.cc: TranslatorHolder constructor and CallTranslator
- osr_converter.cc: OffscreenSharedTextureValue converter

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7000847

* fixup! 7087956: [api] Promote deprecation of v8::Context and v8::Object API methods

Extended the Node.js patch to cover histogram.cc which also uses
SetAlignedPointerInInternalField and GetAlignedPointerFromInternalField
APIs that now require the EmbedderDataTypeTag parameter.

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7087956

* chore: bump chromium in DEPS to 146.0.7655.0

* chore: update patches

* 7509043: update WebSpellingMarker type for API change

The upstream Chromium API changed - WebSpellingMarker was moved from a
nested type within WebTextCheckClient to a standalone type in the blink
namespace.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509043

* 7498491: update process_id to use OriginatingProcess type

The upstream Chromium API changed - URLLoaderFactoryParams::process_id
was changed from an integer to a union type network::OriginatingProcess
that distinguishes between browser and renderer processes.

- For browser process requests, use OriginatingProcess::browser()
- For renderer process lookups, check !is_browser() and use
  renderer_process().value() to get the child_id

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7498491

* 5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception | https://chromium-review.googlesource.com/c/chromium/src/+/5710330

5710330 added a new NSNextStepFrame interface extension and
implementations for NativeWidgetMacNSWindowTitledFrame and
NativeWidgetMacNSWindowBorderlessFrame. These use private macOS APIs
that are not available in Mac App Store builds.

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7661.0

* chore: bump chromium in DEPS to 146.0.7663.0

* fix(patch-conflict): update accessibility_ui for string_view API change

Upstream removed redundant std::string(default_api_type) conversion as part
of a string_view optimization cleanup. Updated patch context to match.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7514107

* fix(patch-conflict): update service process launch options for sandbox API refactor

Upstream removed content/common/sandbox_init_win.cc and
content/public/common/sandbox_init_win.h, moving the functionality directly
into ChildProcessLauncherHelper. Updated patch to call
sandbox::policy::SandboxWin::StartSandboxedProcess directly with the
LaunchOptions pointer instead of going through the removed helper.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7528253

* fix(patch-conflict): update MAS safestorage for keychain API refactor

Upstream refactored KeychainPassword::GetPassword() to use a new
GetPasswordImpl() helper function with improved error tracking via
base::expected<std::string, OSStatus>. Adapted patch to use the new
GetPasswordImpl with the suffixed account name and handle migration
from legacy accounts through the new API.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7516438

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7663.0

* fix: base::Value::Dict -> base::DictValue
https://chromium-review.googlesource.com/c/chromium/src/+/7513889

* fix: include new cookie exclusion reason
https://chromium-review.googlesource.com/c/chromium/src/+/7486527

* fix: enable libc++ ABI flag for trivially copyable std::vector<bool>

Required for changes introduced in the following CL
https://chromium-review.googlesource.com/c/chromium/src/+/7513653

* fixup! fix: base::Value::Dict -> base::DictValue https://chromium-review.googlesource.com/c/chromium/src/+/7513889

* fix: spellcheck not working in tests
https://chromium-review.googlesource.com/c/chromium/src/+/7452579

* fix: cookie test failing due to multiple rejection reasons
https://chromium-review.googlesource.com/c/chromium/src/+/7506629

* fix: macos sizing unmaximized window incorrectly
https://chromium-review.googlesource.com/c/chromium/src/+/7487666

Changes to headless mode caused the unmaximized window to subtract
the height of the menubar.

* fix: skip tests for incompatible BoringSSL ML-DSA crypto
https://boringssl-review.googlesource.com/c/boringssl/+/84929

* test: fix pseudonymization registration in utility process on Linux

Ref: 7486913: Pass pseudonymization salt via shared memory at process launch | https://chromium-review.googlesource.com/c/chromium/src/+/7486913

* fix: restore MAS patch-outs

Restores some `#if !IS_MAS_BUILD()` gates dropped in 773054ad59

* fixup! 7508687: use ChildProcessId for file permission APIs

* fixup! fix(patch-conflict): update MAS safestorage for keychain API refactor

* chore: add note about parallel upstream change

* fixup! Merge remote-tracking branch 'origin/main' into roller/chromium/main

* Revert "fixup! 7508687: use ChildProcessId for file permission APIs"

This reverts commit 05c43e4e5d.

The _impl version has the signature, but not the public interface. :oof:

* fixup! fix(patch-conflict): update MAS safestorage for keychain API refactor

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Samuel Maddock <samuelmaddock@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
2026-02-12 12:37:56 -05:00
Calvin
e9faa14cc0 test: drag region tests (#49266) 2026-02-12 01:50:02 -06:00
Niklas Wenzel
ce47542ccd feat: add support for long-animation-frame script attribution (#49706)
* feat: add support for `long-animation-frame` script attribution

* docs: document `AlwaysLogLOAFURL`

* chore: add test

* docs: adjust docs as per PR comment

* fix: test failures

* chore: simplify test

* fix: tests on Windows and Linux
2026-02-11 09:34:22 -08:00
dependabot[bot]
ff2df2c98a build(deps): bump diff from 3.5.0 to 3.5.1 in the npm_and_yarn group across 1 directory (#49666)
build(deps): bump diff in the npm_and_yarn group across 1 directory

Bumps the npm_and_yarn group with 1 update in the / directory: [diff](https://github.com/kpdecker/jsdiff).


Updates `diff` from 3.5.0 to 3.5.1
- [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md)
- [Commits](https://github.com/kpdecker/jsdiff/compare/v3.5.0...v3.5.1)

---
updated-dependencies:
- dependency-name: diff
  dependency-version: 3.5.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-11 16:52:05 +01:00
John Kleinschmidt
0284b9afcc build: fixup attestation for release assets (#49732)
* build: fixup attestation for release assets

* Generate artifact attestation for generated artifacts

* set id-token for attestation

* Add artifact-metadata permission for attestation

* add permissions for testing attestations

* Revert "add permissions for testing attestations"

This reverts commit 0284bed175.

* Revert "set id-token for attestation"

This reverts commit 69a1b13a18.

* Revert "Generate artifact attestation for generated artifacts"

This reverts commit ee0536eceb.
2026-02-11 07:17:59 -05:00
David Sanders
52061b4c28 ci: add markdownlint problem matcher (#49751) 2026-02-11 13:17:29 +01:00
David Sanders
ec6d2fe549 build(dev-deps): update micromark-core-commonmark to 2.0.3 (#49749) 2026-02-11 13:11:58 +01:00
Ronald Eddy Jr
1c621cc982 docs: fix typos across documentation (#49734)
Fix 40 typos across 25 documentation files including misspellings,
missing words, doubled words, wrong words, and grammatical errors.
2026-02-11 12:45:46 +01:00
Shelley Vohr
57a6e43025 fix: revoke Read access after removing file via FileSystemAccess API (#49620)
Refs https://chromium-review.googlesource.com/6677249
2026-02-10 15:48:05 +01:00
dependabot[bot]
ef5b232e9f build(deps): bump github/codeql-action from 4.32.1 to 4.32.2 (#49735)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.1 to 4.32.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6bc82e05fd...45cbd0c69e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 15:06:42 +01:00
Bug-Reaper
99fce5b6ca fix: address upstream Chromium shift to enable CoreAudio Tap API for audio capture used in electron's desktopCapturer (🍏 macOS). (#49717)
* fix: Enable CoreAudio Tap API for Audio Capture (🍏 macOS)

* fix: addressed markdown issue which caused pre-commit hook failure

🧑‍🔧 : Ref : https://github.com/electron/electron/pull/49717#issuecomment-3874660013

* fix: updated docs to cover `desktopCapturer` nuances with macOS

📝 : PR https://github.com/electron/electron/pull/49717
2026-02-10 15:06:21 +01:00
Rushikesh Bobade
7c66112e88 docs: link unlinked type references in API documentation (#49651)
docs: add missing type links in menu.md and shared-texture.md
2026-02-09 23:08:52 -08:00
John Kleinschmidt
fd0108907a build: fixup build attestation (#49730) 2026-02-09 11:50:17 -05:00
reito
3fa3e91f90 docs: fix framerate limit when osr with shared texture (#49705) 2026-02-09 15:18:06 +01:00
David Sanders
a3563422c4 ci: fix patches changes detected in apply patches workflow (#49701) 2026-02-06 13:48:30 -08:00
Keeley Hammond
9db2290bcd fix: restore macos 12 support in Node 24 (#49697) 2026-02-06 07:48:37 -08:00
Samuel Attard
60d35bbaf4 feat: add support for disclaiming utility processes (#49128)
* feat: add support for disclaiming utility processes

* chore: update patches

---------

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2026-02-05 14:37:24 -08:00
Michaela Laurencin
15dc7170ef ci: fix ai-pr label commenting (#49685) 2026-02-05 14:27:46 -05:00
Keeley Hammond
59e434a27f refactor: use ComPtr pattern for MSIX to avoid exception handling (#49645)
* Revert "fix: fix Windows MSIX release build errors (#49613)"

This reverts commit 4b5d5f9dd5.

* refactor: use WRL ComPtr pattern for MSIX to avoid exception handling

The MSIX auto-updater code was using C++/WinRT (winrt::* namespace), which requires exception handling (/EHsc). Mixing exception and non-exception handling code in the same binary is problematic at runtime. This commit refactors electron_api_msix_updater.cc to use an upstream Chromium pattern and eliminates the need for special exception handling build flags

* build: import correct packages

* build: consolidate IPackage declarations

* refactor: use IPackageManager/IPackageManager5/IPackageManager9 and
IPackage/IPackage2/IPackage4/IPackage6 interfaces as needed for
different API methods.

Also consolidates duplicate completion handler logic, fixes a bug in
RegisterRestartOnUpdate where the command line string could go out of
scope, and removes unused includes.
2026-02-05 10:42:28 -08:00
Samuel Attard
dec7f937ae build: generate artifact attestions for released assets (#48239)
* build: generate artifact attestions for released assets

* chore: address review feedback

---------

Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
2026-02-05 09:37:17 -05:00
Noah Gregory
50381a6d57 refactor: don't log error just for unsigned code (#49654) 2026-02-05 15:26:17 +09:00
David Sanders
41c7e9bb21 ci: use squash merge for apply patches workflow (#49667) 2026-02-04 15:51:49 -08:00
Shelley Vohr
9740c989da fix: default accelerator for role-based menu items (#49558)
fix: apply default accelerator for role-based menu items

Co-authored-by: Kimgun3383 <tygob5247@gmail.com>
2026-02-04 16:45:29 -05:00
John Kleinschmidt
4ea2d816b8 revert(ci): use new case syntax in workflows (#49665)
Revert "ci: use new case syntax in workflows (#49590)"

This reverts commit def7854848.
2026-02-04 14:55:20 -05:00
Noah Gregory
6a47bb4731 fix: use temp directory for singleton test and clean up at end (#49604)
* fix: create directory for singleton test in `temp` instead of `home`

* fix: remove directory for singleton test at test end

* refactor: avoid extraneous declarations in singleton test

* refactor: reintroduce `userDataFolder` declaration in singleton test

* refactor: move cleanup before app exit in singleton test

* style: add missing semicolon

* refactor: set the user data path after pre-test cleanup in singleton test

* fix: release lock before cleanup in singleton test
2026-02-04 14:43:36 -05:00
David Sanders
ef11669b67 ci: handle PRs with no checks in rerun apply patches (#49630) 2026-02-04 16:13:27 +01:00
Shelley Vohr
d7378d96a5 docs: add Wayland note to win.getPosition() and win.getBounds() (#49632)
docs: add Wayland note to win.getPosition()
2026-02-04 16:13:11 +01:00
Keeley Hammond
431f77ca1c fix: remove menu observer before destroying menu_controller_ (#49648)
* fix: remove menu observer before destroying menu_controller_

* fix: resolves private inheritance conflict
2026-02-04 16:11:00 +01:00
Shelley Vohr
51a9101c3d build: remove Core Graphics private macOS APIs on MAS (#49633) 2026-02-03 12:02:06 -05:00
Shelley Vohr
def7854848 ci: use new case syntax in workflows (#49590)
ci: use new case synta in workflows
2026-02-03 11:57:14 -05:00
Niklas Wenzel
28858ecb85 chore: add "I have built and tested this PR" box to PR template (#49434) 2026-02-03 11:39:07 -05:00
Shelley Vohr
8fdb7549bb fix: alt-space should route through 'system-context-menu' (#49619)
fix: alt-space should route through system-context-menu
2026-02-03 11:34:58 -05:00
dependabot[bot]
c3428fa413 build(deps): bump lodash from 4.17.21 to 4.17.23 in the npm_and_yarn group across 1 directory (#49577)
build(deps): bump lodash in the npm_and_yarn group across 1 directory

Bumps the npm_and_yarn group with 1 update in the / directory: [lodash](https://github.com/lodash/lodash).

Updates `lodash` from 4.17.21 to 4.17.23
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 11:05:40 -05:00
loc
233caf8469 fix(squirrel.mac): clean up old staged updates before downloading new update (#49365)
fix: clean up old staged updates before downloading new update

When checkForUpdates() is called while an update is already staged,
Squirrel creates a new temporary directory for the download without
cleaning up the old one. This can lead to disk usage growth when
new versions are released while the app hasn't restarted.

This adds a force parameter to pruneUpdateDirectories that bypasses
the AwaitingRelaunch state check. This is called before creating a
new temp directory, ensuring old staged updates are cleaned up.
2026-02-03 11:04:06 -05:00
Shelley Vohr
86209f60eb fix: possible crash in FileSystem API (#49578)
Refs https://chromium-review.googlesource.com/6880247

Fixes a crash that can arise in the File System Access API in the
following scenario:

1. Create fileHandle1 at path1.
2. Call fileHandle1.remove() or user manually delete the file.
3. Create fileHandle2 at path2.
4. fileHandle2.move(path1).
2026-02-03 15:15:54 +01:00
dependabot[bot]
bdf2b67462 build(deps): bump github/codeql-action from 4.32.0 to 4.32.1 (#49629)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.0 to 4.32.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b20883b0cd...6bc82e05fd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 15:03:22 +01:00
Mr.Chaofan
4413a0f642 fix: wrong cause and removed flag in cookie change listener (#49103) 2026-02-03 10:19:35 +01:00
Shelley Vohr
3776731f4a fix: menu state in macOS dock menus (#49574) 2026-02-02 17:01:34 -05:00
Robo
db5606b4b3 fix: handle out of order recording errors in skia graphite (#49608) 2026-02-02 14:20:19 +01:00
Calvin
1159de52e7 docs: app.getGPUInfo() may reject (#49580) 2026-02-02 10:00:05 +01:00
Keeley Hammond
4b5d5f9dd5 fix: fix Windows MSIX release build errors (#49613)
* fix: fix MSIX release build

* fix: add C++/WinRT headers

* build: modify include paths

* fix: compile msix as seperate source set

* build: add additional needed deps for msix
2026-02-01 22:27:42 -08:00
Prachi Maskar
0cbf3c2918 docs: add jsign instructions for Azure Trusted Signing on Linux/macOS (#49345)
* docs: add jsign instructions for Azure Trusted Signing on Linux/macOS

* docs: add clickable jsign link for Azure Trusted Signing
2026-01-30 15:24:08 -05:00
axolotl
f272723a33 feat: Allow View.setBounds to animate (#48812)
* feat: allow View::SetBounds to animate

* fix: support width/height animations

* fix: jumping on subsequent animations

* fix: segfault race condition

* fix: remove layer background

* fix: layer clips not being reset

* refactor: use gfx tween gin converter

* fix: layer cleanups causing flickering views

* chore: merge artifact

* fix: missing private method in header

* fix: return type

* fix: do not set layer opacity

* refactor: update animate parameter format

* refactor: move animate into options object

* chore: typo

* docs: update

* spec: add view animation test
2026-01-30 15:18:56 -05:00
Shelley Vohr
331d1e16f5 refactor: address PathProvider TODO (#49563) 2026-01-30 14:16:39 -05:00
Shelley Vohr
6825a522e9 fix: duplicate fullscreen macOS menu item (#49074) 2026-01-30 13:23:43 -05:00
Shelley Vohr
e033c10075 fix: issues with xdg activation on Linux (#49499) 2026-01-30 10:53:04 -05:00
Shelley Vohr
64872a6cb8 fix: macOS menu item accelerators when item disabled (#49553)
fix: macOS menu item acceerators when item disabled
2026-01-30 10:07:16 +01:00
Jan Hannemann
d74fcfcecb feat: msix auto-updater (#49230)
* feat: native auto updater for MSIX on Windows

* doc: added MSIX debug documentation

* fix: allow downgrade with json release file and emit update-available

* test: msix auot-update tests

* doc: API documentation

* test: add package version validation

* fix: docs typo

* fix: don't allow auto-updating when using appinstaller manifest

* fix: getPackageInfo interface implementation

* fix: review feedback, add comment

* fix: missed filename commit

* fix: install test cert on demand

* fix: time stamp mismatch in tests

* fix: feedback - rename to MSIXPackageInfo

* fix: update and reference windowsStore property

* fix: remove getPackagInfo from public API

* fix: type error bcause of removed API
2026-01-29 16:38:26 -05:00
Michaela Laurencin
92a3f7d6c1 ci: add workflow for commenting with new 'ai-pr' label (#49564)
* add workflow for commenting with new 'ai-pr' label

* Update .github/workflows/pull-request-labeled.yml

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* add pr autoclose

* replace with specific secret

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* specify repo

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* update wording of comment

* chore: use GH app token

* chore: fix indentation

---------

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2026-01-29 13:12:42 -05:00
David Sanders
0e161c18eb ci: rework reapply patches (#49552) 2026-01-29 11:19:07 -05:00
David Sanders
3d76d3a469 build(dev-deps): bump @electron/lint-roller to 3.2.0 (#49565) 2026-01-29 16:06:47 +01:00
Kanishk Ranjan
82d350524e test: fix flaky BrowserView test (#49316)
* test: fix flaky BrowserWindow test

* fix: improved as per review
2026-01-28 11:54:35 -08:00
Shelley Vohr
e6be04a7a0 fix: chrome://accessibility drift (#49547)
https://chromium-review.googlesource.com/c/chromium/src/+/6870052
2026-01-28 12:07:14 +01:00
David Sanders
a7de47084b test: remove split dependency (#49551) 2026-01-28 10:47:43 +01:00
Kanishk Ranjan
3820d3ae6c test: fix flaky BrowserWindow test (#49364)
test: fix flaky BrowserWindow test
2026-01-27 21:47:02 -08:00
Charles Kerr
8364b62f68 fix: potential dangling pointer in api::Screen (#49536)
fixes a regression from #49506
2026-01-27 16:27:38 -05:00
dependabot[bot]
441729c3a0 build(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#49541)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e8c483db8...de0fac2e45)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 11:37:15 +01:00
Shelley Vohr
c521c2b868 test: update/fix Node.js disabled specs (#49467) 2026-01-27 11:03:09 +01:00
Shelley Vohr
b2c5093542 docs: correct type for process.noDeprecation (#49524)
* docs: correct type for process.noDeprecation

* docs: mark `noDeprecation` as optional instead

Co-authored-by: René <contact.9a5d6388@renegade334.me.uk>

---------

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: René <contact.9a5d6388@renegade334.me.uk>
2026-01-27 11:02:51 +01:00
dependabot[bot]
ec5eb64788 build(deps): bump github/codeql-action from 4.31.10 to 4.32.0 (#49540)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.10 to 4.32.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cdefb33c0f...b20883b0cd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 11:00:13 +01:00
David Sanders
0cc15a6386 ci: reapply patches if PR base branch updates them (#49516) 2026-01-26 15:13:34 -05:00
David Sanders
4aa89b9c3c ci: add pipeline segment to run clang-tidy (#49072)
* ci: add pipeline segment to run clang-tidy

* chore: set -header-filter='' for clang-tidy

Breaking change in `clang-tidy` 22.0.0:

> clang-tidy now displays warnings from all non-system headers by default.
> Previously, users had to explicitly opt-in to header warnings using
> -header-filter=’.*’. To disable warnings from non-system, set
> -header-filter to an empty string.
2026-01-26 14:37:01 -05:00
Felix Rieseberg
ae43f17b79 build: Run gh workflows only on e/e (#49521) 2026-01-26 14:35:11 -05:00
electron-roller[bot]
b847299f19 chore: bump chromium to 146.0.7650.0 (main) (#49496)
* chore: bump chromium in DEPS to 146.0.7650.0

* 7496671: WaaP: Control hung delay for Initial WebUI

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7496671

* 7494302: [//media] Rename renderable_gpu_memory_buffer_video_frame_pool*

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7494302

* chore: update patches

* 7502996: [DevTools] Add ability to toggle Chromium feature flags from DevTools

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7502996

* 7456200: Vectorize StringImpl::CopyChars and EqualIgnoringASCIICase using Highway.

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7456200

* 7236627: spellcheck: supply full spelling marker info, incld. marker type

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7236627

* chore: rm dependency on wtf::string from blink public headers

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7456200
added a public dependency on //third_party/highway for
//third_party/blink/renderer/platform/wtf:wtf which will not be
inherited by //content/renderer since wtf is internal dependency of
blink leading to the following compilation error

```
In file included from ../../content/public/renderer/window_features_converter.cc:5:
In file included from ../../content/public/renderer/window_features_converter.h:10:
In file included from ../../third_party/blink/public/web/web_window_features.h:38:
In file included from ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:40:
../../third_party/blink/renderer/platform/wtf/text/string_impl.h:27:10: fatal error: 'hwy/highway.h' file not found
   27 | #include <hwy/highway.h>
      |          ^~~~~~~~~~~~~~~
1 error generated.
```

Use `gn desc out/Testing content/renderer:renderer_sources --blame`
to verify the inherited config and dependency list.

* 7493995: Restore directive part of wasm-eval error message

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7493995

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2026-01-26 11:18:09 -08:00
Charles Kerr
6766343173 refactor: simplify NativeWindow-to-BaseWindow lookup (#49520)
refactor: simplify native window to base window lookup
2026-01-26 12:28:57 +01:00
Sourav Bera
75be2fe8d6 docs: add type reference links in Menu and MenuItem API documentation (#49437)
* docs: add type reference links in Menu and MenuItem API documentation

* docs: revert type links in Menu return types to fix parser
2026-01-26 12:22:28 +01:00
Charles Kerr
30f365d9d8 refactor: use gin::Wrappable for electron::api::PowerMonitor (#49509)
* refactor: use `gin::Wrappable` for `electron::api::PowerMonitor`

* chore: update patches
2026-01-25 22:51:31 -06:00
Charles Kerr
e8250f9955 refactor: use gin::Wrappable for electron::api::Screen (#49506) 2026-01-25 13:46:25 -06:00
Kyle Cutler
d5de8883a2 feat: add focusOnNavigation flag to WebPreferences (#49425)
* feat: add focusOnNavigation webPreference

* WebContentsView tests

* fix

* fix
2026-01-23 14:29:34 -05:00
David Franco
8a11d5afb1 fix: avoid startup crash when V8 sandbox is disabled (#49210)
* fix: avoid startup crash when V8 sandbox is disabled

* chore: update patch

---------

Co-authored-by: David Franco <davidfrsan@gmail.com>
2026-01-23 11:49:15 -05:00
Shelley Vohr
89963618d9 fix: second argument to shell.writeShortcutLink is optional (#49476)
fix: second argument to shell.writeShortcutLink is optional
2026-01-23 11:24:47 -05:00
Charles Kerr
8c5c6a6088 refactor: use gin::Wrappable for electron::api::DataPipeHolder (#49495)
* refactor: make `DataPipeHolder` inherit from `gin::Wrappable`

* test: add a test to ensure GC clears the data pipe holder

* chore: e patches all

* chore: e patches all (trivial only)

* refactor: make AllDataPipeHolders a base::flat_map of WeakPersistent
2026-01-23 20:29:01 +09:00
Szymon Kurek
24526ccd39 docs: correct yarn part of tutorial-5-packaging (#49401)
docs: fix yarn part of `tutorial-5-packaging` - adding electron forge
2026-01-23 11:14:19 +01:00
Keeley Hammond
1134d95c6d chore: update main patches (#49498)
chore: update patches
2026-01-22 20:30:32 -08:00
Charles Kerr
d76608b945 refactor: use gin::Wrappable in electron::api::PowerSaveBlocker (#49381)
* refactor: PowerSaveBlocker subclasses gin::Wrappable

* chore: update chore_add_electron_objects_to_wrappablepointertag.patch

* chore: e patches all
2026-01-22 17:31:38 -06:00
electron-roller[bot]
d689f76ff9 chore: bump chromium to 146.0.7645.0 (main) (#49453)
* chore: bump chromium in DEPS to 146.0.7643.0

* chore: bump chromium in DEPS to 146.0.7645.0

* chore: update patches

* 7402162: Refactor app shims to call ContentMain

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7402162

* 7454282: Add master key management for HTTP Cache Encryption

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7454282

* 7490440: Reland "Delete unused base::Contains()"

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7490440

* chore: update patches

* 7414864: Pass CSSParserLocalContext down to CSSMathExpressionNodeParser

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7414864

* 7460969: Move child_process_id.h to common

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7460969

* 7474608: [api] Remove deprecated v8::PropertyCallbackInfo<T>::This()

Refs https://chromium-review.googlesource.com/c/v8/v8/+/7474608

* 7461067: [Viz] Rename kPreferGpuMemoryBuffer

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7461067

* 7487174: Remove GLHelper

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7487174

* 7457538: Set timeout from multi source page context fetcher

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7457538

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2026-01-22 17:01:09 -05:00
reito
e3142865b2 fix: offscreen rendering with correct screen info. (#48730)
fix: osr use correct screen info.
2026-01-22 14:58:54 -05:00
David Sanders
1f8e4079cd test: fix version color output when running prebuilt Electron (#49491) 2026-01-22 16:17:56 +01:00
Shelley Vohr
bad88c6ed4 fix: potential devtools crash on empty (#49468) 2026-01-21 17:05:26 -08:00
Noah Gregory
534cb33465 fix: return early from platform_util::Beep() on Linux if there is no default GDK display (#49442)
fix: return early from beep on linux if there is no default gdk display
2026-01-21 15:55:24 -05:00
Soobin Rho
51e7753ae9 docs: clearer wording performance common pitfalls (#45308)
docs: clearer wording (performance common pitfalls)

Signed-off-by: Soobin Rho <soobinrho@gmail.com>
2026-01-21 14:46:02 -05:00
sam marshall
d141934885 docs: document that shell.trashItem requires backslashes (#49038)
docs: Update shell.md: Document that shell.trashItem requires backslashes

In Windows many functions relating to files (e.g. shell.openItem, the Node fs functions, as well as native Win32 APIs) will accept either type of slash / or \ as a folder separator.

shell.trashItem does not work with / as folder separator in Windows. This documentation change explains that.

See also:
https://github.com/electron/electron/issues/28831
2026-01-21 13:21:01 -05:00
Erick Zhao
22e8cf9416 docs: add a few API history fragments (#49340)
* docs: add a few API history fragments

* manual fixes
2026-01-21 12:57:02 -05:00
David Sanders
5856b2e01c ci: trigger website docs update on release published (#49429) 2026-01-21 10:44:18 -05:00
Shelley Vohr
49d91dd02b revert: use deprecated setAllowedFileTypes in macOS dialogs (#49444)
* revert: use deprectated setAllowedFileTypes in macOS dialogs

Closes https://github.com/electron/electron/issues/48191

* chore: remove stray import
2026-01-21 13:08:04 +01:00
David Franco
2f20d287d1 feat: import shared texture supports p010le (#49272)
feat: import shared texture supports p010le.
2026-01-20 11:50:30 +01:00
Shelley Vohr
73377af79e build: try removing zero-fill sandbox patch component (#49452) 2026-01-20 09:40:33 +01:00
dependabot[bot]
47766801e4 build(deps): bump actions/setup-node from 6.1.0 to 6.2.0 (#49456)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](395ad32622...6044e13b5d)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-20 09:40:02 +01:00
dependabot[bot]
bf0510dc22 build(deps): bump electron/github-app-auth-action from 1.1.1 to 2.0.0 (#49457)
Bumps [electron/github-app-auth-action](https://github.com/electron/github-app-auth-action) from 1.1.1 to 2.0.0.
- [Release notes](https://github.com/electron/github-app-auth-action/releases)
- [Commits](384fd19694...e14e47722e)

---
updated-dependencies:
- dependency-name: electron/github-app-auth-action
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-20 09:39:47 +01:00
electron-roller[bot]
486a9a61d2 chore: bump chromium to 146.0.7635.0 (main) (#49408)
* chore: bump chromium in DEPS to 146.0.7635.0

* chore: update patch hunk headers

* 7078551: [wasm] Refactor caching API

https://chromium-review.googlesource.com/c/v8/v8/+/7078551

* 7141498: [api] Remove unused context parameter from FixedArray::Get

https://chromium-review.googlesource.com/c/v8/v8/+/7141498

* 7454865: Add timeouts to content API for CopyFromSurface

https://chromium-review.googlesource.com/c/chromium/src/+/7454865

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-01-19 15:37:02 +01:00
Niklas Wenzel
7851a34c2d docs: fix webContents.hostWebContents types (#49424) 2026-01-19 10:45:23 +01:00
Shelley Vohr
faa21a748f fix: MAS rejection for private APIs (#49391) 2026-01-18 10:34:16 +01:00
Shelley Vohr
5bd2938f6a fix: try clearing InspectableWebContents delegate earlier (#49406)
fix: try clearing InspectableWebContents delegate earlier
2026-01-16 21:36:34 +01:00
electron-roller[bot]
f149efe32e chore: bump node to v24.13.0 (main) (#49189)
* chore: bump node in DEPS to v24.12.0

* src: use CP_UTF8 for wide file names on win32

https://github.com/nodejs/node/pull/60575

* test,crypto: handle a few more BoringSSL tests

https://github.com/nodejs/node/pull/59030

* chore: fixup patch indices

* chore: re-add accidentally removed sslv23 test

* chore: fixup crypto patch rebase

* test: make buffer sizes 32bit-aware in test-internal-util-construct-sab

https://github.com/nodejs/node/pull/61026

* src: add internal binding for constructing SharedArrayBuffers

https://github.com/nodejs/node/pull/60497

* chore: bump node in DEPS to v24.13.0

* chore: fixup patch indices

* chore: fixup sandboxed pointers patch

* tls: route callback exceptions through error handlers

https://github.com/nodejs-private/node-private/pull/782

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-01-16 11:08:38 -05:00
Daniel Gräfe
5dd509d2f4 fix: restore AXDocument accessibility attribute for representedFilename on macOS (#49346)
Starting from Chromium 134.0.6989.0 (Electron 35.0.0-beta.5), the
NativeWidgetMacNSWindow class overrides accessibilityDocument to return
the web content URL from the accessibility tree, but doesn't fall back
to NSWindow's default behavior when that URL is empty.

This broke Electron's setRepresentedFilename() API - the file path was
still set on the NSWindow, but no longer exposed via the AXDocument
accessibility attribute that screen readers use.

This fix adds an accessibilityDocument override in ElectronNSWindow that
checks representedFilename first, falling back to Chromium's behavior
for web content URLs.

Fixes: https://github.com/electron/electron/issues/XXXXX

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 10:27:29 +01:00
Alex Schwartz
bdd7730a24 fix: make toplevel icon Wayland protocol work (#49290) 2026-01-16 09:55:52 +01:00
dependabot[bot]
060e76f1b6 build(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 (#49220)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](330a01c490...b7c566a772)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-16 09:55:38 +01:00
David Sanders
2fbf1f5c72 ci: detect patch needs update error with problem matcher (#49405) 2026-01-15 19:18:50 -08:00
Charles Kerr
c769361af2 fix: warning: default arguments on virtual or override methods (#49398)
fix: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]

we never override these, so just make them nonvirtual
2026-01-15 16:09:43 -08:00
electron-roller[bot]
6ea7d6d5a4 chore: bump chromium to 146.0.7633.0 (main) (#49390)
* chore: bump chromium in DEPS to 146.0.7633.0

* chore: fixup patch indices

* chore: fix unsafe buffer usage in browser_linux.cc

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-01-15 10:52:42 -05:00
Charles Kerr
27b3a32307 chore: update patches (#49399) 2026-01-14 22:33:23 -08:00
Charles Kerr
ddeb970f18 refactor: make ReplyChannel inherit from gin::Wrappable (#49339)
* refactor: make ReplyChannel inherit from gin::Wrappable

* chore: add kElectronReplyChannel to chore_add_electron_objects_to_wrappablepointertag.patch

* fix: use gin::PerIsolateData::DisposeObserver

* fix: lifetime issues

* chore: rm perisolatedata hook in favor of prefinalizer

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2026-01-14 18:35:01 -06:00
electron-roller[bot]
5d80264944 chore: bump chromium to 145.0.7628.0 (main) (#49331)
* chore: bump chromium in DEPS to 145.0.7620.0

* chore: bump chromium in DEPS to 145.0.7622.0

* chore: bump chromium in DEPS to 145.0.7624.0

* chore: bump chromium in DEPS to 145.0.7626.0

* chore: bump chromium in DEPS to 145.0.7628.0

* 7362759: Migrate various base::Contains() to contains() in ui | https://chromium-review.googlesource.com/c/chromium/src/+/7362759

* chore: update patches

* 7411324: url: Mark deprecated functions as UNSAFE_BUFFER_USAGE

https://chromium-review.googlesource.com/c/chromium/src/+/7411324

* 7366867: Store property info in CSSParserLocalContext for random()

https://chromium-review.googlesource.com/c/chromium/src/+/7366867

* 7277406: Exclude PiP from getDisplayMedia picker thumbnails

https://chromium-review.googlesource.com/c/chromium/src/+/7277406

* 7253489: activity_reporter: Create stub module owned by browser_process

https://chromium-review.googlesource.com/c/chromium/src/+/7253489

* 7404514: Create device parental controls delegate

https://chromium-review.googlesource.com/c/chromium/src/+/7404514

* 7269504: Update histograms to use the updated MediaStreamRequestResult enum

https://chromium-review.googlesource.com/c/chromium/src/+/7269504

* fixup! 7253489: activity_reporter: Create stub module owned by browser_process

* 7368549: Reland "Use native rollup"

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7368549

* 4803165: Enable suppressing input event dispatch while paint-holding.

https://chromium-review.googlesource.com/c/chromium/src/+/4803165

* chore: make device_parental_controls lazy

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-01-14 15:34:24 +01:00
Erick Zhao
dae76c2885 docs: remove stale example and standardize DevTools capitalization (#49321)
* docs: remove stale example and standardize `DevTools` capitalization

* Update docs/api/web-contents.md

Co-authored-by: Kilian Valkhof <kilian@kilianvalkhof.com>

---------

Co-authored-by: Kilian Valkhof <kilian@kilianvalkhof.com>
2026-01-14 10:35:53 +01:00
Erick Zhao
a368c5da0c docs: improve build-tools instructions (#49294)
* docs: improve build-tools instructions

* address comments

* update directory structure

* update

* nits

* node -> electron_node

* update macos build version

* Update docs/development/build-instructions-gn.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

---------

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2026-01-14 09:51:55 +01:00
Keeley Hammond
1b2679b315 fix: revert os_crypt async cookie provider implementation (#49382)
* Revert "fix: provide explicit cookie encryption provider for cookie encryption (#49348)"

This reverts commit 95f097a392.

* Revert "fix: fix cookie encryption provider loading on Windows and Linux (#49371)"

This reverts commit 0e4ee9f03a.

* revert: 6996667: Reland "Port net::CookieCryptoDelegate to os_crypt async" | https://chromium-review.googlesource.com/c/chromium/src/+/6996667
2026-01-14 09:34:00 +01:00
Shelley Vohr
15acf70760 build: roll build-image to a82b87d (#49377)
build: roll build-image to a82b87d
2026-01-13 12:13:14 +01:00
dependabot[bot]
324eb0eb1c build(deps): bump github/codeql-action from 4.31.7 to 4.31.10 (#49376)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.7 to 4.31.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cf1bb45a27...cdefb33c0f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-13 10:25:10 +01:00
Keeley Hammond
0e4ee9f03a fix: fix cookie encryption provider loading on Windows and Linux (#49371)
* fix: support cookie encryption provider cross-platform

* fix: add async macos key provider
2026-01-12 19:39:29 -08:00
Charles Kerr
ae94cefdba refactor: add static ReplyChannel::SendError() helper (#49338)
* refactor: add static void ReplyChannel::SendError()

* refactor: use static SendError() instead of instantiating a temporary

* refactor: remove non-static version of SendError()

* refactor: remove redundant callback-is-non-null checks
2026-01-12 17:02:58 -06:00
Shelley Vohr
409c29b12b build: roll build-tools SHA to 4430e4a (#49362)
build: roll build-tools SHA to 4430e4a
2026-01-12 12:22:30 -05:00
Shelley Vohr
b0e012f14e build: update on-create-command for siso (#49357) 2026-01-12 14:30:48 +01:00
Calvin
9a5ffd920c feat: suppress devtools console logging (#49292)
* feat: suppress devtools console logging

* Emit messages as-is in testing builds

* Promote `DCHECK_IS_ON()` to preprocessor check
2026-01-12 11:31:33 +01:00
Charles Kerr
cf2e283332 fix: clang-tidy warnings, pt. 1 (#49083)
* fix: google-readability-casting warning about the uint32_t cast

* fix: modernize-use-equals-default warnings

* fix: readability-redundant-member-init warning

* fix: modernize-make-unique warnings

* fix: modernize-use-emplace

warning: use emplace_back instead of push_back

* refactor: address code review feedback
2026-01-09 22:57:38 -08:00
Niklas Wenzel
d6a6312fc8 build: update NMV to 145 (#49349) 2026-01-09 18:14:18 -08:00
Keeley Hammond
95f097a392 fix: provide explicit cookie encryption provider for cookie encryption (#49348)
fix: provide explicit cookie encryption provider

Fixes 6996667: Reland "Port net::CookieCryptoDelegate to os_crypt async" | https://chromium-review.googlesource.com/c/chromium/src/+/6996667
2026-01-09 11:53:58 -08:00
Niklas Wenzel
b380755514 chore: remove stakeholders mention from PR template (#49317) 2026-01-09 00:36:40 -08:00
David Sanders
3985daa81c chore: improvements to script/run-clang-tidy.ts (#49335)
* chore: disable color output for clang-tidy in CI

* chore: small QoL improvements to run-clang-tidy.ts

* chore: add --fix option to script/run-clang-tidy.ts
2026-01-08 22:05:44 -08:00
Erick Zhao
5901d8a6d8 docs: document ELECTRON_SKIP_BINARY_DOWNLOAD (#49320) 2026-01-07 14:54:22 -08:00
electron-roller[bot]
eee60f202c chore: bump chromium to 145.0.7618.0 (main) (#49314)
* chore: bump chromium in DEPS to 145.0.7618.0

* 7399531: [GTK] Don't preselect file dialog accept buttons | https://chromium-review.googlesource.com/c/chromium/src/+/7399531

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2026-01-07 15:01:56 -05:00
Charles Kerr
b5a7d81c7d refactor: have GetXdgAppId() return a std::optional<std::string> (#49318)
* refactor: GetXdgAppId() now returns std::optional<std::string>

* refactor: slightly simplify app.setDesktopName() ts calls

* refactor: add better documentation for dekstop-entry in XDG notifications
2026-01-07 14:30:09 -05:00
dependabot[bot]
a89b2cd9bc build(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 (#49221)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](018cc2cf5b...37930b1c2a)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-06 15:48:38 -05:00
Niklas Wenzel
44fa30695f docs: update roundedCorners documentation (#49195) 2026-01-05 16:27:46 -05:00
Niklas Wenzel
2ab56adbbd test: remove outdated disabled test (#49196) 2026-01-05 16:27:01 -05:00
electron-roller[bot]
a1f0ef80d4 chore: bump chromium to 145.0.7616.0 (main) (#49279)
* chore: bump chromium in DEPS to 145.0.7605.0

* chore: bump chromium in DEPS to 145.0.7606.0

* chore: bump chromium in DEPS to 145.0.7608.0

* chore: update patches

* chore: bump chromium in DEPS to 145.0.7610.0

* chore: update patches

* [InputVizard] Fix missing touch cancel in InputTransferHandlerAndroid
using InputEventSource

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7302368

* chore: bump chromium in DEPS to 145.0.7611.0

* chore: update patches

* chore: bump chromium in DEPS to 145.0.7614.0

* chore: bump chromium in DEPS to 145.0.7615.0

* chore: update patches

* chore: bump chromium in DEPS to 145.0.7616.0

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2026-01-05 13:34:36 -05:00
dependabot[bot]
c1a031be83 build(deps): bump actions-cool/issues-helper from 3.7.3 to 3.7.5 (#49282)
Bumps [actions-cool/issues-helper](https://github.com/actions-cool/issues-helper) from 3.7.3 to 3.7.5.
- [Release notes](https://github.com/actions-cool/issues-helper/releases)
- [Changelog](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md)
- [Commits](3809910bc1...e2ff99831a)

---
updated-dependencies:
- dependency-name: actions-cool/issues-helper
  dependency-version: 3.7.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-05 12:26:03 -05:00
John Kleinschmidt
c8bb700509 build: fixup release notes generation (#49302) 2026-01-05 11:11:40 -05:00
Calvin
46922de638 fix: drag regions in child windows (#49231)
* fix: drag regions in child windows

* Update comments
2026-01-05 10:34:01 -05:00
Niklas Wenzel
75ea93a279 chore: remove quiet period mention from PR template (#49298) 2026-01-05 10:12:07 -05:00
John Kleinschmidt
ace0beaa3f build: add logging to notes generator (#49300) 2026-01-05 09:49:51 -05:00
electron-roller[bot]
9eb43f3286 chore: bump chromium to 145.0.7604.0 (main) (#49265)
* chore: bump chromium in DEPS to 145.0.7599.0

* chore: bump chromium in DEPS to 145.0.7600.0

* chore: bump chromium in DEPS to 145.0.7602.0

* chore: bump chromium in DEPS to 145.0.7604.0

* chore: update patches (trivial only)

* [bytesize] Migrate network data in Task Manager to ByteSize.

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/7266090

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-12-28 20:40:50 -08:00
electron-roller[bot]
809ab09b6f chore: bump chromium to 145.0.7596.0 (main) (#49224)
* chore: bump chromium in DEPS to 145.0.7588.0

* fix(patch-conflict): update scroll_bounce_flag for split overscroll methods

Chromium split IsElasticOverscrollEnabled() into two methods:
IsElasticOverscrollEnabledOnRoot() and IsElasticOverscrollSupported().
Updated patch to apply the scroll-bounce command-line switch to both
methods.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7233733

* fix(patch-conflict): update exclusive_access patch context

Upstream refactored the profile variable declaration. Updated patch to
match new surrounding context with brace-style if statement.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7239252

* fix(patch-conflict): update screen capture kit non-shareable filter

Upstream refactored PiP window exclusion to use GetWindowsToExclude()
helper function. Updated patch to combine non-shareable window filtering
with the new helper's output.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7274596

* fix(patch-conflict): update corner smoothing CSS property id position

Upstream added new internal overscroll CSS properties. Updated patch to
add kElectronCornerSmoothing after the new entries.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7234051

* fix(patch-conflict): update permission patches for new permission types

Upstream added new permission types: LOCAL_NETWORK, LOOPBACK_NETWORK,
and GEOLOCATION_APPROXIMATE. Updated Electron permission patches to
include these new types and renumber Electron-specific permissions.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7231952

* fix(patch-conflict): update memory query fallback for new function signature

Upstream added AmountOfTotalPhysicalMemory() with PCHECK. Updated patch
to maintain fallback logic with correct ByteSize return type.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7254886

* chore: update patch hunk headers

* fix(patch): update reclient-configs patch to use new file mode

The fix_add_python_remote_wrapper patch was using 'copy from' mode
which caused inconsistent behavior between local and CI git versions.
Changed to 'new file' mode for consistent patch application.

* fix(patch-conflict): remove duplicate GEOLOCATION_APPROXIMATE case

Upstream moved GEOLOCATION_APPROXIMATE earlier in the switch statement
in GetPermissionString(). The 3-way merge kept both the old and new
positions, causing a duplicate case error.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/6397637

* chore: update libcxx filenames for new headers

* chore: bump chromium in DEPS to 145.0.7590.0

* chore: update patch hunk headers

* fix(patch): update memory fallback return type to ByteSize

Upstream changed the return type from ByteCount to ByteSize.

* fix: suppress nodiscard warning in node_file.cc

libc++ added [[nodiscard]] to std::filesystem::copy_options operator|=
which causes build failures with -Werror.

* 7229082: update CopyFromSurface to use CopyFromSurfaceResult

Upstream changed CopyFromSurface callback to return
base::expected<viz::CopyOutputBitmapWithMetadata, std::string>
instead of SkBitmap, enabling better error handling.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7229082

* 7254070: add ip_address_space param to OnLocalNetworkAccessPermissionRequired

Upstream added IPAddressSpace parameter to check address space for
proper permission handling in Local Network Access.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7254070

* 7136679: add spelling_markers param to RequestCheckingOfText

Upstream added spelling_markers parameter to report misspelling
ranges from Blink to Spellcheck to IME.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7136679

* 7240487: remove second param from RegisterWebSafeIsolatedScheme

Upstream removed the schemes_okay_to_appear_as_origin_headers_ parameter.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7240487

* 7254577: use explicit WebElement constructor

WebElement default constructor now requires explicit construction
rather than brace initialization.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7254577

* 7256335: remove override from CreateGlobalFeaturesForTesting

Upstream removed BrowserProcess::CreateGlobalFeaturesForTesting virtual
method so the override specifier is no longer valid.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7256335

* chore: add missing SingleThreadTaskRunner include

A transitive include of SingleThreadTaskRunner was removed upstream,
requiring an explicit include.

Ref: Unable to locate specific CL (transitive include change)

* 7260483: add LOCAL_NETWORK, LOOPBACK_NETWORK permission type cases

Upstream added new permission types for Local Network Access split
permissions.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7260483

* chore: update patch hunk headers

* 7264893: update postMessage tests for file: origin serialization change

Chromium now serializes file: origins as 'null' in MessageEvent per spec.
This is a security improvement aligning with the HTML spec behavior.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7264893

* fix: add paths to custom scheme URLs in protocol tests

Custom scheme URLs without paths (e.g. test-scheme://foo) cause a
DCHECK crash in ASAN builds when CorsURLLoader tries to log the
request via GenerateRequestLine -> PathForRequest, which asserts
that the path is non-empty.

Adding trailing slashes ensures URLs have valid paths.

* chore: bump chromium in DEPS to 145.0.7592.0

* chore: update patches (trivial only)

* chore: bump chromium in DEPS to 145.0.7594.0

* chore: bump chromium in DEPS to 145.0.7596.0

* chore: update accelerator.patch

no manual changes; patch applied with fuzz 2 (offset 1 line)

* chore: update patches (trivial only)

* chore: node ./script/gen-libc++-filenames.js

---------

Co-authored-by: Alice Zhao <alicelovescake@anthropic.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-12-25 17:15:53 -06:00
Samuel Attard
3df3a6a736 fix: webRequest.onBeforeSendHeaders not being able to modify reserved headers (#49226)
* fix: `webRequest.onBeforeSendHeaders` not being able to modify reserved headers

* chore: add unit test for reserved header
2025-12-19 23:08:40 +13:00
Samuel Attard
7433c14af5 chore: add CLAUDE.md and Chromium Upgrade claude skill (#49229)
* chore: add CLAUDE.md and Chromium Upgrade claude skill

* Update script/lint.js

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

---------

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-12-19 13:07:58 +13:00
electron-roller[bot]
a90ccc753b chore: bump chromium to 145.0.7577.0 (main) (#49175)
* chore: bump chromium in DEPS to 145.0.7572.0

* chore: update patches (trivial only)

* chore(patch-conflict): feat_filter_out_non-shareable_windows_in_the_current_application_in.patch

Polished the edits and formatted the result. No real changes.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7232079 "7232079: Use WindowsToExclude to exclude PiP window in macOS screencapture device"

* chore(patch-conflict): feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7214586 "7214586: Refactor SelectFileDialogLinuxPortal to request XDG portal on demand"
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7237910 "7237910: Remove g_gtk_ui global"

* 7228586: Migrate SystemMemoryInfo from ByteCount to ByteSize

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7228586

* 7207583: GlobalRenderFrameHostId to ChildProcessId

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7207583

* 7205548: Remove uses of BodyAsStringCallbackDeprecated (extensions/)

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7205548

* chore: bump chromium in DEPS to 145.0.7574.0

* chore: update libc++ filenames

* chore: update patches (trivial only)

* chore(patch-conflict): feat_filter_out_non-shareable_windows_in_the_current_application_in.patch

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7246150 "7246150: Fix crash in ScreenCaptureKitDeviceMac due to null PIPScreenCaptureCoordinator"

* fixup! chore(patch-conflict): feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch

* fixup! chore(patch-conflict): feat_filter_out_non-shareable_windows_in_the_current_application_in.patch

* 7239572: [OOPIF PDF] Enable OOPIF PDF by default on Windows/macOS/Linux

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7239572

* chore: bump chromium in DEPS to 145.0.7576.0

* fixup! chore(patch-conflict): feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch

* chore: update patches (trivial only)

* chore: add note to keep patch that was upstreamed but reverted

fix_restore_original_resize_performance_on_macos.patch was organically upstreamed but that change got reverted just after the current roll's cutoff.

I've added a note in the patch contents so the patch sticks around and so we can keep it after the revert is included.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7255334 "7255334: Revert 'Fix jank when resizing browser window'"

* chore: bump chromium in DEPS to 145.0.7577.0

* chore: update patches (trivial only)

* chore(patch-conflict): keep patch after revert

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7255334 "7255334: Revert 'Fix jank when resizing browser window'"

* 7237910: Remove g_gtk_ui global

I tried to find a way to avoid the patch, but other approaches seemed complex and involved.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7237910

* 7251900: Reland "Remove callback_helpers.h include from is_callback.h (try 5)"

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7251900

* 7170174: [LNA] Retry requests for cached local resources

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7170174

* fix: PDFs use OOPIF (behavior change)

* fixup! 7237910: Remove g_gtk_ui global

* fixup! 7251900: Reland "Remove callback_helpers.h include from is_callback.h (try 5)"

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
2025-12-16 12:32:38 -05:00
John Kleinschmidt
e181fd040f build: drop dugite as a dependency (#49194) 2025-12-12 13:43:12 -05:00
David Sanders
a486185e10 ci: disallow non-maintainer changes to Yarn files (#49186) 2025-12-11 09:25:29 -05:00
John Kleinschmidt
8cefc8425c build: upgrade yarn to 4.12.0 (#49176) 2025-12-10 14:04:14 -05:00
electron-roller[bot]
fe477ce3aa chore: bump chromium to 145.0.7568.0 (main) (#49145)
* chore: bump chromium in DEPS to 145.0.7562.0

* fix(patch-conflict): update code cache patch for PersistentCache refactor

Upstream refactored code cache to use PersistentCache with new class-based
implementation (NoopCodeCacheHost, LocalCodeCacheHost, CodeCacheWithPersistentCacheHost).
Updated patch to integrate custom scheme support into the new structure while
preserving ProcessLockURLIsCodeCacheScheme checks for embedder-registered schemes.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7044986

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-conflict): update dialog patch for RequestXdgDesktopPortal API

Upstream changed from SetSystemdScopeUnitNameForXdgPortal to RequestXdgDesktopPortal
API pattern. Updated OnServiceStarted signature and kept OnSystemdUnitStarted callback
that calls Electron's file_dialog::StartPortalAvailabilityTestInBackground().

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7204285

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-conflict): remove reference to deleted AbortByPlaceholderLayout flag

Upstream removed the AbortByPlaceholderLayout runtime flag from
runtime_enabled_features.json5. Updated patch to only add ElectronCSSCornerSmoothing
without the removed flag reference.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7226494

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): guard media_file_system_registry for ChromeOS only

Upstream CL https://chromium-review.googlesource.com/c/chromium/src/+/7100719
moved media_file_system_registry to be ChromeOS-only since Media
Galleries is a Chrome Apps API and Chrome Apps are only available
on Chrome OS now.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): update VideoPixelFormat API for SharedImageFormat

Upstream CL https://chromium-review.googlesource.com/c/chromium/src/+/7207153
removed VideoPixelFormatToGfxBufferFormat as part of migration to
SharedImageFormat. Update to use VideoPixelFormatToSharedImageFormat
which directly returns the SharedImageFormat.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): extend profile methods patch for ShouldEnableXfaForms

The ShouldEnableXfaForms function uses Profile::FromBrowserContext()
which is not available in Electron. Wrap the profile-dependent code
in #if 0 to fall through to the feature flag default.

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: bump chromium in DEPS to 145.0.7563.0

* chore: bump chromium in DEPS to 145.0.7565.0

* chore: bump chromium in DEPS to 145.0.7567.0

* chore: bump chromium in DEPS to 145.0.7568.0

* fix(patch-conflict): update content_main_delegate.h context for IsInitFeatureListEarly

Upstream added a new IsInitFeatureListEarly() virtual method to ContentMainDelegate
just before where our GetBrowserV8SnapshotFilename() method is added. Updated patch
context to account for this new method.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7092856

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-update): include v8-cppgc.h for CppHeap complete type

The std::unique_ptr<v8::CppHeap> default argument in node.h requires
the complete CppHeap type definition for the destructor. Added the
v8-cppgc.h include to provide the full type definition.

Ref: Unable to locate CL - libc++ unique_ptr requires complete type for destructor

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): move NativeAppWindowFrameViewMacClient before constructor

The std::unique_ptr<NativeAppWindowFrameViewMacClient> member requires
the complete type definition to be visible at the point of the constructor
because the unique_ptr destructor may be instantiated during exception
handling. Moved the class definition before the NativeWindowMac constructor.

Ref: Unable to locate CL - libc++ unique_ptr requires complete type for destructor

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-conflict): update create_browser_v8_snapshot_file_name_fuse context for IsInitFeatureListEarly

The upstream added IsInitFeatureListEarly() virtual method declaration to
ContentMainDelegate class. Updated the patch context to account for this
new function being present before the GetBrowserV8SnapshotFilename()
declaration we add.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7092856

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(patch-update): remove reverted IsInitFeatureListEarly from v8 snapshot patch

The upstream added IsInitFeatureListEarly() was reverted, so the patch should
not include this declaration. Only GetBrowserV8SnapshotFilename() should be
added by the create_browser_v8_snapshot_file_name_fuse patch.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7230430

Co-Authored-By: Claude <noreply@anthropic.com>

* 6171655: include single_thread_task_runner.h for complete type

Added include for base/task/single_thread_task_runner.h in osr_converter.cc
to resolve incomplete type error when using
base::SingleThreadTaskRunner::GetCurrentDefault().

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/6171655

Co-Authored-By: Claude <noreply@anthropic.com>

* 7224136: use CHROMIUM_GIT_REVISION directly instead of removed function

Upstream removed GetChromiumGitRevision() function from embedder_support.
Updated to use CHROMIUM_GIT_REVISION macro directly via
build/util/chromium_git_revision.h as recommended in the Chromium CL.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7224136

Co-Authored-By: Claude <noreply@anthropic.com>

* fixup! 7224136: use CHROMIUM_GIT_REVISION directly instead of removed function

* fix(build): add missing include

`components/dbus/xdg/systemd.h` for `void OnSystemdUnitStarted(dbus_xdg::SystemdUnitStatus)` in the same patch.

* fix(build): adapt to string-view-ification change in windows jump_list.cc

7186922: Fix unsafe buffer usage in base/win/win_util.cc
https://chromium-review.googlesource.com/c/chromium/src/+/7186922

* chore: update libc++ filenames

* fixup! fix(build): add missing include

* fixup! fix(build): extend profile methods patch for ShouldEnableXfaForms

* fixup! fix(build): guard media_file_system_registry for ChromeOS only

* fixup! fixup! fix(build): extend profile methods patch for ShouldEnableXfaForms

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: clavin <clavin@electronjs.org>
2025-12-10 10:28:31 -05:00
John Kleinschmidt
bab6bd3dae build: use @electron-ci/dev-root for package.json default (#49154) 2025-12-09 14:49:12 -05:00
dependabot[bot]
33f6942565 build(deps): bump actions/stale from 10.1.0 to 10.1.1 (#49159)
Bumps [actions/stale](https://github.com/actions/stale) from 10.1.0 to 10.1.1.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](5f858e3efb...997185467f)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: 10.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:14:50 -05:00
dependabot[bot]
a1b2e82778 build(deps): bump actions-cool/issues-helper from 3.7.2 to 3.7.3 (#49157)
Bumps [actions-cool/issues-helper](https://github.com/actions-cool/issues-helper) from 3.7.2 to 3.7.3.
- [Release notes](https://github.com/actions-cool/issues-helper/releases)
- [Changelog](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md)
- [Commits](9861779a69...3809910bc1)

---
updated-dependencies:
- dependency-name: actions-cool/issues-helper
  dependency-version: 3.7.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:14:13 -05:00
dependabot[bot]
1e06b74cd2 build(deps): bump github/codeql-action from 4.31.6 to 4.31.7 (#49155)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.6 to 4.31.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fe4161a26a...cf1bb45a27)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 11:15:08 -05:00
dependabot[bot]
fe0caa0e0d build(deps): bump actions/checkout from 6.0.0 to 6.0.1 (#49158)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1af3b93b68...8e8c483db8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 11:14:41 -05:00
dependabot[bot]
cd48083be8 build(deps): bump actions/setup-node from 6.0.0 to 6.1.0 (#49156)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](2028fbc5c2...395ad32622)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 11:13:56 -05:00
John Kleinschmidt
8d5b104c17 build: upgrade github-app-auth to 3.2.0 (#49152) 2025-12-09 09:49:37 -05:00
John Kleinschmidt
6e134a8ad9 build: use powershell for Electron build step (#49144) 2025-12-08 16:03:40 -05:00
electron-roller[bot]
95e87e46ab chore: bump chromium to 144.0.7547.0 (main) (#49058)
* chore: bump chromium in DEPS to 144.0.7543.0

* Pass PipScreenCaptureCoordinatorProxy to ScreenCaptureKitDeviceMac

https://chromium-review.googlesource.com/c/chromium/src/+/7157590

* chore: update patches

* chore: update filenames.libcxx.gni

* 7142359: Spanification of process_singleton_posix.cc

https: //chromium-review.googlesource.com/c/chromium/src/+/7142359
Co-Authored-By: Charles Kerr <70381+ckerr@users.noreply.github.com>

* Move logging::LoggingSettings to base/logging/logging_settings.h

https://chromium-review.googlesource.com/c/chromium/src/+/7173024

* chore: bump chromium in DEPS to 144.0.7545.0

* 7159368: update PluginService API for sync GetPlugins

Upstream removed async PluginService APIs:
- GetPluginsAsync() removed, use synchronous GetPlugins()
- RegisterInternalPlugin() now takes single argument (remove add_at_beginning)
- RefreshPlugins() removed entirely

Updated ElectronPluginInfoHostImpl to use synchronous plugin loading and
simplified ElectronBrowserMainParts internal plugin registration.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7159368
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7159328
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7159056
(cherry picked from commit 88cdf50b0a)

* 7159184: add missing base/files/file_path.h include

Add explicit include for base/files/file_path.h in electron_browser_context.h.
After removal of superfluous Mojo includes from content headers, base::FilePath
is no longer transitively included via content/public/browser/browser_context.h.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7159184
(cherry picked from commit 6ca8ea03ec)

* 7126479: add ShouldForceRefreshTextCheckService parameter to SpellCheckClient

Upstream added a force-refresh parameter to WebTextCheckClient::RequestCheckingOfText
to bypass spell check cache. Add the new ShouldForceRefreshTextCheckService
parameter to SpellCheckClient's override (currently unused in Electron).

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7126479
(cherry picked from commit 879c0401c4)

* 7083663: remove fingerprinting_protection_ruleset_service override

Upstream deleted external references to Fingerprinting Protection Filter (FPF)
component. Remove the fingerprinting_protection_ruleset_service() override
from BrowserProcessImpl as the method no longer exists in the base class.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7083663
(cherry picked from commit 8350d152f9)

* 7155287: implement WebContentsView::GetSize and Resize

Upstream delegated WebContents::GetSize() and Resize() to WebContentsView,
making them pure virtual. Add const qualifier to GetSize() and implement
the Resize() override in OffScreenWebContentsView (no-op for offscreen).

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7155287
(cherry picked from commit 084eaa568e)

* 7184238: add OnUnconfirmedTapConvertedToTap override

Upstream added OnUnconfirmedTapConvertedToTap as a pure virtual method
to RenderWidgetHostViewBase to inform root view when child frame converts
an unconfirmed tap. Add empty override for offscreen rendering.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7184238
(cherry picked from commit ef03400d9a)

* 7143586: add widget parameter to OnCommandsChanged

GlobalAcceleratorListener::OnCommandsChanged gained a gfx::AcceleratedWidget
parameter for window association in the GlobalShortcutListenerLinux
implementation. Pass gfx::kNullAcceleratedWidget for Electron's usage.

Ref: : Pass parent handle to GlobalAcceleratorListenerLinux::BindShortcuts | https://chromium-review.googlesource.com/c/chromium/src/+/7143586
(cherry picked from commit 38306e2bfc)
Co-Authored-By: Samuel Attard <MarshallOfSound@users.noreply.github.com>

* chore: update patches

Co-Authored-By: Samuel Attard <MarshallOfSound@users.noreply.github.com>

* chore: bump chromium in DEPS to 144.0.7547.0

* chore: update patches

* 7189232: Add support for UnownedUserData in GlobalFeatures

https: //chromium-review.googlesource.com/c/chromium/src/+/7189232

* Refactor: Use std::u16string for extension load error messages

https://chromium-review.googlesource.com/c/chromium/src/+/7185844

* fixup Add support for UnownedUserData in GlobalFeatures

* 7165650: Remove ResourceContext

https://chromium-review.googlesource.com/c/chromium/src/+/7165650

* fixup BUILD.gn for lint

* 7202164: Reland "Reland "Remove GenericScopedHandle:IsValid""

https://chromium-review.googlesource.com/c/chromium/src/+/7202164

* advance deprecation of v8::ReturnValue<void>::Set(Local<S>).

7168624: [runtime][api] Relax requirements for setter/definer/deleter callbacks | https://chromium-review.googlesource.com/c/v8/v8/+/7168624

* fixup advance deprecation of v8::ReturnValue<void>::Set(Local<S>)

* chore: skip setting LPAC ACLs

* Revert "chore: skip setting LPAC ACLs"

This reverts commit e187aec488.

* chore: revert Convert to UNSAFE_TODO in sandbox

revert https://chromium-review.googlesource.com/c/chromium/src/+/7131661 to see if it fixes the Windows sandbox issue.

* Revert "chore: revert Convert to UNSAFE_TODO in sandbox"

This reverts commit 57afbfefe5.

* chore: Revert "Enable network sandbox by default on Windows"

see if this fixes the Windows sandbox issue

* Enable network sandbox by default on Windows

https://chromium-review.googlesource.com/c/chromium/src/+/7204292

* Revert "chore: Revert "Enable network sandbox by default on Windows""

This reverts commit 530ab6af82.

* fixup! Enable network sandbox by default on Windows | https://chromium-review.googlesource.com/c/chromium/src/+/7204292

* fixup!: Correct flag name, add kLocalNetworkAccessChecks to all platforms

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <70381+ckerr@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@anthropic.com>
Co-authored-by: Samuel Attard <MarshallOfSound@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2025-12-04 16:40:04 -08:00
Jan Hannemann
90e338df50 fix: run toast creation on background thread (#49106)
* fix: run toast creation on background thread

notes: attempts to fix app freeze when triggering notifications and the COM server in WindowsShellExperienceHost hangs

* fix: comments
2025-12-02 15:27:22 -08:00
dependabot[bot]
1b3fc9c174 build(deps): bump actions/checkout from 4.2.2 to 6.0.0 (#49125)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 6.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.2...1af3b93b6815bc44a9784bd300feb67ff0d1eeb3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 14:02:06 -05:00
dependabot[bot]
c51018281f build(deps): bump github/codeql-action from 4.31.5 to 4.31.6 (#49124)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.5 to 4.31.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fdbfb4d275...fe4161a26a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 14:01:21 -05:00
598 changed files with 15663 additions and 6282 deletions

1
.claude/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
settings.local.json

24
.claude/settings.json Normal file
View File

@@ -0,0 +1,24 @@
{
"permissions": {
"allow": [
"Bash(e sync)",
"Bash(e patches --list-targets:*)",
"Bash(git add:*)",
"Bash(git am:*)",
"Bash(git commit:*)",
"Bash(git log:*)",
"Bash(git show:*)",
"Bash(e patches:*)",
"Bash(e sync:*)",
"Skill(electron-chromium-upgrade)",
"Read(*)",
"Bash(echo:*)",
"Bash(e build:*)",
"Bash(tee:*)",
"Bash(git diff:*)",
"Bash(git rev-parse:*)"
],
"deny": [],
"ask": []
}
}

View File

@@ -0,0 +1,181 @@
---
name: electron-chromium-upgrade
description: Guide for performing Chromium version upgrades in the Electron project. Use when working on the roller/chromium/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Chromium changes, and proper commit formatting for patch fixes.
---
# Electron Chromium Upgrade: Phase One
## Summary
Run `e sync --3` repeatedly, fixing patch conflicts as they arise, until it succeeds. Then export patches and commit changes atomically.
## Success Criteria
Phase One is complete when:
- `e sync --3` exits with code 0 (no patch failures)
- All changes are committed per the commit guidelines
Do not stop until these criteria are met.
**CRITICAL** Do not delete or skip patches unless 100% certain the patch is no longer needed. Complicated conflicts or hard to resolve issues should be presented to the user after you have exhausted all other options. Do not delete the patch just because you can't solve it.
## Context
The `roller/chromium/main` branch is created by automation to update Electron's Chromium dependency SHA. No work has been done to handle breaking changes between the old and new versions.
**Key directories:**
- Current directory: Electron repo (always run `e` commands here)
- `..` (parent): Chromium repo (where most patches apply)
- `patches/`: Patch files organized by target
- `docs/development/patches.md`: Patch system documentation
## Pre-flight Checks
Run these once at the start of each upgrade session:
1. **Clear rerere cache** (if enabled): `git rerere clear` in both the electron and `..` repos. Stale recorded resolutions from a prior attempt can silently apply wrong merges.
2. **Ensure pre-commit hooks are installed**: Check that `.git/hooks/pre-commit` exists. If not, run `yarn husky` to install it. The hook runs `lint-staged` which handles clang-format for C++ files.
## Workflow
1. Run `e sync --3` (the `--3` flag enables 3-way merge, always required)
2. If succeeds → skip to step 5
3. If patch fails:
- Identify target repo and patch from error output
- Analyze failure (see references/patch-analysis.md)
- Fix conflict in target repo's working directory
- Run `git am --continue` in affected repo
- Repeat until all patches for that repo apply
- IMPORTANT: Once `git am --continue` succeeds you MUST run `e patches {target}` to export fixes
- Return to step 1
4. When `e sync --3` succeeds, run `e patches all`
5. **Read `references/phase-one-commit-guidelines.md` NOW**, then commit changes following those instructions exactly.
## Commands Reference
| Command | Purpose |
|---------|---------|
| `e sync --3` | Clone deps and apply patches with 3-way merge |
| `git am --continue` | Continue after resolving conflict (run in target repo) |
| `e patches {target}` | Export commits from target repo to patch files |
| `e patches all` | Export all patches from all targets |
| `e patches {target} --commit-updates` | Export patches and auto-commit trivial changes |
| `e patches --list-targets` | List targets and config paths |
## Patch System Mental Model
```
patches/{target}/*.patch → [e sync --3] → target repo commits
← [e patches] ←
```
## When to Edit Patches
| Situation | Action |
|-----------|--------|
| During active `git am` conflict | Fix in target repo, then `git am --continue` |
| Modifying patch outside conflict | Edit `.patch` file directly |
| Creating new patch (rare, avoid) | Commit in target repo, then `e patches {target}` |
Fix existing patches 99% of the time rather than creating new ones.
## Patch Fixing Rules
1. **Preserve authorship**: Keep original author in TODO comments (from patch `From:` field)
2. **Never change TODO assignees**: `TODO(name)` must retain original name
3. **Update descriptions**: If upstream changed (e.g., `DCHECK``CHECK_IS_TEST`), update patch commit message to reflect current state
# Electron Chromium Upgrade: Phase Two
## Summary
Run `e build -k 999 -- --quiet` repeatedly, fixing build issues as they arise, until it succeeds. Then run `e start --version` to validate Electron launches and commit changes atomically.
Run Phase Two immediately after Phase One is complete.
## Success Criteria
Phase Two is complete when:
- `e build -k 999 -- --quiet` exits with code 0 (no build failures)
- `e start --version` has been run to check Electron launches
- All changes are committed per the commit guidelines
Do not stop until these criteria are met. Do not delete code or features, never comment out code in order to take short cut. Make all existing code, logic and intention work.
## Context
The `roller/chromium/main` branch is created by automation to update Electron's Chromium dependency SHA. No work has been done to handle breaking changes between the old and new versions. Chromium APIs frequently are renamed or refactored. In every case the code in Electron must be updated to account for the change in Chromium, strongly avoid making changes to the code in chromium to fix Electrons build.
**Key directories:**
- Current directory: Electron repo (always run `e` commands here)
- `..` (parent): Chromium repo (do not touch this code to fix build issues, just read it to obtain context)
## Workflow
1. Run `e build -k 999 -- --quiet` (the `--quiet` flag suppresses per-target status lines, showing only errors and the final result)
2. If succeeds → skip to step 6
3. If build fails:
- Identify underlying file in "electron" from the compilation error message
- Analyze failure
- Fix build issue by adapting Electron's code for the change in Chromium
- Run `e build -t {target_that_failed}.o` to build just the failed target we were specifically fixing
- You can identify the target_that_failed from the failure line in the build log. E.g. `FAILED: 2e506007-8d5d-4f38-bdd1-b5cd77999a77 "./obj/electron/chromium_src/chrome/process_singleton_posix.o" CXX obj/electron/chromium_src/chrome/process_singleton_posix.o` the target name is `obj/electron/chromium_src/chrome/process_singleton_posix.o`
- **Read `references/phase-two-commit-guidelines.md` NOW**, then commit changes following those instructions exactly.
- Return to step 1
4. **CRITICAL**: After ANY commit (especially patch commits), immediately run `git status` in the electron repo
- Look for other modified `.patch` files that only have index/hunk header changes
- These are dependent patches affected by your fix
- Commit them immediately with: `git commit -am "chore: update patches (trivial only)"`
5. Return to step 1
6. When `e build` succeeds, run `e start --version`
7. Check if you have any pending changes in the Chromium repo by running `git status`
- If you have changes follow the instructions below in "A. Patch Fixes" to correctly commit those modifications into the appropriate patch file
## Commands Reference
| Command | Purpose |
|---------|---------|
| `e build -k 999 -- --quiet` | Build Electron, continue on errors, suppress status lines |
| `e build -t {target}.o` | Build just one specific target to verify a fix |
| `e start --version` | Validate Electron launches after successful build |
## Two Types of Build Fixes
### A. Patch Fixes (for files in chromium_src or patched Chromium files)
When the error is in a file that Electron patches (check with `grep -l "filename" patches/chromium/*.patch`):
1. Edit the file in the Chromium source tree (e.g., `/src/chrome/browser/...`)
2. Create a fixup commit targeting the original patch commit:
```bash
cd .. # to chromium repo
git add <modified-file>
git commit --fixup=<original-patch-commit-hash>
GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^
```
3. Export the updated patch: `e patches chromium`
4. Commit the updated patch file following `references/phase-one-commit-guidelines.md`.
To find the original patch commit to fixup: `git log --oneline | grep -i "keyword from patch name"`
The base commit for rebase is the Chromium commit before patches were applied. Find it by checking the `refs/patches/upstream-head` ref.
### B. Electron Code Fixes (for files in shell/, electron/, etc.)
When the error is in Electron's own source code:
1. Edit files directly in the electron repo
2. Commit directly (no patch export needed)
# Critical: Read Before Committing
- Before ANY Phase One commits: Read `references/phase-one-commit-guidelines.md`
- Before ANY Phase Two commits: Read `references/phase-two-commit-guidelines.md`
# Skill Directory Structure
This skill has additional reference files in `references/`:
- patch-analysis.md - How to analyze patch failures
- phase-one-commit-guidelines.md - Commit format for Phase One
- phase-two-commit-guidelines.md - Commit format for Phase Two
Read these when referenced in the workflow steps.

View File

@@ -0,0 +1,119 @@
# Analyzing Patch Failures
## Investigation Steps
1. **Read the patch file** at `patches/{target}/{patch_name}.patch`
2. **Examine current state** of the file in Chromium at mentioned line numbers
3. **Check recent upstream changes:**
```bash
cd .. # or relevant target repo
git log --oneline -10 -- {file}
```
4. **Find Chromium CL** in commit messages:
```
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/{CL_NUMBER}
```
## Critical: Resolve by Intent, Not by Mechanical Merge
When resolving a patch conflict, do NOT blindly preserve the patch's old code. Instead:
1. **Understand the upstream CL's full scope** — not just the conflicting hunk.
Run `git show <commit> --stat` and read diffs for all affected files.
Upstream may have removed structs, members, or methods that the patch
references in other hunks or files.
2. **Re-read the patch commit message** to understand its *intent* — what
behavior does it need to preserve or add?
3. **Implement the intent against the new upstream code.** If the patch's
purpose is "add a feature flag guard", add only the guard — don't also
restore old code inside the guard that upstream separately removed.
### Lesson: Upstream Removals Break Patch References
- **Trigger:** Patch conflict involves an upstream refactor (not just context drift)
- **Strategy:** After identifying the upstream CL, check its full diff for
removed types, members, and methods. If the patch's old code references
something removed, the resolution must use the new upstream mechanism.
- **Evidence:** An upstream CL removed a `HeadlessModeWindow` struct from a
header, but the conflict was only in a `.mm` file. Mechanically keeping the
patch's old line (`headless_mode_window_ = ...`) produced code referencing
a nonexistent type — caught only on review, not at patch-apply time.
### Lesson: Separate Patch Purpose from Patch Implementation
- **Trigger:** Conflict between "upstream simplified code" vs "patch has older code"
- **Strategy:** Identify the *minimal* change the patch needs. If the patch
wraps code in a conditional, only add the conditional — don't restore old
code that was inside the conditional but was separately cleaned up upstream.
- **Evidence:** An occlusion patch needed only a feature flag check, but the
old patch also contained a version check that upstream intentionally removed.
Mechanically preserving the old patch code re-added the removed check.
### Lesson: Finish the Adaptation at Conflict Time
- **Trigger:** A patch conflict involves an upstream API removal or replacement
- **Strategy:** When resolving the conflict, fully adapt the patch to use the
new API in the same commit. Don't remove the old code and leave behind stale
references that will "be fixed in Phase Two." Each patch fix commit should be
a complete resolution.
- **Evidence:** A safestorage patch conflicted because Chromium removed Keychain V1.
The conflict was resolved by removing V1 hunks, but the remaining code still
called V1 methods (`FindGenericPassword` with 3 args, `ItemDelete` with
`SecKeychainItemRef`). These should have been adapted to V2 APIs in the same
commit, not deferred.
## Common Failure Patterns
| Pattern | Cause | Solution |
|---------|-------|----------|
| Context lines don't match | Surrounding code changed | Update context in patch |
| File not found | File renamed/moved | Update patch target path |
| Function not found | Refactored upstream | Find new function name |
| `DCHECK` → `CHECK_IS_TEST` | Macro change | Update to new macro |
| Deleted code | Feature removed | Verify patch still needed |
## Using Git Blame
To find the CL that changed specific lines:
```bash
cd ..
git blame -L {start},{end} -- {file}
git log -1 {commit_sha} # Look for Reviewed-on: line
```
## Verifying Patch Necessity
Before deleting a patch, verify:
1. The patched functionality was intentionally removed upstream
2. Electron doesn't need the patch for other reasons
3. No other code depends on the patched behavior
When in doubt, keep the patch and adapt it.
## Phase Two: Build-Time Patch Issues
Sometimes patches that applied successfully in Phase One cause build errors in Phase Two. This can happen when:
1. **Incomplete types**: A patch disables a header include, but new upstream code uses the type
2. **Missing members**: A patch modifies a class, but upstream added new code referencing the original
### Finding Which Patch Affects a File
```bash
grep -l "filename.cc" patches/chromium/*.patch
```
Matching Existing Patch Patterns
When fixing build errors in patched files, examine the existing patch to understand its style:
- Does it use #if 0 / #endif guards?
- Does it use #if BUILDFLAG(...) conditionals?
- What's the pattern for disabled functionality?
Apply fixes consistent with the existing patch style.

View File

@@ -0,0 +1,102 @@
# Phase One Commit Guidelines
Only follow these instructions if there are uncommitted changes to `patches/` after Phase One succeeds.
Ignore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.
## Each Commit Must Be Complete
When resolving a patch conflict, fully adapt the patch to the new upstream code in the same commit. If the upstream change removes an API the patch uses, update the patch to use the replacement API now — don't leave stale references knowing they'll need fixing later. The goal is that each commit represents a finished resolution, not a partial one that defers known work to a future phase.
## Commit Message Style
**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters.
Always include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).
### Patch conflict fixes
Use `fix(patch):` prefix. The title should name the upstream change, not your response to it:
```
fix(patch): {topic headline}
Ref: {Chromium CL link}
Co-Authored-By: <AI model attribution>
```
Only add a description body if it provides clarity beyond the title. For straightforward context drift or simple API renames, the title + Ref is sufficient.
Examples:
- `fix(patch): constant moved to header`
- `fix(patch): headless mode refactor upstream`
- `fix(patch): V1 Keychain removal`
### Upstreamed patch removal
When patches are no longer needed (applied cleanly with "already applied" or confirmed upstreamed), group ALL removals into a single commit:
```
chore: remove upstreamed patch
```
or (if multiple):
```
chore: remove upstreamed patches
```
If the patch file did NOT contain a `Reviewed-on: https://chromium-review.googlesource.com/c/chromium/...` link, add a `Ref:` in the commit. If it did (i.e. cherry-picks), no `Ref:` is needed.
### Trivial patch updates
After all fix commits, stage remaining trivial changes (index, line numbers, context only):
```bash
git add patches
git commit -m "chore: update patches (trivial only)"
```
**Conflict resolution can produce trivial results.** A `git am` conflict doesn't always mean the patch content changed — context drift alone can cause a conflict. After resolving and exporting, inspect the patch diff: if only index hashes, line numbers, and context lines changed (not the patch's own `+`/`-` lines), it's trivial and belongs here, not in a `fix(patch):` commit.
## Atomic Commits
Each patch conflict fix gets its own commit with its own Ref.
IMPORTANT: Try really hard to find the CL reference per the instructions below. Each change you made should in theory have been in response to a change made in Chromium that you identified or can identify. Try for a while to identify and include the ref in the commit message. Do not give up easily.
## Finding CL References
Use `git log` or `git blame` on Chromium source files. Look for:
```
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/XXXXXXX
```
If no CL found after searching: `Ref: Unable to locate CL`
## Example Commits
### Patch conflict fix (simple — title is sufficient)
```
fix(patch): constant moved to header
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7536483
Co-Authored-By: <AI model attribution>
```
### Patch conflict fix (complex — description adds value)
```
fix(patch): V1 Keychain removal
Upstream deleted the V1 Keychain API. Removed V1 hunks and adapted
keychain_password_mac.mm to use KeychainV2 APIs.
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7540447
Co-Authored-By: <AI model attribution>
```

View File

@@ -0,0 +1,84 @@
# Phase Two Commit Guidelines
Only follow these instructions if there are uncommitted changes in the Electron repo after any fixes are made during Phase Two that result a target that was failing, successfully building.
Ignore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.
## Commit Message Style
**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters. Exception: upstream Chromium CL titles are used verbatim even if longer.
Always include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).
## Two Commit Types
### For Electron Source Changes (shell/, electron/, etc.)
```
{CL-Number}: {upstream CL's original title}
Ref: {Chromium CL link}
Co-Authored-By: <AI model attribution>
```
Use the **upstream CL's original commit title** — do not paraphrase or rewrite it. To find it: `git log -1 --format=%s <chromium-commit-hash>`.
Only add a description body if it provides clarity beyond what the title already says (e.g., when Electron's adaptation is non-obvious). For simple renames, method additions, or straightforward API updates, the title + Ref link is sufficient.
Each change should have its own commit and its own Ref. Logically group into commits that make sense rather than one giant commit. You may include multiple "Ref" links if required.
For a CL link in the format `https://chromium-review.googlesource.com/c/chromium/src/+/2958369` the "CL-Number" is `2958369`.
IMPORTANT: Try really hard to find the CL reference. Each change you made should in theory have been in response to a change in Chromium. Do not give up easily.
### For Patch Updates (patches/chromium/*.patch)
Use the same fixup workflow as Phase One and follow `references/phase-one-commit-guidelines.md` for the commit message format (`fix(patch):` prefix, topic style).
## Dependent Patch Header Updates
After any patch modification, check for other affected patches:
```bash
git status
# If other .patch files show as modified with only index, line number, and context changes:
git add patches/
git commit -m "chore: update patches (trivial only)"
```
## Finding CL References
Use git log or git blame on Chromium source files. Look for:
```
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/XXXXXXX
```
If no CL found after searching: `Ref: Unable to locate CL`
## Example Commits
### Electron Source Fix (simple — title is self-explanatory)
```
7535923: Rename ozone buildflags
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7535923
Co-Authored-By: <AI model attribution>
```
### Electron Source Fix (complex — description adds value)
```
7534194: Convert some functions in ui::Clipboard to async
Adapted ExtractCustomPlatformNames calls to use RunLoop pattern
consistent with existing ReadImage implementation, since upstream
converted the API from synchronous return to callback-based.
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7534194
Co-Authored-By: <AI model attribution>
```

View File

@@ -2,7 +2,7 @@ version: '3'
services:
buildtools:
image: ghcr.io/electron/devcontainer:933c7d6ff6802706875270bec2e3c891cf8add3f
image: ghcr.io/electron/devcontainer:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb
volumes:
- ..:/workspaces/gclient/src/electron:cached

View File

@@ -48,7 +48,8 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
\"gen\": {
\"args\": [
\"import(\\\"//electron/build/args/testing.gn\\\")\",
\"use_remoteexec = true\"
\"use_remoteexec = true\",
\"use_siso=true\"
],
\"out\": \"Testing\"
},
@@ -58,7 +59,7 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then
},
\"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\",
\"configValidationLevel\": \"strict\",
\"remoteBuild\": \"reclient\",
\"remoteBuild\": \"siso\",
\"preserveSDK\": 5
}
" >$buildtools/configs/evm.testing.json

View File

@@ -1,6 +1,3 @@
> [!IMPORTANT]
> Please note that code reviews and merges will be delayed during our [quiet period in December](https://www.electronjs.org/blog/dec-quiet-period-25) and might not happen until January.
#### Description of Change
<!--
@@ -13,7 +10,8 @@ Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.
#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->
- [ ] PR description included and stakeholders cc'd
- [ ] PR description included
- [ ] I have built and tested this PR
- [ ] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] 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)

View File

@@ -26,6 +26,9 @@ inputs:
is-asan:
description: 'The ASan Linux build'
required: false
upload-out-gen-artifacts:
description: 'Whether to upload the out/${dir}/gen artifacts'
required: false
runs:
using: "composite"
steps:
@@ -45,6 +48,7 @@ runs:
shell: bash
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
- name: Build Electron ${{ inputs.step-suffix }}
if: ${{ inputs.target-platform != 'win' }}
shell: bash
run: |
rm -rf "src/out/Default/Electron Framework.framework"
@@ -70,14 +74,37 @@ runs:
# Upload build stats to Datadog
if ! [ -z $DD_API_KEY ]; then
if [ "$TARGET_PLATFORM" = "win" ]; then
npx node electron/script/build-stats.mjs out/Default/siso.exe.INFO --upload-stats || true
else
npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true
fi
npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true
else
echo "Skipping build-stats.mjs upload because DD_API_KEY is not set"
fi
- name: Build Electron (Windows) ${{ inputs.step-suffix }}
if: ${{ inputs.target-platform == 'win' }}
shell: powershell
run: |
cd src\electron
git pack-refs
cd ..
$env:NINJA_SUMMARIZE_BUILD = 1
if ("${{ inputs.is-release }}" -eq "true") {
e build --target electron:release_build
} else {
e build --target electron:testing_build
}
Copy-Item out\Default\.ninja_log out\electron_ninja_log
node electron\script\check-symlinks.js
# Upload build stats to Datadog
if ($env:DD_API_KEY) {
try {
npx node electron\script\build-stats.mjs out\Default\siso.exe.INFO --upload-stats ; $LASTEXITCODE = 0
} catch {
Write-Host "Build stats upload failed, continuing..."
}
} else {
Write-Host "Skipping build-stats.mjs upload because DD_API_KEY is not set"
}
- name: Verify dist.zip ${{ inputs.step-suffix }}
shell: bash
run: |
@@ -192,6 +219,7 @@ runs:
- name: Publish Electron Dist ${{ inputs.step-suffix }}
if: ${{ inputs.is-release == 'true' }}
shell: bash
id: github-upload
run: |
rm -rf src/out/Default/obj
cd src/electron
@@ -202,6 +230,11 @@ runs:
echo 'Uploading Electron release distribution to GitHub releases'
script/release/uploaders/upload.py --verbose
fi
- name: Generate artifact attestation
if: ${{ inputs.is-release == 'true' }}
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
with:
subject-path: ${{ steps.github-upload.outputs.UPLOADED_PATHS }}
- name: Generate siso report
if: ${{ inputs.target-platform != 'win' && !cancelled() }}
shell: bash
@@ -250,3 +283,9 @@ runs:
with:
name: src_artifacts_${{ env.ARTIFACT_KEY }}
path: ./src_artifacts_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
- name: Upload Out Gen Artifacts ${{ inputs.step-suffix }}
if: ${{ inputs.upload-out-gen-artifacts == 'true' }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: out_gen_artifacts_${{ env.ARTIFACT_KEY }}
path: ./src/out/Default/gen

View File

@@ -143,11 +143,12 @@ runs:
echo "No changes to patches detected"
fi
fi
- name: Remove patch conflict problem matcher
- name: Remove patch conflict problem matchers
shell: bash
run: |
echo "::remove-matcher owner=merge-conflict::"
echo "::remove-matcher owner=patch-conflict::"
echo "::remove-matcher owner=patch-needs-update::"
- name: Upload patches stats
if: ${{ inputs.target-platform == 'linux' && github.ref == 'refs/heads/main' }}
shell: bash

View File

@@ -37,6 +37,22 @@ runs:
installation-dir: third_party/esbuild
target-platform: ${{ inputs.target-platform }}
package: infra/3pp/tools/esbuild/${platform}
- name: Fix rollup
if: ${{ inputs.target-platform != 'linux' }}
uses: ./src/electron/.github/actions/cipd-install
with:
cipd-root-prefix-path: src/third_party/devtools-frontend/src/
dependency: rollup_libs
deps-file: src/third_party/devtools-frontend/src/DEPS
installation-dir: third_party/rollup_libs
target-platform: ${{ inputs.target-platform }}
package: infra/3pp/tools/rollup_libs/${platform}
- name: Sync native rollup libs
if: ${{ inputs.target-platform != 'linux' }}
shell: bash
run : |
cd src/third_party/devtools-frontend/src
python3 scripts/deps/sync_rollup_libs.py
- name: Fix rustc
if: ${{ inputs.target-platform != 'linux' }}
shell: bash

View File

@@ -15,7 +15,7 @@ runs:
git config --global core.preloadindex true
git config --global core.longpaths true
fi
export BUILD_TOOLS_SHA=a5d9f9052dcc36ee88bef5c8b13acbefd87b7d8d
export BUILD_TOOLS_SHA=a0cc95a1884a631559bcca0c948465b725d9295a
npm i -g @electron/build-tools
# Update depot_tools to ensure python
e d update_depot_tools

122
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,122 @@
# Copilot Instructions for Electron
## Build System
Electron uses `@electron/build-tools` (`e` CLI). Install with `npm i -g @electron/build-tools`.
```bash
e sync # Fetch sources and apply patches
e build # Build Electron (GN + Ninja)
e build -k 999 # Build, continuing through errors
e start # Run built Electron
e start --version # Verify Electron launches
e test # Run full test suite
e debug # Run in debugger (lldb on macOS, gdb on Linux)
```
### Linting
```bash
npm run lint # Run all linters (JS, C++, Python, GN, docs)
npm run lint:js # JavaScript/TypeScript only
npm run lint:clang-format # C++ formatting only
npm run lint:cpp # C++ linting only
npm run lint:docs # Documentation only
```
### Running a Single Test
```bash
npm run test -- -g "pattern" # Run tests matching a regex pattern
# Example: npm run test -- -g "ipc"
```
### Running a Single Node.js Test
```bash
node script/node-spec-runner.js parallel/test-crypto-keygen
```
## Architecture
Electron embeds Chromium (rendering) and Node.js (backend) to enable desktop apps with web technologies. The parent directory (`../`) is the Chromium source tree.
### Process Model
Electron has two primary process types, mirroring Chromium:
- **Main process** (`shell/browser/` + `lib/browser/`): Controls app lifecycle, creates windows, system APIs
- **Renderer process** (`shell/renderer/` + `lib/renderer/`): Runs web content in BrowserWindows
### Native ↔ JavaScript Bridge
Each API is implemented as a C++/JS pair:
- C++ side: `shell/browser/api/electron_api_{name}.cc/.h` — uses `gin::Wrappable` and `ObjectTemplateBuilder`
- JS side: `lib/browser/api/{name}.ts` — exports the module, registered in `lib/browser/api/module-list.ts`
- Binding: `NODE_LINKED_BINDING_CONTEXT_AWARE(electron_browser_{name}, Initialize)` in C++ and registered in `shell/common/node_bindings.cc`
- Type declaration: `typings/internal-ambient.d.ts` maps `process._linkedBinding('electron_browser_{name}')`
### Patches System
Electron patches upstream dependencies (Chromium, Node.js, V8, etc.) rather than forking them. Patches live in `patches/` organized by target, with `patches/config.json` mapping directories to repos.
```text
patches/{target}/*.patch → [e sync] → target repo commits
← [e patches] ←
```
Key rules:
- Fix existing patches rather than creating new ones
- Preserve original authorship in TODO comments — never change `TODO(name)` assignees
- Each patch commit message must explain why the patch exists
- After modifying patches, run `e patches {target}` to export
When working on the `roller/chromium/main` branch for Chromium upgrades, use `e sync --3` for 3-way merge conflict resolution.
## Conventions
### File Naming
- JS/TS files: kebab-case (`file-name.ts`)
- C++ files: snake_case with `electron_api_` prefix (`electron_api_safe_storage.cc`)
- Test files: `api-{module-name}-spec.ts` in `spec/`
- Source file lists are maintained in `filenames.gni` (with platform-specific sections)
### JavaScript/TypeScript
- Semicolons required (`"semi": ["error", "always"]`)
- `const` and `let` only (no `var`)
- Arrow functions preferred
- Import order enforced: `@electron/internal``@electron``electron` → external → builtin → relative
- API naming: `PascalCase` for classes (`BrowserWindow`), `camelCase` for module APIs (`globalShortcut`)
- Prefer getters/setters over jQuery-style `.text([text])` patterns
### C++
- Follows Chromium coding style, enforced by `clang-format` and `clang-tidy`
- Uses Chromium abstractions (`base::`, `content::`, etc.)
- Header guards: `#ifndef ELECTRON_SHELL_BROWSER_API_ELECTRON_API_{NAME}_H_`
- Platform-specific files: `_mac.mm`, `_win.cc`, `_linux.cc`
### Testing
- Framework: Mocha + Chai + Sinon
- Test helpers in `spec/lib/` (e.g., `spec-helpers.ts`, `window-helpers.ts`)
- Use `defer()` from spec-helpers for cleanup, `closeAllWindows()` for window teardown
- Tests import from `electron/main` or `electron/renderer`
### Documentation
- API docs in `docs/api/` as Markdown, parsed by `@electron/docs-parser` to generate `electron.d.ts`
- API history tracked via YAML blocks in HTML comments within doc files
- Docs must pass `npm run lint:docs`
### Build Configuration
- `BUILD.gn`: Main GN build config
- `buildflags/buildflags.gni`: Feature flags (PDF viewer, extensions, spellchecker)
- `build/args/`: Build argument profiles (`testing.gn`, `release.gn`, `all.gn`)
- `DEPS`: Dependency versions and checkout paths
- `chromium_src/`: Chromium source file overrides (compiled instead of originals)

View File

@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "markdownlint",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+)\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}

View File

@@ -19,6 +19,16 @@
"line": 3
}
]
},
{
"owner": "patch-needs-update",
"pattern": [
{
"regexp": "^((patches\/.*): needs update)$",
"message": 1,
"file": 2
}
]
}
]
}

73
.github/workflows/apply-patches.yml vendored Normal file
View File

@@ -0,0 +1,73 @@
name: Apply Patches
on:
pull_request:
permissions: {}
concurrency:
group: apply-patches-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
if: github.repository == 'electron/electron'
runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: read
outputs:
has-patches: ${{ steps.filter.outputs.patches }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
# Use dorny/paths-filter instead of the path filter under the on: pull_request: block
# so that the output can be used to conditionally run the apply-patches job, which lets
# the job be marked as a required status check (conditional skip counts as a success).
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
patches:
- DEPS
- 'patches/**'
apply-patches:
needs: setup
if: ${{ needs.setup.outputs.has-patches == 'true' }}
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
container:
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb
options: --user root
volumes:
- /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
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.base.ref }}
- name: Merge PR HEAD
working-directory: src/electron
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
git config user.email "electron@github.com"
git config user.name "Electron Bot"
git fetch origin refs/pull/${PR_NUMBER}/head
git merge --squash FETCH_HEAD
git commit -n -m "Squashed commits"
- name: Checkout & Sync & Save
uses: ./src/electron/.github/actions/checkout
with:
target-platform: linux

View File

@@ -13,13 +13,13 @@ jobs:
contents: read
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
- name: Setup Node.js/npm
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 22.21.x
node-version: 24.12.x
- name: Setting Up Dig Site
run: |
echo "remote: ${{ github.event.pull_request.head.repo.clone_url }}"
@@ -45,7 +45,7 @@ jobs:
sha-file: .dig-old
filename: electron.old.d.ts
- name: Upload artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f #v6.0.0
with:
name: artifacts
path: electron/artifacts

View File

@@ -11,16 +11,17 @@ permissions: {}
jobs:
audit_branch_ci:
name: Audit CI on Branches
if: github.repository == 'electron/electron'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 22.17.x
- name: Sparse checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
.

View File

@@ -14,7 +14,7 @@ permissions: {}
jobs:
release-branch-created:
name: Release Branch Created
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller')) }}
if: ${{ github.repository == 'electron/electron' && (github.event_name == 'workflow_dispatch' || (github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller'))) }}
permissions:
contents: read
pull-requests: write
@@ -68,7 +68,7 @@ jobs:
done
- name: Generate GitHub App token
if: ${{ steps.check-major-version.outputs.MAJOR }}
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}

View File

@@ -10,11 +10,12 @@ permissions: {}
jobs:
build-git-cache-linux:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
container:
image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb
options: --user root
volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
@@ -23,7 +24,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -33,11 +34,12 @@ jobs:
target-platform: linux
build-git-cache-windows:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
container:
image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
volumes:
- /mnt/win-cache:/mnt/win-cache
@@ -47,7 +49,7 @@ jobs:
TARGET_OS: 'win'
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -57,13 +59,14 @@ jobs:
target-platform: win
build-git-cache-macos:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
# This job updates the same git cache as linux, so it needs to run after the linux one.
needs: build-git-cache-linux
container:
image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb
options: --user root
volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
@@ -72,7 +75,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0

View File

@@ -6,7 +6,7 @@ on:
build-image-sha:
type: string
description: 'SHA for electron/build image'
default: '933c7d6ff6802706875270bec2e3c891cf8add3f'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb'
required: true
skip-macos:
type: boolean
@@ -47,6 +47,7 @@ permissions: {}
jobs:
setup:
if: github.repository == 'electron/electron'
runs-on: ubuntu-latest
permissions:
contents: read
@@ -57,7 +58,7 @@ jobs:
build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
docs-only: ${{ steps.set-output.outputs.docs-only }}
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@@ -76,7 +77,7 @@ jobs:
id: set-output
run: |
if [ -z "${{ inputs.build-image-sha }}" ]; then
echo "build-image-sha=933c7d6ff6802706875270bec2e3c891cf8add3f" >> "$GITHUB_OUTPUT"
echo "build-image-sha=a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb" >> "$GITHUB_OUTPUT"
else
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
fi
@@ -124,7 +125,7 @@ jobs:
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -156,7 +157,7 @@ jobs:
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -188,7 +189,7 @@ jobs:
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -283,13 +284,15 @@ jobs:
contents: read
issues: read
pull-requests: read
uses: ./.github/workflows/pipeline-electron-build-and-test-and-nan.yml
uses: ./.github/workflows/pipeline-electron-build-and-tidy-and-test-and-nan.yml
needs: checkout-linux
if: ${{ needs.setup.outputs.src == 'true' }}
with:
build-runs-on: electron-arc-centralus-linux-amd64-32core
clang-tidy-runs-on: electron-arc-centralus-linux-amd64-8core
test-runs-on: electron-arc-centralus-linux-amd64-4core
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
clang-tidy-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
target-platform: linux
target-arch: x64
@@ -426,7 +429,7 @@ jobs:
permissions:
contents: read
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64]
if: always() && !contains(needs.*.result, 'failure')
if: always() && github.repository == 'electron/electron' && !contains(needs.*.result, 'failure')
steps:
- name: GitHub Actions Jobs Done
run: |

View File

@@ -12,6 +12,7 @@ permissions: {}
jobs:
clean-src-cache:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read

View File

@@ -21,7 +21,7 @@ jobs:
AUTHOR_ASSOCIATION=$(gh api /repos/electron/electron/issues/comments/${{ github.event.comment.id }} --jq '.author_association')
echo "author_association=$AUTHOR_ASSOCIATION" >> "$GITHUB_OUTPUT"
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
if: ${{ !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), steps.get-author-association.outputs.author_association) }}
id: generate-token
with:

View File

@@ -15,7 +15,7 @@ jobs:
contents: read
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
@@ -36,7 +36,7 @@ jobs:
contents: read
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
@@ -69,13 +69,13 @@ jobs:
fi
- name: Generate GitHub App token
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
- name: Create comment
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
uses: actions-cool/issues-helper@9861779a695cf1898bd984c727f685f351cfc372 # v3.7.2
uses: actions-cool/issues-helper@71b62d7da76e59ff7b193904feb6e77d4dbb2777 # v3.7.6
with:
actions: 'create-comment'
token: ${{ steps.generate-token.outputs.token }}

View File

@@ -14,7 +14,7 @@ jobs:
permissions: {}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
@@ -32,13 +32,13 @@ jobs:
permissions: {}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- name: Sparse checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
.
@@ -146,7 +146,7 @@ jobs:
}
- name: Create unsupported major comment
if: ${{ steps.add-labels.outputs.unsupportedMajor }}
uses: actions-cool/issues-helper@9861779a695cf1898bd984c727f685f351cfc372 # v3.7.2
uses: actions-cool/issues-helper@71b62d7da76e59ff7b193904feb6e77d4dbb2777 # v3.7.6
with:
actions: 'create-comment'
token: ${{ steps.generate-token.outputs.token }}

View File

@@ -14,7 +14,7 @@ jobs:
if: ${{ !github.event.changes.new_repository.private }}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}

View File

@@ -24,7 +24,7 @@ jobs:
fi
- name: Generate GitHub App token
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}

View File

@@ -6,7 +6,7 @@ on:
build-image-sha:
type: string
description: 'SHA for electron/build image'
default: '933c7d6ff6802706875270bec2e3c891cf8add3f'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb'
upload-to-storage:
description: 'Uploads to Azure storage'
required: false
@@ -21,6 +21,7 @@ permissions: {}
jobs:
checkout-linux:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
@@ -35,7 +36,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -43,9 +44,12 @@ jobs:
uses: ./src/electron/.github/actions/checkout
publish-x64:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-linux
with:
environment: production-release
@@ -60,9 +64,12 @@ jobs:
secrets: inherit
publish-arm:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-linux
with:
environment: production-release
@@ -77,9 +84,12 @@ jobs:
secrets: inherit
publish-arm64:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-linux
with:
environment: production-release

View File

@@ -13,6 +13,7 @@ permissions: {}
jobs:
macos-disk-cleanup:
if: github.repository == 'electron/electron'
strategy:
fail-fast: false
matrix:
@@ -25,7 +26,7 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
.github/actions/free-space-macos

View File

@@ -6,7 +6,7 @@ on:
build-image-sha:
type: string
description: 'SHA for electron/build image'
default: '933c7d6ff6802706875270bec2e3c891cf8add3f'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb'
required: true
upload-to-storage:
description: 'Uploads to Azure storage'
@@ -22,6 +22,7 @@ permissions: {}
jobs:
checkout-macos:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
@@ -36,7 +37,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -47,9 +48,12 @@ jobs:
target-platform: macos
publish-x64-darwin:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-macos
with:
environment: production-release
@@ -64,9 +68,12 @@ jobs:
secrets: inherit
publish-x64-mas:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-macos
with:
environment: production-release
@@ -81,9 +88,12 @@ jobs:
secrets: inherit
publish-arm64-darwin:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-macos
with:
environment: production-release
@@ -98,9 +108,12 @@ jobs:
secrets: inherit
publish-arm64-mas:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-macos
with:
environment: production-release

View File

@@ -7,6 +7,8 @@ on:
- 'spec/yarn.lock'
- '.github/workflows/**'
- '.github/actions/**'
- '.yarn/**'
- '.yarnrc.yml'
permissions: {}

View File

@@ -0,0 +1,124 @@
name: Electron Build & Clang Tidy & Test (+ Node + NaN) Pipeline
on:
workflow_call:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos, win or linux.'
required: true
target-arch:
type: string
description: 'Arch to build for, can be x64, arm64 or arm'
required: true
build-runs-on:
type: string
description: 'What host to run the build'
required: true
clang-tidy-runs-on:
type: string
description: 'What host to run clang-tidy on'
required: true
test-runs-on:
type: string
description: 'What host to run the tests on'
required: true
build-container:
type: string
description: 'JSON container information for aks runs-on'
required: false
default: '{"image":null}'
clang-tidy-container:
type: string
description: 'JSON container information to run clang-tidy on'
required: false
default: '{"image":null}'
test-container:
type: string
description: 'JSON container information for testing'
required: false
default: '{"image":null}'
is-release:
description: 'Whether this build job is a release job'
required: true
type: boolean
default: false
gn-build-type:
description: 'The gn build type - testing or release'
required: true
type: string
default: testing
generate-symbols:
description: 'Whether or not to generate symbols'
required: true
type: boolean
default: false
upload-to-storage:
description: 'Whether or not to upload build artifacts to external storage'
required: true
type: string
default: '0'
is-asan:
description: 'Building the Address Sanitizer (ASan) Linux build'
required: false
type: boolean
default: false
permissions: {}
concurrency:
group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
jobs:
build:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
permissions:
contents: read
with:
build-runs-on: ${{ inputs.build-runs-on }}
build-container: ${{ inputs.build-container }}
target-platform: ${{ inputs.target-platform }}
target-arch: ${{ inputs.target-arch }}
is-release: ${{ inputs.is-release }}
gn-build-type: ${{ inputs.gn-build-type }}
generate-symbols: ${{ inputs.generate-symbols }}
upload-to-storage: ${{ inputs.upload-to-storage }}
upload-out-gen-artifacts: true
secrets: inherit
clang-tidy:
uses: ./.github/workflows/pipeline-segment-electron-clang-tidy.yml
permissions:
contents: read
needs: build
with:
clang-tidy-runs-on: ${{ inputs.clang-tidy-runs-on }}
clang-tidy-container: ${{ inputs.clang-tidy-container }}
target-platform: ${{ inputs.target-platform }}
target-arch: ${{ inputs.target-arch }}
secrets: inherit
test:
uses: ./.github/workflows/pipeline-segment-electron-test.yml
permissions:
contents: read
issues: read
pull-requests: read
needs: build
with:
target-arch: ${{ inputs.target-arch }}
target-platform: ${{ inputs.target-platform }}
test-runs-on: ${{ inputs.test-runs-on }}
test-container: ${{ inputs.test-container }}
secrets: inherit
nn-test:
uses: ./.github/workflows/pipeline-segment-node-nan-test.yml
permissions:
contents: read
needs: build
with:
target-arch: ${{ inputs.target-arch }}
target-platform: ${{ inputs.target-platform }}
test-runs-on: ${{ inputs.test-runs-on }}
test-container: ${{ inputs.test-container }}
gn-build-type: ${{ inputs.gn-build-type }}
secrets: inherit

View File

@@ -0,0 +1,121 @@
name: Electron Build & Clang Tidy & Test Pipeline
on:
workflow_call:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos, win or linux'
required: true
target-arch:
type: string
description: 'Arch to build for, can be x64, arm64 or arm'
required: true
build-runs-on:
type: string
description: 'What host to run the build'
required: true
clang-tidy-runs-on:
type: string
description: 'What host to run clang-tidy on'
required: true
test-runs-on:
type: string
description: 'What host to run the tests on'
required: true
build-container:
type: string
description: 'JSON container information for aks runs-on'
required: false
default: '{"image":null}'
clang-tidy-container:
type: string
description: 'JSON container information to run clang-tidy on'
required: false
default: '{"image":null}'
test-container:
type: string
description: 'JSON container information for testing'
required: false
default: '{"image":null}'
is-release:
description: 'Whether this build job is a release job'
required: true
type: boolean
default: false
gn-build-type:
description: 'The gn build type - testing or release'
required: true
type: string
default: testing
generate-symbols:
description: 'Whether or not to generate symbols'
required: true
type: boolean
default: false
upload-to-storage:
description: 'Whether or not to upload build artifacts to external storage'
required: true
type: string
default: '0'
is-asan:
description: 'Building the Address Sanitizer (ASan) Linux build'
required: false
type: boolean
default: false
enable-ssh:
description: 'Enable SSH debugging'
required: false
type: boolean
default: false
concurrency:
group: electron-build-and-tidy-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
permissions: {}
jobs:
build:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
permissions:
contents: read
with:
build-runs-on: ${{ inputs.build-runs-on }}
build-container: ${{ inputs.build-container }}
target-platform: ${{ inputs.target-platform }}
target-arch: ${{ inputs.target-arch }}
is-release: ${{ inputs.is-release }}
gn-build-type: ${{ inputs.gn-build-type }}
generate-symbols: ${{ inputs.generate-symbols }}
upload-to-storage: ${{ inputs.upload-to-storage }}
is-asan: ${{ inputs.is-asan }}
enable-ssh: ${{ inputs.enable-ssh }}
upload-out-gen-artifacts: true
secrets: inherit
clang-tidy:
uses: ./.github/workflows/pipeline-segment-electron-clang-tidy.yml
permissions:
contents: read
needs: build
with:
clang-tidy-runs-on: ${{ inputs.clang-tidy-runs-on }}
clang-tidy-container: ${{ inputs.clang-tidy-container }}
target-platform: ${{ inputs.target-platform }}
target-arch: ${{ inputs.target-arch }}
secrets: inherit
test:
uses: ./.github/workflows/pipeline-segment-electron-test.yml
permissions:
contents: read
issues: read
pull-requests: read
needs: build
with:
target-arch: ${{ inputs.target-arch }}
target-platform: ${{ inputs.target-platform }}
test-runs-on: ${{ inputs.test-runs-on }}
test-container: ${{ inputs.test-container }}
is-asan: ${{ inputs.is-asan }}
enable-ssh: ${{ inputs.enable-ssh }}
secrets: inherit

View File

@@ -27,7 +27,7 @@ jobs:
container: ${{ fromJSON(inputs.container) }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -43,7 +43,7 @@ jobs:
with:
target-platform: linux
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0

View File

@@ -27,7 +27,7 @@ jobs:
container: ${{ fromJSON(inputs.container) }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -65,9 +65,11 @@ jobs:
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/buildtools/DEPS?format=TEXT" | base64 -d > src/buildtools/DEPS
gclient sync --spec="solutions=[{'name':'src/buildtools','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':True},'managed':False}]"
- name: Add ESLint problem matcher
- name: Add problem matchers
shell: bash
run: echo "::add-matcher::src/electron/.github/problem-matchers/eslint-stylish.json"
run: |
echo "::add-matcher::src/electron/.github/problem-matchers/eslint-stylish.json"
echo "::add-matcher::src/electron/.github/problem-matchers/markdownlint.json"
- name: Run Lint
shell: bash
run: |
@@ -85,4 +87,8 @@ jobs:
run: |
cd src/electron
node script/yarn.js tsc -p tsconfig.script.json
- name: Check GHA Workflows
shell: bash
run: |
cd src/electron
node script/copy-pipeline-segment-publish.js --check

View File

@@ -53,6 +53,11 @@ on:
required: false
type: boolean
default: false
upload-out-gen-artifacts:
description: 'Whether to upload the src/gen artifacts'
required: false
type: boolean
default: false
enable-ssh:
description: 'Enable SSH debugging'
required: false
@@ -95,7 +100,7 @@ jobs:
run: |
mkdir src
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -119,7 +124,7 @@ jobs:
run: df -h
- name: Setup Node.js/npm
if: ${{ inputs.target-platform == 'macos' }}
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 22.21.x
cache: yarn
@@ -163,7 +168,7 @@ jobs:
if: ${{ inputs.target-platform == 'linux' }}
uses: ./src/electron/.github/actions/restore-cache-aks
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -201,6 +206,7 @@ jobs:
generate-symbols: '${{ inputs.generate-symbols }}'
upload-to-storage: '${{ inputs.upload-to-storage }}'
is-asan: '${{ inputs.is-asan }}'
upload-out-gen-artifacts: '${{ inputs.upload-out-gen-artifacts }}'
- name: Set GN_EXTRA_ARGS for MAS Build
if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' || inputs.target-variant == 'mas') }}
run: |

View File

@@ -0,0 +1,159 @@
name: Pipeline Segment - Electron Clang-Tidy
on:
workflow_call:
inputs:
target-platform:
type: string
description: 'Platform to run on, can be macos, win or linux'
required: true
target-arch:
type: string
description: 'Arch to build for, can be x64, arm64 or arm'
required: true
clang-tidy-runs-on:
type: string
description: 'What host to run clang-tidy on'
required: true
clang-tidy-container:
type: string
description: 'JSON container information for aks runs-on'
required: false
default: '{"image":null}'
permissions: {}
concurrency:
group: electron-clang-tidy-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
cancel-in-progress: true
env:
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
ELECTRON_OUT_DIR: Default
jobs:
clang-tidy:
defaults:
run:
shell: bash
runs-on: ${{ inputs.clang-tidy-runs-on }}
permissions:
contents: read
container: ${{ fromJSON(inputs.clang-tidy-container) }}
env:
BUILD_TYPE: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
TARGET_ARCH: ${{ inputs.target-arch }}
TARGET_PLATFORM: ${{ inputs.target-platform }}
ARTIFACT_KEY: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}_${{ inputs.target-arch }}
steps:
- name: Checkout Electron
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Cleanup disk space on macOS
if: ${{ inputs.target-platform == 'macos' }}
shell: bash
run: |
sudo mkdir -p $TMPDIR/del-target
tmpify() {
if [ -d "$1" ]; then
sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
fi
}
tmpify /Library/Developer/CoreSimulator
tmpify ~/Library/Developer/CoreSimulator
sudo rm -rf $TMPDIR/del-target
- name: Check disk space after freeing up space
if: ${{ inputs.target-platform == 'macos' }}
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
if: ${{ inputs.target-platform == 'win' }}
run: |
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
- name: Generate DEPS Hash
run: |
node src/electron/script/generate-deps-hash.js
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
- 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
if [ "${{ inputs.target-platform }}" = "win" ]; then
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
echo "target_os=['win']" >> tmpgclient
fi
e d gclient runhooks --gclientfile=tmpgclient
# Fix VS Toolchain
if [ "${{ inputs.target-platform }}" = "win" ]; then
rm -rf src/third_party/depot_tools/win_toolchain/vs_files
e d python3 src/build/vs_toolchain.py update --force
fi
- name: Regenerate DEPS Hash
run: |
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
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: Checkout Electron
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
uses: ./src/electron/.github/actions/install-dependencies
- name: Default GN gen
run: |
cd src/electron
git pack-refs
- name: Download Out Gen Artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: out_gen_artifacts_${{ env.ARTIFACT_KEY }}
path: ./src/out/${{ env.ELECTRON_OUT_DIR }}/gen
- name: Add Clang problem matcher
shell: bash
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
- name: Run Clang-Tidy
run: |
e init -f --root=$(pwd) --out=${ELECTRON_OUT_DIR} testing --target-cpu ${TARGET_ARCH}
export GN_EXTRA_ARGS="target_cpu=\"${TARGET_ARCH}\""
if [ "${{ inputs.target-platform }}" = "win" ]; then
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
fi
e build --only-gen
cd src/electron
node script/yarn.js lint:clang-tidy --jobs 8 --out-dir ../out/${ELECTRON_OUT_DIR}
- name: Remove Clang problem matcher
shell: bash
run: echo "::remove-matcher owner=clang::"
- name: Wait for active SSH sessions
if: always() && !cancelled()
shell: bash
run: |
while [ -f /var/.ssh-lock ]
do
sleep 60
done

View File

@@ -48,7 +48,7 @@ jobs:
container: ${{ fromJSON(inputs.check-container) }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -115,7 +115,7 @@ jobs:
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0

View File

@@ -0,0 +1,243 @@
# AUTOGENERATED FILE - DO NOT EDIT MANUALLY
# ONLY EDIT .github/workflows/pipeline-segment-electron-build.yml
name: Pipeline Segment - Electron Build
on:
workflow_call:
inputs:
environment:
description: using the production or testing environment
required: false
type: string
target-platform:
type: string
description: Platform to run on, can be macos, win or linux
required: true
target-arch:
type: string
description: Arch to build for, can be x64, arm64, ia32 or arm
required: true
target-variant:
type: string
description: Variant to build for, no effect on non-macOS target platforms. Can
be darwin, mas or all.
default: all
build-runs-on:
type: string
description: What host to run the build
required: true
build-container:
type: string
description: JSON container information for aks runs-on
required: false
default: '{"image":null}'
is-release:
description: Whether this build job is a release job
required: true
type: boolean
default: false
gn-build-type:
description: The gn build type - testing or release
required: true
type: string
default: testing
generate-symbols:
description: Whether or not to generate symbols
required: true
type: boolean
default: false
upload-to-storage:
description: Whether or not to upload build artifacts to external storage
required: true
type: string
default: "0"
is-asan:
description: Building the Address Sanitizer (ASan) Linux build
required: false
type: boolean
default: false
upload-out-gen-artifacts:
description: Whether to upload the src/gen artifacts
required: false
type: boolean
default: false
enable-ssh:
description: Enable SSH debugging
required: false
type: boolean
default: false
permissions: {}
concurrency:
group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch
}}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{
github.ref_protected == true && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
env:
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' &&
'--custom-var=checkout_mac=True --custom-var=host_os=mac' ||
inputs.target-platform == 'win' && '--custom-var=checkout_win=True' ||
'--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
ELECTRON_OUT_DIR: Default
ACTIONS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
jobs:
build:
defaults:
run:
shell: bash
runs-on: ${{ inputs.build-runs-on }}
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
container: ${{ fromJSON(inputs.build-container) }}
environment: ${{ inputs.environment }}
env:
TARGET_ARCH: ${{ inputs.target-arch }}
TARGET_PLATFORM: ${{ inputs.target-platform }}
steps:
- name: Create src dir
run: |
mkdir src
- name: Checkout Electron
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup SSH Debugging
if: ${{ inputs.target-platform == 'macos' && (inputs.enable-ssh ||
env.ACTIONS_STEP_DEBUG == 'true') }}
uses: ./src/electron/.github/actions/ssh-debug
with:
tunnel: "true"
env:
CLOUDFLARE_TUNNEL_CERT: ${{ secrets.CLOUDFLARE_TUNNEL_CERT }}
CLOUDFLARE_TUNNEL_HOSTNAME: ${{ vars.CLOUDFLARE_TUNNEL_HOSTNAME }}
CLOUDFLARE_USER_CA_CERT: ${{ secrets.CLOUDFLARE_USER_CA_CERT }}
AUTHORIZED_USERS: ${{ secrets.SSH_DEBUG_AUTHORIZED_USERS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Free up space (macOS)
if: ${{ inputs.target-platform == 'macos' }}
uses: ./src/electron/.github/actions/free-space-macos
- name: Check disk space after freeing up space
if: ${{ inputs.target-platform == 'macos' }}
run: df -h
- name: Setup Node.js/npm
if: ${{ inputs.target-platform == 'macos' }}
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 22.21.x
cache: yarn
cache-dependency-path: src/electron/yarn.lock
- name: Install Dependencies
uses: ./src/electron/.github/actions/install-dependencies
- name: Install AZCopy
if: ${{ inputs.target-platform == 'macos' }}
run: brew install azcopy
- name: Set GN_EXTRA_ARGS for Linux
if: ${{ inputs.target-platform == 'linux' }}
run: >
if [ "${{ inputs.target-arch }}" = "arm" ]; then
if [ "${{ inputs.is-release }}" = true ]; then
GN_EXTRA_ARGS='target_cpu="arm" build_tflite_with_xnnpack=false symbol_level=1'
else
GN_EXTRA_ARGS='target_cpu="arm" build_tflite_with_xnnpack=false'
fi
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
GN_EXTRA_ARGS='target_cpu="arm64" fatal_linker_warnings=false enable_linux_installer=false'
elif [ "${{ inputs.is-asan }}" = true ]; then
GN_EXTRA_ARGS='is_asan=true'
fi
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
- 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: Generate DEPS Hash
run: |
node src/electron/script/generate-deps-hash.js
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
- name: Restore src cache via AZCopy
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 Electron
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- 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 }} --remote-build siso
- name: Run Electron Only Hooks
run: |
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
- name: Regenerate DEPS Hash
run: >
(cd src/electron && git checkout .) && node
src/electron/script/generate-deps-hash.js
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: Free up space (macOS)
if: ${{ inputs.target-platform == 'macos' }}
uses: ./src/electron/.github/actions/free-space-macos
- name: Build Electron
if: ${{ inputs.target-platform != 'macos' || (inputs.target-variant == 'all' ||
inputs.target-variant == 'darwin') }}
uses: ./src/electron/.github/actions/build-electron
with:
target-arch: ${{ inputs.target-arch }}
target-platform: ${{ inputs.target-platform }}
artifact-platform: ${{ inputs.target-platform == 'macos' && 'darwin' ||
inputs.target-platform }}
is-release: ${{ inputs.is-release }}
generate-symbols: ${{ inputs.generate-symbols }}
upload-to-storage: ${{ inputs.upload-to-storage }}
is-asan: ${{ inputs.is-asan }}
upload-out-gen-artifacts: ${{ inputs.upload-out-gen-artifacts }}
- name: Set GN_EXTRA_ARGS for MAS Build
if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' ||
inputs.target-variant == 'mas') }}
run: |
echo "MAS_BUILD=true" >> $GITHUB_ENV
GN_EXTRA_ARGS='is_mas_build=true'
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
- name: Build Electron (MAS)
if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' ||
inputs.target-variant == 'mas') }}
uses: ./src/electron/.github/actions/build-electron
with:
target-arch: ${{ inputs.target-arch }}
target-platform: ${{ inputs.target-platform }}
artifact-platform: mas
is-release: ${{ inputs.is-release }}
generate-symbols: ${{ inputs.generate-symbols }}
upload-to-storage: ${{ inputs.upload-to-storage }}
step-suffix: (mas)

View File

@@ -72,7 +72,7 @@ jobs:
cp $(which node) /mnt/runner-externals/node24/bin/
- name: Setup Node.js/npm
if: ${{ inputs.target-platform == 'win' }}
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 22.21.x
- name: Add TCC permissions on macOS
@@ -119,7 +119,7 @@ jobs:
if: ${{ inputs.target-platform == 'macos' }}
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -168,12 +168,12 @@ jobs:
echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
echo "IS_ASAN=true" >> $GITHUB_ENV
- name: Download Generated Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
- name: Download Src Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: src_artifacts_${{ env.ARTIFACT_KEY }}
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
@@ -266,7 +266,7 @@ jobs:
if: always() && !cancelled()
- name: Upload Test Artifacts
if: always() && !cancelled()
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: test_artifacts_${{ env.ARTIFACT_KEY }}_${{ matrix.shard }}
path: src/electron/spec/artifacts

View File

@@ -50,7 +50,7 @@ jobs:
container: ${{ fromJSON(inputs.test-container) }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -65,12 +65,12 @@ jobs:
- name: Install Dependencies
uses: ./src/electron/.github/actions/install-dependencies
- name: Download Generated Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
- name: Download Src Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
@@ -106,7 +106,7 @@ jobs:
container: ${{ fromJSON(inputs.test-container) }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -121,12 +121,12 @@ jobs:
- name: Install Dependencies
uses: ./src/electron/.github/actions/install-dependencies
- name: Download Generated Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
- name: Download Src Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}

View File

@@ -32,7 +32,7 @@ jobs:
permissions: {}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
@@ -44,3 +44,35 @@ jobs:
project-number: 94
field: Status
field-value: ✅ Reviewed
pull-request-labeled-ai-pr:
name: ai-pr label added
if: github.event.label.name == 'ai-pr'
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
- name: Create comment
uses: actions-cool/issues-helper@71b62d7da76e59ff7b193904feb6e77d4dbb2777 # v3.7.6
with:
actions: 'create-comment'
token: ${{ steps.generate-token.outputs.token }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- ai-pr -->
*AI PR Detected*
Hello @${{ github.event.pull_request.user.login }}. Due to the high amount of AI spam PRs we receive, if a PR is detected to be majority AI-generated without disclosure and untested, we will automatically close the PR.
We welcome the use of AI tools, as long as the PR meets our quality standards and has clearly been built and tested. If you believe your PR was closed in error, we welcome you to resubmit. However, please read our [CONTRIBUTING.md](http://contributing.md/) carefully before reopening. Thanks for your contribution.
- name: Close the pull request
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
GH_REPO: electron/electron
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
gh pr close "$PR_NUMBER"

View File

@@ -0,0 +1,71 @@
name: Rerun PR Apply Patches
on:
push:
branches:
- main
- '[1-9][0-9]-x-y'
paths:
- 'DEPS'
- 'patches/**'
permissions: {}
jobs:
rerun-apply-patches:
runs-on: ubuntu-latest
permissions:
actions: write
checks: read
contents: read
pull-requests: read
steps:
- name: Find PRs and Rerun Apply Patches
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
BRANCH="${GITHUB_REF#refs/heads/}"
# Find all open PRs targeting this branch
PRS=$(gh pr list --base "$BRANCH" --state open --limit 250 --json number)
echo "$PRS" | jq -c '.[]' | while read -r pr; do
PR_NUMBER=$(echo "$pr" | jq -r '.number')
echo "Processing PR #${PR_NUMBER}"
# Find the Apply Patches workflow check for this PR
CHECK=$(gh pr view "$PR_NUMBER" --json statusCheckRollup --jq '[.statusCheckRollup[] | select(.workflowName == "Apply Patches" and .name == "apply-patches")] | first')
if [ -z "$CHECK" ] || [ "$CHECK" = "null" ]; then
echo " No Apply Patches workflow found for PR #${PR_NUMBER}"
continue
fi
CONCLUSION=$(echo "$CHECK" | jq -r '.conclusion')
if [ "$CONCLUSION" = "SKIPPED" ]; then
echo " apply-patches job was skipped for PR #${PR_NUMBER} (no patches)"
continue
fi
LINK=$(echo "$CHECK" | jq -r '.detailsUrl')
# Extract the run ID from the link (format: .../runs/RUN_ID/job/JOB_ID)
RUN_ID=$(echo "$LINK" | grep -oE 'runs/[0-9]+' | cut -d'/' -f2)
if [ -z "$RUN_ID" ]; then
echo " Could not extract run ID from link: ${LINK}"
continue
fi
# Check if the workflow is currently in progress
RUN_STATUS=$(gh run view "$RUN_ID" --json status --jq '.status')
if [ "$RUN_STATUS" = "in_progress" ] || [ "$RUN_STATUS" = "queued" ] || [ "$RUN_STATUS" = "waiting" ]; then
echo " Workflow run ${RUN_ID} is ${RUN_STATUS}, cancelling..."
gh run cancel "$RUN_ID" --force
gh run watch "$RUN_ID"
fi
gh run rerun "$RUN_ID"
done

View File

@@ -13,6 +13,7 @@ permissions: read-all
jobs:
analysis:
name: Scorecards analysis
if: github.repository == 'electron/electron'
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
@@ -22,7 +23,7 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@@ -42,7 +43,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
@@ -50,6 +51,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
with:
sarif_file: results.sarif

View File

@@ -10,11 +10,12 @@ permissions: {}
jobs:
check-stable-prep-items:
name: Check Stable Prep Items
if: github.repository == 'electron/electron'
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}

View File

@@ -9,15 +9,16 @@ permissions: {}
jobs:
stale:
if: github.repository == 'electron/electron'
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # tag: v10.1.0
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # tag: v10.1.1
with:
repo-token: ${{ steps.generate-token.outputs.token }}
days-before-stale: 90
@@ -33,15 +34,15 @@ jobs:
pending-repro:
runs-on: ubuntu-latest
permissions: {}
if: ${{ always() }}
if: ${{ always() && github.repository == 'electron/electron' }}
needs: stale
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # tag: v10.1.0
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # tag: v10.1.1
with:
repo-token: ${{ steps.generate-token.outputs.token }}
days-before-stale: -1

View File

@@ -0,0 +1,39 @@
name: Update Website Docs
on:
release:
types: [published]
permissions: {}
jobs:
update-website-docs:
name: Update Website Docs
runs-on: ubuntu-latest
environment: website-docs-updater
permissions:
contents: read
id-token: write # needed for secret-service-action
steps:
- name: Get GitHub App token
id: secret-service
uses: electron/secret-service-action@3476425e8b30555aac15b1b7096938e254b0e155 # v1.0.0
- name: Check if this release is the latest
id: check-if-latest-release
env:
GH_REPO: electron/electron
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
LATEST_RELEASE_TAG="$(gh release view --json tagName --jq '.tagName')"
if [ "$LATEST_RELEASE_TAG" = "${GITHUB_REF#refs/tags/}" ]; then
echo "isLatestRelease=true" >> $GITHUB_OUTPUT
else
echo "isLatestRelease=false" >> $GITHUB_OUTPUT
fi
- name: Trigger website docs update
if: ${{ steps.check-if-latest-release.outputs.isLatestRelease }}
env:
GH_REPO: electron/website
GH_TOKEN: ${{ fromJSON(steps.secret-service.outputs.secrets).WEBSITE_DOCS_UPDATER_APP_TOKEN }}
run: |
gh workflow run update-docs.yml -f sha=$GITHUB_SHA

View File

@@ -6,7 +6,7 @@ on:
build-image-sha:
type: string
description: 'SHA for electron/build image'
default: '933c7d6ff6802706875270bec2e3c891cf8add3f'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb'
required: true
upload-to-storage:
description: 'Uploads to Azure storage'
@@ -22,6 +22,7 @@ permissions: {}
jobs:
checkout-windows:
if: github.repository == 'electron/electron'
runs-on: electron-arc-centralus-linux-amd64-32core
permissions:
contents: read
@@ -40,7 +41,7 @@ jobs:
build-image-sha: ${{ inputs.build-image-sha }}
steps:
- name: Checkout Electron
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
path: src/electron
fetch-depth: 0
@@ -51,9 +52,12 @@ jobs:
target-platform: win
publish-x64-win:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-windows
with:
environment: production-release
@@ -67,9 +71,12 @@ jobs:
secrets: inherit
publish-arm64-win:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-windows
with:
environment: production-release
@@ -83,9 +90,12 @@ jobs:
secrets: inherit
publish-x86-win:
uses: ./.github/workflows/pipeline-segment-electron-build.yml
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write
needs: checkout-windows
with:
environment: production-release

File diff suppressed because one or more lines are too long

View File

@@ -9,4 +9,4 @@ npmMinimalAgeGate: 10080
npmPreapprovedPackages:
- "@electron/*"
yarnPath: .yarn/releases/yarn-4.11.0.cjs
yarnPath: .yarn/releases/yarn-4.12.0.cjs

View File

@@ -446,6 +446,7 @@ source_set("electron_lib") {
"shell/services/node/public/mojom",
"//base:base_static",
"//base/allocator:buildflags",
"//build/util:chromium_git_revision",
"//chrome:strings",
"//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
@@ -501,6 +502,7 @@ source_set("electron_lib") {
"//third_party/blink/public/platform/media",
"//third_party/boringssl",
"//third_party/electron_node:libnode",
"//third_party/highway:libhwy",
"//third_party/inspector_protocol:crdtp",
"//third_party/leveldatabase",
"//third_party/libyuv",
@@ -528,6 +530,7 @@ source_set("electron_lib") {
"//base",
"//base:i18n",
"//content/public/app",
"//ui/base/unowned_user_data",
]
include_dirs = [
@@ -593,6 +596,7 @@ source_set("electron_lib") {
use_libcxx_modules = false
deps += [
"//components/os_crypt/async/browser:keychain_key_provider",
"//components/os_crypt/common:keychain_password_mac",
"//components/remote_cocoa/app_shim",
"//components/remote_cocoa/browser",
@@ -655,6 +659,9 @@ source_set("electron_lib") {
":libnotify_loader",
"//build/config/linux/gtk",
"//components/crash/content/browser",
"//components/os_crypt/async/browser:freedesktop_secret_key_provider",
"//components/os_crypt/async/browser:posix_key_provider",
"//components/os_crypt/async/browser:secret_portal_key_provider",
"//dbus",
"//device/bluetooth",
"//third_party/crashpad/crashpad/client",
@@ -695,6 +702,7 @@ source_set("electron_lib") {
deps += [
"//components/app_launch_prefetch",
"//components/crash/core/app:crash_export_thunks",
"//components/os_crypt/async/browser:dpapi_key_provider",
"//third_party/libxml:xml_writer",
"//ui/wm",
"//ui/wm/public",

230
CLAUDE.md Normal file
View File

@@ -0,0 +1,230 @@
# Electron Development Guide
## Project Overview
Electron is a framework for building cross-platform desktop applications using web technologies. It embeds Chromium for rendering and Node.js for backend functionality.
## Directory Structure
```text
electron/ # This repo (run `e` commands here)
├── shell/ # Core C++ application code
│ ├── browser/ # Main process implementation (107+ API modules)
│ ├── renderer/ # Renderer process code
│ ├── common/ # Shared code between processes
│ ├── app/ # Application entry points
│ └── services/ # Node.js service integration
├── lib/ # TypeScript/JavaScript library code
│ ├── browser/ # Main process JS (47 API implementations)
│ ├── renderer/ # Renderer process JS
│ └── common/ # Shared JS modules
├── patches/ # Patches for upstream dependencies
│ ├── chromium/ # ~159 patches to Chromium
│ ├── node/ # ~48 patches to Node.js
│ └── ... # Other targets (v8, boringssl, etc.)
├── spec/ # Test suite (1189+ TypeScript test files)
├── docs/ # API documentation and guides
├── build/ # Build configuration
├── script/ # Build and automation scripts
└── chromium_src/ # Chromium source overrides
../ # Parent directory is Chromium source
```
## Build Tools Setup
Electron uses `@electron/build-tools` for development. The `e` command is the primary CLI.
**Installation:**
```bash
npm i -g @electron/build-tools
```
**Configuration location:** `~/.electron_build_tools/configs/`
## Essential Commands
### Configuration Management
| Command | Purpose |
|---------|---------|
| `e init <name> --root=<path> --bootstrap testing` | Create new build config and sync |
| `e use <name>` | Switch to a different build configuration |
| `e show current` | Display active configuration name |
| `e show configs` | List all available configurations |
### Build & Development Loop
| Command | Purpose |
|---------|---------|
| `e sync` | Fetch/update all source code and apply patches |
| `e sync --3` | Sync with 3-way merge (required for Chromium upgrades) |
| `e build` | Build Electron (runs GN + Ninja) |
| `e build -k 999` | Build and continue on errors (up to 999) |
| `e build -t <target>` | Build specific target (e.g., `electron:node_headers`) |
| `e start` | Run the built Electron executable |
| `e start --version` | Verify Electron launches and print version |
| `e test` | Run the test suite |
| `e debug` | Run Electron in debugger (lldb on macOS, gdb on Linux) |
### Patch Management
| Command | Purpose |
|---------|---------|
| `e patches <target>` | Export patches for a target (chromium, node, v8, etc.) |
| `e patches all` | Export all patches from all targets |
| `e patches --list-targets` | List available patch targets |
## Typical Development Workflow
```bash
# 1. Ensure you're on the right config
e show current
# 2. Sync to get latest code
e sync
# 3. Make your changes in shell/ or lib/ or ../
# 4. Build
e build
# 5. Test your changes (Leave the user to do this, don't run these commands unless asked)
e start
e test
# 6. If you modified patched files in Chromium:
cd .. # Go to Chromium repo
git add <files>
git commit -m "description of change"
cd electron
e patches chromium # Export the patch
```
## Patches System
Electron patches upstream dependencies (Chromium, Node.js, V8, etc.) to add features or modify behavior.
**How patches work:**
```text
patches/{target}/*.patch → [e sync --3] → target repo commits
← [e patches] ←
```
**Patch configuration:** `patches/config.json` maps patch directories to target repos.
**Key rules:**
- Fix existing patches 99% of the time rather than creating new ones
- Preserve original authorship in TODO comments
- Never change TODO assignees (`TODO(name)` must retain original name)
- Each patch file includes commit message explaining its purpose
**Creating/modifying patches:**
1. Make changes in the target repo (e.g., `../` for Chromium)
2. Create a git commit
3. Run `e patches <target>` to export
## Testing
**Test location:** `spec/` directory
**Running tests:**
```bash
e test # Run full test suite
```
**Test frameworks:** Mocha, Chai, Sinon
## Build Configuration
**GN build arguments:** Located in `build/args/`:
- `testing.gn` - Debug/testing builds
- `release.gn` - Release builds
- `all.gn` - Common arguments for all builds
**Main build file:** `BUILD.gn`
**Feature flags:** `buildflags/buildflags.gni`
## Chromium Upgrade Workflow
When working on the `roller/chromium/main` branch to upgrade Chromium activate the "Electron Chromium Upgrade" skill.
## Pull Requests
PR bodies must always include a `Notes:` section as the **last line** of the body. This is a consumer-facing release note for Electron app developers — describe the user-visible fix or change, not internal implementation details. Use `Notes: none` if there is no user-facing change.
## Code Style
**C++:** Follows Chromium style, enforced by clang-format
**TypeScript/JavaScript:** ESLint configuration in `.eslintrc.json`
**Linting:**
```bash
npm run lint # Run all linters
npm run lint:clang-format # C++ formatting
```
## Key Files
| File | Purpose |
|------|---------|
| `BUILD.gn` | Main GN build configuration |
| `DEPS` | Dependency versions and checkout paths |
| `patches/config.json` | Patch target configuration |
| `filenames.gni` | Source file lists by platform |
| `package.json` | Node.js dependencies and scripts |
## Environment Variables
| Variable | Purpose |
|----------|---------|
| `GN_EXTRA_ARGS` | Additional GN arguments (useful in CI) |
| `ELECTRON_RUN_AS_NODE=1` | Run Electron as Node.js |
## Useful Git Commands for Chromium
```bash
# Find CL that changed a file
cd ..
git log --oneline -10 -- {file}
git blame -L {start},{end} -- {file}
# Look for Chromium CL reference in commit
git log -1 {commit_sha} # Find "Reviewed-on:" line
# Find which patch affects a file
grep -l "filename.cc" patches/chromium/*.patch
```
## CI/CD
GitHub Actions workflows in `.github/workflows/`:
- `build.yml` - Main build workflow
- `pipeline-electron-lint.yml` - Linting
- `pipeline-segment-electron-test.yml` - Testing
## Common Issues
**Patch conflict during sync:**
- Use `e sync --3` for 3-way merge
- Check if file was renamed/moved upstream
- Verify patch is still needed
**Build error in patched file:**
- Find the patch: `grep -l "filename" patches/chromium/*.patch`
- Match existing patch style (#if 0 guards, BUILDFLAG conditionals, etc.)
**Remote build issues:**
- Try `e build --no-remote` to build locally
- Check reclient/siso configuration in your build config

6
DEPS
View File

@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'144.0.7527.0',
'147.0.7687.0',
'node_version':
'v24.11.1',
'v24.13.1',
'nan_version':
'675cefebca42410733da8a454c8d9391fcebfbc2',
'squirrel.mac_version':
@@ -152,7 +152,7 @@ hooks = [
'action': [
'python3',
'-c',
'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["node", ".yarn/releases/yarn-4.11.0.cjs", "install", "--immutable"]);',
'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["node", ".yarn/releases/yarn-4.12.0.cjs", "install", "--immutable"]);',
],
},
{

View File

@@ -2,7 +2,7 @@ is_electron_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
node_module_version = 143
node_module_version = 145
v8_promise_internal_field_count = 1
v8_embedder_string = "-electron.0"

View File

@@ -9,5 +9,6 @@
"embedded_asar_integrity_validation": "0",
"only_load_app_from_asar": "0",
"load_browser_process_specific_v8_snapshot": "0",
"grant_file_protocol_extra_privileges": "1"
"grant_file_protocol_extra_privileges": "1",
"wasm_trap_handlers": "1"
}

View File

@@ -1,21 +0,0 @@
# -*- bazel-starlark -*-
load("@builtin//struct.star", "module")
def __platform_properties(ctx):
container_image = "docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:d7cb1ab14a0f20aa669c23f22c15a9dead761dcac19f43985bf9dd5f41fbef3a"
return {
"default": {
"OSFamily": "Linux",
"container-image": container_image,
},
"large": {
"OSFamily": "Linux",
"container-image": container_image,
},
}
backend = module(
"backend",
platform_properties = __platform_properties,
)

View File

@@ -1,66 +0,0 @@
load("@builtin//encoding.star", "json")
load("@builtin//path.star", "path")
load("@builtin//runtime.star", "runtime")
load("@builtin//struct.star", "module")
load("@config//main.star", upstream_init = "init")
load("@config//win_sdk.star", "win_sdk")
load("@config//gn_logs.star", "gn_logs")
def init(ctx):
mod = upstream_init(ctx)
step_config = json.decode(mod.step_config)
# Buildbarn doesn't support input_root_absolute_path so disable that
for rule in step_config["rules"]:
input_root_absolute_path = rule.get("input_root_absolute_path", False)
if input_root_absolute_path:
rule.pop("input_root_absolute_path", None)
# Only wrap clang rules with a remote wrapper if not on Linux. These are currently only
# needed for X-Compile builds, which run on Windows and Mac.
if runtime.os != "linux":
for rule in step_config["rules"]:
if rule["name"].startswith("clang/") or rule["name"].startswith("clang-cl/"):
rule["remote_wrapper"] = "../../buildtools/reclient_cfgs/chromium-browser-clang/clang_remote_wrapper"
if "inputs" not in rule:
rule["inputs"] = []
rule["inputs"].append("buildtools/reclient_cfgs/chromium-browser-clang/clang_remote_wrapper")
rule["inputs"].append("third_party/llvm-build/Release+Asserts_linux/bin/clang")
if "executables" not in step_config:
step_config["executables"] = []
step_config["executables"].append("buildtools/reclient_cfgs/chromium-browser-clang/clang_remote_wrapper")
step_config["executables"].append("third_party/llvm-build/Release+Asserts_linux/bin/clang")
if runtime.os == "darwin":
# Update platforms to match our default siso config instead of reclient configs.
step_config["platforms"].update({
"clang": step_config["platforms"]["default"],
"clang_large": step_config["platforms"]["default"],
})
if runtime.os == "windows":
# Add additional Windows SDK headers needed by Electron
win_toolchain_dir = win_sdk.toolchain_dir(ctx)
if win_toolchain_dir:
sdk_version = gn_logs.read(ctx).get("windows_sdk_version")
step_config["input_deps"][win_toolchain_dir + ":headers"].extend([
# third_party/electron_node/deps/uv/include/uv/win.h includes mswsock.h
path.join(win_toolchain_dir, "Windows Kits/10/Include", sdk_version, "um/mswsock.h"),
# third_party/electron_node/src/debug_utils.cc includes lm.h
path.join(win_toolchain_dir, "Windows Kits/10/Include", sdk_version, "um/Lm.h"),
])
# Update platforms to match our default siso config instead of reclient configs.
step_config["platforms"].update({
"clang-cl": step_config["platforms"]["default"],
"clang-cl_large": step_config["platforms"]["default"],
"lld-link": step_config["platforms"]["default"],
})
return module(
"config",
step_config = json.encode(step_config),
filegroups = mod.filegroups,
handlers = mod.handlers,
)

View File

@@ -110,11 +110,9 @@ async function loadApplicationPackage (packagePath: string) {
} else if (packageJson.name) {
app.name = packageJson.name;
}
if (packageJson.desktopName) {
app.setDesktopName(packageJson.desktopName);
} else {
app.setDesktopName(`${app.name}.desktop`);
}
app.setDesktopName(packageJson.desktopName || `${app.name}.desktop`);
// Set v8 flags, deliberately lazy load so that apps that do not use this
// feature do not pay the price
if (packageJson.v8Flags) {

View File

@@ -250,7 +250,9 @@ Returns:
Emitted when the user clicks the native macOS new tab button. The new
tab button is only visible if the current `BrowserWindow` has a
`tabbingIdentifier`
`tabbingIdentifier`.
You must create a window in this handler in order for macOS tabbing to work as expected.
### Event: 'browser-window-blur'
@@ -612,7 +614,7 @@ Returns `string` - The current application directory.
may backup this directory to cloud storage.
* `sessionData` The directory for storing data generated by `Session`, such
as localStorage, cookies, disk cache, downloaded dictionaries, network
state, devtools files. By default this points to `userData`. Chromium may
state, DevTools files. By default this points to `userData`. Chromium may
write very large disk cache here, so if your app does not rely on browser
storage like localStorage or cookies to save user data, it is recommended
to set this directory to other locations to avoid polluting the `userData`
@@ -633,7 +635,7 @@ Returns `string` - The current application directory.
Returns `string` - A path to a special directory or file associated with `name`. On
failure, an `Error` is thrown.
If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being called first, a default log directory will be created equivalent to calling `app.setAppLogsPath()` without a `path` parameter.
If `app.getPath('logs')` is called without calling `app.setAppLogsPath()` being called first, a default log directory will be created equivalent to calling `app.setAppLogsPath()` without a `path` parameter.
### `app.getFileIcon(path[, options])`
@@ -648,7 +650,7 @@ Returns `Promise<NativeImage>` - fulfilled with the app's icon, which is a [Nati
Fetches a path's associated icon.
On _Windows_, there a 2 kinds of icons:
On _Windows_, there are 2 kinds of icons:
* Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
* Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
@@ -764,7 +766,7 @@ app.getPreferredSystemLanguages() // ['fr-CA', 'en-US', 'zh-Hans-FI', 'es-419']
Both the available languages and regions and the possible return values differ between the two operating systems.
As can be seen with the example above, on Windows, it is possible that a preferred system language has no country code, and that one of the preferred system languages corresponds with the language used for the regional format. On macOS, the region serves more as a default country code: the user doesn't need to have Finnish as a preferred language to use Finland as the region,and the country code `FI` is used as the country code for preferred system languages that do not have associated countries in the language name.
As can be seen with the example above, on Windows, it is possible that a preferred system language has no country code, and that one of the preferred system languages corresponds with the language used for the regional format. On macOS, the region serves more as a default country code: the user doesn't need to have Finnish as a preferred language to use Finland as the region, and the country code `FI` is used as the country code for preferred system languages that do not have associated countries in the language name.
### `app.addRecentDocument(path)` _macOS_ _Windows_
@@ -1122,6 +1124,19 @@ Updates the current activity if its type matches `type`, merging the entries fro
Changes the [Application User Model ID][app-user-model-id] to `id`.
### `app.setToastActivatorCLSID(id)` _Windows_
* `id` string
Changes the [Toast Activator CLSID][toast-activator-clsid] to `id`. If one is not set via this method, it will be randomly generated for the app.
* The value must be a valid GUID/CLSID in one of the following forms:
* Canonical brace-wrapped: `{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}` (preferred)
* Canonical without braces: `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` (braces will be added automatically)
* Hex digits are case-insensitive.
This method should be called early (before showing notifications) so the value is baked into the registration/shortcut. Supplying an empty string or an unparsable value throws and leaves the existing (or generated) CLSID unchanged. If this method is never called, a random CLSID is generated once per run and exposed via `app.toastActivatorCLSID`.
### `app.setActivationPolicy(policy)` _macOS_
* `policy` string - Can be 'regular', 'accessory', or 'prohibited'.
@@ -1226,7 +1241,7 @@ Returns `boolean` - whether hardware acceleration is currently enabled.
### `app.disableDomainBlockingFor3DAPIs()`
By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per
domain basis if the GPU processes crashes too frequently. This function
domain basis if the GPU process crashes too frequently. This function
disables that behavior.
This method can only be called before app is ready.
@@ -1285,6 +1300,8 @@ For `infoType` equal to `basic`:
Using `basic` should be preferred if only basic information like `vendorId` or `deviceId` is needed.
Promise is rejected if the GPU is completely disabled, i.e. no hardware and software implementations are available.
### `app.setBadgeCount([count])` _Linux_ _macOS_
* `count` Integer (optional) - If a value is provided, set the badge to the provided value otherwise, on macOS, display a plain white dot (e.g. unknown number of notifications). On Linux, if a value is not provided the badge will not display.
@@ -1702,8 +1719,13 @@ platforms) that allows you to perform actions on your app icon in the user's doc
A `boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
### `app.toastActivatorCLSID` _Windows_ _Readonly_
A `string` property that returns the app's [Toast Activator CLSID][toast-activator-clsid].
[tasks]:https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[toast-activator-clsid]: https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-toastactivatorclsid
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/packager
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115

View File

@@ -32,9 +32,19 @@ update process. Apps that need to disable ATS can add the
### Windows
On Windows, you have to install your app into a user's machine before you can
use the `autoUpdater`, so it is recommended that you use
[electron-winstaller][installer-lib] or [Electron Forge's Squirrel.Windows maker][electron-forge-lib] to generate a Windows installer.
On Windows, the `autoUpdater` module automatically selects the appropriate update mechanism
based on how your app is packaged:
* **MSIX packages**: If your app is running as an MSIX package (created with [electron-windows-msix][msix-lib] and detected via [`process.windowsStore`](process.md#processwindowsstore-readonly)),
the module uses the MSIX updater, which supports direct MSIX file links and JSON update feeds.
* **Squirrel.Windows**: For apps installed via traditional installers (created with
[electron-winstaller][installer-lib] or [Electron Forge's Squirrel.Windows maker][electron-forge-lib]),
the module uses Squirrel.Windows for updates.
You don't need to configure which updater to use; Electron automatically detects the packaging
format and uses the appropriate one.
#### Squirrel.Windows
Apps built with Squirrel.Windows will trigger [custom launch events](https://github.com/Squirrel/Squirrel.Windows/blob/51f5e2cb01add79280a53d51e8d0cfa20f8c9f9f/docs/using/custom-squirrel-events-non-cs.md#application-startup-commands)
that must be handled by your Electron application to ensure proper setup and teardown.
@@ -55,6 +65,14 @@ The installer generated with Squirrel.Windows will create a shortcut icon with a
same ID for your app with `app.setAppUserModelId` API, otherwise Windows will
not be able to pin your app properly in task bar.
#### MSIX Packages
When your app is packaged as an MSIX, the `autoUpdater` module provides additional
functionality:
* Use the `allowAnyVersion` option in `setFeedURL()` to allow updates to older versions (downgrades)
* Support for direct MSIX file links or JSON update feeds (similar to Squirrel.Mac format)
## Events
The `autoUpdater` object emits the following events:
@@ -92,7 +110,7 @@ Returns:
Emitted when an update has been downloaded.
On Windows only `releaseName` is available.
With Squirrel.Windows only `releaseName` is available.
> [!NOTE]
> It is not strictly necessary to handle this event. A successfully
@@ -100,6 +118,13 @@ On Windows only `releaseName` is available.
### Event: 'before-quit-for-update'
<!--
```YAML history
added:
- pr-url: https://github.com/electron/electron/pull/12619
```
-->
This event is emitted after a user calls `quitAndInstall()`.
When this API is called, the `before-quit` event is not emitted before all windows are closed. As a result you should listen to this event if you wish to perform actions before the windows are closed while a process is quitting, as well as listening to `before-quit`.
@@ -110,11 +135,23 @@ The `autoUpdater` object has the following methods:
### `autoUpdater.setFeedURL(options)`
<!--
```YAML history
changes:
- pr-url: https://github.com/electron/electron/pull/5879
description: "Added `headers` as a second parameter."
- pr-url: https://github.com/electron/electron/pull/11925
description: "Changed API to accept a single `options` argument (contains `url`, `headers`, and `serverType` properties)."
```
-->
* `options` Object
* `url` string
* `url` string - The update server URL. For _Windows_ MSIX, this can be either a direct link to an MSIX file (e.g., `https://example.com/update.msix`) or a JSON endpoint that returns update information (see the [Squirrel.Mac][squirrel-mac] README for more information).
* `headers` Record\<string, string\> (optional) _macOS_ - HTTP request headers.
* `serverType` string (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.
* `allowAnyVersion` boolean (optional) _Windows_ - If `true`, allows downgrades to older versions for MSIX packages.
Defaults to `false`.
Sets the `url` and initialize the auto updater.
@@ -151,3 +188,4 @@ closed.
[electron-forge-lib]: https://www.electronforge.io/config/makers/squirrel.windows
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[msix-lib]: https://github.com/electron-userland/electron-windows-msix

View File

@@ -351,7 +351,11 @@ Emitted when the window has closed a sheet.
#### Event: 'new-window-for-tab' _macOS_
Emitted when the native new tab button is clicked.
Emitted when the user clicks the native macOS new tab button. The new
tab button is only visible if the current `BrowserWindow` has a
`tabbingIdentifier`.
You must create a window in this handler in order for macOS tabbing to work as expected.
#### Event: 'system-context-menu' _Windows_ _Linux_
@@ -756,6 +760,9 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `
> [!NOTE]
> On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
> [!NOTE]
> On Wayland, this method will return `{ x: 0, y: 0, ... }` as introspecting or programmatically changing the global window coordinates is prohibited.
#### `win.getBackgroundColor()`
Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) format.
@@ -969,6 +976,9 @@ Moves window to `x` and `y`.
Returns `Integer[]` - Contains the window's current position.
> [!NOTE]
> On Wayland, this method will return `[0, 0]` as introspecting or programmatically changing the global window coordinates is prohibited.
#### `win.setTitle(title)`
* `title` string
@@ -1043,7 +1053,7 @@ under this mode apps can choose to optimize their UI for tablets, such as
enlarging the titlebar and hiding titlebar buttons.
This API returns whether the window is in tablet mode, and the `resize` event
can be be used to listen to changes to tablet mode.
can be used to listen to changes to tablet mode.
#### `win.getMediaSourceId()`

View File

@@ -435,7 +435,11 @@ Emitted when the window has closed a sheet.
#### Event: 'new-window-for-tab' _macOS_
Emitted when the native new tab button is clicked.
Emitted when the user clicks the native macOS new tab button. The new
tab button is only visible if the current `BrowserWindow` has a
`tabbingIdentifier`.
You must create a window in this handler in order for macOS tabbing to work as expected.
#### Event: 'system-context-menu' _Windows_ _Linux_
@@ -862,6 +866,9 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `
> [!NOTE]
> On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
> [!NOTE]
> On Wayland, this method will return `{ x: 0, y: 0, ... }` as introspecting or programmatically changing the global window coordinates is prohibited.
#### `win.getBackgroundColor()`
Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) format.
@@ -1087,6 +1094,9 @@ Not supported on Wayland (Linux).
Returns `Integer[]` - Contains the window's current position.
> [!NOTE]
> On Wayland, this method will return `[0, 0]` as introspecting or programmatically changing the global window coordinates is prohibited.
#### `win.setTitle(title)`
* `title` string
@@ -1159,7 +1169,7 @@ under this mode apps can choose to optimize their UI for tablets, such as
enlarging the titlebar and hiding titlebar buttons.
This API returns whether the window is in tablet mode, and the `resize` event
can be be used to listen to changes to tablet mode.
can be used to listen to changes to tablet mode.
#### `win.getMediaSourceId()`

View File

@@ -264,7 +264,7 @@ will not be allowed. The `finish` event is emitted just after the end operation.
Cancels an ongoing HTTP transaction. If the request has already emitted the
`close` event, the abort operation will have no effect. Otherwise an ongoing
event will emit `abort` and `close` events. Additionally, if there is an ongoing
response object,it will emit the `aborted` event.
response object, it will emit the `aborted` event.
#### `request.followRedirect()`

View File

@@ -5,7 +5,7 @@
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) _Deprecated_ (non-sandboxed only)
> [!NOTE]
> Using the `clipoard` API from the renderer process is deprecated.
> Using the `clipboard` API from the renderer process is deprecated.
> [!IMPORTANT]
> If you want to call this API from a renderer process,

View File

@@ -172,7 +172,7 @@ Enables net log events to be saved and writes them to `path`.
Sets the verbosity of logging when used together with `--enable-logging`.
`N` should be one of [Chrome's LogSeverities][severities].
Note that two complimentary logging mechanisms in Chromium -- `LOG()`
Note that two complementary logging mechanisms in Chromium -- `LOG()`
and `VLOG()` -- are controlled by different switches. `--log-level`
controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()`
messages. So you may want to use a combination of these three switches
@@ -317,7 +317,7 @@ By default inspector websocket url is available in stderr and under /json/list e
### `--experimental-network-inspection`
Enable support for devtools network inspector events, for visibility into requests made by the nodejs `http` and `https` modules.
Enable support for DevTools network inspector events, for visibility into requests made by the nodejs `http` and `https` modules.
### `--no-deprecation`
@@ -370,6 +370,13 @@ Keep in mind that standalone switches can sometimes be split into individual fea
Finally, you'll need to ensure that the version of Chromium in Electron matches the version of the browser you're using to cross-reference the switches.
### Chromium features relevant to Electron apps
* `AlwaysLogLOAFURL`: enables script attribution for
[`long-animation-frame`](https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Long_animation_frame_timing)
`PerformanceObserver` events for non-http(s), non-data, non-blob URLs (such as `file:` or custom
protocol URLs).
[app]: app.md
[append-switch]: command-line.md#commandlineappendswitchswitch-value
[debugging-main-process]: ../tutorial/debugging-main-process.md

View File

@@ -51,7 +51,12 @@ Returns:
* `event` Event
* `cookie` [Cookie](structures/cookie.md) - The cookie that was changed.
* `cause` string - The cause of the change with one of the following values:
* `explicit` - The cookie was changed directly by a consumer's action.
* `inserted` - The cookie was inserted.
* `inserted-no-change-overwrite` - The newly inserted cookie overwrote a cookie but
did not result in any change. For example, inserting an identical cookie will produce this cause.
* `inserted-no-value-change-overwrite` - The newly inserted cookie overwrote a cookie but
did not result in any value change, but it's web observable (e.g. updates the expiry).
* `explicit` - The cookie was deleted directly by a consumer's action.
* `overwrite` - The cookie was automatically removed due to an insert
operation that overwrote it.
* `expired` - The cookie was automatically removed as it expired.
@@ -102,7 +107,7 @@ the response.
cookie and will not be retained between sessions.
* `sameSite` string (optional) - The [Same Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_cookies) policy to apply to this cookie. Can be `unspecified`, `no_restriction`, `lax` or `strict`. Default is `lax`.
Returns `Promise<void>` - A promise which resolves when the cookie has been set
Returns `Promise<void>` - A promise which resolves when the cookie has been set.
Sets a cookie with `details`.
@@ -111,16 +116,16 @@ Sets a cookie with `details`.
* `url` string - The URL associated with the cookie.
* `name` string - The name of cookie to remove.
Returns `Promise<void>` - A promise which resolves when the cookie has been removed
Returns `Promise<void>` - A promise which resolves when the cookie has been removed.
Removes the cookies matching `url` and `name`
Removes the cookies matching `url` and `name`.
#### `cookies.flushStore()`
Returns `Promise<void>` - A promise which resolves when the cookie store has been flushed
Returns `Promise<void>` - A promise which resolves when the cookie store has been flushed.
Writes any unwritten cookies data to disk
Writes any unwritten cookies data to disk.
Cookies written by any method will not be written to disk immediately, but will be written every 30 seconds or 512 operations
Cookies written by any method will not be written to disk immediately, but will be written every 30 seconds or 512 operations.
Calling this method can cause the cookie to be written to disk immediately.

View File

@@ -49,7 +49,7 @@ Use the `system-ui` keyword to match the smoothness to the OS design language.
| Value: | `60%` | `0%` |
| Example: | ![A rectangle with round corners whose smoothness matches macOS](../images/corner-smoothing-example-60.svg) | ![A rectangle with round corners whose smoothness matches Windows and Linux](../images/corner-smoothing-example-0.svg) |
### Controlling availibility
### Controlling availability
This CSS rule can be disabled using the Blink feature flag `ElectronCSSCornerSmoothing`.

View File

@@ -44,7 +44,7 @@ Returns:
* `reason` string - Reason for detaching debugger.
Emitted when the debugging session is terminated. This happens either when
`webContents` is closed or devtools is invoked for the attached `webContents`.
`webContents` is closed or DevTools is invoked for the attached `webContents`.
#### Event: 'message'

View File

@@ -94,18 +94,45 @@ The `desktopCapturer` module has the following methods:
Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`DesktopCapturerSource`](structures/desktop-capturer-source.md) objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured.
> [!NOTE]
> Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
> which can detected by [`systemPreferences.getMediaAccessStatus`][].
> * Capturing audio requires `NSAudioCaptureUsageDescription` Info.plist key on macOS 14.2 Sonoma and higher - [read more](#macos-versions-142-or-higher).
> * Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher, which can detected by [`systemPreferences.getMediaAccessStatus`][].
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-windows-macos
## Caveats
### Linux
`desktopCapturer.getSources(options)` only returns a single source on Linux when using Pipewire.
PipeWire supports a single capture for both screens and windows. If you request the window and screen type, the selected source will be returned as a window capture.
`navigator.mediaDevices.getUserMedia` does not work on macOS for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a [signed kernel extension](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/KernelExtensions/KernelExtensions.html). Chromium, and by extension Electron, does not provide this.
---
It is possible to circumvent this limitation by capturing system audio with another macOS app like Soundflower and passing it through a virtual audio input device. This virtual device can then be queried with `navigator.mediaDevices.getUserMedia`.
### MacOS versions 14.2 or higher
`NSAudioCaptureUsageDescription` Info.plist key must be added in-order for audio to be captured by `desktopCapturer`. If instead you are running electron from another program like a terminal or IDE then that parent program must contain the Info.plist key.
This is in order to facillitate use of Apple's new [CoreAudio Tap API](https://developer.apple.com/documentation/CoreAudio/capturing-system-audio-with-core-audio-taps#Configure-the-sample-code-project) by Chromium.
> [!WARNING]
> Failure of `desktopCapturer` to start an audio stream due to `NSAudioCaptureUsageDescription` permission not present will still create a dead audio stream however no warnings or errors are displayed.
As of electron `v39.0.0-beta.4` Chromium [made Apple's new `CoreAudio Tap API` the default](https://source.chromium.org/chromium/chromium/src/+/ad17e8f8b93d5f34891b06085d373a668918255e) for desktop audio capture. There is no fallback to the older `Screen & System Audio Recording` permissions system even if [CoreAudio Tap API](https://developer.apple.com/documentation/CoreAudio/capturing-system-audio-with-core-audio-taps) stream creation fails.
If you need to continue using `Screen & System Audio Recording` permissions for `desktopCapturer` on macOS versions 14.2 and later, you can apply a chromium feature flag to force use of that older permissions system:
```js
// main.js (right beneath your require/import statments)
app.commandLine.appendSwitch('disable-features', 'MacCatapLoopbackAudioForScreenShare')
```
---
### MacOS versions 12.7.6 or lower
`navigator.mediaDevices.getUserMedia` does not work on macOS versions 12.7.6 and prior for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a [signed kernel extension](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/KernelExtensions/KernelExtensions.html). Chromium, and by extension Electron, does not provide this. Only in macOS 13 and onwards does Apple provide APIs to capture desktop audio without the need for a signed kernel extension.
It is possible to circumvent this limitation by capturing system audio with another macOS app like [BlackHole](https://existential.audio/blackhole/) or [Soundflower](https://rogueamoeba.com/freebies/soundflower/) and passing it through a virtual audio input device. This virtual device can then be queried with `navigator.mediaDevices.getUserMedia`.

View File

@@ -344,7 +344,7 @@ Displays a modal dialog that shows an error message.
This API can be called safely before the `ready` event the `app` module emits,
it is usually used to report errors in early stage of startup. If called
before the app `ready`event on Linux, the message will be emitted to stderr,
before the app `ready` event on Linux, the message will be emitted to stderr,
and no GUI dialog will appear.
### `dialog.showCertificateTrustDialog([window, ]options)` _macOS_ _Windows_

View File

@@ -159,6 +159,22 @@ Notification activated (com.github.Electron:notification:EAF7B87C-A113-43D7-8E76
Notification replied to (com.github.Electron:notification:EAF7B87C-A113-43D7-8E76-F88EC9D73D44)
```
### `ELECTRON_DEBUG_MSIX_UPDATER`
Adds extra logs to MSIX updater operations on Windows to aid in debugging. Extra logging will be displayed when MSIX update operations are initiated, including package updates, package registration, and restart registration. This helps diagnose issues with MSIX package updates and deployments.
Sample output:
```sh
UpdateMsix called with URI: https://example.com/app.msix
DoUpdateMsix: Starting
Calling AddPackageByUriAsync... URI: https://example.com/app.msix
Update options - deferRegistration: true, developerMode: false, forceShutdown: false, forceTargetShutdown: false, forceUpdateFromAnyVersion: false
Waiting for deployment...
Deployment finished.
MSIX Deployment completed.
```
### `ELECTRON_LOG_ASAR_READS`
When Electron reads from an ASAR file, log the read offset and file path to
@@ -186,3 +202,14 @@ the one downloaded by `npm install`. Usage:
```sh
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
```
### `ELECTRON_SKIP_BINARY_DOWNLOAD`
If you want to install your project's dependencies but don't need to use Electron functionality,
you can set the `ELECTRON_SKIP_BINARY_DOWNLOAD` environment variable to prevent the binary from being
downloaded. For instance, this feature can be useful in continuous integration environments when
running unit tests that mock out the `electron` module.
```sh
ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
```

View File

@@ -57,7 +57,7 @@ The following methods are available on instances of `Extensions`:
* `options` Object (optional)
* `allowFileAccess` boolean - Whether to allow the extension to read local files over `file://`
protocol and inject content scripts into `file://` pages. This is required e.g. for loading
devtools extensions on `file://` URLs. Defaults to false.
DevTools extensions on `file://` URLs. Defaults to false.
Returns `Promise<Extension>` - resolves when the extension is loaded.
@@ -83,7 +83,7 @@ const path = require('node:path')
app.whenReady().then(async () => {
await session.defaultSession.extensions.loadExtension(
path.join(__dirname, 'react-devtools'),
// allowFileAccess is required to load the devtools extension on file:// URLs.
// allowFileAccess is required to load the DevTools extension on file:// URLs.
{ allowFileAccess: true }
)
// Note that in order to use the React DevTools extension, you'll need to

View File

@@ -34,7 +34,7 @@ Returns:
* `error` Error - Typically holds an error string identifying failure root cause.
Emitted when an error was encountered while streaming response data events. For
instance, if the server closes the underlying while the response is still
instance, if the server closes the underlying connection while the response is still
streaming, an `error` event will be emitted on the response object and a `close`
event will subsequently follow on the request object.

View File

@@ -17,7 +17,7 @@ See [`Menu`](menu.md) for examples.
* `options` Object
* `click` Function (optional) - Will be called with
`click(menuItem, window, event)` when the menu item is clicked.
* `menuItem` MenuItem
* `menuItem` [MenuItem](menu-item.md)
* `window` [BaseWindow](base-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
@@ -91,7 +91,7 @@ It can be called with `menuItem.click(event, focusedWindow, focusedWebContents)`
#### `menuItem.submenu`
A `Menu` (optional) containing the menu
A [`Menu`](menu.md) (optional) containing the menu
item's submenu, if present.
#### `menuItem.type`
@@ -107,7 +107,7 @@ A `string` (optional) indicating the item's role, if set. Can be `undo`, `redo`,
#### `menuItem.accelerator`
An `Accelerator` (optional) indicating the item's accelerator, if set.
An `Accelerator | null` indicating the item's accelerator, if set.
#### `menuItem.userAccelerator` _Readonly_ _macOS_
@@ -171,4 +171,4 @@ A `number` indicating an item's sequential unique id.
#### `menuItem.menu`
A `Menu` that the item is a part of.
A [`Menu`](menu.md) that the item is a part of.

View File

@@ -28,7 +28,7 @@ The `Menu` class has the following static methods:
#### `Menu.setApplicationMenu(menu)`
- `menu` Menu | null
- `menu` [Menu](menu.md) | null
Sets `menu` as the application menu on macOS. On Windows and Linux, the
`menu` will be set as each window's top menu.
@@ -39,7 +39,7 @@ indicate which letter should get a generated accelerator. For example, using
opens the associated menu. The indicated character in the button label then gets an
underline, and the `&` character is not displayed on the button label.
In order to escape the `&` character in an item name, add a proceeding `&`. For example, `&&File` would result in `&File` displayed on the button label.
In order to escape the `&` character in an item name, add a preceding `&`. For example, `&&File` would result in `&File` displayed on the button label.
Passing `null` will suppress the default menu. On Windows and Linux,
this has the additional effect of removing the menu bar from the window.
@@ -70,9 +70,9 @@ for more information on macOS' native actions.
#### `Menu.buildFromTemplate(template)`
- `template` (MenuItemConstructorOptions | MenuItem)[]
- `template` (MenuItemConstructorOptions | [MenuItem](menu-item.md))[]
Returns `Menu`
Returns [`Menu`](menu.md)
Generally, the `template` is an array of `options` for constructing a
[MenuItem](menu-item.md). The usage can be referenced above.
@@ -123,7 +123,7 @@ Appends the `menuItem` to the menu.
- `id` string
Returns `MenuItem | null` the item with the specified `id`
Returns [`MenuItem | null`](menu-item.md) - the item with the specified `id`
#### `menu.insert(pos, menuItem)`

View File

@@ -36,7 +36,7 @@ everything will be reset to the OS default. By default `themeSource` is `system
Settings this property to `dark` will have the following effects:
* `nativeTheme.shouldUseDarkColors` will be `true` when accessed
* Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the dark UI.
* Any UI Electron renders on Linux and Windows including context menus, DevTools, etc. will use the dark UI.
* Any UI the OS renders on macOS including menus, window frames, etc. will use the dark UI.
* The [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) CSS query will match `dark` mode.
* The `updated` event will be emitted
@@ -44,7 +44,7 @@ Settings this property to `dark` will have the following effects:
Settings this property to `light` will have the following effects:
* `nativeTheme.shouldUseDarkColors` will be `false` when accessed
* Any UI Electron renders on Linux and Windows including context menus, devtools, etc. will use the light UI.
* Any UI Electron renders on Linux and Windows including context menus, DevTools, etc. will use the light UI.
* Any UI the OS renders on macOS including menus, window frames, etc. will use the light UI.
* The [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) CSS query will match `light` mode.
* The `updated` event will be emitted
@@ -83,4 +83,4 @@ Currently, Windows high contrast is the only system setting that triggers forced
### `nativeTheme.prefersReducedTransparency` _Readonly_
A `boolean` that indicates the whether the user has chosen via system accessibility settings to reduce transparency at the OS level.
A `boolean` that indicates whether the user has chosen via system accessibility settings to reduce transparency at the OS level.

View File

@@ -67,6 +67,22 @@ Emitted when the notification is shown to the user. Note that this event can be
multiple times as a notification can be shown multiple times through the
`show()` method.
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Title!',
subtitle: 'Subtitle!',
body: 'Body!'
})
n.on('show', () => console.log('Notification shown!'))
n.show()
})
```
#### Event: 'click'
Returns:
@@ -75,6 +91,22 @@ Returns:
Emitted when the notification is clicked by the user.
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Title!',
subtitle: 'Subtitle!',
body: 'Body!'
})
n.on('click', () => console.log('Notification clicked!'))
n.show()
})
```
#### Event: 'close'
Returns:
@@ -88,21 +120,85 @@ is closed.
On Windows, the `close` event can be emitted in one of three ways: programmatic dismissal with `notification.close()`, by the user closing the notification, or via system timeout. If a notification is in the Action Center after the initial `close` event is emitted, a call to `notification.close()` will remove the notification from the action center but the `close` event will not be emitted again.
#### Event: 'reply' _macOS_
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Title!',
subtitle: 'Subtitle!',
body: 'Body!'
})
n.on('close', () => console.log('Notification closed!'))
n.show()
})
```
#### Event: 'reply' _macOS_ _Windows_
Returns:
* `event` Event
* `reply` string - The string the user entered into the inline reply field.
* `details` Event\<\>
* `reply` string - The string the user entered into the inline reply field.
* `reply` string _Deprecated_
Emitted when the user clicks the "Reply" button on a notification with `hasReply: true`.
#### Event: 'action' _macOS_
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Send a Message',
body: 'Body Text',
hasReply: true,
replyPlaceholder: 'Message text...'
})
n.on('reply', (e, reply) => console.log(`User replied: ${reply}`))
n.on('click', () => console.log('Notification clicked'))
n.show()
})
```
#### Event: 'action' _macOS_ _Windows_
Returns:
* `event` Event
* `index` number - The index of the action that was activated.
* `details` Event\<\>
* `actionIndex` number - The index of the action that was activated.
* `selectionIndex` number _Windows_ - The index of the selected item, if one was chosen. -1 if none was chosen.
* `actionIndex` number _Deprecated_
* `selectionIndex` number _Windows_ _Deprecated_
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const items = ['One', 'Two', 'Three']
const n = new Notification({
title: 'Choose an Action!',
actions: [
{ type: 'button', text: 'Action 1' },
{ type: 'button', text: 'Action 2' },
{ type: 'selection', text: 'Apply', items }
]
})
n.on('click', () => console.log('Notification clicked'))
n.on('action', (e) => {
console.log(`User triggered action at index: ${e.actionIndex}`)
if (e.selectionIndex > -1) {
console.log(`User chose selection item '${items[e.selectionIndex]}'`)
}
})
n.show()
})
```
#### Event: 'failed' _Windows_
@@ -113,6 +209,22 @@ Returns:
Emitted when an error is encountered while creating and showing the native notification.
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Bad Action'
})
n.on('failed', (e, err) => {
console.log('Notification failed: ', err)
})
n.show()
})
```
### Instance Methods
Objects created with the `new Notification()` constructor have the following instance methods:
@@ -126,12 +238,42 @@ call this method before the OS will display it.
If the notification has been shown before, this method will dismiss the previously
shown notification and create a new one with identical properties.
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Title!',
subtitle: 'Subtitle!',
body: 'Body!'
})
n.show()
})
```
#### `notification.close()`
Dismisses the notification.
On Windows, calling `notification.close()` while the notification is visible on screen will dismiss the notification and remove it from the Action Center. If `notification.close()` is called after the notification is no longer visible on screen, calling `notification.close()` will try remove it from the Action Center.
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const n = new Notification({
title: 'Title!',
subtitle: 'Subtitle!',
body: 'Body!'
})
n.show()
setTimeout(() => n.close(), 5000)
})
```
### Instance Properties
#### `notification.title`

View File

@@ -71,7 +71,7 @@ will disable the support for `asar` archives in Node's built-in modules.
### `process.noDeprecation`
A `boolean` that controls whether or not deprecation warnings are printed to `stderr`.
A `boolean` (optional) that controls whether or not deprecation warnings are printed to `stderr`.
Setting this to `true` will silence deprecation warnings. This property is used
instead of the `--no-deprecation` command line flag.
@@ -99,13 +99,13 @@ property is used instead of the `--throw-deprecation` command line flag.
A `boolean` that controls whether or not deprecations printed to `stderr` include
their stack trace. Setting this to `true` will print stack traces for deprecations.
This property is instead of the `--trace-deprecation` command line flag.
This property is used instead of the `--trace-deprecation` command line flag.
### `process.traceProcessWarnings`
A `boolean` that controls whether or not process warnings printed to `stderr` include
their stack trace. Setting this to `true` will print stack traces for process warnings
(including deprecations). This property is instead of the `--trace-warnings` command
(including deprecations). This property is used instead of the `--trace-warnings` command
line flag.
### `process.type` _Readonly_
@@ -128,8 +128,8 @@ A `string` representing Electron's version string.
### `process.windowsStore` _Readonly_
A `boolean`. If the app is running as a Windows Store app (appx), this property is `true`,
for otherwise it is `undefined`.
A `boolean`. If the app is running as an MSIX package (including AppX for Windows Store),
this property is `true`, otherwise it is `undefined`.
### `process.contextId` _Readonly_

View File

@@ -7,21 +7,44 @@ Process: [Main](../glossary.md#main-process)
This module adds extra protection to data being stored on disk by using OS-provided cryptography systems. Current
security semantics for each platform are outlined below.
> [!NOTE]
> We recommend using the asynchronous API (`encryptStringAsync`/`decryptStringAsync`) over the synchronous API.
> The async API is non-blocking, supports key rotation, and handles temporary unavailability gracefully.
> The synchronous API may be deprecated in a future version of Electron.
## Platform-Specific Key Providers
### Synchronous API
* **macOS**: Encryption keys are stored for your app in [Keychain Access](https://support.apple.com/en-ca/guide/keychain-access/kyca1083/mac) in a way that prevents
other applications from loading them without user override. Therefore, content is protected from other users and other apps running in the same userspace.
* **Windows**: Encryption keys are generated via [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata).
As per the Windows documentation: "Typically, only a user with the same logon credential as the user who encrypted the data can typically
decrypt the data". Therefore, content is protected from other users on the same machine, but not from other apps running in the
* **Windows**: Encryption keys are generated via [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptprotectdata). As per the Windows documentation: "Typically, only a user with the same logon credential as the user who encrypted the data can typically decrypt the data". Therefore, content is protected from other users on the same machine, but not from other apps running in the
same userspace.
* **Linux**: Encryption keys are generated and stored in a secret store that varies depending on your window manager and system setup. Options currently supported are `kwallet`, `kwallet5`, `kwallet6` and `gnome-libsecret`, but more may be available in future versions of Electron. As such, the
security semantics of content protected via the `safeStorage` API vary between window managers and secret stores.
* Note that not all Linux setups have an available secret store. If no secret store is available, items stored in using the `safeStorage` API will be unprotected
as they are encrypted via hardcoded plaintext password. You can detect when this happens when `safeStorage.getSelectedStorageBackend()` returns `basic_text`.
* Note that not all Linux setups have an available secret store. If no secret store is available, items stored in using the `safeStorage` API will be unprotected as they are encrypted via hardcoded plaintext password. You can detect when this happens when `safeStorage.getSelectedStorageBackend()` returns `basic_text`.
Note that on Mac, access to the system Keychain is required and
Note that on macOS, access to the system Keychain is required and
these calls can block the current thread to collect user input.
The same is true for Linux, if a password management tool is available.
### Asynchronous API
The asynchronous API uses pluggable key providers that vary by platform:
* **macOS**: Encryption keys are stored and retrieved from [Keychain Access](https://developer.apple.com/documentation/security/keychain-items). This provides the same security model as the synchronous API, protecting content from other users and other apps running in the same userspace.
* **Windows**: Encryption keys are protected via [DPAPI](https://learn.microsoft.com/en-us/windows/win32/api/dpapi). This provides the same security model as the synchronous API, protecting content from other users on the same machine but not from other apps running in the same userspace.
* **Linux**: Multiple key providers may be available depending on the desktop environment:
* [`org.freedesktop.portal.Secret`](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Secret.html): Uses the Portal Secret D-Bus interface to retrieve application-specific secrets. This is the preferred provider for sandboxed environments like Flatpak.
* [Secret Service API](https://specifications.freedesktop.org/secret-service/latest/): Uses the freedesktop.org Secret Service API (e.g., GNOME Keyring) for key storage.
* A fallback provider is used for environments without a secret service available.
Unlike the synchronous API, these operations are non-blocking and support additional features like key rotation (indicated by `shouldReEncrypt`) and temporary unavailability handling (indicated by `isTemporarilyUnavailable`).
## Events
The `safeStorage` module emits the following events:
## Methods
The `safeStorage` module has the following methods:
@@ -34,6 +57,10 @@ On Linux, returns true if the app has emitted the `ready` event and the secret k
On MacOS, returns true if Keychain is available.
On Windows, returns true once the app has emitted the `ready` event.
### `safeStorage.isAsyncEncryptionAvailable()`
Returns `Promise<Boolean>` - Whether encryption is available for asynchronous safeStorage operations.
### `safeStorage.encryptString(plainText)`
* `plainText` string
@@ -49,7 +76,21 @@ This function will throw an error if encryption fails.
Returns `string` - the decrypted string. Decrypts the encrypted buffer
obtained with `safeStorage.encryptString` back into a string.
This function will throw an error if decryption fails.
### `safeStorage.encryptStringAsync(plainText)`
* `plainText` string
Returns `Promise<Buffer>` - An array of bytes representing the encrypted string.
### `safeStorage.decryptStringAsync(encrypted)`
* `encrypted` Buffer
Returns `Promise<Object>` - Resolve with an object containing the following:
* `shouldReEncrypt` boolean - whether data that has just been returned from the decrypt operation should be
re-encrypted, as the key has been rotated or a new key is available that provides a different security level. If `true`, you should call `decryptStringAsync` again to receive the new decrypted string.
* `result` string - the decrypted string.
### `safeStorage.setUsePlainTextEncryption(usePlainText)`

View File

@@ -1216,7 +1216,7 @@ function createWindow () {
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
bluetoothPinCallback = callback
// Send a IPC message to the renderer to prompt the user to confirm the pairing.
// Send an IPC message to the renderer to prompt the user to confirm the pairing.
// Note that this will require logic in the renderer to handle this message and
// display a prompt to the user.
mainWindow.webContents.send('bluetooth-pairing-request', details)
@@ -1264,7 +1264,7 @@ session.defaultSession.allowNTLMCredentialsForDomains('*')
Overrides the `userAgent` and `acceptLanguages` for this session.
The `acceptLanguages` must a comma separated ordered list of language codes, for
The `acceptLanguages` must be a comma separated ordered list of language codes, for
example `"en-US,fr,de,ko,zh-CN,ja"`.
This doesn't affect existing `WebContents`, and each `WebContents` can use
@@ -1512,7 +1512,7 @@ will not work on non-persistent (in-memory) sessions.
* `options` Object (optional)
* `allowFileAccess` boolean - Whether to allow the extension to read local files over `file://`
protocol and inject content scripts into `file://` pages. This is required e.g. for loading
devtools extensions on `file://` URLs. Defaults to false.
DevTools extensions on `file://` URLs. Defaults to false.
Returns `Promise<Extension>` - resolves when the extension is loaded.
@@ -1538,7 +1538,7 @@ const path = require('node:path')
app.whenReady().then(async () => {
await session.defaultSession.loadExtension(
path.join(__dirname, 'react-devtools'),
// allowFileAccess is required to load the devtools extension on file:// URLs.
// allowFileAccess is required to load the DevTools extension on file:// URLs.
{ allowFileAccess: true }
)
// Note that in order to use the React DevTools extension, you'll need to

View File

@@ -9,6 +9,13 @@ For including the share menu as a submenu of other menus, please use the
## Class: ShareMenu
<!--
```YAML history
added:
- pr-url: https://github.com/electron/electron/pull/25629
```
-->
> Create share menu on macOS.
Process: [Main](../glossary.md#main-process)

View File

@@ -21,7 +21,7 @@ Imports the shared texture from the given options.
> [!NOTE]
> This method is only available in the main process.
Returns `SharedTextureImported` - The imported shared texture.
Returns [`SharedTextureImported`](structures/shared-texture-imported.md) - The imported shared texture.
### `sharedTexture.sendSharedTexture(options, ...args)` _Experimental_

View File

@@ -29,6 +29,14 @@ Show the given file in a file manager. If possible, select the file.
### `shell.openPath(path)`
<!--
```YAML history
added:
- pr-url: https://github.com/electron/electron/pull/20682
breaking-changes-header: api-changed-shellopenitem-is-now-shellopenpath
```
-->
* `path` string
Returns `Promise<string>` - Resolves with a string containing the error message corresponding to the failure if a failure occurred, otherwise "".
@@ -37,6 +45,18 @@ Open the given file in the desktop's default manner.
### `shell.openExternal(url[, options])`
<!--
```YAML history
changes:
- pr-url: https://github.com/electron/electron/pull/4508
description: "Added `activate` option."
- pr-url: https://github.com/electron/electron/pull/15065
description: "Added `workingDirectory` option."
- pr-url: https://github.com/electron/electron/pull/37139
description: "Added `logUsage` option."
```
-->
* `url` string - Max 2081 characters on Windows.
* `options` Object (optional)
* `activate` boolean (optional) _macOS_ - `true` to bring the opened application to the foreground. The default is `true`.
@@ -50,6 +70,14 @@ Open the given external protocol URL in the desktop's default manner. (For examp
### `shell.trashItem(path)`
<!--
```YAML history
added:
- pr-url: https://github.com/electron/electron/pull/25114
breaking-changes-header: deprecated-shellmoveitemtotrash
```
-->
* `path` string - path to the item to be moved to the trash.
Returns `Promise<void>` - Resolves when the operation has been completed.
@@ -58,6 +86,10 @@ Rejects if there was an error while deleting the requested item.
This moves a path to the OS-specific trash location (Trash on macOS, Recycle
Bin on Windows, and a desktop-environment-specific location on Linux).
The path must use the default path separator for the platform (backslash on
Windows). Use `path.resolve()` from the `node:path` module to ensure correct
handling on all filesystems.
### `shell.beep()`
Play the beep sound.

View File

@@ -102,9 +102,9 @@
* `trafficLightPosition` [Point](point.md) (optional) _macOS_ -
Set a custom position for the traffic light buttons in frameless windows.
* `roundedCorners` boolean (optional) _macOS_ _Windows_ - Whether frameless window
should have rounded corners. Default is `true`. Setting this property
to `false` will prevent the window from being fullscreenable on macOS.
On Windows versions older than Windows 11 Build 22000 this property has no effect, and frameless windows will not have rounded corners.
should have rounded corners. Default is `true`. On Windows versions older than
Windows 11 Build 22000 this property has no effect, and frameless windows will
not have rounded corners.
* `thickFrame` boolean (optional) _Windows_ - Use `WS_THICKFRAME` style for
frameless windows on Windows, which adds the standard window frame. Setting it
to `false` will remove window shadow and window animations, and disable window

View File

@@ -7,7 +7,7 @@
* `depthPerComponent` number - The number of bits per color component.
* `detected` boolean - `true` if the display is detected by the system.
* `displayFrequency` number - The display refresh rate.
* `id` number - Unique identifier associated with the display. A value of of -1 means the display is invalid or the correct `id` is not yet known, and a value of -10 means the display is a virtual display assigned to a unified desktop.
* `id` number - Unique identifier associated with the display. A value of -1 means the display is invalid or the correct `id` is not yet known, and a value of -10 means the display is a virtual display assigned to a unified desktop.
* `internal` boolean - `true` for an internal display and `false` for an external display.
* `label` string - User-friendly label, determined by the platform.
* `maximumCursorSize` [Size](size.md) - Maximum cursor size in native pixels.

View File

@@ -1,13 +1,15 @@
# NotificationAction Object
* `type` string - The type of action, can be `button`.
* `type` string - The type of action, can be `button` or `selection`. `selection` is only supported on Windows.
* `text` string (optional) - The label for the given action.
* `items` string[] (optional) _Windows_ - The list of items for the `selection` action `type`.
## Platform / Action Support
| Action Type | Platform Support | Usage of `text` | Default `text` | Limitations |
|-------------|------------------|-----------------|----------------|-------------|
| `button` | macOS | Used as the label for the button | "Show" (or a localized string by system default if first of such `button`, otherwise empty) | Only the first one is used. If multiple are provided, those beyond the first will be listed as additional actions (displayed when mouse active over the action button). Any such action also is incompatible with `hasReply` and will be ignored if `hasReply` is `true`. |
| `button` | macOS, Windows | Used as the label for the button | "Show" on macOS (localized) if first `button`, otherwise empty; Windows uses provided `text` | macOS: Only the first one is used as primary; others shown as additional actions (hover). Incompatible with `hasReply` (beyond first ignored). |
| `selection` | Windows | Used as the label for the submit button for the selection menu | "Select" | Requires an `items` array property specifying option labels. Emits the `action` event with `(index, selectedIndex)` where `selectedIndex` is the chosen option (>= 0). Ignored on platforms that do not support selection actions. |
### Button support on macOS
@@ -15,6 +17,37 @@ In order for extra notification buttons to work on macOS your app must meet the
following criteria.
* App is signed
* App has it's `NSUserNotificationAlertStyle` set to `alert` in the `Info.plist`.
* App has its `NSUserNotificationAlertStyle` set to `alert` in the `Info.plist`.
If either of these requirements are not met the button won't appear.
### Selection support on Windows
To add a selection (combo box) style action, include an action with `type: 'selection'`, a `text` label for the submit button, and an `items` array of strings:
```js
const { Notification, app } = require('electron')
app.whenReady().then(() => {
const items = ['One', 'Two', 'Three']
const n = new Notification({
title: 'Choose an option',
actions: [{
type: 'selection',
text: 'Apply',
items
}]
})
n.on('action', (e) => {
console.log(`User triggered action at index: ${e.actionIndex}`)
if (e.selectionIndex > 0) {
console.log(`User chose selection item '${items[e.selectionIndex]}'`)
}
})
n.show()
})
```
When the user activates the selection action, the notification's `action` event will be emitted with two parameters: `actionIndex` (the action's index in the `actions` array) and `selectedIndex` (the zero-based index of the chosen item, or `-1` if unavailable). On non-Windows platforms selection actions are ignored.

View File

@@ -5,6 +5,7 @@
* `rgba` - 32bpp RGBA (byte-order), 1 plane.
* `rgbaf16` - Half float RGBA, 1 plane.
* `nv12` - 12bpp with Y plane followed by a 2x2 interleaved UV plane.
* `p010le` - 4:2:0 10-bit YUV (little-endian), Y plane followed by a 2x2 interleaved UV plane.
* `colorSpace` [ColorSpace](color-space.md) (optional) - The color space of the texture.
* `codedSize` [Size](size.md) - The full dimensions of the shared texture.
* `visibleRect` [Rectangle](rectangle.md) (optional) - A subsection of [0, 0, codedSize.width, codedSize.height]. In common cases, it is the full section area.

View File

@@ -40,7 +40,7 @@
* `javascript` boolean (optional) - Enables JavaScript support. Default is `true`.
* `webSecurity` boolean (optional) - When `false`, it will disable the
same-origin policy (usually using testing websites by people), and set
`allowRunningInsecureContent` to `true` if this options has not been set
`allowRunningInsecureContent` to `true` if this option has not been set
by user. Default is `true`.
* `allowRunningInsecureContent` boolean (optional) - Allow an https page to run
JavaScript, CSS or plugins from http URLs. Default is `false`.
@@ -94,6 +94,7 @@
The actual output pixel format and color space of the texture should refer to [`OffscreenSharedTexture`](../structures/offscreen-shared-texture.md) object in the `paint` event.
* `argb` - The requested output texture format is 8-bit unorm RGBA, with SRGB SDR color space.
* `rgbaf16` - The requested output texture format is 16-bit float RGBA, with scRGB HDR color space.
* `deviceScaleFactor` number (optional) _Experimental_ - The device scale factor of the offscreen rendering output. If not set, will use primary display's scale factor as default.
* `contextIsolation` boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults
to `true`. The context that the `preload` script runs in will only have
@@ -156,6 +157,8 @@
`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`.
* `focusOnNavigation` boolean (optional) - Whether to focus the WebContents
when navigating. 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

View File

@@ -36,6 +36,12 @@ Process: [Main](../glossary.md#main-process)<br />
`com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will allow the utility process
to load unsigned libraries. Unless you specifically need this capability, it is best to leave this disabled.
Default is `false`.
* `disclaim` boolean (optional) _macOS_ - With this flag, the utility process will disclaim
responsibility for the child process. This causes the operating system to consider the child
process as a separate entity for purposes of security policies like Transparency, Consent, and
Control (TCC). When responsibility is disclaimed, the parent process will not be attributed
for any TCC requests initiated by the child process. This is useful when launching processes
that run third-party or otherwise untrusted code. Default is `false`.
* `respondToAuthRequestsFromMainProcess` boolean (optional) - With this flag, all HTTP 401 and 407 network
requests created via the [net module](net.md) will allow responding to them via the
[`app#login`](app.md#event-login) event in the main process instead of the default

View File

@@ -62,9 +62,17 @@ it becomes the topmost view.
If the view passed as a parameter is not a child of this view, this method is a no-op.
#### `view.setBounds(bounds)`
#### `view.setBounds(bounds[, options])`
* `bounds` [Rectangle](structures/rectangle.md) - New bounds of the View.
* `options` Object (optional) - Options for setting the bounds.
* `animate` boolean | Object (optional) - If true, the bounds change will be animated. If an object is passed, it can contain the following properties:
* `duration` Integer (optional) - Duration of the animation in milliseconds. Default is `250`.
* `easing` string (optional) - Easing function for the animation. Default is `linear`.
* `linear`
* `ease-in`
* `ease-out`
* `ease-in-out`
#### `view.getBounds()`

View File

@@ -62,7 +62,7 @@ console.log(webContents)
### `webContents.getAllWebContents()`
Returns `WebContents[]` - An array of all `WebContents` instances. This will contain web contents
for all windows, webviews, opened devtools, and devtools extension background pages.
for all windows, webviews, opened DevTools, and DevTools extension background pages.
### `webContents.getFocusedWebContents()`
@@ -383,7 +383,7 @@ Emitted after a server side redirect occurs during navigation. For example a 30
redirect.
This event cannot be prevented, if you want to prevent redirects you should
checkout out the `will-redirect` event above.
check out the `will-redirect` event above.
#### Event: 'did-navigate'
@@ -958,7 +958,7 @@ win.loadURL('https://github.com')
#### Event: 'devtools-reload-page'
Emitted when the devtools window instructs the webContents to reload
Emitted when the DevTools window instructs the webContents to reload
#### Event: 'will-attach-webview'
@@ -1465,7 +1465,7 @@ Ignore application menu shortcuts while this web contents is focused.
without a recognized 'action' value will result in a console error and have
the same effect as returning `{action: 'deny'}`.
Called before creating a window a new window is requested by the renderer, e.g.
Called before creating a window when a new window is requested by the renderer, e.g.
by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or
submitting a form with `<form target="_blank">`. See
[`window.open()`](window-open.md) for more details and how to use this in
@@ -1748,11 +1748,12 @@ Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/
* `footer` string (optional) - string to be printed as page footer.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`,
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
* `usePrinterDefaultPageSize` boolean (optional) - Whether to use a given printer's default page size. Default is `false`. Cannot be combined with `pageSize`. When `deviceName` is provided, uses the default page size of that specific printer. When `deviceName` is not provided, uses the default page size of the system's default printer. If the printer's default page size cannot be retrieved, falls back to A4 (210mm x 297mm).
* `callback` Function (optional)
* `success` boolean - Indicates success of the print call.
* `failureReason` string - Error description called back if the print fails.
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minimum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minimum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems. If a valid `pageSize` is not passed and `usePrinterDefaultPageSize` is `false`, an error will be thrown.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings for printing.
@@ -1865,66 +1866,20 @@ Removes the specified path from DevTools workspace.
* `devToolsWebContents` WebContents
Uses the `devToolsWebContents` as the target `WebContents` to show devtools.
Uses the `devToolsWebContents` as the target `WebContents` to show DevTools.
The `devToolsWebContents` must not have done any navigation, and it should not
be used for other purposes after the call.
By default Electron manages the devtools by creating an internal `WebContents`
By default, Electron manages the DevTools by creating an internal `WebContents`
with native view, which developers have very limited control of. With the
`setDevToolsWebContents` method, developers can use any `WebContents` to show
the devtools in it, including `BrowserWindow`, `BrowserView` and `<webview>`
tag.
the DevTools in it, such as [`BrowserWindow`](./browser-window.md) or [`WebContentsView`](./web-contents-view.md).
Note that closing the devtools does not destroy the `devToolsWebContents`, it
is caller's responsibility to destroy `devToolsWebContents`.
Note that closing the DevTools does not destroy the `devToolsWebContents`, it
is the caller's responsibility to destroy `devToolsWebContents` manually.
An example of showing devtools in a `<webview>` tag:
```html
<html>
<head>
<style type="text/css">
* { margin: 0; }
#browser { height: 70%; }
#devtools { height: 30%; }
</style>
</head>
<body>
<webview id="browser" src="https://github.com"></webview>
<webview id="devtools" src="about:blank"></webview>
<script>
const { ipcRenderer } = require('electron')
const emittedOnce = (element, eventName) => new Promise(resolve => {
element.addEventListener(eventName, event => resolve(event), { once: true })
})
const browserView = document.getElementById('browser')
const devtoolsView = document.getElementById('devtools')
const browserReady = emittedOnce(browserView, 'dom-ready')
const devtoolsReady = emittedOnce(devtoolsView, 'dom-ready')
Promise.all([browserReady, devtoolsReady]).then(() => {
const targetId = browserView.getWebContentsId()
const devtoolsId = devtoolsView.getWebContentsId()
ipcRenderer.send('open-devtools', targetId, devtoolsId)
})
</script>
</body>
</html>
```
```js
// Main process
const { ipcMain, webContents } = require('electron')
ipcMain.on('open-devtools', (event, targetContentsId, devtoolsContentsId) => {
const target = webContents.fromId(targetContentsId)
const devtools = webContents.fromId(devtoolsContentsId)
target.setDevToolsWebContents(devtools)
target.openDevTools()
})
```
An example of showing devtools in a `BrowserWindow`:
An example of showing DevTools in a `BrowserWindow`:
```js title='main.js'
const { app, BrowserWindow } = require('electron')
@@ -1944,31 +1899,31 @@ app.whenReady().then(() => {
#### `contents.openDevTools([options])`
* `options` Object (optional)
* `mode` string - Opens the devtools with specified dock state, can be
* `mode` string - Opens the DevTools with specified dock state, can be
`left`, `right`, `bottom`, `undocked`, `detach`. Defaults to last used dock state.
In `undocked` mode it's possible to dock back. In `detach` mode it's not.
* `activate` boolean (optional) - Whether to bring the opened devtools window
* `activate` boolean (optional) - Whether to bring the opened DevTools window
to the foreground. The default is `true`.
* `title` string (optional) - A title for the DevTools window (only in `undocked` or `detach` mode).
Opens the devtools.
Opens the DevTools.
When `contents` is a `<webview>` tag, the `mode` would be `detach` by default,
explicitly passing an empty `mode` can force using last used dock state.
On Windows, if Windows Control Overlay is enabled, Devtools will be opened with `mode: 'detach'`.
On Windows, if Windows Control Overlay is enabled, DevTools will be opened with `mode: 'detach'`.
#### `contents.closeDevTools()`
Closes the devtools.
Closes the DevTools view.
#### `contents.isDevToolsOpened()`
Returns `boolean` - Whether the devtools is opened.
Returns `boolean` - Whether the DevTools view is opened.
#### `contents.isDevToolsFocused()`
Returns `boolean` - Whether the devtools view is focused .
Returns `boolean` - Whether the DevTools view is focused .
#### `contents.getDevToolsTitle()`
@@ -2214,7 +2169,7 @@ Returns `boolean` - If _offscreen rendering_ is enabled returns whether it is cu
* `fps` Integer
If _offscreen rendering_ is enabled sets the frame rate to the specified number.
Only values between 1 and 240 are accepted.
When `webPreferences.offscreen.useSharedTexture` is `false` only values between 1 and 240 are accepted.
#### `contents.getFrameRate()`
@@ -2410,11 +2365,12 @@ A [`NavigationHistory`](navigation-history.md) used by this webContents.
#### `contents.hostWebContents` _Readonly_
A [`WebContents`](web-contents.md) instance that might own this `WebContents`.
A `WebContents | null` property that represents a [`WebContents`](web-contents.md)
instance that might own this `WebContents`.
#### `contents.devToolsWebContents` _Readonly_
A `WebContents | null` property that represents the of DevTools `WebContents` associated with a given `WebContents`.
A `WebContents | null` property that represents the DevTools `WebContents` associated with a given `WebContents`.
> [!NOTE]
> Users should never store this object because it may become `null`

View File

@@ -197,7 +197,7 @@ dispatch errors of isolated worlds to foreign worlds.
* `info` Object
* `securityOrigin` string (optional) - Security origin for the isolated world.
* `csp` string (optional) - Content Security Policy for the isolated world.
* `name` string (optional) - Name for isolated world. Useful in devtools.
* `name` string (optional) - Name for isolated world. Useful in DevTools.
Set the security origin, content security policy and name of the isolated world.

View File

@@ -588,6 +588,7 @@ Stops any `findInPage` request for the `webview` with the provided `action`.
* `footer` string (optional) - string to be printed as page footer.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` in microns.
* `usePrinterDefaultPageSize` boolean (optional) - Whether to use the system's default page size. Default is `false`. Cannot be combined with `pageSize`. When `deviceName` is provided, uses the default page size of that specific printer. When `deviceName` is not provided, uses the default page size of the system's default printer. If the printer's default page size cannot be retrieved, falls back to A4 (210mm x 297mm).
Returns `Promise<void>`

View File

@@ -12,6 +12,32 @@ 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 (42.0)
### Behavior Changed: Offscreen rendering will use `1.0` as default device scale factor.
Previously, OSR used the primary display's device scale factor for rendering, which made the output frame size vary across users.
Developers had to manually calculate the correct size using `screen.getPrimaryDisplay().scaleFactor`. We now provide an optional property
`webPreferences.offscreen.deviceScaleFactor` to specify a custom value when creating an OSR window. At first, if the property is not set, it defaults
to the primary display's scale factor (preserving the old behavior). Starting from Electron 42, the default will change to a constant value of `1.0`
for more consistent output sizes.
## Planned Breaking API Changes (41.0)
### Behavior Changed: PDFs no longer create a separate WebContents
Previously, PDF resources created a separate guest [WebContents](https://www.electronjs.org/docs/latest/api/web-contents) for rendering. Now, PDFs are rendered within the same WebContents instead. If you have code to detect PDF resources, use the [frame tree](https://www.electronjs.org/docs/latest/api/web-frame-main) instead of WebContents.
Under the hood, Chromium [enabled](https://chromium-review.googlesource.com/c/chromium/src/+/7239572) a feature that changes PDFs to use out-of-process iframes (OOPIFs) instead of the `MimeHandlerViewGuest` extension.
### Behavior Changed: Updated Cookie Change Cause in the Cookie 'changed' Event
We have updated the [cookie](https://www.electronjs.org/docs/latest/api/cookies#event-changed) change cause in the cookie 'changed' event.
When a new cookie is set, the change cause is `inserted`.
When a cookie is deleted, the change cause remains `explicit`.
When the cookie being set is identical to an existing one (same name, domain, path, and value, with no actual changes), the change cause is `inserted-no-change-overwrite`.
When the value of the cookie being set remains unchanged but some of its attributes are updated, such as the expiration attribute, the change cause will be `inserted-no-value-change-overwrite`.
## Planned Breaking API Changes (40.0)
### Deprecated: `clipboard` API access from renderer processes
@@ -50,6 +76,22 @@ webContents.setWindowOpenHandler((details) => {
})
```
### Behavior Changed: `NSAudioCaptureUsageDescription` should be included in your app's Info.plist file to use `desktopCapturer` (🍏 macOS ≥14.2)
Per [Chromium update](https://source.chromium.org/chromium/chromium/src/+/ad17e8f8b93d5f34891b06085d373a668918255e) which enables Apple's newer [CoreAudio Tap API](https://developer.apple.com/documentation/CoreAudio/capturing-system-audio-with-core-audio-taps#Configure-the-sample-code-project) by default, you now must have `NSAudioCaptureUsageDescription` defined in your `Info.plist` to use `desktopCapturer`.
Electron's `desktopCapturer` will create a dead audio stream if the new permission is absent however no errors or warnings will occur. This is partially a side-effect of Chromium not falling back to the older `Screen & System Audio Recording` permissions system if the new system fails.
To restore previous behavior:
```js
// main.js (right beneath your require/import statments)
app.commandLine.appendSwitch(
'disable-features',
'MacCatapLoopbackAudioForScreenShare'
)
```
### Behavior Changed: shared texture OSR `paint` event data structure
When using shared texture offscreen rendering feature, the `paint` event now emits a more structured object.
@@ -68,7 +110,7 @@ Users can force XWayland by passing `--ozone-platform=x11`.
### Removed: `ORIGINAL_XDG_CURRENT_DESKTOP` environment variable
Previously, Electron changed the value of `XDG_CURRENT_DESKTOP` internally to `Unity`, and stored the original name of the desktop session
in a separate variable. `XDG_CURRENT_DESKTOP` is no longer overriden and now reflects the actual desktop environment.
in a separate variable. `XDG_CURRENT_DESKTOP` is no longer overridden and now reflects the actual desktop environment.
### Removed: macOS 11 support
@@ -149,7 +191,7 @@ window is not currently visible.
`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`.
If you were using `app.commandLine` to control the behavior of the main process, you should do this via `process.argv`.
### Deprecated: `NativeImage.getBitmap()`
@@ -179,7 +221,7 @@ from upstream Chromium.
### 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.
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
@@ -190,7 +232,7 @@ and then using it in `ProtocolResponse.session`.
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.
is only one type left -- `'temporary'` -- so specifying it is unnecessary.
### Deprecated: Extension methods and events on `session`
@@ -519,7 +561,7 @@ more information.
### Removed: The `--disable-color-correct-rendering` switch
This switch was never formally documented but it's removal is being noted here regardless. Chromium itself now has better support for color spaces so this flag should not be needed.
This switch was never formally documented but its removal is being noted here regardless. Chromium itself now has better support for color spaces so this flag should not be needed.
### Behavior Changed: `BrowserView.setAutoResize` behavior on macOS
@@ -1210,7 +1252,7 @@ more details.
### API Changed: `webContents.printToPDF()`
`webContents.printToPDF()` has been modified to conform to [`Page.printToPDF`](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) in the Chrome DevTools Protocol. This has been changes in order to
`webContents.printToPDF()` has been modified to conform to [`Page.printToPDF`](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) in the Chrome DevTools Protocol. This has been changed in order to
address changes upstream that made our previous implementation untenable and rife with bugs.
**Arguments Changed**
@@ -2677,6 +2719,18 @@ Replace with: https://atom.io/download/electron
The following list includes the breaking API changes made in Electron 2.0.
### `autoUpdater`
```js
// Deprecated
autoUpdater.setFeedURL(url, headers)
// Replace with
autoUpdater.setFeedURL({
url,
headers
})
```
### `BrowserWindow`
```js

View File

@@ -6,30 +6,104 @@ Follow the guidelines below for building **Electron itself**, for the purposes o
## Platform prerequisites
Check the build prerequisites for your platform before proceeding
Check the build prerequisites for your platform before proceeding:
* [macOS](build-instructions-macos.md#prerequisites)
* [Linux](build-instructions-linux.md#prerequisites)
* [Windows](build-instructions-windows.md#prerequisites)
## Build Tools
## Setting up `@electron/build-tools` (recommended)
[Electron's Build Tools](https://github.com/electron/build-tools) automate much of the setup for compiling Electron from source with different configurations and build targets. If you wish to set up the environment manually, the instructions are listed below.
[Electron Build Tools](https://github.com/electron/build-tools) automate much of the setup for
compiling Electron from source with different configurations and build targets.
Most of the [manual setup](#manual-setup-advanced) instructions can be replaced by simpler Build Tools commands.
> [!TIP]
> Build Tools also gives you access to [remote execution and caching of build actions](./reclient.md),
> which will dramatically improve build times.
Electron Build Tools can be installed globally from npm:
```sh
npm install -g @electron/build-tools
```
Once installed, the `e` command should be globally available in your command line. The `e init`
command bootstraps a local checkout of Electron:
```sh
# The 'Hello, World!' of build-tools: get and build `main`
# Choose the directory where Electron's source and build files will reside.
# You can specify any path you like; this command defaults to `$PWD/electron`.
# If you're going to use multiple branches, you may want something like:
# `--root=~/electron/branch` (e.g. `~/electron-gn/main`)
e init --root=~/electron --bootstrap testing
```
The `--bootstrap` flag also runs `e sync` (synchronizes source code branches from
[`DEPS`](https://github.com/electron/electron/blob/main/DEPS) using
[`gclient`](https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/HEAD/README.gclient.md))
and `e build` (compiles the Electron binary into the `${root}/src/out` folder).
> [!IMPORTANT]
>
> Sometime after the initial `e sync` phase, you will be asked to run `e d rbe login` to auth into
> remote build execution and proceed into the build. This may take about 20-30 minutes!
Once the build is done compiling, you can test it by running `e start` (or by loading it into
[Electron Fiddle](http://electronjs.org/fiddle)).
### Navigating the project
Some quick tips on building once your checkout is set up:
* **Directory structure:** Within the project, Chromium code is synced to `${root}/src/` while Electron's code (i.e. code in
https://github.com/electron/electron) lives in `${root}/src/electron/`. Note that both directories
have their own git repositories.
* **Updating your checkout:** Run git commands such as `git checkout <branch>` and `git pull` from `${root}/src/electron`.
Whenever you update your commit `HEAD`, make sure to `e sync` before `e build` to sync dependencies
such as Chromium and Node.js. This is especially relevant because the Chromium version in
[`DEPS`](https://github.com/electron/electron/blob/main/DEPS) changes frequently.
* **Rebuilding:** When making changes to code in `${root}/src/electron/` in a local branch, you only need to re-run `e build`.
* **Adding patches:** When contributing changes in `${root}/src/` outside of `${root}/src/electron/`, you need to do so
via Electron's [patch system](./patches.md). The `e patches` command can export all relevant patches to
`${root}/src/electron/patches/` once your code change is ready.
> [!IMPORTANT]
> Unless you're applying upstream patches, you should treat `${root}/src/` as a read-only folder and
> spend most of your development time in `${root}/src/electron/`. You should not need to make any
> changes or run `git` commands in `${root}/src/`.
> [!TIP]
> Detailed documentation for all available `e` commands can be found in the
> repository's [README.md](https://github.com/electron/build-tools/blob/main/README.md). You can
> also run `e --help` to list all commands and use the `--help` flag on any command to get more
> usage info.
> [!TIP]
> For more information on project structure, see the [Source Code Directory Structure](./source-code-directory-structure.md)
> guide.
<details>
<!-- markdownlint-disable-next-line MD033 -->
<summary><strong>Manual setup (advanced)</strong></summary>
## Manual setup (advanced)
Electron uses [GN](https://gn.googlesource.com/gn) for project generation and
[ninja](https://ninja-build.org/) for building. Project configurations can
be found in the `.gn` and `.gni` files.
[siso](https://chromium.googlesource.com/build/+/refs/heads/main/siso/README.md) for building.
Project configurations can be found in the `.gn` and `.gni` files in the `electron/electron` repo.
## GN Files
### GN files
The following `gn` files contain the main rules for building Electron:
* `BUILD.gn` defines how Electron itself is built and
includes the default configurations for linking with Chromium.
* `build/args/{testing,release,all}.gn` contain the default build arguments for
building Electron.
* [`BUILD.gn`](https://github.com/electron/electron/blob/main/BUILD.gn) defines how Electron itself
is built and includes the default configurations for linking with Chromium.
* [`build/args/{testing,release,all}.gn`](https://github.com/electron/electron/tree/main/build/args)
contain the default build arguments for building Electron.
## GN prerequisites
### GN prerequisites
You'll need to install [`depot_tools`][depot-tools], the toolset
used for fetching Chromium and its dependencies.
@@ -56,7 +130,7 @@ $ mkdir -p "${GIT_CACHE_PATH}"
# This will use about 16G.
```
## Getting the code
### Getting the code
```sh
$ mkdir electron && cd electron
@@ -68,7 +142,7 @@ $ gclient sync --with_branch_heads --with_tags
> Instead of `https://github.com/electron/electron`, you can use your own fork
> here (something like `https://github.com/<username>/electron`).
### A note on pulling/pushing
#### A note on pulling/pushing
If you intend to `git pull` or `git push` from the official `electron`
repository in the future, you now need to update the respective folder's
@@ -83,12 +157,13 @@ $ git branch --set-upstream-to=origin/main
$ cd -
```
:memo: `gclient` works by checking a file called `DEPS` inside the
`src/electron` folder for dependencies (like Chromium or Node.js).
> [!TIP]
> `gclient` works by checking a file called `DEPS` inside the
`${root}/src/electron` folder for dependencies (like Chromium or Node.js).
Running `gclient sync -f` ensures that all dependencies required
to build Electron match that file.
So, in order to pull, you'd run the following commands:
In order to pull, you'd run the following commands:
```sh
$ cd src/electron
@@ -96,7 +171,7 @@ $ git pull
$ gclient sync -f
```
## Building
### Building
**Set the environment variable for chromium build tools**
@@ -156,7 +231,7 @@ $ gn gen out/Release --args="import(\`"//electron/build/args/release.gn\`")"
```
> [!NOTE]
> This will generate a `out/Testing` or `out/Release` build directory under `src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.
> This will generate a `out/Testing` or `out/Release` build directory under `${root}/src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.
Also you shouldn't have to run `gn gen` again—if you want to change the build arguments, you can run `gn args out/Testing` to bring up an editor. To see the list of available build configuration options, run `gn args out/Testing --list`.
@@ -189,7 +264,7 @@ $ ./out/Testing/electron.exe
$ ./out/Testing/electron
```
### Packaging
#### Packaging
To package the electron build as a distributable zip file:
@@ -197,7 +272,7 @@ To package the electron build as a distributable zip file:
$ ninja -C out/Release electron:electron_dist_zip
```
### Cross-compiling
#### Cross-compiling
To compile for a platform that isn't the same as the one you're building on,
set the `target_cpu` and `target_os` GN arguments. For example, to compile an
@@ -223,7 +298,7 @@ and [`target_cpu`][target_cpu values].
[target_os values]: https://gn.googlesource.com/gn/+/main/docs/reference.md#built_in-predefined-variables-target_os_the-desired-operating-system-for-the-build-possible-values
[target_cpu values]: https://gn.googlesource.com/gn/+/main/docs/reference.md#built_in-predefined-variables-target_cpu_the-desired-cpu-architecture-for-the-build-possible-values
#### Windows on Arm (experimental)
#### Windows on Arm
To cross-compile for Windows on Arm, [follow Chromium's guide](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/windows_build_instructions.md#Visual-Studio) to get the necessary dependencies, SDK and libraries, then build with `ELECTRON_BUILDING_WOA=1` in your environment before running `gclient sync`.
@@ -241,12 +316,12 @@ gclient sync -f --with_branch_heads --with_tags
Next, run `gn gen` as above with `target_cpu="arm64"`.
## Tests
### Tests
To run the tests, you'll first need to build the test modules against the
same version of Node.js that was built as part of the build process. To
generate build headers for the modules to compile against, run the following
under `src/` directory.
under `${root}/src/` directory.
```sh
$ ninja -C out/Testing electron:node_headers
@@ -262,7 +337,7 @@ $ npm run test -- \
--enable-logging -g 'BrowserWindow module'
```
## Sharing the git cache between multiple machines
### Sharing the git cache between multiple machines
It is possible to share the gclient git cache with other machines by exporting it as
SMB share on linux, but only one process/machine can be using the cache at a
@@ -284,11 +359,14 @@ This can be set quickly in powershell (ran as administrator):
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\Lanmanworkstation\Parameters" -Name DirectoryCacheLifetime -Value 0 -PropertyType DWORD -Force
```
</details>
## Troubleshooting
### gclient sync complains about rebase
### `sync` complains about rebase
If `gclient sync` is interrupted the git tree may be left in a bad state, leading to a cryptic message when running `gclient sync` in the future:
If `e sync` (or `gclient sync`) is interrupted, the git tree may be left in a bad state, leading to
a cryptic message when running `sync` in the future:
```plaintext
2> Conflict while rebasing this branch.
@@ -296,17 +374,19 @@ If `gclient sync` is interrupted the git tree may be left in a bad state, leadin
2> See man git-rebase for details.
```
If there are no git conflicts or rebases in `src/electron`, you may need to abort a `git am` in `src`:
If there are no git conflicts or rebases in `${root}/src/electron`, you may need to abort a `git am`
in `${root}/src`:
```sh
$ cd ../
$ git am --abort
$ cd electron
$ gclient sync -f
$ e sync -f
```
This may also happen if you have checked out a branch (as opposed to having a detached head) in `electron/src/`
or some other dependencys repository. If that is the case, a `git checkout --detach HEAD` in the appropriate repository should do the trick.
This may also happen if you have checked out a branch (as opposed to having a detached head) in `${root}/src/`
or some other dependencys repository. If that is the case, a `git checkout --detach HEAD` in the
appropriate repository should do the trick.
### I'm being asked for a username/password for chromium-internal.googlesource.com
@@ -315,16 +395,6 @@ If you see a prompt for `Username for 'https://chrome-internal.googlesource.com'
your locally installed version of Visual Studio (by default, `depot_tools` will
try to download a Google-internal version that only Googlers have access to).
### `e` Module not found
If `e` is not recognized despite running `npm i -g @electron/build-tools`, ie:
```sh
Error: Cannot find module '/Users/<user>/.electron_build_tools/src/e'
```
We recommend installing Node through [nvm](https://github.com/nvm-sh/nvm). This allows for easier Node version management, and is often a fix for missing `e` modules.
### RBE authentication randomly fails with "Token not valid"
This could be caused by the local clock time on the machine being off by a small amount. Use [time.is](https://time.is/) to check.

View File

@@ -6,7 +6,7 @@ Follow the guidelines below for building **Electron itself** on macOS, for the p
## Prerequisites
* macOS >= 11.6.0
* macOS >= 12
* [Xcode](https://developer.apple.com/technologies/tools/). The exact version
needed depends on what branch you are building, but the latest version of
Xcode is generally a good bet for building `main`.
@@ -40,7 +40,7 @@ If you are on arm64 architecture, the build script may be pointing to the wrong
### Certificates fail to verify
installing [`certifi`](https://pypi.org/project/certifi/) will fix the following error:
Installing [`certifi`](https://pypi.org/project/certifi/) will fix the following error:
```sh
________ running 'python3 src/tools/clang/scripts/update.py' in '/Users/<user>/electron'

View File

@@ -28,7 +28,7 @@ with breakpoints inside Electron's source code.
format.
* **ProcMon**: The [free SysInternals tool][sys-internals] allows you to inspect
a processes parameters, file handles, and registry operations.
a process's parameters, file handles, and registry operations.
## Attaching to and Debugging Electron

View File

@@ -4,12 +4,40 @@ The source code of Electron is separated into a few parts, mostly
following Chromium on the separation conventions.
You may need to become familiar with
[Chromium's multi-process architecture](https://dev.chromium.org/developers/design-documents/multi-process-architecture)
[Chromium's multi-process architecture](https://www.chromium.org/developers/design-documents/multi-process-architecture/)
to understand the source code better.
## Structure of Source Code
## Project structure
```diff
Electron is a complex project containing multiple upstream dependencies, which are tracked in source
control via the [`DEPS`](https://github.com/electron/electron/blob/main/DEPS) file. When
[initializing a local Electron checkout](./build-instructions-gn.md), Electron's source code is just one
of many nested folders within the project root.
The project contains a single `src` folder that corresponds to a specific git checkout of
[Chromium's `src` folder](https://source.chromium.org/chromium/chromium/src). In addition, Electron's
repository code is contained in `src/electron` (with its own nested git repository), and other
Electron-specific third-party dependencies (e.g. [nan](https://github.com/nodejs/nan) or
[node](https://github.com/nodejs/node)) are located in `src/third_party` (along with all other
Chromium third-party dependencies, such as WebRTC or ANGLE).
For all code outside of `src/electron`, Electron-specific code changes are maintained via git patches.
See the [Patches](./patches.md) development guide for more information.
```plaintext
Project Root
└── src
├── electron
├── third_party
│   ├── nan
│   ├── electron_node
│   └── ...other third party deps
└── ...other folders
```
## Structure of Electron source code
```plaintext
Electron
├── build/ - Build configuration files needed to build with GN.
├── buildflags/ - Determines the set of features that can be conditionally built.
@@ -25,24 +53,23 @@ Electron
├── lib/ - JavaScript/TypeScript source code.
| ├── browser/ - Main process initialization code.
| | ├── api/ - API implementation for main process modules.
| | └── remote/ - Code related to the remote module as it is
| | used in the main process.
| ├── common/ - Relating to logic needed by both main and renderer processes.
| | └── api/ - API implementation for modules that can be used in
| | both the main and renderer processes
| ├── isolated_renderer/ - Handles creation of isolated renderer processes when
| | contextIsolation is enabled.
| ├── node/ - Initialization code for Node.js in the main process.
│   ├── preload_realm/ - Initialization code for sandboxed renderer preload scripts.
│   │   └── api/ - API implementation for preload scripts.
| ├── renderer/ - Renderer process initialization code.
| | ├── api/ - API implementation for renderer process modules.
| | ├── extension/ - Code related to use of Chrome Extensions
| | | in Electron's renderer process.
| | ├── remote/ - Logic that handles use of the remote module in
| | | the main process.
| | └── web-view/ - Logic that handles the use of webviews in the
| | renderer process.
| ├── sandboxed_renderer/ - Logic that handles creation of sandboxed renderer
| | | processes.
| | └── api/ - API implementation for sandboxed renderer processes.
│   ├── utility/ - Utility process initialization code.
│   │   └── api/ - API implementation for utility process modules.
| └── worker/ - Logic that handles proper functionality of Node.js
| environments in Web Workers.
├── patches/ - Patches applied on top of Electron's core dependencies
@@ -67,27 +94,30 @@ Electron
| | └── resources/ - Icons, platform-dependent files, etc.
| ├── renderer/ - Code that runs in renderer process.
| | └── api/ - The implementation of renderer process APIs.
| ── common/ - Code that used by both the main and renderer processes,
| | including some utility functions and code to integrate node's
| | message loop into Chromium's message loop.
| └── api/ - The implementation of common APIs, and foundations of
| Electron's built-in modules.
| ── common/ - Code that used by both the main and renderer processes,
| | | including some helper functions and code to integrate node's
| | | message loop into Chromium's message loop.
| | └── api/ - The implementation of common APIs, and foundations of
| | Electron's built-in modules.
│   ├── services/node/ - Provides a Node.js runtime to utility processes.
│   └── utility - Code that runs in the utility process.
├── spec/ - Components of Electron's test suite run in the main process.
├── typings/ - Internal TypeScript types that aren't exported in electron.d.ts.
└── BUILD.gn - Building rules of Electron.
```
## Structure of Other Directories
## Structure of other Electron directories
* **.github** - GitHub-specific config files including issues templates, CI with GitHub Actions and CODEOWNERS.
* **dist** - Temporary directory created by `script/create-dist.py` script
when creating a distribution.
* **node_modules** - Third party node modules used for building.
* **npm** - Logic for installation of Electron via npm.
* **out** - Temporary output directory of `ninja`.
* **out** - Temporary output directory for `siso`.
* **script** - Scripts used for development purpose like building, packaging,
testing, etc.
```diff
```plaintext
script/ - The set of all scripts Electron runs for a variety of purposes.
├── codesign/ - Fakes codesigning for Electron apps; used for testing.
├── lib/ - Miscellaneous python utility scripts.

View File

@@ -99,7 +99,7 @@ Using `autoUpdater` as an example:
## Methods
### `autoUpdater.setFeedURL(url[, requestHeaders])`
### `autoUpdater.setFeedURL(options)`
```
### Classes

Some files were not shown because too many files have changed in this diff Show More