fix cookies/storage (#10)

This commit is contained in:
Chris Tate
2026-01-11 23:27:49 -06:00
committed by GitHub
parent 5e94a18496
commit 9f7d7d6447
4 changed files with 559 additions and 10 deletions
+9 -1
View File
@@ -791,7 +791,15 @@ async function handleCookiesSet(
): Promise<Response> {
const page = browser.getPage();
const context = page.context();
await context.addCookies(command.cookies);
// Auto-fill URL for cookies that don't have domain/path/url set
const pageUrl = page.url();
const cookies = command.cookies.map((cookie) => {
if (!cookie.url && !cookie.domain && !cookie.path) {
return { ...cookie, url: pageUrl };
}
return cookie;
});
await context.addCookies(cookies);
return successResponse(command.id, { set: true });
}