(detail: chrome.cookies.GetAllDetails)
| 22 | } |
| 23 | |
| 24 | function getCookies(detail: chrome.cookies.GetAllDetails): Promise<chrome.cookies.Cookie[]> { |
| 25 | return new Promise((resolve) => { |
| 26 | chrome.cookies.getAll(detail, (cookies) => { |
| 27 | const lastError = chrome.runtime.lastError; |
| 28 | if (lastError) { |
| 29 | console.error("chrome.runtime.lastError in chrome.cookies.getAll:", lastError); |
| 30 | // 无视错误继续执行 |
| 31 | } |
| 32 | resolve(cookies); |
| 33 | }); |
| 34 | }); |
| 35 | } |
| 36 | |
| 37 | // 解析导出cookie表达式生成导出的cookie |
| 38 | export function parseExportCookie(exportCookie: string): Promise<ExportCookies[]> { |
no test coverage detected