openclaw/openclaw · error

Location probe returned an empty URL

Error message

Location probe returned an empty URL

What it means

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.

Source

Thrown at extensions/browser/src/browser/routes/agent.act.ts:79

type ExistingSessionOperation = ChromeMcpOperationOptions & {
  profileName: string;
  profile?: ChromeMcpProfileOptions;
  userDataDir?: string;
  targetId: string;
};

async function readExistingSessionLocationHref(params: ExistingSessionOperation): Promise<string> {
  const currentUrl = await evaluateChromeMcpScript({
    ...params,
    fn: "() => window.location.href",
  });
  if (typeof currentUrl !== "string") {
    throw new Error("Location probe returned a non-string result");
  }
  const normalizedUrl = currentUrl.trim();
  if (!normalizedUrl) {
    throw new Error("Location probe returned an empty URL");
  }
  return normalizedUrl;
}

async function assertExistingSessionPostInteractionNavigationAllowed(
  params: ExistingSessionOperation &
    BrowserNavigationPolicyOptions & {
      listTabs: () => Promise<Array<{ targetId: string; url: string }>>;
      initialTabTargetIds: ReadonlySet<string>;
    },
): Promise<void> {
  const navigationPolicy = withBrowserNavigationPolicy(params.ssrfPolicy, {
    browserProxyMode: params.browserProxyMode,
  });
  if (!navigationPolicy.ssrfPolicy && !navigationPolicy.browserProxyMode) {
    return;
  }
  const listTabs = params.listTabs;

View on GitHub (pinned to 01804a7531)

Solutions

  1. Navigate to a real URL before issuing actions — use a navigate request to load a page first
  2. If the page is mid-navigation, add a short wait before the action to let it settle
  3. Disable SSRF/proxy navigation policy if the blank-page check is a false positive for your use case
  4. Retry after ensuring the tab has committed to a concrete http(s) URL
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await fetch('/act', { method: 'POST', body: JSON.stringify(action) });
} catch (err) {
  if (err.message?.includes('Location probe returned an empty URL')) {
    // Page is likely about:blank or mid-navigation — navigate first then retry
    await navigateToUrl(targetId, 'https://example.com');
    return retryAction(action);
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/9f0203a834ba548a. Report an issue: GitHub.