{"id":13583052,"url":"https://github.com/bertrandom/chrome-cookies-secure","last_synced_at":"2025-05-15T13:09:03.792Z","repository":{"id":24359444,"uuid":"27758135","full_name":"bertrandom/chrome-cookies-secure","owner":"bertrandom","description":"Extract encrypted Google Chrome cookies for a url on a Mac or Linux","archived":false,"fork":false,"pushed_at":"2025-03-19T21:01:04.000Z","size":331,"stargazers_count":156,"open_issues_count":14,"forks_count":58,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T06:39:25.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/chrome-cookies-secure","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertrandom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-09T09:02:56.000Z","updated_at":"2025-04-04T12:11:06.000Z","dependencies_parsed_at":"2024-04-08T16:11:46.129Z","dependency_job_id":"e8cf3d0c-b7ef-48b5-bee7-86706aa63414","html_url":"https://github.com/bertrandom/chrome-cookies-secure","commit_stats":{"total_commits":98,"total_committers":16,"mean_commits":6.125,"dds":0.6734693877551021,"last_synced_commit":"dbe65ac42c5ad257a42434138380a8b7060e9cfb"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fchrome-cookies-secure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fchrome-cookies-secure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fchrome-cookies-secure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandom%2Fchrome-cookies-secure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertrandom","download_url":"https://codeload.github.com/bertrandom/chrome-cookies-secure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492550,"owners_count":21916961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:03:13.466Z","updated_at":"2025-05-15T13:09:02.252Z","avatar_url":"https://github.com/bertrandom.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","module"],"sub_categories":[],"readme":"# chrome-cookies-secure\n\nExtract encrypted Google Chrome cookies for a url on Mac OS X, Windows, or Linux\n\n## Installation\n\n```\nnpm install chrome-cookies-secure\n```\n\n## Optional Dependencies\n\nBecause this package is designed to work cross-platform, two operating system specific dependencies are declared as `optionalDependencies`.\n\nIf you are working on these platforms you should install these manually after running `npm i`.\n\n### For Windows\n\n- `win-dpapi` is required\n- `npm i win-dpapi@1.1.0`\n\n### For macOS\n\n- `keytar` is required\n- `npm i keytar@7.9.0`\n\n## API\n\ngetCookies(url[,format],callback,profile)\n---------------------------------\n\n`url` should be a fully qualified url, e.g. `https://www.example.com/path`\n\n`format` is optional and can be one of the following values:\n\nformat | description\n------------ | -------------\ncurl | [Netscape HTTP Cookie File](http://curl.haxx.se/docs/http-cookies.html) contents usable by curl and wget\njar | cookie jar compatible with [tough-cookie]\nset-cookie | Array of Set-Cookie header values\nheader | `cookie` header string, similar to what a browser would send\npuppeteer | an array of objects that can be loaded into puppeteer using the `setCookie(...)` method\nobject | (default) Object where key is the cookie name and value is the cookie value. These are written in order so it's possible that duplicate cookie names will be overriden by later values\n\nIf `format` is not specified, `object` will be used as the format by default.\n\nCookie order tries to follow [RFC 6265 - Section 5.4, step 2](http://tools.ietf.org/html/rfc6265#section-5.4) as best as possible.\n\n## Examples\n\nbasic usage\n-----------\n\n```javascript\nconst chrome = require('chrome-cookies-secure');\nchrome.getCookies('https://www.example.com/path/', function(err, cookies) {\n\tconsole.log(cookies);\n});\n```\n\n```javascript\nconst chrome = require('chrome-cookies-secure');\nconst cookies = await chrome.getCookiesPromised('https://www.example.com/path/', 'jar')\n```\n\npuppeteer with specific Chrome profile\n---------------------\n\n```javascript\nconst chrome = require('chrome-cookies-secure');\nconst puppeteer = require('puppeteer');\n\nconst url = 'https://www.yourUrl.com/';\n\nconst getCookies = (callback) =\u003e {\n    chrome.getCookies(url, 'puppeteer', function(err, cookies) {\n        if (err) {\n            console.log(err, 'error');\n            return\n        }\n        console.log(cookies, 'cookies');\n        callback(cookies);\n    }, 'yourProfile') // e.g. 'Profile 2'\n}\n\ngetCookies(async (cookies) =\u003e {\n    const browser = await puppeteer.launch({\n        headless: false\n    });\n    const page = await browser.newPage();\n\n    await page.setCookie(...cookies);\n    await page.goto(url);\n    await page.waitFor(1000);\n    browser.close();\n});\n\n```\n\nCalling using async/await\n---------------------\n\n```javascript\nconst chrome = require('chrome-cookies-secure');\nconst url = 'https://www.yourUrl.com/';\n\nconst myFunction = async () =\u003e {\n    const cookies = await chrome.getCookiesPromised(url, 'puppeteer', 'Profile 28')\n    // ..... Use the cookies\n}\n```\n\n## Limitations\n\nOn OS X, this module requires Keychain Access to read the Google Chrome encryption key. The first time you use it, it will popup this dialog:\n\n![image](https://raw.githubusercontent.com/bertrandom/chrome-cookies-secure/gh-pages/access.png)\n\nThe SQLite database that Google Chrome stores its cookies is only persisted to every 30 seconds or so, so this can explain while you'll see a delay between which cookies your browser has access to and this module.\n\n## License\n\nThis software is free to use under the MIT license. See the [LICENSE file][] for license text and copyright information.\n\n[LICENSE file]: https://github.com/bertrandom/chrome-cookies-secure/blob/master/LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandom%2Fchrome-cookies-secure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertrandom%2Fchrome-cookies-secure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandom%2Fchrome-cookies-secure/lists"}