{"record":{"id":"9f0203a834ba548a","repo":"openclaw/openclaw","slug":"location-probe-returned-an-empty-url","errorCode":null,"errorMessage":"Location probe returned an empty URL","messagePattern":"Location probe returned an empty URL","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"extensions/browser/src/browser/routes/agent.act.ts","lineNumber":79,"sourceCode":"\ntype ExistingSessionOperation = ChromeMcpOperationOptions & {\n  profileName: string;\n  profile?: ChromeMcpProfileOptions;\n  userDataDir?: string;\n  targetId: string;\n};\n\nasync function readExistingSessionLocationHref(params: ExistingSessionOperation): Promise<string> {\n  const currentUrl = await evaluateChromeMcpScript({\n    ...params,\n    fn: \"() => window.location.href\",\n  });\n  if (typeof currentUrl !== \"string\") {\n    throw new Error(\"Location probe returned a non-string result\");\n  }\n  const normalizedUrl = currentUrl.trim();\n  if (!normalizedUrl) {\n    throw new Error(\"Location probe returned an empty URL\");\n  }\n  return normalizedUrl;\n}\n\nasync function assertExistingSessionPostInteractionNavigationAllowed(\n  params: ExistingSessionOperation &\n    BrowserNavigationPolicyOptions & {\n      listTabs: () => Promise<Array<{ targetId: string; url: string }>>;\n      initialTabTargetIds: ReadonlySet<string>;\n    },\n): Promise<void> {\n  const navigationPolicy = withBrowserNavigationPolicy(params.ssrfPolicy, {\n    browserProxyMode: params.browserProxyMode,\n  });\n  if (!navigationPolicy.ssrfPolicy && !navigationPolicy.browserProxyMode) {\n    return;\n  }\n  const listTabs = params.listTabs;","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/browser/src/browser/routes/agent.act.ts#L61-L97","documentation":"After confirming the Chrome MCP location probe returned a string, readExistingSessionLocationHref trims it and checks for emptiness. If window.location.href evaluates to a blank or whitespace-only string, the probe is treated as unreliable and this error fires. This happens on special pages like about:blank, during page transitions where location.href is momentarily empty, or on certain browser-internal pages.","triggerScenarios":"The existing-session tab is on about:blank or a data: URL with no content. The page is in the middle of a navigation — document is unloading and location.href returns empty. The tab was just opened and hasn't committed a URL yet. Certain chrome:// or devtools:// pages may expose an empty href.","commonSituations":"A new tab was opened programmatically but the navigation guard fires before the page loads. The action triggered a download or redirect that left the page in a transitional state. The profile opens to a blank page by default and the first action's post-interaction check hits this.","solutions":["Navigate to a real URL before issuing actions — use a navigate request to load a page first","If the page is mid-navigation, add a short wait before the action to let it settle","Disable SSRF/proxy navigation policy if the blank-page check is a false positive for your use case","Retry after ensuring the tab has committed to a concrete http(s) URL"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await fetch('/act', { method: 'POST', body: JSON.stringify(action) });\n} catch (err) {\n  if (err.message?.includes('Location probe returned an empty URL')) {\n    // Page is likely about:blank or mid-navigation — navigate first then retry\n    await navigateToUrl(targetId, 'https://example.com');\n    return retryAction(action);\n  }\n  throw err;\n}","preventionTips":["Navigate to a concrete http(s) URL before issuing actions on existing-session tabs","Avoid issuing actions on freshly-opened blank tabs — wait for a URL to commit first","If SSRF/proxy navigation policy is active, ensure the target URL is in the allowed set"],"tags":["runtime-error","chrome-mcp","existing-session","navigation-guard"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}