From 7afb4621364f86c854cbdbffd50e49fdd38bbe12 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 2 Sep 2023 09:09:17 +0200 Subject: [PATCH] Add Beleggersbelangen.nl (Roularta) --- README.md | 1 + changelog.txt | 1 + contentScript.js | 61 ++++++++++++++++++++++++---------------- custom/manifest.json | 2 +- custom/sites_custom.json | 1 + manifest.json | 3 +- sites.js | 1 + sites_updated.json | 7 +++++ 8 files changed, 51 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 1ec85a3b..6c267d11 100644 --- a/README.md +++ b/README.md @@ -721,6 +721,7 @@ Grouped in options:\ *[ProMedia Group](https://www.promedia.nl/publicaties)* sites (opt-in to custom sites)\ *Roularta Media Group* sites like\ [Artsenkrant](https://www.artsenkrant.com) - +[Beleggers Belangen](https://www.beleggersbelangen.nl) - [Flair.be](https://www.flair.be/nl) - [Knack](https://www.knack.be) - [Krant van West-Vlaanderen](https://kw.be) - diff --git a/changelog.txt b/changelog.txt index 61d5de1c..0a6bd893 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 +Add Beleggersbelangen.nl (Roularta) Add Revista Oeste (Brazil) Add Wissenschaft.de Fix BQ Prime (js) diff --git a/contentScript.js b/contentScript.js index fabd9b78..0bbdb141 100644 --- a/contentScript.js +++ b/contentScript.js @@ -8,7 +8,7 @@ var dompurify_loaded = (typeof DOMPurify === 'function'); var ar_grupo_clarin_domains = ['clarin.com', 'lavoz.com.ar', 'losandes.com.ar']; var be_groupe_ipm_domains = ['dhnet.be', 'lalibre.be', 'lavenir.net']; -var be_roularta_domains = ['artsenkrant.com', 'femmesdaujourdhui.be', 'flair.be', 'knack.be', 'kw.be', 'levif.be', 'libelle.be']; +var be_roularta_domains = ['artsenkrant.com', 'beleggersbelangen.nl', 'femmesdaujourdhui.be', 'flair.be', 'knack.be', 'kw.be', 'levif.be', 'libelle.be']; var ca_gcm_domains = ['lesoleil.com'].concat(['latribune.ca', 'lavoixdelest.ca', 'ledroit.com', 'ledroitfranco.com', 'lenouvelliste.ca', 'lequotidien.com']); var ca_torstar_domains = ['niagarafallsreview.ca', 'stcatharinesstandard.ca', 'thepeterboroughexaminer.com', 'therecord.com', 'thespec.com', 'thestar.com', 'wellandtribune.ca']; var de_funke_medien_domains = ['abendblatt.de', 'braunschweiger-zeitung.de', 'morgenpost.de', 'nrz.de', 'otz.de', 'thueringer-allgemeine.de', 'tlz.de', 'waz.de', 'wp.de', 'wr.de']; @@ -2257,31 +2257,44 @@ else if (matchDomain('ftm.nl')) { } else if (matchDomain(be_roularta_domains)) { - let paywall = document.querySelector('div[id*="wall-modal"]'); - if (paywall) { - removeDOMElement(paywall); - let html = document.querySelector('html[class]'); - if (html) - html.removeAttribute('class'); - function roularta_noscroll(node) { - node.removeAttribute('style'); - node.removeAttribute('class'); - } - waitDOMAttribute('html', 'html', 'class', roularta_noscroll, true); - let intro = document.querySelectorAll('div.article-body > p, div.article-body > style'); - removeDOMElement(...intro); - let locked = document.querySelector('body.locked'); - if (locked) - locked.classList.remove('locked'); - } - if (!window.navigator.userAgent.toLowerCase().includes('chrome') && !matchDomain(['artsenkrant.com', 'kw.be']) && window.location.href.match(/\/((\w)+(\-)+){3,}/)) { - let lazy_images = document.querySelectorAll('[src^="data:image/"][data-lazy-src]'); - for (let elem of lazy_images) { - elem.src = elem.getAttribute('data-lazy-src'); + if (matchDomain('beleggersbelangen.nl')) { + let paywall = document.querySelector('div.unlimited-access'); + if (paywall) { + removeDOMElement(paywall); + let no_account = document.querySelector('div.no-account'); + if (no_account) + no_account.classList.remove('no-account'); + let content_inner = document.querySelector('div.content-inner[style]'); + if (content_inner) + content_inner.removeAttribute('style'); + } else { + let paywall = document.querySelector('div[id*="wall-modal"]'); + if (paywall) { + removeDOMElement(paywall); + let html = document.querySelector('html[class]'); + if (html) + html.removeAttribute('class'); + function roularta_noscroll(node) { + node.removeAttribute('style'); + node.removeAttribute('class'); + } + waitDOMAttribute('html', 'html', 'class', roularta_noscroll, true); + let intro = document.querySelectorAll('div.article-body > p, div.article-body > style'); + removeDOMElement(...intro); + let locked = document.querySelector('body.locked'); + if (locked) + locked.classList.remove('locked'); + } + if (!window.navigator.userAgent.toLowerCase().includes('chrome') && !matchDomain(['artsenkrant.com', 'kw.be']) && window.location.href.match(/\/((\w)+(\-)+){3,}/)) { + let lazy_images = document.querySelectorAll('[src^="data:image/"][data-lazy-src]'); + for (let elem of lazy_images) { + elem.src = elem.getAttribute('data-lazy-src'); + } + } } + let ads = document.querySelectorAll('div.rmgAd'); + hideDOMElement(...ads); } - let ads = document.querySelectorAll('div.rmgAd'); - hideDOMElement(...ads); } else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('link[href*=".ndcmediagroep.nl/"]')) { diff --git a/custom/manifest.json b/custom/manifest.json index deb0b5e3..fd6c2796 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.3.1.6" + "version": "3.3.1.7" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 8de469ea..5b43c7ad 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -76,6 +76,7 @@ "Capital.bg": { "allow_cookies": 1, "domain": "capital.bg", + "ld_json": "div.paywall|div.story-content|1", "useragent": "googlebot" }, "Chicago.suntimes.com": { diff --git a/manifest.json b/manifest.json index fa521307..490af86e 100644 --- a/manifest.json +++ b/manifest.json @@ -96,6 +96,7 @@ "*://*.barandbench.com/*", "*://*.barrons.com/*", "*://*.bd.nl/*", + "*://*.beleggersbelangen.nl/*", "*://*.belfasttelegraph.co.uk/*", "*://*.bendigoadvertiser.com.au/*", "*://*.beobachter.ch/*", @@ -794,5 +795,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.3.1.6" + "version": "3.3.1.7" } diff --git a/sites.js b/sites.js index 5274f3fd..f8af8c18 100644 --- a/sites.js +++ b/sites.js @@ -1844,6 +1844,7 @@ var defaultSites = { domain: "###_be_roularta", group: [ "artsenkrant.com", + "beleggersbelangen.nl", "femmesdaujourdhui.be", "flair.be", "knack.be", diff --git a/sites_updated.json b/sites_updated.json index 9b09e9c9..b9799623 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -1,4 +1,11 @@ { + "Beleggersbelangen.nl": { + "domain": "beleggersbelangen.nl", + "allow_cookies": 1, + "block_regex": "(\\.beleggersbelangen\\.nl\\/script\\.js|\\.blueconic\\.net\\/)", + "cs_code": "[{\"cond\":\"div.unlimited-access\", \"rm_elem\": 1, \"elems\":[{\"cond\":\"div.no-account\", \"rm_class\": \"no-account\"}, {\"cond\":\"div.content-inner[style]\", \"rm_attrib\": \"style\"}]}]", + "upd_version": "3.3.1.8" + }, "Bild der Wissenschaft": { "domain": "wissenschaft.de", "allow_cookies": 1,