(href: string)
| 31 | main(); |
| 32 | |
| 33 | async function get(href: string) { |
| 34 | const res = await fetch(href); |
| 35 | const location = res.headers.get("location"); |
| 36 | if (location && res.status >= 300 && res.status < 400) { |
| 37 | return get(new URL(location, href).href); |
| 38 | } |
| 39 | |
| 40 | return res; |
| 41 | } |
| 42 | |
| 43 | async function getAllCookies(domains: string[]) { |
| 44 | const allCookies: Record<string, string> = Object.create(null); |