diff --git a/extension/dist/background.js b/extension/dist/background.js index a457002..4698850 100644 --- a/extension/dist/background.js +++ b/extension/dist/background.js @@ -6,7 +6,7 @@ const WS_RECONNECT_MAX_DELAY = 6e4; const attached = /* @__PURE__ */ new Set(); function isDebuggableUrl$1(url) { - if (!url) return false; + if (!url) return true; return !url.startsWith("chrome://") && !url.startsWith("chrome-extension://"); } async function ensureAttached(tabId) { @@ -242,6 +242,7 @@ async function getAutomationWindow(workspace) { automationSessions.set(workspace, session); console.log(`[opencli] Created automation window ${session.windowId} (${workspace})`); resetWindowIdleTimer(workspace); + await new Promise((resolve) => setTimeout(resolve, 200)); return session.windowId; } chrome.windows.onRemoved.addListener((windowId) => { @@ -302,7 +303,7 @@ async function handleCommand(cmd) { } } function isDebuggableUrl(url) { - if (!url) return false; + if (!url) return true; return !url.startsWith("chrome://") && !url.startsWith("chrome-extension://"); } async function resolveTabId(tabId, workspace) { diff --git a/extension/manifest.json b/extension/manifest.json index b438cd8..92c31af 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "OpenCLI", - "version": "1.2.4", + "version": "1.2.5", "description": "Bridge between opencli CLI and your browser — execute commands, read cookies, manage tabs.", "permissions": [ "debugger", diff --git a/extension/package.json b/extension/package.json index 617a8e0..3db6809 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,6 +1,6 @@ { "name": "opencli-extension", - "version": "1.2.4", + "version": "1.2.5", "private": true, "type": "module", "scripts": { diff --git a/extension/src/background.ts b/extension/src/background.ts index 5327831..64821dd 100644 --- a/extension/src/background.ts +++ b/extension/src/background.ts @@ -152,6 +152,8 @@ async function getAutomationWindow(workspace: string): Promise { automationSessions.set(workspace, session); console.log(`[opencli] Created automation window ${session.windowId} (${workspace})`); resetWindowIdleTimer(workspace); + // Brief delay to let Chrome load the initial data: URI tab + await new Promise(resolve => setTimeout(resolve, 200)); return session.windowId; } @@ -229,7 +231,7 @@ async function handleCommand(cmd: Command): Promise { /** Check if a URL can be attached via CDP (not chrome:// or chrome-extension://) */ function isDebuggableUrl(url?: string): boolean { - if (!url) return false; + if (!url) return true; // empty/undefined = tab still loading, allow it return !url.startsWith('chrome://') && !url.startsWith('chrome-extension://'); } diff --git a/extension/src/cdp.ts b/extension/src/cdp.ts index bcf1241..d742ff1 100644 --- a/extension/src/cdp.ts +++ b/extension/src/cdp.ts @@ -10,7 +10,7 @@ const attached = new Set(); /** Check if a URL can be attached via CDP */ function isDebuggableUrl(url?: string): boolean { - if (!url) return false; + if (!url) return true; // empty/undefined = tab still loading, allow it return !url.startsWith('chrome://') && !url.startsWith('chrome-extension://'); } diff --git a/package-lock.json b/package-lock.json index 3f509a5..fe247aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jackwener/opencli", - "version": "1.2.4", + "version": "1.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jackwener/opencli", - "version": "1.2.4", + "version": "1.2.5", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 9172122..8b1d35c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jackwener/opencli", - "version": "1.2.4", + "version": "1.2.5", "publishConfig": { "access": "public" },