Repository navigation
fix: deliver extension events to service workers - #55146
Merged
Merged
Conversation
Extension service workers register their event listeners with the browser over the extensions EventRouter interface, which was only bound for frames. Listeners added in a worker were never registered, so events such as storage.onChanged and alarms.onAlarm never reached it.
dsanders11
approved these changes
Oct 21, 2026
|
Release Notes Persisted
|
This was referenced Oct 21, 2026
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #55152 |
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #55153 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #55154 |
Closed
3 tasks done
saenzramiro
added a commit
to ramboxapp/electron-browser-shell
that referenced
this pull request
Nov 5, 2026
…es across a reload, and document what Electron 44 costs. - chrome-webRequest-spec.ts: new describe "from an MV3 service worker" that checks whether webRequest events registered at the top of an MV3 worker (fixture rpc-mv3) arrive. Red on Electron 44.5.1 and 44.9.3, green on stock 44.10.0 (it carries the backport of electron/electron#55146, "deliver extension events to service workers"), skipped on 43, which has no such events. The suite only measured MV2, which is why 44 looked fixed. - chrome-declarativeNetRequest-spec.ts: new case "keeps a dynamic rule across an unload and a reload of the extension" (green on 43 and 44; the fixture is small and does not trigger the real failure, the comment says so), and the wait of the static rulesets case goes from 2 s to 10 s. - src/renderer/index.ts: comment only, on the block that enables the static rulesets when the worker starts. It now documents the cost measured on Electron 44 (44.5.1, 44.9.3, 44.10.0): any updateEnabledRulesets, this one or the extension's own, leaves the extension without dynamic rules for the session, and without the call 44 does not restore the static ones on a second start either. Two variants (skip it by prefs, defer it 4 s) were tried and reverted because they change nothing. The code stays as it was. Verified: fork suite 313/313 (Electron 43) and the smoke of the 21 catalog extensions 21/21 with the 21 workers running. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Extension service workers register their event listeners with the browser over the extensions EventRouter interface, which was only bound for frames. Listeners added in a worker were never registered, so events such as storage.onChanged and alarms.onAlarm never reached it.
Checklist
npm testpassesRelease Notes
Notes: Fixed MV3 extension events not arriving to background service workers.