mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 06:57:48 +01:00
Fix WaPo gdpr cookie-banner (by holding on to wp_gdpr cookie)
This commit is contained in:
parent
547120a577
commit
450ddeeec1
1 changed files with 23 additions and 0 deletions
|
@ -156,6 +156,18 @@ const remove_cookies = [
|
|||
'wsj.com',
|
||||
]
|
||||
|
||||
// select specific cookie(s) to hold from remove_cookies domains
|
||||
const remove_cookies_select_hold = {
|
||||
'.nrc.nl': ['nmt_closed_cookiebar'],
|
||||
'.washingtonpost.com': ['wp_gdpr'],
|
||||
'.wsj.com': ['wsjregion']
|
||||
}
|
||||
|
||||
// select only specific cookie(s) to drop from remove_cookies domains
|
||||
const remove_cookies_select_drop = {
|
||||
'www.nrc.nl': ['counter']
|
||||
}
|
||||
|
||||
// Override User-Agent with Googlebot
|
||||
const use_google_bot = [
|
||||
'barrons.com',
|
||||
|
@ -372,6 +384,17 @@ browser.webRequest.onCompleted.addListener(function(details) {
|
|||
if (cookies[i].firstPartyDomain !== undefined) {
|
||||
cookie.firstPartyDomain = cookies[i].firstPartyDomain;
|
||||
}
|
||||
|
||||
var cookie_domain = cookies[i].domain;
|
||||
// hold specific cookie(s) from remove_cookies domains
|
||||
if ((cookie_domain in remove_cookies_select_hold) && remove_cookies_select_hold[cookie_domain].includes(cookies[i].name)){
|
||||
continue; // don't remove specific cookie
|
||||
}
|
||||
// drop only specific cookie(s) from remove_cookies domains
|
||||
if ((cookie_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[cookie_domain].includes(cookies[i].name))){
|
||||
continue; // only remove specific cookie
|
||||
}
|
||||
|
||||
browser.cookies.remove(cookie);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue