Commit Graph

30187 Commits

Author SHA1 Message Date
trop[bot]
ff343d4808 build(deps): bump dorny/paths-filter from 3.0.2 to 4.0.1 (#51410)
Bumps [dorny/paths-filter](https://github.com/dorny/paths-filter) from 3.0.2 to 4.0.1.
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](de90cc6fb3...fbd0ab8f3e)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
v41.4.0
2026-04-30 15:27:43 -04:00
electron-roller[bot]
5562011d1d chore: bump chromium to 146.0.7680.216 (41-x-y) (#51382)
* chore: bump chromium in DEPS to 146.0.7680.216

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2026-04-30 09:37:16 -04:00
Samuel Attard
c9a1cff273 fix: dispatch toast action and reply events from WinRT activation path (#51397)
fix: dispatch toast action and reply events from WinRT activation path (#51286)

* fix: dispatch toast action and reply events from WinRT activation path

ToastEventHandler::Invoke previously returned S_OK without dispatching
whenever the activation arguments looked structured (type=action,
type=reply, or contained &tag=), on the assumption that the COM
INotificationActivationCallback::Activate path would deliver the event
instead. That assumption only holds when Windows actually invokes the
COM activator — which it does for MSIX-packaged apps launched cold, and
for unpackaged apps with a properly-registered CLSID when the app is
not already running. For non-MSIX apps with activationType="foreground"
while the app is running (the common case), Windows raises only the
in-process WinRT Activated event, so action and reply were silently
dropped.

Dispatch structured activations through the same HandleToastActivation
the COM path uses. User input (reply text, selection values) is pulled
from IToastActivatedEventArgs2::UserInput, which carries the data the
COM callback would otherwise have received via
NOTIFICATION_USER_INPUT_DATA.

Also drop the &tag= term from the structured-args check. Plain clicks
in Electron-generated XML don't carry tag=, and a custom toast_xml that
puts tag= on a click argument should now dispatch as a click rather
than being silently dropped.

* fix: release HSTRING out-params from toast activation

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-29 23:58:36 -05:00
trop[bot]
8d1475e70b ci: backport secondary siso patch (#51392)
chore: backport secondary siso patch

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
2026-04-29 18:16:21 -05:00
Niklas Wenzel
7e0499d55d feat: support heap profiling in contentTracing (#51178)
* feat: support heap profiling in `contentTracing`

* chore: backport crrev.com/c/7603976 to fix DCHECK failure

* fix: heap profiling test flakes (#51224)
2026-04-29 11:29:46 -07:00
trop[bot]
86b483af5b fix: use no-op header client for Fetch-intercepted requests (#51371)
fix: use no-op header client for Fetch-intercepted requests (#50744)

* fix: use the non-pass-through path for Fetch-intercepted requests

* Revert "fix: use the non-pass-through path for Fetch-intercepted requests"

This reverts commit 395fb8bb8c.

* fix: use no-op header client for Fetch-intercepted requests

* fix: bring back `DCHECK` that was prematurely removed

* style: reformat code

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Noah Gregory <noahmgregory@gmail.com>
2026-04-29 18:42:45 +02:00
trop[bot]
3cd0af44cf fix: include permission element string resources in locale paks (#51373)
The `<geolocation>` HTML element looks up IDS_PERMISSION_REQUEST_GEOLOCATION
via ResourceBundle::GetLocalizedString(). These string IDs are defined in
third_party/blink/public/strings/permission_element_strings.grd.
Electron didn't include that in its pak file, causing CHECK(!data->empty()).

Ths PR adds the per-locale permission_element_strings paks and the
aggregated permission_element_generated_strings pak to electron_paks.gni.
This matches how it's done in `chrome/chrome_repack_locales.gni` and
in `chrome/chrome_paks.gni`.

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-29 17:57:00 +02:00
electron-roller[bot]
f596e35554 chore: bump chromium to 146.0.7680.208 (41-x-y) (#51089)
* chore: bump chromium in DEPS to 146.0.7680.201

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7680.208

* chore: update patches

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-28 12:38:31 -04:00
trop[bot]
9867bbbde8 docs: add further disposition description (#51369)
* docs: add further disposition description

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* add option descriptions

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* fix linter

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>
2026-04-28 11:14:58 -05:00
trop[bot]
6fd63cdba8 fix: prevent crash when calling contentTracing APIs before app is ready (#51352)
* fix: prevent crash when calling contentTracing APIs before app is ready

Added Browser::Get()->is_ready() guards to all contentTracing API functions (startRecording, stopRecording, getCategories, getTraceBufferUsage) so they reject their returned Promises with a clear error message instead of crashing when called before app.whenReady().

Added a crash-case fixture test that validates all four APIs reject properly before readiness and work normally after.

Co-authored-by: om-ghante <mr.omghante1@gmail.com>

* chore: fix linter error in `spec/fixtures/crash-cases/content-tracing-before-ready/` (#51356)

chore: fix linter error in spec/fixtures/crash-cases/content-tracing-before-ready/

introduced earlier today in 6f2e5cd4

* chore: make linter happy

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: om-ghante <mr.omghante1@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-28 11:08:11 -05:00
trop[bot]
a629331619 fix: validate header name and value in webRequest.onBeforeSendHeaders (#51365)
* fix: validate header name and value in webRequest.onBeforeSendHeaders

Chromium's net::HttpRequestHeaders::SetHeader() uses CHECK() to enforce
valid header names and values, which causes a fatal crash if the caller
passes invalid strings. When users modify requestHeaders in the
onBeforeSendHeaders callback with invalid header names (e.g. containing
spaces) or invalid header values (e.g. containing CRLF), the
gin::Converter<net::HttpRequestHeaders>::FromV8() calls SetHeader()
directly, triggering the CHECK and crashing the process.

This change adds pre-validation using net::HttpUtil::IsValidHeaderName()
and net::HttpUtil::IsValidHeaderValue() before calling SetHeader(),
silently skipping invalid headers instead of crashing.

Co-authored-by: loufulton <loufulton.cz@gmail.com>

* Update shell/common/gin_converters/net_converter.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: loufultoncz-coder <loufulton.cz@gmail.com>

* Update spec/api-web-request-spec.ts

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: loufultoncz-coder <loufulton.cz@gmail.com>

* fix: lint

Co-authored-by: loufulton <loufulton.cz@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: loufulton <loufulton.cz@gmail.com>
2026-04-28 11:07:36 -05:00
trop[bot]
248ccef775 fix: add MicrotasksScope for worker exit emit in ContextWillDestroy (#51348)
a39108c5a4 (#47244) replaced gin_helper::EmitEvent with a direct
`v8::Function::Call()` in `WebWorkerObserver::ContextWillDestroy`
to avoid re-entering the microtask checkpoint during worker teardown.

V8 `DCHECK()`s that a policy is set. Under the old code path, this
happened with a node::CallbackScope. Under the new code path, it's
possible for a policy to not be set, causing that `DCHECK()` to fail.

This PR copies a39108c5a4's changes in `ShareEnvironmentWithContext()`:
it explicitly adds a `kDoNotRunMicrotasks` scope.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-27 16:52:26 -07:00
trop[bot]
dd74ff3451 fix: honor webContents.print dpi horizontal/vertical options (#51355)
* fix: honor webContents.print dpi horizontal/vertical options

Co-authored-by: Kunal Dubey <xakep8@protonmail.com>

* style: fix clang-format in print dpi parsing

Co-authored-by: Kunal Dubey <xakep8@protonmail.com>

* style: extract print dpi key constants

Co-authored-by: Kunal Dubey <xakep8@protonmail.com>

* fix: use local dpi constants in print options parser

Co-authored-by: Kunal Dubey <xakep8@protonmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kunal Dubey <xakep8@protonmail.com>
2026-04-27 18:36:54 -05:00
trop[bot]
d0afb91da4 fix: make macOS text replacement work on contenteditable (#51343)
* fix: make macOS text replacement work on `contenteditable` (#51289)

* fix: make macOS text replacement work on `contenteditable`

* fix: remove accidentally included patch line

Co-authored-by: Noah Gregory <noahmgregory@gmail.com>

* chore: update patches (trivial only)

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Noah Gregory <noahmgregory@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-27 16:57:02 -04:00
Erick Zhao
b88bbb9ca6 docs: mention pre-release installation (#51045) 2026-04-27 11:09:18 -05:00
Charles Kerr
dea65bddd4 fix: crash in AutofillPopup teardown (#51321)
fix: crash in AutofillPopup teardown (#51302)

Fix a crash in AutofillPopupView::Show() when the popup
tried to show itself after the parent's native view had
already gone away during teardown.

2026-04-23T20:44:32.7015810Z Received signal 11 SEGV_ACCERR 000000000160
2026-04-23T20:44:32.9322010Z 4   Electron Framework  ... views::Widget::IsVisible() const + 28
2026-04-23T20:44:32.9528810Z 6   Electron Framework  ... electron::AutofillPopupView::Show() + 200
2026-04-23T20:44:32.9632090Z 7   Electron Framework  ... electron::AutofillPopup::CreateView(...) + 1380
2026-04-23T20:44:32.9749770Z 8   Electron Framework  ... electron::AutofillDriver::ShowAutofillPopup(...) + 736
2026-04-23T20:44:33.0015220Z ✗ Electron tests failed with kill signal SIGSEGV.
2026-04-27 10:49:00 +02:00
trop[bot]
57fee9f2c1 fix: remove insets on fullscreen windows on Windows (#51332)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mitchell Cohen <mitch.cohen@me.com>
2026-04-26 19:13:13 -05:00
trop[bot]
d6bc5b6753 test: fix race in reentrant loadURL() ready-to-commit test (#51323)
test: fix race in reentrant loadURL() ready-to-commit test

Fix 'fails if loadurl is called after the navigation is ready to commit'
by using a done() callback to ensure the test waits for did-fail-load
before exiting.

Previously, the test would return and call afterEach(closeAllWindows),
potentially destroying the window while navigation was in flight.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-26 12:30:12 -05:00
Keeley Hammond
51f35cf926 chore: cherry-pick 1 change from chromium (#51319) 2026-04-26 09:38:42 -05:00
reito
93cc936a94 fix: offscreen rendering with correct screen info. (#50375)
* fix: osr use correct screen info.

Co-authored-by: reito <reito@chromium.org>

* chore: e patches all (trivial only)

* 更新 breaking-changes.md

* chore: fixup .patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2026-04-24 12:36:54 -04:00
trop[bot]
48401169d9 build: restrict npm tarball contents to an explicit allowlist (#51305)
* build: restrict npm tarball contents to an explicit allowlist

The npm publish flow runs `npm pack` in a staging temp dir, but
`npm/package.json` had no `files` field — so any file that happened
to land in that dir was packed into the published tarball.

Recent releases (41.2.1+, 40.9.1+, 39.8.8+) shipped a self-referential
`.npm-cache/_logs/*-debug-0.log` (npm's own debug log, written into
the pack dir before pack finishes reading files) and a stray copy of
`SHASUMS256.txt` that duplicates the info already in `checksums.json`.

Add an explicit `files` allowlist so only the intended contents are
packaged, regardless of staging-dir contamination. `package.json`,
`README.md`, and `LICENSE` are auto-included by npm.

Fixes #51290.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* build: include LICENSE and README.md in files allowlist

These are auto-included by npm regardless, but listing them makes the
intended contents of the tarball self-documenting alongside the other
entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2026-04-24 13:05:22 +00:00
Charles Kerr
c4965cb580 test: add linux coverage for default protocol client APIs (#51288)
Add Linux-only app tests to check the default protocol handler.
This includes adding reusable XDG mock fixtures.

Manual backport of 2c46abe from `main`.
2026-04-23 13:47:37 -05:00
trop[bot]
f24e43dc75 build: drop script/run-gn-format.py (#51282)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2026-04-23 14:52:28 +02:00
Keeley Hammond
a3275d605c chore: cherry-pick 6 changes from chromium (41-x-y) (#51259)
* chore: cherry-pick 3 changes from chromium (41-x-y)

CVE-2026-5866: Use after free in Media
https://chromium-review.googlesource.com/c/chromium/src/+/7673253

CVE-2026-5867: Heap buffer overflow in WebML
https://chromium-review.googlesource.com/c/chromium/src/+/7677538

CVE-2026-5869: Heap buffer overflow in WebML
https://chromium-review.googlesource.com/c/chromium/src/+/7687895

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

* chore: cherry-pick 3 changes from chromium

Backported security fixes for 493319454, 494158331, 496281816.

cherry-pick 7673406 from chromium
[WebNN] Reject fusing per-channel quantized gemm if the quantized dimension of filter is not 0
Bug: 493319454
Change-Id: Ib7e1236a535dc6a34d3ff9b9f0124a101bd89dbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7673406

cherry-pick 7687618 from chromium
[WebNN] Prevent Pool2d indirection buffer overflow in TFLite
Bug: 494158331
Change-Id: I984556f0f608badf8f73fcbb096da5f41170a958
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7687618

cherry-pick 848cf5567223 from chromium
Check parent nodes when handling vector node insertions.
Fixed: 496281816
Change-Id: I0fc6956d1c09fcb7ea54d94819fdf1cb06fbd9e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7705373

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

* chore: reconcile build issues with patches

* chore: fixup patches

---------

Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
2026-04-23 01:05:16 -07:00
Samuel Attard
2674aa64b9 ci: centralize build-image SHA and pre-seed node-gyp headers (41-x-y) (#51275)
ci: centralize build-image SHA and pre-seed node-gyp headers (#51148)

* ci: centralize build-image SHA and pre-seed node-gyp headers

- Add .github/actions/build-image-sha as the single source of truth for
  the ghcr.io/electron/build (and arch-tagged electron/test) image SHA,
  with an optional override input for workflow_dispatch.
- Refactor build.yml, apply-patches.yml, build-git-cache.yml,
  clean-src-cache.yml, clean-orphaned-cache-uploads.yml, and the three
  publish workflows to resolve the SHA via a small ubuntu-slim setup job
  instead of hardcoding it in each file.
- Bump the image to daad061f (electron/build-images#68, which pre-warms
  the node-gyp header cache in the Linux images).
- Run the build.yml setup job on ubuntu-slim instead of ubuntu-latest.
- In install-dependencies (and the inline yarn installs in
  pipeline-electron-lint and generate-types), link deps with
  --mode=skip-build first, run `node-gyp install` with up to 3 retries
  (5s backoff) to populate the header cache, then run the build phase.
  This avoids the parallel-download race that intermittently fails the
  first native-addon configure with an empty common.gypi on cold
  macOS/Windows runners.

* ci: skip node-gyp header pre-seed on Linux

* ci: invoke node-gyp via its JS entrypoint for Windows compat

(cherry picked from commit f7ba34064e)
2026-04-23 09:54:07 +02:00
Keeley Hammond
47d85799a5 chore: cherry-pick 1 change from skia (#51264)
* chore: cherry-pick 8c705ac86366 from skia

Use SkSafeMath to prevent overflow in pixel offset calculations.

Bug:b/495534710
Change-Id: I0b2a684b5ad1105c7d25418556e40b4d9f511daf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1481416
Commit-Queue: Stephen Nusko <nuskos@google.com>
Reviewed-by: Herb Derby <herb@google.com>

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

* chore: update patch

---------

Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
2026-04-23 09:50:22 +02:00
Samuel Attard
ce0739ad4f fix: ensure corsEnabled: false protocol handlers do not work across protocols (41-x-y) (#51270)
fix: ensure corsEnabled: false protocol handlers do not work across protocols (#51152)

* fix: ensure corsEnabled: false protocol handlers do not work across protocols

Subresource requests for registered custom protocols are routed to
ElectronURLLoaderFactory via the renderer's per-scheme URLLoaderFactoryBundle
entry, which bypasses the network service's CorsURLLoaderFactory. This meant a
cross-origin page could fetch() a scheme registered with {supportFetchAPI: true}
and read the response body even when {corsEnabled: true} was not set.

Replicate CorsURLLoader::StartRequest's kCorsDisabledScheme gate in
ElectronURLLoaderFactory::CreateLoaderAndStart so cross-origin mode=cors
requests to such schemes fail before the JS handler runs, and tag cross-origin
mode=no-cors responses as opaque so the body is not script-readable while <img>
and similar subresource loads continue to work.

Re-enable the long-disabled "disallows CORS and fetch requests when only
supportFetchAPI is specified" test, add coverage for the opaque/no-cors,
same-origin, handler-not-invoked, corsEnabled-unaffected and net.fetch-unaffected
cases, and migrate spec helpers that were exercising a {supportFetchAPI: true}
scheme cross-origin to a corsEnabled scheme.

* chore: oxfmt

(cherry picked from commit 92f0993d94)
2026-04-23 09:49:23 +02:00
David Sanders
285efaf87b build: don't use //third_party/depot_tools in lint.js (#51261)
build: don't use //third_party/depot_tools in lint.js (#51034)

* build: don't use //third_party/depot_tools in lint.js

* chore: also run python3 through depot tools
2026-04-22 16:58:23 -07:00
electron-roller[bot]
12410f16ba chore: bump node to v24.15.0 (41-x-y) (#51088)
* chore: bump node in DEPS to v24.15.0

* fix(patch): adapt V8 sandboxed pointers for buffer kMaxLength

Upstream replaced the hardcoded buffer length limit with a runtime
kMaxLength variable, making the patch's regex workaround for sandbox
vs non-sandbox limits unnecessary. Dropped the test-buffer-concat.js
hunk.

Ref: https://github.com/nodejs/node/pull/61721

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(patch): adapt deprecated GetIsolate for upstream refactors

Upstream removed Uint32ToName from node_contextify.cc and
node_webstorage.cc, and renamed LookupAndCompile to
LookupAndCompileFunction in node_builtins.cc. Updated the
GetIsolate deprecation patch to match.

Ref: https://github.com/nodejs/node/pull/60846
Ref: https://github.com/nodejs/node/pull/60518

* chore: remove upstreamed patch

The fix_generate_config_gypi_needs_to_generate_valid_json patch
applied with "No changes -- Patch already applied", confirming
the fix has been incorporated upstream.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* node#60518: src: build v8 tick processor as built-in source text modules

Upstream restructured BuiltinLoader to auto-detect parameters by
source type, removing the custom parameters overload. Added a new
LookupAndCompileFunction overload for embedder scripts and updated
node_util.cc to use it. Also suppressed exit-time-destructors
warning from builtin_info.h in node_includes.h.

Ref: https://github.com/nodejs/node/pull/60518

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(patch): add LookupAndCompileFunction overload for embedder scripts

Ref: https://github.com/nodejs/node/pull/60518

* fix(patch): stop using v8::PropertyCallbackInfo<T>::This() in sqlite

Ref: https://github.com/nodejs/node/issues/60616

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(patch): correct thenable snapshot for Chromium V8

The snapshot used `*` wildcards which don't match the actual output.
Regenerated with NODE_REGENERATE_SNAPSHOTS=1 to capture the correct
concrete frame + <node-internal-frames> output.

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

* fix(patch): GN build files for new merve dep

Ref: https://github.com/nodejs/node/pull/61984

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(patch): adapt fileExists patch to resolve.js module reorg

Ref: https://github.com/nodejs/node/pull/61769

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(patch): adapt new crypto tests for BoringSSL

Guard aes-128-ccm test in test-crypto-authenticated.js behind cipher
availability check. Skip Ed448/X448/DSA tests in
test-crypto-key-objects-raw.js. Skip AES-KW tests in
test-webcrypto-promise-prototype-pollution.mjs.

Ref: https://github.com/nodejs/node/pull/62240
Ref: https://github.com/nodejs/node/pull/62455

* fix(patch): guard DH key test for BoringSSL

BoringSSL does not support loading DH private keys from PEM, causing
createPrivateKey to throw UNSUPPORTED_ALGORITHM.

Ref: https://github.com/nodejs/node/pull/62240

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(patch): adapt cppgc_heap patch to upstream CppHeap handling

Upstream Node moved CppHeap creation to run unconditionally before
Isolate::Initialize via settings.cpp_heap. The patch's embedder-set
params->cpp_heap was being overwritten by the new upstream default.
Fold the patch into the upstream block so settings.cpp_heap still
wins, an embedder-set params->cpp_heap is preserved, and a default
is only created when neither is provided.

Ref: https://github.com/nodejs/node/pull/58070

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: update patches (trivial only)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(patch): normalize brotli decoder error codes for Chromium's brotli

Electron uses Chromium's brotli (via the unbundling patch), which
returns just the NAME from BrotliDecoderErrorString() instead of the
full "_ERROR_..." prefix Node's bundled brotli emits. Upstream's
web-compression spec-compliance fix (nodejs/node#62107) classifies
brotli failures as TypeError via the "ERR__ERROR_" prefix, which
doesn't match Chromium's output — so DecompressionStream surfaced a
plain Error and the WPT decompression-bad-chunks suite failed for
brotli. Normalize the emitted error code on the C++ side so the JS
layer works against either brotli build.

Ref: https://github.com/nodejs/node/pull/62107

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v41.3.0
2026-04-22 21:52:17 +02:00
trop[bot]
e7f168f326 fix: trigger ShipIt Mach service after SMJobSubmit to unblock on-demand-only mode (#51210)
fix: trigger ShipIt Mach service after SMJobSubmit to unblock on-demand-only mode (#51191)

* fix: trigger ShipIt Mach service to unblock on-demand-only mode

When a macOS system update is pending, launchd puts the user domain
into on-demand-only mode, preventing ShipIt from starting. The
MachServices endpoint in the job dictionary was registered but never
connected to (a leftover from the XPC removal in 2013).

Instead of removing MachServices, fire a lightweight XPC connection
to the Mach port after SMJobSubmit. This satisfies launchd's
on-demand trigger, starting ShipIt immediately while preserving
KeepAlive retry behavior.



* fix: add ResetAtClose to ShipIt MachServices to prevent standing demand

The XPC trigger message sent after SMJobSubmit sits in the Mach port's
kernel queue unread. Without ResetAtClose, this creates standing demand
that causes launchd to respawn ShipIt after a successful exit(0),
defeating KeepAlive.SuccessfulExit = NO.

Set ResetAtClose on the MachServices registration so launchd tears down
and recreates the port when ShipIt exits, flushing the stale trigger.



* fix: drain Mach port before exit(0) instead of using ResetAtClose

ResetAtClose blocks KeepAlive.SuccessfulExit retries in on-demand-only
mode because it removes demand when the port resets. Instead, have
ShipIt drain its own Mach service port (via bootstrap_check_in +
mach_msg) before each exit(EXIT_SUCCESS). This clears the standing
demand from the trigger message so launchd won't respawn after a
successful exit, while leaving the message in place on failure exits
so KeepAlive retries remain demand-backed.

Tested in on-demand-only mode (pending macOS update):
- exit(0) + drain: 1 run, no respawn ✓
- exit(1) + no drain: continuous respawn every 2s ✓



* chore: update patch

* chore: harden ShipIt Mach trigger and simplify port drain

Scope the XPC trigger to the unprivileged path and add a send barrier
so the connection cannot be released before the message is on the wire.
Reduce drainMachServicePort to bootstrap_check_in (process exit flushes
the queue), dropping the mach_msg loop whose buffer/dealloc usage was
incorrect, and remove the no-op drain from the posix_spawn'd launch
helper. Patch filename regenerated to match the commit subject.

* fix: restore explicit mach_msg drain in drainMachServicePort

bootstrap_check_in alone does not prevent respawn: launchd tracks
outstanding demand independently of the receive right's lifetime, so the
queued trigger message must be explicitly dequeued with mach_msg before
exit(0). Verified empirically (check-in-only: 5 respawns in 10s; full
drain: 1 run). Keep the correctness fixes from the previous commit
(4K buffer, mach_msg_destroy on each receive, no mach_port_deallocate).

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2026-04-22 11:47:27 -07:00
trop[bot]
e105d66074 fix: ignore draggable regions in hidden WebContentsView (#51246)
fix: ignore draggable regions in hidden WebContentsView

Hidden child WebContentsViews were still contributing their draggable
regions to the parent window's non-client hit test, so clicks in the
area where a hidden view's draggable element would render still dragged
the window. Early-return HTNOWHERE when the view is not visible.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-22 10:34:59 -05:00
trop[bot]
57b26459d4 build: FTBFS when pdf is disabled (#51248)
fix: FTBFS when pdf is disabled

pdf_features.h has a static_assert that pdf is enabled

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-22 16:05:18 +02:00
trop[bot]
2c05608a76 fix: preserve transparency across setResizable toggles on Windows (#51217)
After #49428 made `NativeWindowViews::CanResize()` return `resizable_`
for frameless windows (instead of `resizable_ && thick_frame_`),
`HWNDMessageHandler::SizeConstraintsChanged()` started adding
`WS_THICKFRAME` to the window style whenever `CanResize()` reported true.
`WS_THICKFRAME` is incompatible with layered (translucent) windows and
destroys their transparency.

`SetContentSizeConstraints` already guards against this by skipping
`OnSizeConstraintsChanged()` when `!thick_frame_`. `SetResizable` did
not, so toggling resizability on a transparent window (e.g.
`setResizable(false)` then `setResizable(true)`) caused the Chromium
path to add `WS_THICKFRAME` and strip transparency.

Apply the same guard in `SetResizable`. Min/max constraints are still
enforced — Chromium reads them from the widget delegate on every
`WM_GETMINMAXINFO`, independent of `SizeConstraintsChanged()`.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-22 12:33:06 +02:00
trop[bot]
35aea3afcc fix: reset printToPDF queue after a rejection (#51221)
fix: reset printToPDF queue after a rejection

The module-scoped `pendingPromise` in `webContents.printToPDF` was chained
with `.then(onFulfilled)` and never cleared. Once a call rejected (e.g.
an out-of-range `pageRanges` like `"999"`), subsequent calls chained onto
the rejected promise and short-circuited without ever invoking
`_printToPDF` — so every following call re-surfaced the original error.

Replace the shared variable with a per-`WebContents` `WeakMap` queue that
swallows prior rejections before chaining and clears its entry once the
tail drains.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-22 12:32:47 +02:00
trop[bot]
f111adcfc0 build: use Yarn JsZipImpl for node-modules link to fix arm32 OOM (#51231)
* build: use Yarn JsZipImpl for node-modules link step

Patch the vendored .yarn/releases/yarn-4.12.0.cjs so the node-modules
(and pnpm-loose) linker constructs its read-only ZipOpenFS with
customZipImplementation = JsZipImpl instead of the default WASM
LibZipImpl.

LibZipImpl loads each cache zip fully into the Emscripten WASM heap and
malloc's a WASM buffer per file read. With up to 80 zips held open, the
32-bit arm32v7 test container intermittently fails to allocate the ~9 MB
buffer for typescript/lib/typescript.js. Yarn's cross-FS copyFilePromise
swallows the real error and surfaces it as a generic
"EINVAL: invalid argument, copyfile", which has been failing ~1-in-3
linux-arm test shards at Install Dependencies since 2026-04-13.

JsZipImpl opens zips by fd, reads only the central directory, and pulls
individual entries into plain Node Buffers — no WASM heap involved.
There is no .yarnrc.yml or env knob for this, so the vendored release is
edited directly. .claude/README.md documents the patch and how to
re-apply it on Yarn upgrades.

Refs: yarnpkg/berry#3972, yarnpkg/berry#6722, yarnpkg/berry#6550

Co-authored-by: Sam Attard <sattard@anthropic.com>

* docs: move JsZipImpl patch notes to .yarn/README.md

Relocate the patch rationale next to the vendored release it documents,
reword the intro for its new home, and update the header comment in
yarn-4.12.0.cjs to point at .yarn/README.md.

Co-authored-by: Sam Attard <sattard@anthropic.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Sam Attard <sattard@anthropic.com>
2026-04-22 12:27:05 +02:00
trop[bot]
9d564abf41 test: add Linux-specific test for app.getApplicationNameForProtocol() (#51215)
* test: add Linux-specific test for getApplicationNameForProtocol()

On Linux, use XDG env vars to inject a mock that we can use
to test app.getApplicationNameForProtocol().

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! test: add Linux-specific test for getApplicationNameForProtocol()

better system mocks

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: make lint happy

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2026-04-21 16:42:34 -05:00
trop[bot]
fa920f882b ci: don't upload build stats on Windows if build fails (#51201)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2026-04-21 11:53:06 +00:00
trop[bot]
f258998fcb fix: intermittent CI failure is-not-alwaysOnTop (#51135)
* fix: intermittent CI failure is-not-alwaysOnTop

Ensure that the `always-on-top-changed` event always fires with the
right 'alwaysOnTop' boolean, regardless of interaction between
SetZOrderLevel() and MoveBehindTaskBarIfNeeded(). We know what the
value will be when all of the HWND events settle, so use that value.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* test: temporary commit to torture-test the new change with 1000 iterations

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* test: keep eventually-becomes-consistent test but do not loop 1000 times

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
v41.2.2
2026-04-20 15:25:00 -07:00
trop[bot]
2791b2465c chore: add Phase Three (node smoke tests) to Node.js upgrade skill (#51186)
Adds test suite workflow, BoringSSL incompatibility reference table,
snapshot regeneration instructions, and commit guidelines.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-20 14:42:13 -07:00
trop[bot]
b977376c5d fix: allow PDF viewer to show save file picker (#51073)
The PDF viewer's "save with changes" feature uses
`window.showSaveFilePicker()`, but the PDF extension runs in a
cross-origin iframe (chrome-extension:// inside the app's origin).
Chromium's File System Access API blocks cross-origin subframes from
showing file pickers unless the embedder explicitly allows them via
`ContentClient::IsFilePickerAllowedForCrossOriginSubframe()`.

Chrome overrides this in `ChromeContentClient` to allowlist the PDF
extension origin, but Electron never did — so the picker was always
blocked with a SecurityError.

This adds the same override to `ElectronContentClient`, allowing the
built-in PDF extension origin to bypass the cross-origin check.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-20 14:21:01 -07:00
trop[bot]
f47840be6a build: update ANGLE repository URL to GitHub mirror (#51170)
Clone angle from github.com/google/angle in fix-sync action

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-04-20 13:27:31 -07:00
trop[bot]
936347d024 docs: update versioning references (#51173)
* docs: update versioning references

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* fixups

Co-authored-by: Erick Zhao <erick@hotmail.ca>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2026-04-20 13:25:55 -07:00
trop[bot]
830a77cbee build: resolve electron_version from git when building in a worktree (#51165)
BUILD.gn previously hard-coded read_file(".git/packed-refs", ...) and
".git/HEAD" to derive electron_version. In a `git worktree` checkout
.git is a file containing a gitdir: pointer, not a directory, so GN's
read_file() fails and gn gen aborts unless override_electron_version is
set manually.

Ask git itself for the real locations via `git rev-parse --git-dir` /
`--git-common-dir` in a small helper script, and feed those resolved
paths to read_file() and the exec_script dependency list. Behaviour in
a plain clone is unchanged (both resolve to electron/.git/...), and the
tarball case still fails loudly with a pointer to
override_electron_version.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Sam Attard <sattard@anthropic.com>
2026-04-20 15:07:45 -05:00
trop[bot]
82ed28e817 fix: nodeIntegrationInWorker not working in AudioWorklet (#51006)
* fix: nodeIntegrationInWorker not working in AudioWorklet

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: deadlock on Windows when destroying non-AudioWorklet worker contexts

The previous change kept the WebWorkerObserver alive across
ContextWillDestroy so the worker thread could be reused for the next
context (AudioWorklet thread pooling, Chromium CL:5270028). This is
correct for AudioWorklet but wrong for PaintWorklet and other worker
types, which Blink does not pool — each teardown destroys the thread.

For those worker types, ~NodeBindings was deferred to the thread-exit
TLS callback. By that point set_uv_env(nullptr) had already run, so on
Windows the embed thread was parked in GetQueuedCompletionStatus with a
stale async_sent latch that swallowed the eventual WakeupEmbedThread()
from ~NodeBindings. uv_thread_join then blocked forever, deadlocking
renderer navigation. The worker-multiple-destroy crash case timed out
on win-x64/x86/arm64 as a result. macOS/Linux (epoll/kqueue) don't have
the latch and were unaffected.

Plumb is_audio_worklet from WillDestroyWorkerContextOnWorkerThread into
ContextWillDestroy. For non-AudioWorklet contexts, restore the
pre-existing behavior of calling lazy_tls->Set(nullptr) at the end of
the last-context cleanup so ~NodeBindings runs while the worker thread
is still healthy. AudioWorklet continues to keep the observer alive so
the next pooled context can share NodeBindings.

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: address review feedback

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: stop embed thread before destroying environments in worker teardown

FreeEnvironment (called via environments_.clear()) runs uv_run to drain
handle close callbacks. On Windows, both that uv_run and the embed
thread's PollEvents call GetQueuedCompletionStatus on the same IOCP
handle. IOCP completions are consumed by exactly one waiter, so the
embed thread can steal completions that FreeEnvironment needs, causing
uv_run to block indefinitely. On Linux/Mac epoll_wait/kevent can wake
multiple waiters for the same event so the race doesn't manifest.

Add NodeBindings::StopPolling() which cleanly joins the embed thread
without destroying handles or the loop, and allows PrepareEmbedThread +
StartPolling to restart it later. Call StopPolling() in
WebWorkerObserver::ContextWillDestroy before environments_.clear() so
FreeEnvironment's uv_run is the only thread touching the IOCP.

Split PrepareEmbedThread's handle initialization (uv_async_init,
uv_sem_init) from thread creation via a new embed_thread_prepared_ flag
so the handles survive across stop/restart cycles for pooled worklets
while the embed thread itself can be recreated.

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: address outstanding feedback

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2026-04-20 12:01:52 +02:00
Samuel Attard
d86cbe9284 chore: cherry-pick 27 changes from chromium, v8, angle, skia, pdfium, libaom (#51137)
* chore: cherry-pick b149a5c62d76 from angle

* chore: cherry-pick 4073d491fb55 from chromium

* chore: cherry-pick 0566b2f5f0d1 from skia

* chore: cherry-pick 8c1ead5a699f from chromium

* chore: cherry-pick 8b08fb7c9dce from chromium

* chore: cherry-pick be87466afecb from chromium

* chore: cherry-pick c215f8e6f049 from chromium

* chore: cherry-pick 036e5e8f69be from v8

* chore: cherry-pick a6357144e7bf from chromium

* chore: cherry-pick 3f9969421ad5 from skia

* chore: cherry-pick ca8a943c247c from pdfium

* chore: cherry-pick 07398289d921 from v8

* chore: cherry-pick 41bfbc009df8 from chromium

* chore: cherry-pick 4002a66778d2 from chromium

* chore: cherry-pick 23865499a86a from chromium

* chore: cherry-pick 7c11e1188705 from dawn

* chore: cherry-pick c81f01b469c4 from chromium

* chore: cherry-pick 1b69067db7d2 from chromium

* chore: cherry-pick d513cd2fe668 from chromium

* chore: cherry-pick bb8d4c29dfdb from chromium

* chore: cherry-pick 847b11ad2fa3 from chromium

* chore: cherry-pick bce2e6728279 from pdfium

* chore: cherry-pick eeb3e031eb89 from chromium

* chore: cherry-pick a068030f5179 from v8

* chore: cherry-pick 4 changes from libaom and add new patch dirs to config.json

* chore: update patches (e sync --3 resolved; drop dawn — no M146 upstream merge)

* chore: update patches

---------

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2026-04-19 12:47:43 -07:00
trop[bot]
7f61587762 fix: linux test shutdown error "AttributeError: type object 'DBusTestCase' has no attribute 'stop_dbus'" (#51150)
stop_dbus() was removed on 2025-09-14 by
99c4800e9e

I think CI isn't seeing this yet because its image has an older version.

This patched script should work on old & new versions of python-dbusmock.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-04-19 01:28:15 -07:00
Samuel Attard
03a05497a0 ci: build a patched siso for Windows builds (#51116)
ci: build a patched siso for Windows builds (#51077)

* ci: build a patched siso for Windows builds

The Windows Chromium builds intermittently fail during manifest load
with 'The parameter is incorrect.' (ERROR_INVALID_PARAMETER) out of
bindflt.sys. Root cause is a handle-relative NtCreateFile race in
siso/toolsupport/ninjautil/file_parser.go, which opens each subninja
twice — once in the outer goroutine and once more per chunk for
ReadAt. (*os.File).ReadAt is documented as safe for concurrent use,
so the extra open is redundant and removing it both halves the
CreateFileW calls per subninja and sidesteps the race.

Add a new build-siso-windows job on ubuntu-latest (runs in parallel
with checkout-windows) that:

- reads chromium_version from DEPS and pulls the matching siso_version
  SHA from the Chromium mirror's DEPS at that ref
- shallow-clones chromium.googlesource.com/build at that SHA
- applies the in-tree patches under .github/siso-patches/ via git am
- cross-compiles siso.exe for windows/amd64
- caches the binary keyed on siso SHA + sha256 of the patches, so
  subsequent runs hit the cache and skip the clone/patch/build steps
- uploads the result as a siso-windows-amd64 artifact

The Windows build jobs now depend on build-siso-windows, download the
artifact into $RUNNER_TEMP/siso, and export SISO_PATH, which
depot_tools/siso.py already honors. Mirrored into windows-publish.yml
and the regenerated pipeline-segment-electron-publish.yml so release
builds pick it up too.

Notes: none

* ci: extract siso build into a reusable workflow segment

Move the build-siso-windows job body into
pipeline-segment-build-siso-windows.yml and call it from both build.yml
and windows-publish.yml via workflow_call. Also pin actions/cache to
v5.0.5 and add version comments next to the action SHAs introduced by
this change.

(cherry picked from commit 5523130c92)
2026-04-18 03:46:10 -04:00
Samuel Attard
c2420b9f44 refactor: attach translator holder via v8::Function data slot (#51120)
refactor: attach translator holder via v8::Function data slot (#50867)

(cherry picked from commit bfa5c93332)
2026-04-17 16:49:56 -05:00
Samuel Attard
8f2ba3c176 fix: use fresh LazyNow for OnEndWorkItemImpl to fix TimeKeeper DCHECK (#51100)
fix: use fresh LazyNow for OnEndWorkItemImpl to fix TimeKeeper DCHECK (#50418)
2026-04-17 15:16:26 +02:00
trop[bot]
60abafe15c fix: fix types in devtools console for release (#51109)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2026-04-16 15:15:45 -07:00