From 59d053dd2fe2f6015193c76ee34da89758f11376 Mon Sep 17 00:00:00 2001 From: gamebeaker Date: Mon, 26 Aug 2024 08:21:42 +0200 Subject: [PATCH] set_cookie_domain_to_highest_domain --- plugin/js/HttpClient.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/js/HttpClient.js b/plugin/js/HttpClient.js index 8d6b6168..3f40b0b1 100644 --- a/plugin/js/HttpClient.js +++ b/plugin/js/HttpClient.js @@ -217,7 +217,10 @@ class HttpClient { // get all cookie from the site which use the partitionKey (e.g. cloudflare) //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.replace(/^www./, ""),partitionKey: {}}); + + //set domain to the highest level from the website as all subdomains are included #1447 #1445 + let urlparts = parsedUrl.hostname.split("."); + let cookies = await chrome.cookies.getAll({domain: urlparts[urlparts.length-2]+"."+urlparts[urlparts.length-1],partitionKey: {}}); //create new cookies for the site without the partitionKey //cookies without the partitionKey get sent with fetch