From a32800cd571c3541b13f8a9f9f38278f90f70d96 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 11 Sep 2020 18:07:02 +0200 Subject: [PATCH] Fix-update sites Nine Entertainment (Australia) Brisbane Times, Sydney Morning Herald & WAtoday --- background.js | 3 +++ contentScript.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index f06047b..ade043f 100644 --- a/background.js +++ b/background.js @@ -144,6 +144,7 @@ var blockedRegexes = { 'bizjournals.com': /(assets\.bizjournals\.com\/static\/js\/app\/cxense\.js|cdn\.cxense\.com)/, 'bloomberg.com': /.+\.tinypass\.com\/.+/, 'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/, +'brisbanetimes.com.au': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/, 'businessinsider.com': /.+\.tinypass\.com\/.+/, 'challenges.fr': /.+\.poool\.fr\/.+/, 'charliehebdo.fr': /.+\.poool\.fr\/.+/, @@ -205,6 +206,7 @@ var blockedRegexes = { 'scmp.com': /.+\.tinypass\.com\/.+/, 'sfchronicle.com': /.+\.blueconic\.net\/.+/, 'sloanreview.mit.edu': /(.+\.tinypass\.com\/.+|.+\.netdna-ssl\.com\/wp-content\/themes\/smr\/assets\/js\/libs\/welcome-ad\.js)/, +'smh.com.au': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/, 'spectator.co.uk': /.+\.tinypass\.com\/.+/, 'spectator.com.au': /.+\.tinypass\.com\/.+/, 'technologyreview.com': /.+\.blueconic\.net\/.+/, @@ -215,6 +217,7 @@ var blockedRegexes = { 'thenation.com': /.+\.tinypass\.com\/.+/, 'valeursactuelles.com': /.+\.qiota\.com\/.+/, 'washingtonpost.com': /.+\.washingtonpost\.com\/dr\/resources\/dist\/washpost\/pwapi-proxy\.min\.js/, +'watoday.com.au': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/, 'wsj.com': /(cdn\.ampproject\.org\/v\d\/amp-access-.+\.js|cdn\.cxense\.com)/ }; diff --git a/contentScript.js b/contentScript.js index 38ac9ae..2445b76 100644 --- a/contentScript.js +++ b/contentScript.js @@ -40,14 +40,14 @@ if (matchDomain("thesaturdaypaper.com.au")) { removeDOMElement(paywall); } -else if (matchDomain(["theage.com.au"])) { +else if (domain = matchDomain(["brisbanetimes.com.au", "smh.com.au", "theage.com.au", "watoday.com.au"])) { let url = window.location.href; let for_subscribers = document.querySelector('meta[content^="FOR SUBSCRIBERS"]'); if (for_subscribers) { window.setTimeout(function () { window.location.href = url.replace('www.', 'amp.'); }, 500); // Delay (in milliseconds) - } else if (url.includes('amp.theage.com.au')) { + } else if (url.includes('amp.' + domain)) { let subscr_sections = document.querySelectorAll('div[subscriptions-section="content"]'); for (let subscr_section of subscr_sections) { subscr_section.removeAttribute('subscriptions-section');