Add Defector

This commit is contained in:
magnolia1234 2023-03-17 17:31:00 +01:00
parent 6f463457af
commit 797d521a75
6 changed files with 34 additions and 2 deletions

View File

@ -184,6 +184,7 @@ Grouped in options:\
[Atavist Magazine](https://magazine.atavist.com) -
[Axios](https://www.axios.com) -
[Commentary Magazine](https://www.commentary.org) -
[Defector](https://defector.com) -
[Field & Stream](https://www.fieldandstream.com) -
[First Things](https://www.firstthings.com) -
[Harper's Magazine](https://harpers.org) -

View File

@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
Updates: https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases
Post-release
Add Defector
Remove Iltalehti.fi (fix obsolete)
Fix ilManifesto.it (timing)
Fix iPolitics.ca (refresh)

View File

@ -3044,6 +3044,31 @@ else if (matchDomain('dallasnews.com')) {
}
}
else if (matchDomain('defector.com')) {
let paywall = document.querySelector('[class^="ContentGate_wrapper__"]');
if (paywall) {
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(article_new, article);
});
}
});
} catch (err) {
console.log(err);
}
}
}
else if (matchDomain('digiday.com')) {
if (window.location.pathname.endsWith('/amp/')) {
amp_unhide_access_hide('="NOT p.showPageviewExpired AND NOT p.showPayWall"', '', 'amp-ad, .advertisement, .ad-wrapper');

View File

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.0.9.3"
"version": "3.0.9.4"
}

View File

@ -176,6 +176,7 @@
"*://*.dailytelegraph.com.au/*",
"*://*.dailywire.com/*",
"*://*.dallasnews.com/*",
"*://*.defector.com/*",
"*://*.democratandchronicle.com/*",
"*://*.demorgen.be/*",
"*://*.denverpost.com/*",
@ -736,5 +737,5 @@
"*://*.wallkit.net/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.0.9.3"
"version": "3.0.9.4"
}

View File

@ -386,6 +386,10 @@ var defaultSites = {
domain: "tijd.be",
referer: "google"
},
"Defector": {
domain: "defector.com",
allow_cookies: 1
},
"Der Spiegel (link to archive.is)": {
domain: "spiegel.de",
allow_cookies: 1