Fix Media Group Westfalen

This commit is contained in:
magnolia1234 2023-10-03 12:39:45 +02:00
parent c1fe970b42
commit 25001ed17b
3 changed files with 13 additions and 2 deletions

View file

@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add Interesting Engineering
Fix Media Group Westfalen
Fix Mediahuis Nederland Regional (js)
Fix The Atlantic (images)

View file

@ -1258,9 +1258,19 @@ else if (matchDomain('ruhrnachrichten.de') || document.querySelector('a.mgw-logo
let paywall = document.querySelector('body.is_plus_article');
if (paywall && dompurify_loaded) {
paywall.classList.remove('is_plus_article');
let json_url;
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
} else {
let pathname = window.location.pathname;
let article_id;
if (pathname.includes('-p-'))
article_id = pathname.split('-p-')[1].split('/')[0];
if (article_id)
json_url = 'https://' + window.location.hostname + '/wp-json/wp/v2/posts/' + article_id;
}
if (json_url) {
fetch(json_url)
.then(response => {
if (response.ok) {

View file

@ -2,8 +2,8 @@
"addons": {
"magnolia@12.34": {
"updates": [
{ "version": "3.3.5.0",
"update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.3.5.0.xpi" }
{ "version": "3.3.6.0",
"update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.3.6.0.xpi" }
]
}
}