Dev Feed

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

My old Linux machine died. Not sure if any of the reason substantial dependency bumps have had the side-effect of resolving this?

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

Closing due to inactivity

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

Hi everyone. The profile for test has been checked by manually opening chrome, but the code provided by readme.md keeps issuing the error 'unable to open database file'. I am on windows 10 x64, chrome 80.0.3987.149 (Official Build) (64-bit) (cohort: 80_149_Win), Node v12.16.1, and npm 6.13.4. Here is the code for test: ``` const chrome = require('chrome-cookies-secure'); const puppeteer = require('puppeteer-core'); const url = 'https://www.hostloc.com/forum.php'; const getCookies = (callback) => { chrome.getCookies(url, 'puppeteer', function(err, cookies) { if (err) { console.log(err, 'error'); return } console.log(cookies, 'cookies'); callback(cookies); }, './UserData2') // Absolute path has been also tested. } getCookies(async (cookies) => { const browser = await puppeteer.launch({ headless: false }); const page = await browser.newPage(); await page.setCookie(...cookies); await page.goto(url); await page.waitFor(1000); browser.close(); }); ``` The errors issued: ``` events.js:288 throw er; // Unhandled 'error' event ^ [Error: SQLITE_CANTOPEN: unable to open database file Emitted 'error' event on Database instance at: ] { errno: 14, code: 'SQLITE_CANTOPEN' } ```

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

There have been quite a few releases in the meantime. Im going to close this and rely on it being re-raised if it's still an issue.

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

Error: > [Error: SQLITE_CANTOPEN: unable to open database file > Emitted 'error' event on Database instance at: > ] Steps to reproduce: 1. `npm init -y && npm i -S chrome-cookies-secure` 2. ``` echo "const chrome = require('chrome-cookies-secure'); \ const url = 'https://wallapop.com/'; \ chrome.getCookies(url, function (err, cookies) { \ console.log(cookies); \ }); " > index.js ``` 3. `node index.js` Versions: Ubuntu 18.04.1 (Virtual Machine) Node.js v14.17.4 (also tried with v16.3.0) Extra info: I also tried on Mac OS 10.14 and it worked fine

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

ReleaseEvent

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

I looked through the Chromium source code and I think this is the relevant section: https://github.com/chromium/chromium/blob/dc778ef2640dfd02ee7a896b92cd72e8f6d5cdf1/components/os_crypt/os_crypt_mac.mm#L35 ``` // Salt for Symmetric key derivation. constexpr char kSalt[] = "saltysalt"; // Key size required for 128 bit AES. constexpr size_t kDerivedKeySizeInBits = 128; // Constant for Symmetic key derivation. constexpr size_t kEncryptionIterations = 1003; ``` I tried updating your module to use 1003 iterations when loading the Chromium sqlite db but it doesn't appear to be decrypting correctly. Searching the chromium source for `DeriveKeyFromPasswordUsingPbkdf2` seems to hint a little bit of how it works. Possibly related source code is persistent cookie store code [here](https://github.com/chromium/chromium/blob/4fdaed9084dbacaecbd59afbd289e9547e76a9ac/net/extras/sqlite/sqlite_persistent_cookie_store.h) or in [here](https://github.com/chromium/chromium/tree/main/net/cookies). Besides changing setting the path to support Chromium and trying different iteration values, I also made this change: ``` keytar.getPassword('Chromium Safe Storage', 'Chromium').then(function(chromePassword) { crypto.pbkdf2(chromePassword, SALT, 1003, KEYLENGTH, 'sha1', callback); }); ``` It returns the values but they're all garbled since they weren't decrypted correctly. What else might I be missing?

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

Closing due to inactivity. Please re-test on latest version and provide platform if still an issue.

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

I'm going to assume this was related to the following: https://github.com/bertrandom/chrome-cookies-secure/pull/69 Apple Silicon fix rolled in as @beta: `3.0.0-beta.1` Please file a new issue if this persists in the @beta version (with more detail).

2025-03-19

GitHub | bertrandom/chrome-cookies-secure

IssuesEvent