mirror of
https://github.com/electron/electron.git
synced 2026-10-28 11:44:46 +08:00
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.