{"record":{"id":"e9b3037e16852166","repo":"garrytan/gstack","slug":"not-supported","errorCode":"not_supported","errorMessage":"CDP extraction is only needed on Windows","messagePattern":"CDP extraction is only needed on Windows","errorType":"exception","errorClass":"CookieImportError","httpStatus":null,"severity":"error","filePath":"browse/src/cookie-import-browser.ts","lineNumber":806,"sourceCode":"}\n\n/**\n * Extract cookies via Chrome DevTools Protocol. Launches Chrome headless with\n * remote debugging on the user's real profile directory. Requires Chrome to be\n * closed first (profile lock).\n *\n * v20 App-Bound Encryption binds decryption keys to the original user-data-dir\n * path, so a temp copy of the profile won't work — Chrome silently discards\n * cookies it can't decrypt. We must use the real profile.\n */\nexport async function importCookiesViaCdp(\n  browserName: string,\n  domains: string[],\n  profile = 'Default',\n): Promise<ImportResult> {\n  if (domains.length === 0) return { cookies: [], count: 0, failed: 0, domainCounts: {} };\n  if (process.platform !== 'win32') {\n    throw new CookieImportError('CDP extraction is only needed on Windows', 'not_supported');\n  }\n\n  const browser = resolveBrowser(browserName);\n  const exePath = findBrowserExe(browser.name);\n  if (!exePath) {\n    throw new CookieImportError(\n      `Cannot find ${browser.name} executable. Install it or use /connect-chrome.`,\n      'not_installed',\n    );\n  }\n\n  if (await isBrowserRunning(browser.name)) {\n    throw new CookieImportError(\n      `${browser.name} is running. Close it first so we can launch headless with your profile, or use /connect-chrome to control your real browser directly.`,\n      'browser_running',\n      'retry',\n    );\n  }","sourceCodeStart":788,"sourceCodeEnd":824,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/cookie-import-browser.ts#L788-L824","documentation":"Error \"CDP extraction is only needed on Windows\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/cookie-import-browser.ts:806 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}