From cc2d0a140bf96afe8c7c5267aae72c9d32cfaefa Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 2 Apr 2024 18:01:01 +0200 Subject: [PATCH] Add Capital.fr --- README.md | 1 + changelog.txt | 1 + contentScript.js | 31 +++++++++++-------------------- manifest.json | 1 + sites.js | 5 +++++ sites_updated.json | 6 ++++++ 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 18b8ca2..b13843d 100644 --- a/README.md +++ b/README.md @@ -511,6 +511,7 @@ Grouped in options:\ [Alternatives Economiques](https://www.alternatives-economiques.fr) - [Atlantico](https://atlantico.fr) - [Auto Plus](https://www.autoplus.fr) - +[Capital](https://www.capital.fr) - [Causeur](https://www.causeur.fr) - [Challenges](https://www.challenges.fr) - [Charlie Hebdo](https://charliehebdo.fr) - diff --git a/changelog.txt b/changelog.txt index acc1bdc..1468e48 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Add Bild.de (fetch from archive.is) +Add Capital.fr Fix Nzz.ch (css) * v3.6.2.0 (2024-04-01) diff --git a/contentScript.js b/contentScript.js index d5d7c5b..fb5db4a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1327,18 +1327,14 @@ else if (matchDomain(['stuttgarter-nachrichten.de', 'stuttgarter-zeitung.de', 's } else if (matchDomain('sueddeutsche.de')) { - let clear_ads = function () { - let ads = document.querySelectorAll('er-ad-slot'); - hideDOMElement(...ads); - } - func_post = clear_ads; let url = window.location.href; if (window.location.pathname.startsWith('/projekte/artikel/')) { getArchive(url, 'div.offer-page', '', 'main'); } else { getArchive(url, 'p.sz-article-body__paragraph--reduced', {rm_attrib: 'class'}, 'div[itemprop="articleBody"]'); } - clear_ads(); + let ads = 'er-ad-slot'; + hideDOMStyle(ads); } else if (matchDomain('suedkurier.de')) { @@ -1846,6 +1842,11 @@ else if (matchDomain('autoplus.fr')) { hideDOMElement(...ads); } +else if (matchDomain('capital.fr')) { + let ads = 'div.containerAds, div.ads-introText, div.outbrain-ads'; + hideDOMStyle(ads); +} + else if (matchDomain(['challenges.fr', 'sciencesetavenir.fr'])) { if (window.location.pathname.endsWith('.amp')) { amp_unhide_access_hide('="paywall.access OR cha.access"', '="NOT (paywall.access OR cha.access)"'); @@ -4775,10 +4776,6 @@ else if (matchDomain('newrepublic.com')) { } else if (matchDomain('newscientist.com')) { - let clear_ads = function() { - let ads = document.querySelectorAll('div[class*="Advert"]'); - hideDOMElement(...ads); - } let url = window.location.href; func_post = function () { let lazy_images = document.querySelectorAll('img.lazyload[data-src]:not([src])'); @@ -4796,10 +4793,10 @@ else if (matchDomain('newscientist.com')) { removeDOMElement(break_post); } } - clear_ads(); } getGoogleWebcache(url, 'section#subscription-barrier', '', 'div.article-body, article'); - clear_ads(); + let ads = 'div[class*="Advert"]'; + hideDOMStyle(ads); } else if (matchDomain('newsday.com')) { @@ -4994,19 +4991,13 @@ else if (matchDomain(pl_ringier_domains)) { else if (matchDomain('komputerswiat.pl')) article_sel = 'div[data-run-module="local/main.adult"] > div:nth-last-of-type(1) article'; let url = window.location.href; - func_post = function () { - clear_ads(); - } let url_archive = 'https://' + archiveRandomDomain() + '/' + url.split(/[#\?]/)[0]; replaceDomElementExt(url_archive, true, false, article_sel); } waitDOMElement('div.contentPremium div.tp-container-inner', 'DIV', archive_main); } - function clear_ads() { - let ads = document.querySelectorAll('div[class^="AdPlaceholder_"], div[data-placeholder-caption], div[data-run-module$=".floatingAd"], aside[data-ad-container], [class^="pwAds"], .hide-for-paying, div.onet-ad, div.bottomBar'); - hideDOMElement(...ads); - } - clear_ads(); + let ads = 'div[class^="AdPlaceholder_"], div[data-placeholder-caption], div[data-run-module$=".floatingAd"], aside[data-ad-container], [class^="pwAds"], .hide-for-paying, div.onet-ad, div.bottomBar'; + hideDOMStyle(ads); } else if (matchDomain('polityka.pl')) { diff --git a/manifest.json b/manifest.json index cfa7d0b..5ff70d7 100644 --- a/manifest.json +++ b/manifest.json @@ -141,6 +141,7 @@ "*://*.cambiocolombia.com/*", "*://*.canarias7.es/*", "*://*.canberratimes.com.au/*", + "*://*.capital.fr/*", "*://*.capitalgazette.com/*", "*://*.cartacapital.com.br/*", "*://*.causeur.fr/*", diff --git a/sites.js b/sites.js index a8d7fc8..b803908 100644 --- a/sites.js +++ b/sites.js @@ -340,6 +340,11 @@ var defaultSites = { allow_cookies: 1, block_regex: /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/ }, + "Capital.fr": { + domain: "capital.fr", + allow_cookies: 1, + block_regex: /\.poool\.fr\// + }, "CartaCapital": { domain: "cartacapital.com.br", allow_cookies: 1 diff --git a/sites_updated.json b/sites_updated.json index ce27328..d4c9292 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -11,6 +11,12 @@ "ld_json": "div[id*='paywall-banner']|div[class^='paywall-story-']", "upd_version": "3.6.0.5" }, + "Capital.fr": { + "domain": "capital.fr", + "allow_cookies": 1, + "block_regex": "\\.poool\\.fr", + "upd_version": "3.6.2.2" + }, "Grupo Clarín": { "domain": "###_ar_grupo_clarin", "group": [