microsoft/playwright · error · Error
Not supported
Error message
Not supported
What it means
WVBrowser (the iOS Safari / WKWebView connection via ios_webkit_debug_proxy) exposes a single pre-existing browser context tied to the live Safari process. It cannot manufacture a fresh context because the underlying device only exposes whatever Safari is running. doCreateNewContext therefore unconditionally throws 'Not supported'.
Source
Thrown at packages/playwright-core/src/server/webkit/webview/wvBrowser.ts:271
entry.connection.close();
entry.page.didClose();
}
async _closeAllTabs(): Promise<void> {
for (const pageId of Array.from(this._tabs.keys()))
this._detachTab(pageId);
this._fireDidCloseOnce();
}
private _fireDidCloseOnce(): void {
if (this._didCloseFired)
return;
this._didCloseFired = true;
this.didClose();
}
async doCreateNewContext(options: types.BrowserContextOptions): Promise<BrowserContext> {
throw new Error('Not supported');
}
contexts(): BrowserContext[] {
return [this._context];
}
version(): string {
return '';
}
userAgent(): string {
return '';
}
isConnected(): boolean {
return this._tabs.size > 0;
}
}View on GitHub (pinned to c8fc3bf8d3)
Solutions
- Use browser.contexts()[0] (the existing WVBrowserContext) instead of browser.newContext().
- If you need isolation, disconnect and reconnect rather than creating a context.
- Restructure tests so each test does not call newContext on a webview browser.
Example fix
// before const browser = await webkit.connectOverCDP(endpoint); const context = await browser.newContext(); // Not supported // after const browser = await webkit.connectOverCDP(endpoint); const context = browser.contexts()[0];
Defensive patterns
Strategy: validation
Validate before calling
function useExistingContext(browser) {
const contexts = browser.contexts();
if (!contexts.length) throw new Error('No context attached to webview browser');
return contexts[0];
}
const context = useExistingContext(browser); // instead of browser.newContext() Try / catch
let context;
try { context = await browser.newContext(); }
catch (e) {
if (/Not supported/i.test(String(e.message))) context = browser.contexts()[0];
else throw e;
} Prevention
- Never call browser.newContext() on a connectOverCDP webview browser.
- Reuse browser.contexts()[0].
- Disconnect/reconnect for isolation rather than creating contexts.
When it happens
Trigger: Calling browser.newContext() (or any path that triggers doCreateNewContext) on a browser obtained from webkit.connectOverCDP against a real iOS Safari session. The webview backend has exactly one context.
Common situations: Treating a connectOverCDP webview browser like a launched browser and trying to spin isolated contexts; test code reused from a chromium launch flow that calls newContext per test.
Related errors
- ios_webkit_debug_proxy ${proxyBase}/json returned ${res.stat
- No Mobile Safari tabs found at ${this._proxyBase}/json — ope
- Cannot set cookies without an open page
- Method not implemented.
- SyncServer: failed to bind HTTP server
AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12).
Data as JSON: /api/errors/4f6e6adea9421896.
Report an issue: GitHub.