From 9004966da6491b368d12abeeb175256eedb78a2a Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Sun, 8 Nov 2026 15:10:48 +0000 Subject: navigate: do not require the debugger Attaching first (for the Leave-site prompt) made chrome_navigate fail on a tab whose page holds another extension's frame, such as a 1Password inline prompt, which is exactly when navigating away is the way out. Attach is now best effort. --- .../chrome-profile-bridge/browser-extension/service_worker.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'extensions') diff --git a/extensions/chrome-profile-bridge/browser-extension/service_worker.js b/extensions/chrome-profile-bridge/browser-extension/service_worker.js index 7fbbbba..3dcb0f4 100644 --- a/extensions/chrome-profile-bridge/browser-extension/service_worker.js +++ b/extensions/chrome-profile-bridge/browser-extension/service_worker.js @@ -1981,8 +1981,15 @@ async function dispatch(action, params) { await registerInitScript(tab.id, params.initScript); } // Attach first: the debugger is how we hear about, and answer, a "Leave site?" prompt. - await attachDebugger(tab.id); - await cdp(tab.id, "Page.enable", {}).catch(() => undefined); + // Best effort: another extension's frame on the page (a password manager's inline prompt) + // makes Chrome refuse the attach, and navigating away is often how a stuck tab is freed. + // Without the debugger we cannot answer a Leave-site prompt, but the navigation still runs. + try { + await attachDebugger(tab.id); + await cdp(tab.id, "Page.enable", {}).catch(() => undefined); + } catch (error) { + console.warn(`[pi-chrome] navigating tab ${tab.id} without the debugger: ${error?.message || error}`); + } dialogPolicy.set(tab.id, { leave: params.leaveIfAsked === true }); const dialogDismissed = new Promise((resolve) => dialogWaiters.set(tab.id, resolve)); const waitsForLoad = params.waitUntilLoad !== false; -- cgit v1.2.3