You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MCP]: browser_cookie_set fails with internal assertion error when domain is omitted on blank page #43309
Following up on closed issue #43274 to isolate individual reproducible cases. This report covers the error handling when invoking browser_cookie_set on a blank tab (about:blank) without an explicit domain.
When an agent or user invokes browser_cookie_set immediately after opening a browser or on an unnavigated tab (about:blank):
On about:blank, new URL('about:blank').hostname is "". When params.domain is omitted, cookie.domain becomes "".
When passed to browserContext.addCookies([cookie]), Playwright's internal validation in packages/playwright-core/src/server/network.ts line 165 checks:
assert(c.url||(c.domain&&c.path),'Cookie should have a url or a domain/path pair');
Because c.domain === "", (c.domain && c.path) evaluates to "" (falsy), and Playwright throws an internal assertion failure:
Error: browserBackend.callTool: Cookie should have a url or a domain/path pair
Reproduction
test('browser_cookie_set on about:blank without domain',async({ startClient })=>{const{ client }=awaitstartClient({config: {capabilities: ['storage']}});constresponse=awaitclient.callTool({name: 'browser_cookie_set',arguments: {name: 'session_id',value: 'xyz123'},});// Fails with: Error: browserBackend.callTool: Cookie should have a url or a domain/path pair});
Expected Behavior
Rather than crashing with an internal core assertion error (Cookie should have a url or a domain/path pair), browser_cookie_set should validate that the domain can be determined and report an actionable error to the client/LLM:
Cannot infer cookie domain from current page URL "about:blank". Please specify "domain".
I have tested and verified this case independently in isolation on blank sessions. I will be opening a PR shortly to handle this with a clear validation error.
Activity
alok-108 commentedon Oct 12, 2026
I have tested and verified this case independently in isolation on blank sessions. I will be opening a PR shortly to handle this with a clear validation error.
chore: mark v0.1.23 (#494)