From 1a3f5cdcded02cdeb59b8885aa2f06e6c7ee47ca Mon Sep 17 00:00:00 2001 From: Ashley Connor Date: Sat, 21 Sep 2019 09:50:50 -0400 Subject: [PATCH] Add Newstatesman to no-javascript list - Add gitignore for web-ext-artifacts - Remove trailing whitespace --- .gitignore | 1 + background.js | 6 +++--- contentScript.js | 4 ++-- options.js | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44ce34d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +web-ext-artifacts diff --git a/background.js b/background.js index 50e2268..58706c8 100644 --- a/background.js +++ b/background.js @@ -233,10 +233,10 @@ chrome.webRequest.onBeforeRequest.addListener(function(details) { if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { return; } - return {cancel: true}; + return {cancel: true}; }, { - urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*"], + urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*"], types: ["script"] }, ["blocking"] @@ -295,7 +295,7 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) { // override User-Agent to use Googlebot var useGoogleBot = use_google_bot.filter(function(item) { - return typeof item == 'string' && details.url.indexOf(item) > -1; + return typeof item == 'string' && details.url.indexOf(item) > -1; }).length > 0; if (useGoogleBot) { diff --git a/contentScript.js b/contentScript.js index 3e6cf8f..154c703 100644 --- a/contentScript.js +++ b/contentScript.js @@ -69,7 +69,7 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } } else if (window.location.href.indexOf("wsj.com") !== -1) { if (location.href.includes('/articles/')) { - setTimeout(function() { + setTimeout(function() { document.querySelector('.close-btn').click(); }, 2000); } @@ -86,6 +86,6 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { document.querySelector('.gdpr-consent-container .consent-page:not(.hide) .continue-btn.button.accept-consent').click(); } - }, 300); // Delay (in milliseconds) + }, 300); // Delay (in milliseconds) } } diff --git a/options.js b/options.js index ae39036..64023df 100644 --- a/options.js +++ b/options.js @@ -33,7 +33,7 @@ var defaultSites = { 'MIT Technology Review': 'technologyreview.com', 'Mountain View Voice': 'mv-voice.com', 'National Post': 'nationalpost.com', - 'New Statesman': 'newstatesman.com', + 'New Statesman (javascript disabled)': 'newstatesman.com', 'New York Magazine': 'nymag.com', 'New Zealand Herald': 'nzherald.co.nz', 'Nikkei Asian Review': 'asia.nikkei.com',