fix(browser): normalize resident webview reuse

Resident nodes restored from the parking host could carry stale offscreen styles after hot reload, so reapply the permanent parking path before returning them.
This commit is contained in:
Mohamed Boudra
2026-07-03 11:42:39 +02:00
parent ab62a023fd
commit 860fe92fdd
2 changed files with 35 additions and 1 deletions
@@ -117,13 +117,14 @@ export function ensureResidentBrowserWebview(input: {
const resident = residentWebviewsByBrowserId.get(browserId) ?? null;
if (resident?.isConnected) {
releaseResidentBrowserWebview(browserId, resident);
return resident;
}
const existing = findBrowserWebview(browserId, ownerDocument);
if (existing) {
if (existing.parentElement?.id === RESIDENT_BROWSER_HOST_ID) {
residentWebviewsByBrowserId.set(browserId, existing);
releaseResidentBrowserWebview(browserId, existing);
}
return existing;
}