Repository navigation
fix: removing a loaded <webview> threw "Invalid guestInstanceId" - #54089
Merged
Merged
Conversation
Removing a <webview> from the DOM tears down its internal iframe first, which destroys the guest and drops it from guestInstances. The element's disconnectedCallback then sends GUEST_VIEW_MANAGER_DETACH_GUEST for that id. Since #53684 the handler validates the id with getGuestForFrame() before detaching, so the already-gone guest made the sync IPC throw back into disconnectedCallback. The uncaught error also skipped the element's reset, so a removed <webview> that was re-inserted never got a new guest. Treat a detach for an unknown guest as a no-op again (as detachGuest() always did) and keep the sender-frame check for live guests. Fixes #53989.
|
Release note looks good now. |
jkleinsc
enabled auto-merge (squash)
September 18, 2026 17:42
jkleinsc
approved these changes
Sep 18, 2026
|
Release Notes Persisted
|
This was referenced Sep 18, 2026
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54096 |
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #54097 |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #54098 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54099 |
6 of 7 tasks
m-tabaza
added a commit
to opencx-labs/catamorphic
that referenced
this pull request
Oct 9, 2026
* Electron 45 beta so Google's sign-in accepts Work again
Chrome 156 is stable and Google's sign-in now refuses Work ("This browser
or app may not be secure"). Every Electron 44 release, 44.7.0 included,
carries Chromium 152; Electron 45.0.0-beta.1 carries Chromium
156.0.8078.12. The app already presents as plain Chrome, so the engine
version was the gap. The beta is pinned exactly.
- Screen sharing: Electron 45 reports getDisplayMedia to the permission
handler as display-capture instead of media with no media types. The
share picker now runs on display-capture, a granted share keeps the
page awake as before, and media maps only to camera and microphone.
- Electron 45.0.0-beta.1 carries the Invalid guestInstanceId fix
(electron/electron#54089, backport #54096), so the renderer guard and
the e2e harness filter are gone (ADR 0150, TODO.md).
- node-abi 4.37.0 in the lockfile so @electron/rebuild maps Electron 45
to its ABI (150); 4.33.0 reported 149.
- ADR 0150 records the upgrade and why; DESIGN.md entry for 2026-10-09.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Present Chrome's reduced user agent, and check what a page sees
Chrome's user agent names only its major version (Chrome/156.0.0.0);
Electron's carries the full one, which no Chrome sends. The fallback UA now
reduces it, and the full-version client hint takes the engine's real
version from process.versions.chrome instead of the UA.
browser-identity.e2e.ts checks a page's view: the request's User-Agent,
and in JavaScript the user agent, its brands and the full version list.
TODO.md records the stable pin and the async safeStorage follow-up.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Build Chrome's brand list the way Chromium does, and record the gaps
The placeholder brand was Chrome 150's ("Not;A=Brand") in a fixed order.
shared/chrome-brands.ts builds the list as Chromium's
GetGreasedUserAgentBrandVersion does, seeded by the major version, so
Chrome 156 is "Not:A-Brand";v="8", "Chromium";v="156",
"Google Chrome";v="156" in the header, navigator.userAgentData.brands
and its toJSON() alike (toJSON read Chromium's own list). Main and the
preload share it, from process.versions.chrome.
ADR 0150 and DESIGN.md record the reduced user agent and that headers are
not a full match (page loads carry no client hints). TODO.md: the
safeStorage entry covers isEncryptionAvailable and Electron 46's removal;
new follow-ups for page-load client hints and the legacy chromeMediaSource
capture path.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Closed
5 tasks done
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
Before: removing a
<webview>whose guest had loaded threwUncaught Error: Invalid guestInstanceId: Nout of the element'sdisconnectedCallback, and because the throw skipped the element reset, re-inserting that<webview>never created a new guest.After: the element is removed (and can be re-inserted) with no error, as it was before #53684.
Removing the element tears down its internal iframe first, which destroys the guest and drops it from
guestInstances;disconnectedCallbackthen sendsGUEST_VIEW_MANAGER_DETACH_GUESTfor an id that is already gone. #53684 putgetGuestForFrame()in front ofdetachGuest(), and it throws for an unknown id.How: the detach handler returns early when the id is no longer in
guestInstances— the no-opdetachGuest()always did for that case — and keeps the sender-frame check for live guests.Fixes #53989.
Checklist
Release Notes
Notes: Fixed an "Invalid
guestInstanceId" error when removing a loaded<webview>from the DOM.