microsoft/playwright · error · Error

Cannot navigate to "${url}": this page is not available in a

Error message

Cannot navigate to "${url}": this page is not available in an isolated browser context, and opening it crashes the browser. Use browserType.launchPersistentContext() instead.

What it means

Thrown by _assertNavigationDoesNotCrashBrowser (crPage.ts:180). In a non-persistent context, navigating to known crashing WebUI hosts (chrome://, edge:// variants listed in kCrashingWebUIHosts) would crash the whole browser, so Playwright refuses the navigation up front and points the user at launchPersistentContext().

Source

Thrown at packages/playwright-core/src/server/chromium/crPage.ts:180

  }

  didClose() {
    for (const session of this._sessions.values())
      session.dispose();
    this._page._didClose();
  }

  async navigateFrame(frame: frames.Frame, url: string, referrer: string | undefined): Promise<frames.GotoResult> {
    this._assertNavigationDoesNotCrashBrowser(url);
    return this._sessionForFrame(frame)._navigate(frame, url, referrer);
  }

  private _assertNavigationDoesNotCrashBrowser(url: string) {
    if (this._browserContext.isPersistentContext())
      return;
    const isEdge = this._browserContext._browser.userAgent().includes('Edg/');
    if ((isEdge ? kCrashingWebUIHosts.edge : kCrashingWebUIHosts.chromium).has(webUIHost(url)))
      throw new Error(`Cannot navigate to "${url}": this page is not available in an isolated browser context, and opening it crashes the browser. Use browserType.launchPersistentContext() instead.`);
  }

  async updateExtraHTTPHeaders(): Promise<void> {
    const headers = network.mergeHeaders([
      this._browserContext._options.extraHTTPHeaders,
      this._page.extraHTTPHeaders()
    ]);
    await this._networkManager.setExtraHTTPHeaders(headers);
  }

  async updateGeolocation(): Promise<void> {
    await this._forAllFrameSessions(frame => frame._updateGeolocation(false));
  }

  async updateOffline(): Promise<void> {
    await this._networkManager.setOffline(!!this._browserContext._options.offline);
  }

View on GitHub (pinned to c8fc3bf8d3)

Solutions

  1. Use browserType.launchPersistentContext(userDataDir, ...) instead of launch + newContext.
  2. If you must use a non-persistent context, do not navigate to chrome:// / edge:// WebUI hosts.
  3. For devtools/extension testing, drive them through the persistent context's pages.

Example fix

// before
const browser = await chromium.launch();
const ctx = await browser.newContext();
const page = await ctx.newPage();
await page.goto('chrome://settings');
// after
const ctx = await chromium.launchPersistentContext('/tmp/profile');
const page = ctx.pages()[0] ?? await ctx.newPage();
await page.goto('chrome://settings');
Defensive patterns

Strategy: validation

Validate before calling

// Reject WebUI navigations in non-persistent contexts up front.
const WEBUI = /^(chrome|edge|devtools):\/\//i;
if (WEBUI.test(url) && !persistent)
  throw new Error('Use launchPersistentContext for WebUI URLs');
await page.goto(url);

Prevention

When it happens

Trigger: page.goto('chrome://settings') or 'edge://settings' in a context created via browser.newContext() (incognito-style); launching chromium with launch() then navigating to a WebUI URL.

Common situations: Tests targeting browser settings, devtools://, or chrome-extension:// pages; automation that introspects browser internals via WebUI.

Related errors


AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12). Data as JSON: /api/errors/2cc2637f00c862b3. Report an issue: GitHub.