Page.reload() silently no-ops from a stale CDP session; target loss silently falls back to about:blank

Author: axisrowCreated Sep 21, 2026Updated Sep 28, 2026

Summary

Two related silent-failure modes make a stale/hung page indistinguishable from a working one, and both fail without raising:

  1. Page.reload() (and evaluate('location.reload()')) silently no-ops from a CDP session that lived through a hung target. Every call succeeds, nothing happens, no error, no event.
  2. When the target disappears, the session silently falls back to another tab / auto-creates its own about:blank (log: "No tabs remain! Creating new tab for agent", "New tab created with disallowed URL: about:blank#..."). All subsequent evaluates then run against the blank tab and return empty results that look like app bugs.

Environment

  • browser-use 0.13.8, Python 3.12, macOS 15
  • BrowserSession(cdp_url=...) attached to an already-running headed Chromium (persistent profile), driving an SPA (web.telegram.org/k) whose JS gets stuck in a "loads forever" state (its own shared-worker bug — app-side, not browser-use's)

Repro / observed sequence

  1. The SPA hangs mid-boot (its shared workers wedge; page never mounts). document.readyState is complete, DOM has only the HTML skeleton.
  2. From the already-connected BrowserSession: await page.reload() succeeds — page never remounts. Same for page.evaluate('() => location.reload()'). Zero errors.
  3. Kill the stuck shared workers via CDP HTTP (/json/list + /json/close/{id}) and retry await page.reload() from the same session: still succeeds, still never remounts.
  4. Open a fresh BrowserSession (reconnect via the same cdp_url) and call page.reload() there: page revives in ~5 s. → The session that lived through the hung state silently loses the ability to reload. Only ground truth that anything is off comes from outside browser-use: raw CDP HTTP /json/list.
  5. Separately: after the target disappears, browser-use logs "Agent focus target ... detached!" / "No tabs remain! Creating new tab for agent" and subsequent evaluate calls silently run against its own about:blank tab — every read returns empty, which looks exactly like "the app returned nothing".

Expected

  • reload()/evaluate against a dead/detached target should raise (e.g. "target detached, reconnect required") or transparently reconnect with a fresh session — not return success while doing nothing.
  • Fallback tab creation should be loud and opt-in (or at least surfaced as a first-class state on the session), not a silent misdirect.

Workaround we shipped (for reference)

Treat any "silent empty result" as distrust of the session: list targets via raw CDP HTTP, kill the stuck workers, reconnect (new BrowserSession), page.reload() from the fresh session. Works every time, but it's re-implementing the library's job per-project.

Related

  • #5803 — js() runner silently returns empty results for an entire session ("undetectable dead state") — same root family.
  • #5469 — stale Input session while Runtime.evaluate stays healthy; ensure_real_tab doesn't recover.