Skip to content

Commit

Permalink
Merge pull request #1442 from gamebeaker/claudflare_chrome
Browse files Browse the repository at this point in the history
fix_chrome_cookie_bug
  • Loading branch information
gamebeaker authored Aug 25, 2024
2 parents 3cc33f7 + 78b441e commit 91a851f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugin/js/HttpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@ class HttpClient {
if (!util.isFirefox()) {
// get partitionKey in the form of https://<site name>.<tld>
let parsedUrl = new URL(url);
let topLevelSite = parsedUrl.protocol + "//" + parsedUrl.hostname;
//keep old code for reference in case it changes again
//let topLevelSite = parsedUrl.protocol + "//" + parsedUrl.hostname;

try {
// get all cookie from the site which use the partitionKey (e.g. cloudflare)
let cookies = await chrome.cookies.getAll({partitionKey: {topLevelSite: topLevelSite}});
//keep old code for reference in case it changes again
//let cookies = await chrome.cookies.getAll({partitionKey: {topLevelSite: topLevelSite}});
let cookies = await chrome.cookies.getAll({domain: parsedUrl.hostname,partitionKey: {}});

//create new cookies for the site without the partitionKey
//cookies without the partitionKey get sent with fetch
Expand Down

0 comments on commit 91a851f

Please sign in to comment.