diff --git a/background.js b/background.js index 919c812..0b4bddf 100755 --- a/background.js +++ b/background.js @@ -197,7 +197,8 @@ var blockedRegexes = { 'thecourier.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/, 'thedailybeast.com': /.+\.tinypass\.com\/.+/, 'thenation.com': /.+\.tinypass\.com\/.+/, -'valeursactuelles.com': /.+\.poool\.fr\/.+/ +'valeursactuelles.com': /.+\.poool\.fr\/.+/, +'wsj.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/contentScript.js b/contentScript.js index 747945f..a67e02e 100755 --- a/contentScript.js +++ b/contentScript.js @@ -121,22 +121,17 @@ else if (matchDomain("wsj.com")) { close_button.click(); } document.addEventListener('DOMContentLoaded', () => { - let wsj_login = document.querySelector('.wsj-snippet-login'); - if (wsj_login && !window.location.hash) { - let url = window.location.href; - if (url.includes('?')) { - window.location.href = url.replace('?', '#refreshed?'); - } else { - window.location.href = url + '#refreshed'; - } + let wsj_login = document.querySelector('.wsj-snippet-login, .wsjpro-label'); + if (wsj_login) { + window.location.href = window.location.href.replace('wsj.com', 'wsj.com/amp'); } }); } else if (matchDomain("sloanreview.mit.edu")) { const read_more = document.querySelector('.btn-read-more'); - if(read_more) - read_more.click(); + if (read_more) + read_more.click(); } else if (matchDomain("mexiconewsdaily.com")) {