jackwener/OpenCLI · warning
[opencli] data: URI was intercepted (${updated.url}), creati
Error message
[opencli] data: URI was intercepted (${updated.url}), creating fresh tab What it means
A console warning emitted when a reused tab was navigated to a blank page but, after re-fetching, its URL is still not debuggable — typically because the browser intercepted or transformed the navigation (e.g. a data: URI landed as the tab's URL or was blocked). The extension logs this and falls back to creating a fresh tab.
Source
Thrown at extension/src/background.ts:1582
const role = getOwnedWindowRole(leaseKey);
const group = existingSession?.owned ? await ensureOwnedContainerGroup(role, windowId, []) : null;
const scopedWindowId = group?.windowId ?? windowId;
const reusableTabId = await findReusableOwnedContainerTab(scopedWindowId, existingSession?.owned ? (group?.id ?? null) : undefined);
if (reusableTabId !== undefined) return { tabId: reusableTabId, tab: await chrome.tabs.get(reusableTabId) };
// No debuggable tab — another extension may have hijacked the tab URL.
// Only recycle arbitrary tabs for legacy unscoped sessions. Owned sessions
// without a group signal must create a fresh tab rather than overwrite user
// content in a window where an OpenCLI group may have disappeared.
const tabs = await chrome.tabs.query({ windowId: scopedWindowId });
const reuseTab = existingSession?.owned ? undefined : tabs.find(t => t.id);
if (reuseTab?.id) {
await chrome.tabs.update(reuseTab.id, { url: BLANK_PAGE });
await new Promise(resolve => setTimeout(resolve, 300));
try {
const updated = await chrome.tabs.get(reuseTab.id);
if (isDebuggableUrl(updated.url)) return { tabId: reuseTab.id, tab: updated };
console.warn(`[opencli] data: URI was intercepted (${updated.url}), creating fresh tab`);
} catch {
// Tab was closed during navigation
}
}
// Fallback: create a new tab
const newTab = await chrome.tabs.create({ windowId: scopedWindowId, url: BLANK_PAGE, active: true });
if (!newTab.id) throw new Error('Failed to create tab in automation container');
await ensureOwnedContainerGroup(role, scopedWindowId, [newTab.id]);
return { tabId: newTab.id, tab: await chrome.tabs.get(newTab.id) };
}
/** Build a page-scoped success result with targetId resolved from tabId */
async function pageScopedResult(id: string, tabId: number, data?: unknown): Promise<Result> {
const page = await identity.resolveTargetId(tabId);
return { id, ok: true, data, page };
}
View on GitHub (pinned to 49907e53dc)
Solutions
- Nothing needed — the extension automatically creates a fresh tab as fallback
- Avoid targeting data: URIs; serve content over http(s) instead
- Reload the interfering extensions or test in a clean profile
- Update Chrome if a newer build handles the navigation correctly
Defensive patterns
Strategy: fallback
Validate before calling
const updated = await chrome.tabs.get(reuseTab.id); if (!isDebuggable(updated.url)) await createFreshTab();
Type guard
const isDebuggable = (url) => typeof url === 'string' && /^https?:\/\//.test(url);
Prevention
- Avoid data: URIs as navigation targets
- Serve test content over http(s)
- Disable interfering extensions during automation
When it happens
Trigger: During tab creation with reuse, chrome.tabs.update to BLANK_PAGE completes but the resulting updated.url fails isDebuggableUrl — e.g. a data: URI was intercepted, a redirect chain ends on a non-debuggable page, or a site error page replaced the blank document.
Common situations: Navigating to data: URIs that Chrome blocks or wraps; extension interference with navigation; error/interstitial pages replacing the blank target.
Related errors
- [opencli] Tab ${tabId} drifted to window ${tab.windowId}, mo
- [opencli] Failed to move tab back: ${moveErr}
- [opencli] Tab ${tabId} URL is not debuggable (${tab.url}), r
- [opencli] Tab ${tabId} no longer exists, re-resolving
- [opencli] Navigate to ${targetUrl} timed out after 15s
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/34c2e237a0059306.
Report an issue: GitHub.