Fix Defector (cookie)

This commit is contained in:
magnolia1234 2023-05-26 08:42:46 +02:00
parent 4c9dfb6488
commit 380cdcc512
6 changed files with 7 additions and 26 deletions

View file

@ -12,7 +12,7 @@ if (typeof ext_api.action !== 'object') {
ext_api.action = ext_api.browserAction;
}
const dompurify_sites = ['arcinfo.ch', 'belfasttelegraph.co.uk', 'bloomberg.com', 'cicero.de', 'citywire.com', 'defector.com', 'dn.no', 'ilmanifesto.it', 'inc42.com', 'independent.ie', 'ipolitics.ca', 'italiaoggi.it', 'jacobin.de', 'lecourrierdesstrateges.fr', 'lepoint.fr', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newscientist.com', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'schwaebische.de', 'sloanreview.mit.edu', 'stratfor.com', 'stylist.co.uk', 'techinasia.com', 'thebulletin.org', 'vn.nl', 'zerohedge.com'].concat(nl_mediahuis_noord_domains, nl_mediahuis_region_domains, no_nhst_media_domains);
const dompurify_sites = ['arcinfo.ch', 'belfasttelegraph.co.uk', 'bloomberg.com', 'cicero.de', 'citywire.com', 'dn.no', 'ilmanifesto.it', 'inc42.com', 'independent.ie', 'ipolitics.ca', 'italiaoggi.it', 'jacobin.de', 'lecourrierdesstrateges.fr', 'lepoint.fr', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newscientist.com', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'schwaebische.de', 'sloanreview.mit.edu', 'stratfor.com', 'stylist.co.uk', 'techinasia.com', 'thebulletin.org', 'vn.nl', 'zerohedge.com'].concat(nl_mediahuis_noord_domains, nl_mediahuis_region_domains, no_nhst_media_domains);
var optin_setcookie = false;
var optin_update = true;
var blocked_referer = false;

View file

@ -6,6 +6,7 @@ Post-release
Add GauchaZH
Add VmnMedia.nl Group (opt-in to custom sites)
Remove Weltkunst.de (fix obsolete)
Fix Defector (cookie)
Fix TheTimes.co.uk (overlay)
Fix TownNews sites (encrypted)
Update popup (Google Search Tool)

View file

@ -3301,28 +3301,8 @@ else if (matchDomain('dallasnews.com')) {
}
else if (matchDomain('defector.com')) {
let paywall = document.querySelector('[class^="ContentGate_wrapper__"]');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let url = window.location.href;
try {
fetch(url)
.then(response => {
if (response.ok) {
response.text().then(html => {
let parser = new DOMParser();
let doc = parser.parseFromString(html, 'text/html');
let article_new = doc.querySelector('div[class^="PostContent_wrapper__"]');
let article = document.querySelector('div[class^="PostContent_wrapper__"]');
if (article && article_new)
article.parentNode.replaceChild(DOMPurify.sanitize(article_new), article);
});
}
});
} catch (err) {
console.log(err);
}
}
let paywall = document.querySelector('div[class^="ContentGate_wrapper__"]');
removeDOMElement(paywall);
}
else if (matchDomain('digiday.com')) {

View file

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.1.9.4"
"version": "3.1.9.5"
}

View file

@ -752,5 +752,5 @@
"*://*.wallkit.net/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.1.9.4"
"version": "3.1.9.5"
}

View file

@ -401,7 +401,7 @@ var defaultSites = {
},
"Defector": {
domain: "defector.com",
allow_cookies: 1
remove_cookies_select_drop: ["lede_defector_user"]
},
"Der Spiegel (link to archive.is)": {
domain: "spiegel.de",