From d01b72549e7b111c99046a611e02bcb50d0db5cb Mon Sep 17 00:00:00 2001 From: alastairR Date: Tue, 22 Sep 2020 16:57:08 +1200 Subject: [PATCH] Remove adblock banners for interest.co.nz & stuff.co.nz and bypass paywall thenational.scot (#900) * Interest.co.nz/Stuff/The National --- README.md | 5 ++++- manifest-ff.json | 6 ++++++ src/js/background.js | 3 +++ src/js/contentScript.js | 10 ++++++++++ src/js/sites.js | 3 +++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 79aac89..e7d7b8a 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ [History Extra](https://www.historyextra.com)\ [Il Manifesto](https://www.ilmanifesto.it)\ [Inc.com](https://www.inc.com)\ -[Investors Chronicle](https://www.investorschronicle.co.uk)\ +[Interest.co.nz](https://www.interest.co.nz)\ +[Investors Chronicle](https://www.investorschronicle.co.uk) [L'Écho](https://www.lecho.be)\ [L.A. Business Journal](https://labusinessjournal.com)\ [La Nación](https://www.lanacion.com.ar)\ @@ -110,6 +111,7 @@ [SOFREP](https://sofrep.com)\ [Statista](https://www.statista.com)\ [Star Tribune](https://www.startribune.com)\ +[Stuff](https://www.stuff.co.nz)\ [SunSentinel](https://www.sun-sentinel.com)\ [Tech in Asia](https://www.techinasia.com)\ [Telegraaf](https://www.telegraaf.nl)\ @@ -139,6 +141,7 @@ [The Mercury Tasmania](https://www.themercury.com.au)\ [The Morning Call](https://www.mcall.com)\ [The Nation](https://www.thenation.com)\ +[The National](https://www.thenational.scot)\ [The New Statesman](https://www.newstatesman.com)\ [The New York Times](https://www.nytimes.com)\ [The New Yorker](https://www.newyorker.com)\ diff --git a/manifest-ff.json b/manifest-ff.json index 627c09a..48f5643 100644 --- a/manifest-ff.json +++ b/manifest-ff.json @@ -27,6 +27,7 @@ "*://*.firstthings.com/*", "*://*.ft.com/*", "*://*.haaretz.co.il/*", + "*://*.interest.co.nz/*", "*://*.ledevoir.com/*", "*://*.leparisien.fr/*", "*://*.medium.com/*", @@ -37,6 +38,7 @@ "*://*.repubblica.it/*", "*://*.sfchronicle.com/*", "*://*.sloanreview.mit.edu/*", + "*://*.stuff.co.nz/*", "*://*.techinasia.com/*", "*://*.telegraaf.nl/*", "*://*.the-american-interest.com/*", @@ -47,6 +49,7 @@ "*://*.thecourier.com.au/*", "*://*.theglobeandmail.com/*", "*://*.thehindu.com/*", + "*://*.thenational.scot/*", "*://*.thestar.com/*", "*://*.thewrap.com/*", "*://*.trouw.nl/*", @@ -147,6 +150,7 @@ "*://*.ilmanifesto.it/*", "*://*.inc.com/*", "*://*.inquirer.com/*", + "*://*.interest.co.nz/*", "*://*.investorschronicle.co.uk/*", "*://*.irishtimes.com/*", "*://*.japantimes.co.jp/*", @@ -192,6 +196,7 @@ "*://*.spectator.co.uk/*", "*://*.spectator.com.au/*", "*://*.statista.com/*", + "*://*.stuff.co.nz/*", "*://*.sun-sentinel.com/*", "*://*.techinasia.com/*", "*://*.technologyreview.com/*", @@ -211,6 +216,7 @@ "*://*.themarker.com/*", "*://*.themercury.com.au/*", "*://*.thenation.com/*", + "*://*.thenational.scot/*", "*://*.thesaturdaypaper.com.au/*", "*://*.thestar.com/*", "*://*.thetimes.co.uk/*", diff --git a/src/js/background.js b/src/js/background.js index 7017604..387239e 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -139,6 +139,7 @@ const useGoogleBotSites = [ 'theaustralian.com.au', 'themarker.com', 'themercury.com.au', + 'thenational.scot', 'thetimes.co.uk', 'wsj.com', 'kansascity.com', @@ -174,12 +175,14 @@ const blockedRegexes = { 'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/, 'lrb.co.uk': /.+\.tinypass\.com\/.+/, 'nzherald.co.nz': /nzherald\.co\.nz\/.+\/headjs\/.+\.js/, + 'interest.co.nz': /(.+\.presspatron\.com.+|.+interest\.co\.nz.+pp-ablock-banner\.js)/, 'repubblica.it': /scripts\.repubblica\.it\/pw\/pw\.js.+/, 'spectator.co.uk': /.+\.tinypass\.com\/.+/, 'spectator.com.au': /.+\.tinypass\.com\/.+/, 'telegraph.co.uk': /.+telegraph\.co\.uk.+martech.+/, 'thecourier.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/, 'thenation.com': /thenation\.com\/.+\/paywall-script\.php/, + 'thenational.scot': /(.+\.tinypass\.com\/.+|.+thenational\.scot.+omniture\.js|.+thenational\.scot.+responsive-sync.+)/, 'thewrap.com': /thewrap\.com\/.+\/wallkit\.js/, 'wsj.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/, 'historyextra.com': /.+\.evolok\.net\/.+\/authorize\/.+/, diff --git a/src/js/contentScript.js b/src/js/contentScript.js index caba699..5026b8c 100644 --- a/src/js/contentScript.js +++ b/src/js/contentScript.js @@ -154,6 +154,16 @@ if (matchDomain('elmercurio.com')) { el.removeAttribute('style'); } } +} else if (matchDomain('interest.co.nz')) { + const wrapper = document.getElementById('pp-ablock-banner-wrapper'); + const overlay = document.querySelector('.black-overlay'); + removeDOMElement(overlay, wrapper); +} else if (matchDomain('stuff.co.nz')) { + const overlay = document.querySelector('.x0'); + removeDOMElement(overlay); +} else if (matchDomain('thenational.scot')) { + const overlay = document.querySelector('.template-container'); + removeDOMElement(overlay); } else if (matchDomain('thestar.com')) { setTimeout(function () { const paywall = document.querySelector('.basic-paywall-new'); diff --git a/src/js/sites.js b/src/js/sites.js index e49e37c..efd7fea 100644 --- a/src/js/sites.js +++ b/src/js/sites.js @@ -46,6 +46,7 @@ const defaultSites = { 'History Extra': 'historyextra.com', 'Il Manifesto': 'ilmanifesto.it', 'Inc.com': 'inc.com', + 'Interest NZ': 'interest.co.nz', 'Investors Chronicle': 'investorschronicle.co.uk', 'La Nacion': 'lanacion.com.ar', 'La Repubblica': 'repubblica.it', @@ -86,6 +87,7 @@ const defaultSites = { 'SOFREP': 'sofrep.com', 'Star Tribune': 'startribune.com', 'Statista': 'statista.com', + 'Stuff': 'stuff.co.nz', 'SunSentinel': 'sun-sentinel.com', 'Tech in Asia': 'techinasia.com', 'Telegraaf': 'telegraaf.nl', @@ -116,6 +118,7 @@ const defaultSites = { 'The Mercury Tasmania': 'themercury.com.au', 'The Morning Call': 'mcall.com', 'The Nation': 'thenation.com', + 'The National': 'thenational.scot', 'The News-Gazette': 'news-gazette.com', 'The New Yorker': 'newyorker.com', 'The New York Times': 'nytimes.com',