Files
electron/lib
Samuel Attard 03ce8ca639 fix: removing a loaded <webview> threw "Invalid guestInstanceId" (#54089)
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.
2026-09-18 14:04:53 -04:00
..