From d99bbcbc38dcc2bc99267cf8ab20577093504984 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 15 Dec 2023 09:33:09 +0100 Subject: [PATCH] Fix Automobilwoche.de (js) --- background.js | 1 - changelog.txt | 1 + contentScript.js | 27 ++++++++++++++++++++++++++- custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 2 +- sites_updated.json | 6 ++++++ 7 files changed, 36 insertions(+), 5 deletions(-) diff --git a/background.js b/background.js index c337d3b5..f6a5468c 100644 --- a/background.js +++ b/background.js @@ -28,7 +28,6 @@ var restrictions = { 'elespanol.com': /^((?!\/cronicaglobal\.elespanol\.com\/).)*$/, 'espn.com': /^((?!espn\.com\/watch).)*$/, 'esquire.com': /^((?!\/classic\.esquire\.com\/).)*$/, - 'faz.net': /^((?!\/zeitung\.faz\.net\/).)*$/, 'foreignaffairs.com': /^((?!\/reader\.foreignaffairs\.com\/).)*$/, 'ft.com': /^((?!\/cn\.ft\.com\/).)*$/, 'hilltimes.com': /^((?!\.hilltimes\.com\/slideshow\/).)*$/, diff --git a/changelog.txt b/changelog.txt index b0631284..b3fd749c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Fix Automobilwoche.de (js) * v3.4.7.0 (2023-12-14) Add Die Presse (at) diff --git a/contentScript.js b/contentScript.js index ad140156..1eb4b5e9 100644 --- a/contentScript.js +++ b/contentScript.js @@ -660,6 +660,19 @@ else if (matchDomain('augsburger-allgemeine.de')) { } } +else if (matchDomain('automobilwoche.de')) { + let body_hidden = document.querySelector('body[class]'); + if (body_hidden) + body_hidden.removeAttribute('class'); + let lazy_images = document.querySelectorAll('img.lazy[data-src]'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-src'); + elem.removeAttribute('class'); + } + let lazy_sources = document.querySelectorAll('source[srcset^="data:image"]'); + removeDOMElement(...lazy_sources); +} + else if (matchDomain(['beobachter.ch', 'handelszeitung.ch'])) { let paywall = document.querySelector('div#piano-inlined'); if (paywall && dompurify_loaded) { @@ -832,7 +845,19 @@ else if (matchDomain('diepresse.com')) { } else if (matchDomain('faz.net')) { - if (!matchDomain('zeitung.faz.net')) { + if (matchDomain('zeitung.faz.net')) {// legacy + let paywall_z = document.querySelector('div.c-red-carpet'); + if (paywall_z) { + removeDOMElement(paywall_z); + let og_url = document.querySelector('head > meta[property="og:url"][content]'); + if (og_url) + window.location.href = og_url.content; + else + header_nofix(document.querySelector('div.article__text')); + } + let sticky_advt = document.querySelector('div.sticky-advt'); + removeDOMElement(sticky_advt); + } else { let paywall = document.querySelector('#paywall-form-container-outer, section.atc-ContainerPaywall'); if (paywall) { removeDOMElement(paywall); diff --git a/custom/manifest.json b/custom/manifest.json index ef87913f..540b8355 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.7.0" + "version": "3.4.7.1" } diff --git a/manifest.json b/manifest.json index 11484a47..c5d30d5f 100644 --- a/manifest.json +++ b/manifest.json @@ -822,5 +822,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.7.0" + "version": "3.4.7.1" } diff --git a/sites.js b/sites.js index 2598acf1..bd8965a7 100644 --- a/sites.js +++ b/sites.js @@ -197,7 +197,7 @@ var defaultSites = { "Automobilwoche": { domain: "automobilwoche.de", allow_cookies: 1, - block_regex: /\.automobilwoche\.de\/sites\/camw\/files\/js\/js_wB7.+\.js/ + block_regex: /\.automobilwoche\.de\/sites\/camw\/files\/js\/js_.+\.js/ }, "AutoPlus.fr": { domain: "autoplus.fr", diff --git a/sites_updated.json b/sites_updated.json index 4ebb5992..15067b76 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -1,4 +1,10 @@ { + "Automobilwoche": { + "domain": "automobilwoche.de", + "allow_cookies": 1, + "block_regex": "\\.automobilwoche\\.de\\/sites\\/camw\\/files\\/js\\/js_8J_.+\\.js", + "upd_version": "3.4.7.1" + }, "Bloomberg": { "domain": "bloomberg.com", "allow_cookies": 1,