diff --git a/README.md b/README.md index ce1d803..dad5e27 100755 --- a/README.md +++ b/README.md @@ -370,7 +370,7 @@ Grouped in options:\ [Die Zeit](https://www.zeit.de) - [Frankfurter Allgemeine Zeitung](https://www.faz.net) - [Freie Presse](https://www.freiepresse.de) - -[Handelsblatt](https://www.handelsblatt.com) - +[Handelsblatt](https://www.handelsblatt.com)* - [Krautreporter.de](https://krautreporter.de) - [Kurier.at](https://kurier.at) - [Neue Osnabrücker Zeitung](https://www.noz.de]) - diff --git a/background.js b/background.js index 2c4917b..849ad94 100755 --- a/background.js +++ b/background.js @@ -1181,7 +1181,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let usa_today_site = (matchUrlDomain('gannett-cdn.com', details.url) && matchUrlDomain(['usatoday.com'], header_referer)); allow_ext_source = allow_ext_source || inkl_site || cl_elmerc_site || es_elesp_site || it_repubblica_site || usa_law360_site || usa_mw_site || usa_natgeo_site || usa_today_site; - bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['asiatimes.com', 'augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elpais.com', 'elperiodico.com', 'freiepresse.de', 'inc42.com', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'scmp.com', 'seekingalpha.com', 'shz.de', 'staradvertiser.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk', 'washingtonpost.com'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains, usa_mng_domains, usa_theathletic_domains), header_referer)); + bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['asiatimes.com', 'augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elpais.com', 'elperiodico.com', 'freiepresse.de', 'handelsblatt.com', 'inc42.com', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'scmp.com', 'seekingalpha.com', 'shz.de', 'staradvertiser.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk', 'washingtonpost.com'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains, usa_mng_domains, usa_theathletic_domains), header_referer)); } if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site && !au_apn_site && !au_swm_site) { diff --git a/changelog.txt b/changelog.txt index 17d0355..2d0de3e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release Fix Estadao.com.br +Fix Handelsblatt (only non-premium articles) * v2.3.5.0 (2021-08-29) Add Forbes diff --git a/contentScript.js b/contentScript.js index aeb4d48..255254e 100755 --- a/contentScript.js +++ b/contentScript.js @@ -273,7 +273,7 @@ else { csDone = true; } -} else if (window.location.hostname.match(/\.(de|at|ch)$/) || matchDomain(['faz.net'])) {//germany/austria/switzerland - ch +} else if (window.location.hostname.match(/\.(de|at|ch)$/) || matchDomain(['faz.net', 'handelsblatt.com'])) {//germany/austria/switzerland - ch if (matchDomain('augsburger-allgemeine.de')) { let url = window.location.href; @@ -465,6 +465,23 @@ else if (matchDomain('freiepresse.de')) { } } +else if (matchDomain('handelsblatt.com')) { + let url = window.location.href; + if (url.match(/\/amp(\d)?\./)) { + let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); + removeDOMElement(...amp_ads); + } else { + let paywall = document.querySelector('div.temp-paywall2'); + let amphtml = document.querySelector('link[rel="amphtml"]'); + if (!amphtml) + amphtml = {href: url.replace(/\/(www|app)\./, '/amp2.')}; + if (paywall && amphtml) { + removeDOMElement(paywall); + window.location.href = amphtml.href; + } + } +} + else if (matchDomain('krautreporter.de')) { let paywall = document.querySelector('.article-paywall'); if (paywall) { @@ -1791,7 +1808,7 @@ else if (matchDomain('caixinglobal.com')) { } let app_exclusive_tip = document.querySelector('.app-exclusive-tip'); removeDOMElement(app_exclusive_tip); - }, 500); // Delay (in milliseconds) + }, 1000); // Delay (in milliseconds) } else if (matchDomain(ca_torstar_domains)) { @@ -2250,8 +2267,7 @@ else if (matchDomain('nzherald.co.nz')) { hidden_not_par.removeAttribute('style'); } let hidden_pars = article_content.querySelectorAll('p.' + css_selector); - let par_html, - par_dom; + let par_html, par_dom; let parser = new DOMParser(); for (let hidden_par of hidden_pars) { let par_html = parser.parseFromString('
' + DOMPurify.sanitize(hidden_par.innerHTML) + '
', 'text/html'); diff --git a/custom/manifest.json b/custom/manifest.json index 7c0cb9e..622fa38 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -38,5 +38,5 @@ "webRequestBlocking", "" ], - "version": "2.3.5.1" + "version": "2.3.5.2" } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 31411ae..57d4438 100755 --- a/manifest.json +++ b/manifest.json @@ -542,5 +542,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.3.5.1" + "version": "2.3.5.2" } \ No newline at end of file diff --git a/sites.js b/sites.js index 2da08b2..c7b20de 100755 --- a/sites.js +++ b/sites.js @@ -103,7 +103,7 @@ var defaultSites = "Grupo Vocento (Spain, regional daily)": "###_es_grupo_vocento", "Haaretz English": "haaretz.com", "Haaretz": "haaretz.co.il", - "Handelsblatt": "handelsblatt.com", + "Handelsblatt (only non-premium articles)": "handelsblatt.com", "Harper's Magazine": "harpers.org", "Harvard Business Review": "hbr.org", "Harvard Business Review Taiwan": "hbrtaiwan.com",