Fixed cookie removal bug

This commit is contained in:
ghost 2018-10-18 21:28:29 -07:00
parent 4be98da2ed
commit 3fdac03980
4 changed files with 14 additions and 3 deletions

View file

@ -88,6 +88,7 @@ const allow_cookies = [
// Removes cookies after page load
const remove_cookies = [
'asia.nikkei.com',
'nytimes.com',
'ft.com',
'letemps.ch',
'fd.nl',
@ -255,7 +256,16 @@ browser.webRequest.onCompleted.addListener(function(details) {
}
browser.cookies.getAll({domain: domainVar}, function(cookies) {
for (var i=0; i<cookies.length; i++) {
browser.cookies.remove({url: cookies[i].secure ? "https://" : "http://" + cookies[i].domain + cookies[i].path, name: cookies[i].name});
var cookie = {
url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path,
name: cookies[i].name,
storeId: cookies[i].storeId
};
if (cookies[i].firstPartyDomain !== undefined) {
cookie.firstPartyDomain = cookies[i].firstPartyDomain;
}
console.log("cookie="+cookie.url);
browser.cookies.remove(cookie);
}
});
}

View file

@ -1,5 +1,6 @@
Updates--
2018-10-18 v1.4.0: Fixed cookie removal bug (medium.com should work properly now)
2018-10-06 v1.3.11: Removed dn.se, fixed haaretz.co.il, fixed thestar.com
2018-10-02 v1.3.10: Added The Advocate (theadvocate.com.au), added Examiner (examiner.com.au)
2018-09-09 v1.3.9: Added japantimes.co.jp

View file

@ -43,5 +43,5 @@
"webRequest",
"webRequestBlocking"
],
"version": "1.3.11"
"version": "1.4.0"
}

View file

@ -4,7 +4,7 @@
<meta charset="utf-8">
</head>
<body>
<div style="width:230px;">Bypass Paywalls v1.3.11 by Adam
<div style="width:230px;">Bypass Paywalls v1.4.0 by Adam
<a href="options.html">Options</a></div>
</body>
</html>