MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / getAllCookies

Function getAllCookies

webapp/_webapp/src/libs/browser.ts:2–12  ·  view source on GitHub ↗
(name: string, url: string)

Source from the content-addressed store, hash-verified

1// This function is used in background.js
2export async function getAllCookies(name: string, url: string) {
3 // @ts-expect-error: browser may not be defined in all environments
4 const browserAPI = typeof browser !== "undefined" ? browser : chrome;
5 const stores = await browserAPI.cookies.getAllCookieStores();
6 const cookies: chrome.cookies.Cookie[] = [];
7 for (const store of stores) {
8 const cookieOfStore = await browserAPI.cookies.getAll({ name, url, storeId: store.id });
9 cookies.push(...cookieOfStore);
10 }
11 return cookies;
12}
13
14export enum Browser {
15 Chrome = "chrome",

Callers 1

background.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected