[GH-ISSUE #1167] Allow chrome extension to share cookies for the current tab with the backend #764

Open
opened 2026-03-02 11:52:32 +03:00 by kerem · 5 comments
Owner

Originally created by @maelp on GitHub (Mar 26, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1167

To solve "cookies" and "login" issues easily, we could add "cookies" to the extension manifest, and let the user decide on each tab (when he clicks on "hoarder") to share the current cookies with the backend, so the puppeteer instance would be logged in (and if he does that, the scraping of the current page should be retried once the cookies are added, so that it gets the full data and not paywalls)

chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
  const url = new URL(tabs[0].url);

  chrome.cookies.getAll({ domain: url.hostname }, (cookies) => {
    fetch('https://your-backend/upload-cookies', {
      method: 'POST',
      body: JSON.stringify({
        domain: url.hostname,
        cookies
      }),
      headers: { 'Content-Type': 'application/json' }
    });
  });
});
Originally created by @maelp on GitHub (Mar 26, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1167 To solve "cookies" and "login" issues easily, we could add "cookies" to the extension manifest, and let the user decide on each tab (when he clicks on "hoarder") to share the current cookies with the backend, so the puppeteer instance would be logged in (and if he does that, the scraping of the current page should be retried once the cookies are added, so that it gets the full data and not paywalls) ```typescript chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { const url = new URL(tabs[0].url); chrome.cookies.getAll({ domain: url.hostname }, (cookies) => { fetch('https://your-backend/upload-cookies', { method: 'POST', body: JSON.stringify({ domain: url.hostname, cookies }), headers: { 'Content-Type': 'application/json' } }); }); }); ```
Author
Owner

@mobiledude commented on GitHub (Mar 27, 2025):

I second this. Currently I am using this as a workaround but it is not fully utilizing hoarders possibilities. https://docs.hoarder.app/Guides/singlefile

<!-- gh-comment-id:2759358764 --> @mobiledude commented on GitHub (Mar 27, 2025): I second this. Currently I am using this as a workaround but it is not fully utilizing hoarders possibilities. https://docs.hoarder.app/Guides/singlefile
Author
Owner

@MohamedBassem commented on GitHub (Mar 29, 2025):

I don't think chrome allows extensions to be able to read the cookies of the website it's triggered on?

<!-- gh-comment-id:2763717282 --> @MohamedBassem commented on GitHub (Mar 29, 2025): I don't think chrome allows extensions to be able to read the cookies of the website it's triggered on?
Author
Owner

@maelp commented on GitHub (Mar 29, 2025):

I think it does, since there are extensions doing exactly this (showing the
cookies of the current website)

<!-- gh-comment-id:2763830385 --> @maelp commented on GitHub (Mar 29, 2025): I think it does, since there are extensions doing exactly this (showing the cookies of the current website)
Author
Owner

@maelp commented on GitHub (Mar 29, 2025):

Check eg https://cookie-editor.com/ and source https://github.com/moustachauve/cookie-editor (Chrome + Firefox +Safari)

<!-- gh-comment-id:2763840387 --> @maelp commented on GitHub (Mar 29, 2025): Check eg https://cookie-editor.com/ and source https://github.com/moustachauve/cookie-editor (Chrome + Firefox +Safari)
Author
Owner

@srvoets commented on GitHub (May 21, 2025):

any update on this? It would be very ideal.

<!-- gh-comment-id:2899226132 --> @srvoets commented on GitHub (May 21, 2025): any update on this? It would be very ideal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#764
No description provided.