diff --git a/manifest-ff.json b/manifest-ff.json index e46e62f..9213886 100755 --- a/manifest-ff.json +++ b/manifest-ff.json @@ -77,7 +77,8 @@ "*://*.bostonglobe.com/*", "*://*.theathletic.com/*", "*://*.theathletic.co.uk/*", - "*://*.hbrchina.org/*" + "*://*.hbrchina.org/*", + "*://*.scmp.com/*" ], "js": ["src/js/contentScript.js"] } @@ -282,7 +283,8 @@ "*://*.expansion.com/*", "*://*.theathletic.com/*", "*://*.theathletic.co.uk/*", - "*://*.hbrchina.org/*" + "*://*.hbrchina.org/*", + "*://*.scmp.com/*" ], "version": "1.8.0" } diff --git a/src/js/background.js b/src/js/background.js index 7b2d8a6..278732a 100755 --- a/src/js/background.js +++ b/src/js/background.js @@ -247,7 +247,8 @@ const blockedRegexes = { 'nytimes.com': /(meter-svc\.nytimes\.com\/meter\.js|mwcm\.nyt\.com\/.+\.js|cooking\.nytimes\.com\/api\/.+\/access)/, 'latimes.com': /(metering\.platform\.latimes\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/, 'theathletic.com': /cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js/, - 'japantimes.co.jp': /cdn\.cxense\.com\// + 'japantimes.co.jp': /cdn\.cxense\.com\//, + 'scmp.com': /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/ }; const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'; diff --git a/src/js/contentScript.js b/src/js/contentScript.js index 160a5be..11ec7cc 100755 --- a/src/js/contentScript.js +++ b/src/js/contentScript.js @@ -1,4 +1,4 @@ -if (!matchDomain(['seekingalpha.com', 'sfchronicle.com', 'cen.acs.org', 'elmundo.es'])) { +if (!matchDomain(['seekingalpha.com', 'sfchronicle.com', 'cen.acs.org', 'elmundo.es', 'scmp.com'])) { window.localStorage.clear(); } @@ -710,6 +710,16 @@ if (matchDomain('elmercurio.com')) { if (hiddenDiv) { hiddenDiv.removeAttribute('style'); } +} else if (matchDomain('scmp.com')) { + if (window.location.href.includes('/amp.')) { + const divHidden = document.querySelectorAll('div.article-body[amp-access][amp-access-hide]'); + for (const elem of divHidden) { + elem.removeAttribute('amp-access-hide'); + } + const defaultMeters = document.querySelectorAll('div.default-meter, div#archive-article-meter'); + const ads = document.querySelectorAll('amp-ad, div.ad-banner, div.advert-fly-carpet-container, div.inline-advert'); + removeDOMElement(...defaultMeters, ...ads); + } } function matchDomain (domains) { diff --git a/src/js/sites.js b/src/js/sites.js index dd63d5c..dd262f6 100755 --- a/src/js/sites.js +++ b/src/js/sites.js @@ -114,6 +114,7 @@ const defaultSites = { 'Statista': 'statista.com', 'Stuff': 'stuff.co.nz', "Süddeutsche Zeitung": "sueddeutsche.de", + "South China Morning Post": "scmp.com", 'SunSentinel': 'sun-sentinel.com', 'Tech in Asia': 'techinasia.com', 'Telegraaf': 'telegraaf.nl',