From 7abcb34f5693d0027b837a6ea44a3ea60e052ea7 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 13 Feb 2021 18:11:44 +0100 Subject: [PATCH] Add Augsburger Allgemeine (Germany) --- README.md | 1 + background.js | 4 +++- changelog.txt | 1 + contentScript.js | 13 ++++++++++++- manifest.json | 1 + sites.js | 1 + 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index df504e2..c42edfb 100755 --- a/README.md +++ b/README.md @@ -299,6 +299,7 @@ Groupe Rossel sites (grouped in options) like [SudInfo](https://www.sudinfo.be) ##### Germany/Austria +[Augsburger Allgemeine](https://www.augsburger-allgemeine.de) - [Cicero](https://www.cicero.de) - [Deutsche Wirtschafts Nachrichten](https://deutsche-wirtschafts-nachrichten.de) - [Die Zeit](https://www.zeit.de) - diff --git a/background.js b/background.js index 32b3975..b7965a7 100755 --- a/background.js +++ b/background.js @@ -33,6 +33,7 @@ const restrictions = { // allow_cookies are completed with domains in sites.js (default allow/remove_cookies) var allow_cookies_default = [ 'abc.es', + 'augsburger-allgemeine.de', 'belfasttelegraph.co.uk', 'berlingske.dk', 'bostonglobe.com', @@ -222,6 +223,7 @@ var change_headers = use_google_bot.concat(use_bing_bot, use_facebook_referer, u // block paywall-scripts individually var blockedRegexes = { 'adweek.com': /.+\.lightboxcdn\.com\/.+/, + 'augsburger-allgemeine.de':/(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(ad|subscriptions)-.+\.js)/, 'afr.com': /afr\.com\/assets\/vendorsReactRedux_client.+\.js/, 'alternatives-economiques.fr': /.+\.poool\.fr\/.+/, 'americanbanker.com': /\.tinypass\.com\/.+/, @@ -904,7 +906,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let usa_mw_site = (matchUrlDomain('wsj.net', details.url) && matchUrlDomain('marketwatch.com', header_referer) && isSiteEnabled({url: header_referer})); let bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && isSiteEnabled({url: header_referer}) && - matchUrlDomain(['barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'gelocal.it', 'ilsecoloxix.it', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'seekingalpha.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_nine_domains, de_madsack_domains, de_rp_medien_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, usa_mcc_domains), header_referer)); + matchUrlDomain(['augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'gelocal.it', 'ilsecoloxix.it', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'seekingalpha.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_nine_domains, de_madsack_domains, de_rp_medien_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, usa_mcc_domains), header_referer)); if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !cl_elmerc_site && !medium_custom_domain && !uk_nlr_site && !usa_discmag_site && !usa_mw_site && !bpc_amp_site) { return; diff --git a/changelog.txt b/changelog.txt index 8e253b9..f69a386 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Add Augsburger Allgemeine (Germany) Add group McClatchy (USA) Add Neue Osnabruecker Zeitung (Germany) Add Time Magazine diff --git a/contentScript.js b/contentScript.js index 985cd64..bd9d9bf 100755 --- a/contentScript.js +++ b/contentScript.js @@ -14,7 +14,7 @@ var fr_groupe_la_depeche_domains = ['centrepresseaveyron.fr', 'ladepeche.fr', 'l var usa_mcc_domains = ['bnd.com', 'charlotteobserver.com', 'fresnobee.com', 'kansas.com', 'kansascity.com', 'kentucky.com', 'newsobserver.com', 'sacbee.com', 'star-telegram.com', 'thestate.com', 'tri-cityherald.com']; // clean local storage of sites (with an exemption for hold-list) -var arr_localstorage_hold = ['charliehebdo.fr', 'cmjornal.pt', 'elmundo.es', 'expansion.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk']; +var arr_localstorage_hold = ['augsburger-allgemeine.de', 'charliehebdo.fr', 'cmjornal.pt', 'elmundo.es', 'expansion.com', 'kurier.at', 'nknews.org', 'seekingalpha.com', 'sfchronicle.com', 'thehindu.com', 'thetimes.co.uk']; arr_localstorage_hold = arr_localstorage_hold.concat(de_funke_media_domains, es_grupo_vocento_domains); if (!matchDomain(arr_localstorage_hold)){ window.localStorage.clear(); @@ -2105,6 +2105,17 @@ else if (matchDomain('noz.de')) { } } +else if (matchDomain('augsburger-allgemeine.de')) { + let url = window.location.href; + if (url.includes('-amp.html')) { + let subscr_sections = document.querySelectorAll('div[subscriptions-section="content"]'); + for (let subscr_section of subscr_sections) + subscr_section.removeAttribute('subscriptions-section'); + let amp_ads = document.querySelectorAll('amp-ad'); + removeDOMElement(...amp_ads); + } +} + else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) csDone = true; diff --git a/manifest.json b/manifest.json index 4cd10bf..bb34ac3 100755 --- a/manifest.json +++ b/manifest.json @@ -45,6 +45,7 @@ "*://*.arvopaperi.fi/*", "*://*.asia.nikkei.com/*", "*://*.atavist.com/*", + "*://*.augsburger-allgemeine.de/*", "*://*.baltimoresun.com/*", "*://*.barrons.com/*", "*://*.bd.nl/*", diff --git a/sites.js b/sites.js index 2a7f853..4f71bf1 100755 --- a/sites.js +++ b/sites.js @@ -9,6 +9,7 @@ var defaultSites = "American Affairs": "americanaffairsjournal.org", "American Banker": "americanbanker.com", "Atavist Magazine": "atavist.com", + "Augsburger Allgemeine": "augsburger-allgemeine.de", "Australia News Corp": "###_au_news_corp", "Australian Community Media (daily)": "###_au_comm_media", "Australian Provincial Newspapers (daily) (opt-in)": "###_au_prov_news",