From 3cb1435cd5e20938e4b8702bba309b55d74df2d4 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Mon, 14 Oct 2019 14:52:27 +0200 Subject: [PATCH 01/20] Dutch papers/magazines Adding Dutch papers: ad.nl, ed.nl, parool.nl, trouw.nl, telegraaf.nl Adding Dutch magazines: groene.nl, vn.nl Sites added to manifest.json to make contentScrip.js active (also added missing wsj.com, washingtonpost.com & nzherald.co.nz). --- README.md | 7 +++++++ background.js | 20 ++++++++++++++++++-- contentScript.js | 23 +++++++++++++++++++++++ manifest.json | 19 +++++++++++++++++-- options.js | 7 +++++++ 5 files changed, 72 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index da6ef1d..13f7f3d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ### Bypass the following sites' paywalls with this extension +[Algemeen Dagblad](https://www.ad.nl)\ [Baltimore Sun](https://www.baltimoresun.com)\ [Barron's](https://www.barrons.com)\ [Bloomberg](https://www.bloomberg.com)\ @@ -16,9 +17,11 @@ [Corriere Della Sera](https://www.corriere.it)\ [Daily Press](https://www.dailypress.com)\ [Denver Post](https://www.denverpost.com)\ +[De Groene Amsterdammer](https://www.groene.nl)\ [De Tijd](https://www.tijd.be)\ [de Volkskrant](https://www.volkskrant.nl)\ [The Economist](https://www.economist.com)\ +[Eindhovens Dagblad](https://ed.nl)\ [Examiner](https://www.examiner.com.au)\ [Financial Times](https://www.ft.com)\ [Foreign Policy](https://www.foreignpolicy.com)\ @@ -46,10 +49,12 @@ [Orange County Register](https://www.ocregister.com)\ [Orlando Sentinel](https://www.orlandosentinel.com)\ [Palo Alto Online](https://www.paloaltoonline.com)\ +[Parool](https://www.parool.nl)\ [Quartz](https://qz.com)\ [Quora](https://www.quora.com)\ [Statista](https://www.statista.com)\ [SunSentinel](https://www.sun-sentinel.com)\ +[Telegraaf](https://telegraaf.nl)\ [The Advocate](https://www.theadvocate.com.au)\ [The Age](https://www.theage.com.au)\ [The Atlantic](https://www.theatlantic.com)\ @@ -78,7 +83,9 @@ [The Washington Post](https://www.washingtonpost.com)\ [The Wall Street Journal](https://www.wsj.com)\ [Towards Data Science](https://www.towardsdatascience.com)\ +[Trouw](https://www.trouw.nl)\ [Vanity Fair](https://www.vanityfair.com)\ +[Vrij Nederland](https://www.vn.nl)\ [Wired](https://www.wired.com) ### Sites with limited number of free articles diff --git a/background.js b/background.js index 89e4f3a..ca06a2f 100644 --- a/background.js +++ b/background.js @@ -1,6 +1,7 @@ 'use strict'; var defaultSites = { + 'Algemeen Dagblad': 'ad.nl', 'Baltimore Sun': 'baltimoresun.com', 'Barron\'s': 'barrons.com', 'Bloomberg': 'bloomberg.com', @@ -14,8 +15,10 @@ var defaultSites = { 'Daily Press': 'dailypress.com', 'Denver Post': 'denverpost.com', 'De Tijd': 'tijd.be', + 'De Groene Amsterdammer': 'groene.nl', 'de Volkskrant': 'volkskrant.nl', 'The Economist': 'economist.com', + 'Eindhovens Dagblad': 'ed.nl', 'Examiner': 'examiner.com.au', 'Financial Times': 'ft.com', 'Foreign Policy': 'foreignpolicy.com', @@ -43,9 +46,11 @@ var defaultSites = { 'Orange County Register': 'ocregister.com', 'Orlando Sentinel': 'orlandosentinel.com', 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', 'Statista': 'statista.com', + 'Telegraaf': 'telegraaf.nl', 'SunSentinel': 'sun-sentinel.com', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', @@ -74,7 +79,9 @@ var defaultSites = { 'The Washington Post': 'washingtonpost.com', 'The Wall Street Journal': 'wsj.com', 'Towards Data Science': 'towardsdatascience.com', + 'Trouw': 'trouw.nl', 'Vanity Fair': 'vanityfair.com', + 'Vrij Nederland': 'vn.nl', 'Wired': 'wired.com' }; @@ -106,7 +113,13 @@ const allow_cookies = [ 'hbr.org', 'nymag.com', 'theaustralian.com.au', -'volkskrant.nl', +'ad.nl', +'ed.nl', +'parool.nl', +'telegraaf.nl', +'trouw.nl', +'vn.nl', +'volkskrant.nl' ] // Removes cookies after page load @@ -140,13 +153,16 @@ const remove_cookies = [ 'washingtonpost.com', 'nymag.com', 'nationalpost.com', -'volkskrant.nl', 'handelsblatt.com', 'thediplomat.com', 'latimes.com', 'theatlantic.com', 'chicagobusiness.com', 'qz.com', +'ad.nl', +'ed.nl', +'telegraaf.nl', +'vn.nl' ] // Override User-Agent with Googlebot diff --git a/contentScript.js b/contentScript.js index 154c703..0435762 100644 --- a/contentScript.js +++ b/contentScript.js @@ -88,4 +88,27 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } }, 300); // Delay (in milliseconds) } +} else if (window.location.href.indexOf('telegraaf.nl') !== -1) { + const paywall = document.getElementById('TEMPRORARY_METERING_ID'); + if (paywall) { + window.location.reload(1); + } +} else if (window.location.href.indexOf('ed.nl') !== -1) { + const paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); + if (paywall) { + paywall.remove(); + paywall = null; + } +} else if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { + document.addEventListener('DOMContentLoaded', () => { + const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); + const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); + removeDOMElement(paywall, hidden_section); + }); +} + +function removeDOMElement(...elements) { + for (let element of elements) { + if (element) element.remove(); + } } diff --git a/manifest.json b/manifest.json index 1f58a10..f0d4167 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,15 @@ "*://*.bizjournals.com/*", "*://*.businessinsider.com/*", "*://*.haaretz.co.il/*", - "*://*.repubblica.it/*" + "*://*.nzherald.co.nz/*", + "*://*.repubblica.it/*", + "*://*.washingtonpost.com/*", + "*://*.wsj.com/*", + "*://*.ed.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.volkskrant.nl/*" ], "js": ["contentScript.js"] } @@ -121,7 +129,14 @@ "*://*.wired.com/*", "*://*.thediplomat.com/*", "*://*.theatlantic.com/*", - "*://*.qz.com/*" + "*://*.qz.com/*", + "*://*.ad.nl/*", + "*://*.ed.nl/*", + "*://*.groene.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.vn.nl/*" ], "version": "1.5.9" } diff --git a/options.js b/options.js index 694161e..dfc1a74 100644 --- a/options.js +++ b/options.js @@ -1,4 +1,5 @@ var defaultSites = { + 'Algemeen Dagblad': 'ad.nl', 'Baltimore Sun': 'baltimoresun.com', 'Barron\'s': 'barrons.com', 'Bloomberg': 'bloomberg.com', @@ -11,9 +12,11 @@ var defaultSites = { 'Corriere Della Sera': 'corriere.it', 'Daily Press': 'dailypress.com', 'Denver Post': 'denverpost.com', + 'De Groene Amsterdammer': 'groene.nl', 'De Tijd': 'tijd.be', 'de Volkskrant': 'volkskrant.nl', 'The Economist (javascript disabled)': 'economist.com', + 'Eindhovens Dagblad': 'ed.nl', 'Examiner': 'examiner.com.au', 'Financial Times': 'ft.com', 'Foreign Policy': 'foreignpolicy.com', @@ -41,10 +44,12 @@ var defaultSites = { 'Orange County Register': 'ocregister.com', 'Orlando Sentinel': 'orlandosentinel.com', 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', 'Statista': 'statista.com', 'SunSentinel': 'sun-sentinel.com', + 'Telegraaf': 'telegraaf.nl', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', 'The Atlantic': 'theatlantic.com', @@ -73,7 +78,9 @@ var defaultSites = { 'The Washington Post': 'washingtonpost.com', 'The Wall Street Journal': 'wsj.com', 'Towards Data Science': 'towardsdatascience.com', + 'Trouw': 'trouw.nl', 'Vanity Fair': 'vanityfair.com', + 'Vrij Nederland': 'vn.nl', 'Wired': 'wired.com' }; From a26f2571ee2aa87d3ab2f7631359288818139937 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Mon, 14 Oct 2019 16:09:20 +0200 Subject: [PATCH 02/20] Fix for WSJ redirect issue (print edition) Fixes issue #345 --- background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/background.js b/background.js index ca06a2f..da89538 100644 --- a/background.js +++ b/background.js @@ -228,7 +228,7 @@ browser.runtime.onInstalled.addListener(function(details) { // WSJ bypass browser.webRequest.onBeforeSendHeaders.addListener(function(details) { - if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { + if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { return; } From 8cc78bc25468b03e385487b7808320e53aac1178 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:51:01 +0200 Subject: [PATCH 03/20] Styling --- manifest.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index f0d4167..53a15da 100644 --- a/manifest.json +++ b/manifest.json @@ -10,13 +10,13 @@ "*://*.haaretz.co.il/*", "*://*.nzherald.co.nz/*", "*://*.repubblica.it/*", - "*://*.washingtonpost.com/*", - "*://*.wsj.com/*", - "*://*.ed.nl/*", - "*://*.parool.nl/*", - "*://*.telegraaf.nl/*", - "*://*.trouw.nl/*", - "*://*.volkskrant.nl/*" + "*://*.washingtonpost.com/*", + "*://*.wsj.com/*", + "*://*.ed.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.volkskrant.nl/*" ], "js": ["contentScript.js"] } @@ -138,5 +138,5 @@ "*://*.trouw.nl/*", "*://*.vn.nl/*" ], - "version": "1.5.9" + "version": "1.6.0" } From 4c28bd38ef498720a6763756d5df018698dbf647 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 15 Oct 2019 13:52:27 +0200 Subject: [PATCH 04/20] Reverse version. --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 53a15da..29c8e03 100644 --- a/manifest.json +++ b/manifest.json @@ -138,5 +138,5 @@ "*://*.trouw.nl/*", "*://*.vn.nl/*" ], - "version": "1.6.0" + "version": "1.5.9" } From efa8e0f9fe6ec0c74358af5e50ccf28872916364 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 16 Oct 2019 09:33:59 +0200 Subject: [PATCH 05/20] Fix previous merges --- contentScript.js | 160 ++++++++++++++++++++++++----------------------- manifest.json | 14 ++--- 2 files changed, 90 insertions(+), 84 deletions(-) diff --git a/contentScript.js b/contentScript.js index 0435762..f2375b1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1,93 +1,93 @@ window.localStorage.clear(); if (window.location.href.indexOf("bizjournals.com") !== -1) { - const hiddenStory = document.getElementsByClassName( - "js-pre-chunks__story-body" - ); - if (hiddenStory && hiddenStory.length>0) { - hiddenStory[0].style.display = "block"; - } + const hiddenStory = document.getElementsByClassName( + "js-pre-chunks__story-body" + ); + if (hiddenStory && hiddenStory.length > 0) { + hiddenStory[0].style.display = "block"; + } - const payWallMessage = document.getElementsByClassName( - "chunk chunk--flex@lg chunk--paywall" - ); - if (payWallMessage && payWallMessage.length>0 ) { - payWallMessage[0].style.display = "none"; - } + const payWallMessage = document.getElementsByClassName( + "chunk chunk--flex@lg chunk--paywall" + ); + if (payWallMessage && payWallMessage.length > 0) { + payWallMessage[0].style.display = "none"; + } } else if (window.location.href.indexOf("businessinsider.com") !== -1) { - const paywall = document.getElementsByClassName( - "tp-modal" - ); - while (paywall.length > 0) { - paywall[0].parentNode.removeChild(paywall[0]); - } + const paywall = document.getElementsByClassName( + "tp-modal" + ); + while (paywall.length > 0) { + paywall[0].parentNode.removeChild(paywall[0]); + } } else if (location.hostname.endsWith('haaretz.co.il')) { - const html = document.getElementsByTagName('html'); - if (html && html.length > 0) { - html[0].style['overflow-y'] = 'auto'; - } - const msg = document.getElementById('article-wrapper'); - if (msg) { - msg.style['display'] = 'none'; - } + const html = document.getElementsByTagName('html'); + if (html && html.length > 0) { + html[0].style['overflow-y'] = 'auto'; + } + const msg = document.getElementById('article-wrapper'); + if (msg) { + msg.style['display'] = 'none'; + } } else if (window.location.href.indexOf("nzherald.co.nz") !== -1) { - const paywall = document.getElementById( - "article-content" - ); - if (paywall) { - paywall.classList.remove('premium-content'); - paywall.classList.add('full-content'); - var paras = paywall.querySelectorAll("p, span, h2, div"); - var delClass = ""; - for (var i = 0; i < paras.length; i++) { - if (paras[i].nodeName == 'P' || paras[i].nodeName == 'SPAN') { - paras[i].classList.remove("ellipsis"); - if (delClass == "" && paras[i].className != "") { - delClass = paras[i].className; - } else { - if (delClass != "") { - paras[i].classList.remove(delClass); - } - } - } - paras[i].removeAttribute('style'); - } - } + const paywall = document.getElementById( + "article-content" + ); + if (paywall) { + paywall.classList.remove('premium-content'); + paywall.classList.add('full-content'); + var paras = paywall.querySelectorAll("p, span, h2, div"); + var delClass = ""; + for (var i = 0; i < paras.length; i++) { + if (paras[i].nodeName == 'P' || paras[i].nodeName == 'SPAN') { + paras[i].classList.remove("ellipsis"); + if (delClass == "" && paras[i].className != "") { + delClass = paras[i].className; + } else { + if (delClass != "") { + paras[i].classList.remove(delClass); + } + } + } + paras[i].removeAttribute('style'); + } + } } else if (location.hostname.endsWith('rep.repubblica.it')) { - if (location.href.includes("/pwa/")) { - location.href = location.href.replace("/pwa/", "/ws/detail/"); - } + if (location.href.includes("/pwa/")) { + location.href = location.href.replace("/pwa/", "/ws/detail/"); + } - if (location.href.includes("/ws/detail/")) { - const paywall = document.querySelector('.paywall[subscriptions-section="content"]'); - if (paywall) { - paywall.removeAttribute('subscriptions-section'); - const preview = document.querySelector('div[subscriptions-section="content-not-granted"]'); - if (preview) { - preview.remove(); - } - } - } + if (location.href.includes("/ws/detail/")) { + const paywall = document.querySelector('.paywall[subscriptions-section="content"]'); + if (paywall) { + paywall.removeAttribute('subscriptions-section'); + const preview = document.querySelector('div[subscriptions-section="content-not-granted"]'); + if (preview) { + preview.remove(); + } + } + } } else if (window.location.href.indexOf("wsj.com") !== -1) { - if (location.href.includes('/articles/')) { - setTimeout(function() { - document.querySelector('.close-btn').click(); - }, 2000); - } + if (location.href.includes('/articles/')) { + setTimeout(function () { + document.querySelector('.close-btn').click(); + }, 2000); + } } else if (window.location.href.indexOf("washingtonpost.com") !== -1) { - if (location.href.includes('/gdpr-consent/')) { - document.querySelector('.gdpr-consent-container .continue-btn.button.free').click(); + if (location.href.includes('/gdpr-consent/')) { + document.querySelector('.gdpr-consent-container .continue-btn.button.free').click(); - setTimeout(function (){ + setTimeout(function () { - const gdprcheckbox = document.querySelector('.gdpr-consent-container .consent-page:not(.hide) #agree'); - if (gdprcheckbox) { - gdprcheckbox.checked = true; - gdprcheckbox.dispatchEvent(new Event('change')); + const gdprcheckbox = document.querySelector('.gdpr-consent-container .consent-page:not(.hide) #agree'); + if (gdprcheckbox) { + gdprcheckbox.checked = true; + gdprcheckbox.dispatchEvent(new Event('change')); - document.querySelector('.gdpr-consent-container .consent-page:not(.hide) .continue-btn.button.accept-consent').click(); - } - }, 300); // Delay (in milliseconds) - } + document.querySelector('.gdpr-consent-container .consent-page:not(.hide) .continue-btn.button.accept-consent').click(); + } + }, 300); // Delay (in milliseconds) + } } else if (window.location.href.indexOf('telegraaf.nl') !== -1) { const paywall = document.getElementById('TEMPRORARY_METERING_ID'); if (paywall) { @@ -107,8 +107,14 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { }); } +if (window.location.href.indexOf("bloomberg.com") !== -1) { + const paywall = document.getElementById('paywall-banner'); + removeDOMElement(paywall); +} + function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); } } + diff --git a/manifest.json b/manifest.json index 29c8e03..3873395 100644 --- a/manifest.json +++ b/manifest.json @@ -10,13 +10,13 @@ "*://*.haaretz.co.il/*", "*://*.nzherald.co.nz/*", "*://*.repubblica.it/*", - "*://*.washingtonpost.com/*", - "*://*.wsj.com/*", - "*://*.ed.nl/*", - "*://*.parool.nl/*", - "*://*.telegraaf.nl/*", - "*://*.trouw.nl/*", - "*://*.volkskrant.nl/*" + "*://*.washingtonpost.com/*", + "*://*.ed.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.volkskrant.nl/*", + "*://*.bloomberg.com/*" ], "js": ["contentScript.js"] } From a7d5634b2dd9a288f4bd9552c5b987f7eff4bdf9 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 16 Oct 2019 10:07:50 +0200 Subject: [PATCH 06/20] Master contentScript.js ... --- contentScript.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/contentScript.js b/contentScript.js index f2375b1..e0c8be1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -88,26 +88,10 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } }, 300); // Delay (in milliseconds) } -} else if (window.location.href.indexOf('telegraaf.nl') !== -1) { - const paywall = document.getElementById('TEMPRORARY_METERING_ID'); - if (paywall) { - window.location.reload(1); - } -} else if (window.location.href.indexOf('ed.nl') !== -1) { - const paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); - if (paywall) { - paywall.remove(); - paywall = null; - } -} else if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { - document.addEventListener('DOMContentLoaded', () => { - const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); - const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); - removeDOMElement(paywall, hidden_section); - }); } if (window.location.href.indexOf("bloomberg.com") !== -1) { + console.log('inside bloomberg') const paywall = document.getElementById('paywall-banner'); removeDOMElement(paywall); } From 14787ebc02c1248937a9440fa78ec5c9cd910256 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 16 Oct 2019 10:10:01 +0200 Subject: [PATCH 07/20] Add new Dutch papers --- contentScript.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/contentScript.js b/contentScript.js index e0c8be1..f2375b1 100644 --- a/contentScript.js +++ b/contentScript.js @@ -88,10 +88,26 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } }, 300); // Delay (in milliseconds) } +} else if (window.location.href.indexOf('telegraaf.nl') !== -1) { + const paywall = document.getElementById('TEMPRORARY_METERING_ID'); + if (paywall) { + window.location.reload(1); + } +} else if (window.location.href.indexOf('ed.nl') !== -1) { + const paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); + if (paywall) { + paywall.remove(); + paywall = null; + } +} else if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { + document.addEventListener('DOMContentLoaded', () => { + const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); + const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); + removeDOMElement(paywall, hidden_section); + }); } if (window.location.href.indexOf("bloomberg.com") !== -1) { - console.log('inside bloomberg') const paywall = document.getElementById('paywall-banner'); removeDOMElement(paywall); } From f1b4e8126834cfe143e41678739042857f727f6a Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 16 Oct 2019 10:18:39 +0200 Subject: [PATCH 08/20] Fix else if conflict --- contentScript.js | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/contentScript.js b/contentScript.js index f2375b1..05ea00e 100644 --- a/contentScript.js +++ b/contentScript.js @@ -88,23 +88,6 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } }, 300); // Delay (in milliseconds) } -} else if (window.location.href.indexOf('telegraaf.nl') !== -1) { - const paywall = document.getElementById('TEMPRORARY_METERING_ID'); - if (paywall) { - window.location.reload(1); - } -} else if (window.location.href.indexOf('ed.nl') !== -1) { - const paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); - if (paywall) { - paywall.remove(); - paywall = null; - } -} else if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { - document.addEventListener('DOMContentLoaded', () => { - const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); - const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); - removeDOMElement(paywall, hidden_section); - }); } if (window.location.href.indexOf("bloomberg.com") !== -1) { @@ -112,6 +95,29 @@ if (window.location.href.indexOf("bloomberg.com") !== -1) { removeDOMElement(paywall); } +if (window.location.href.indexOf('telegraaf.nl') !== -1) { + const paywall = document.getElementById('TEMPRORARY_METERING_ID'); + if (paywall) { + window.location.reload(1); + } +} + +if (window.location.href.indexOf('ed.nl') !== -1) { + const paywall = document.querySelector('.article__component.article__component--paywall-module-notification'); + if (paywall) { + paywall.remove(); + paywall = null; + } +} + +if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) { + document.addEventListener('DOMContentLoaded', () => { + const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]'); + const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]'); + removeDOMElement(paywall, hidden_section); + }); +} + function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); From b3d38e3c24adaf61226f8921d3d6975a193eaac5 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 22 Oct 2019 14:33:59 +0200 Subject: [PATCH 09/20] Fix Wsj close-button doesn't exist --- contentScript.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contentScript.js b/contentScript.js index 76b9115..1b1f827 100644 --- a/contentScript.js +++ b/contentScript.js @@ -70,8 +70,10 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } else if (window.location.href.indexOf("wsj.com") !== -1) { if (location.href.includes('/articles/')) { setTimeout(function () { - document.querySelector('.close-btn').click(); - }, 2000); + const close_button = document.querySelector('.close-btn'); + if (close_button) + close_button.click(); + }, 300); } } else if (window.location.href.indexOf("washingtonpost.com") !== -1) { if (location.href.includes('/gdpr-consent/')) { From 1aee1be20b39e086f1e764f772991f1d3c5ee734 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 22 Oct 2019 14:37:02 +0200 Subject: [PATCH 10/20] Fix Wsj with googlebot & mod=rsswn obsolete --- background.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index da89538..76424e1 100644 --- a/background.js +++ b/background.js @@ -167,10 +167,12 @@ const remove_cookies = [ // Override User-Agent with Googlebot const use_google_bot = [ -'theaustralian.com.au', -'telegraph.co.uk', -'thetimes.co.uk', 'barrons.com', +'nytimes.com', +'telegraph.co.uk', +'theaustralian.com.au', +'thetimes.co.uk', +'wsj.com', ] function setDefaultOptions() { @@ -226,6 +228,7 @@ browser.runtime.onInstalled.addListener(function(details) { } }); +/** // WSJ bypass browser.webRequest.onBeforeSendHeaders.addListener(function(details) { if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { @@ -248,6 +251,7 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) { {urls:["*://*.wsj.com/*"], types:["main_frame"]}, ["blocking"] ); +**/ // Disable javascript for these sites chrome.webRequest.onBeforeRequest.addListener(function(details) { From e77e783a62a4713a71d4a19bab21bc1927bf8272 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 22 Oct 2019 14:48:31 +0200 Subject: [PATCH 11/20] Restore timing Wsj close button --- contentScript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contentScript.js b/contentScript.js index 1b1f827..86a1886 100644 --- a/contentScript.js +++ b/contentScript.js @@ -73,7 +73,7 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { const close_button = document.querySelector('.close-btn'); if (close_button) close_button.click(); - }, 300); + }, 2000); } } else if (window.location.href.indexOf("washingtonpost.com") !== -1) { if (location.href.includes('/gdpr-consent/')) { From c0056d7665128923276afb427a37f63686e8ce0f Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 22 Oct 2019 15:37:08 +0200 Subject: [PATCH 12/20] Wsj hide banners (close-btn obsolete) --- contentScript.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contentScript.js b/contentScript.js index 86a1886..432ce87 100644 --- a/contentScript.js +++ b/contentScript.js @@ -69,11 +69,18 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } } else if (window.location.href.indexOf("wsj.com") !== -1) { if (location.href.includes('/articles/')) { + document.addEventListener('DOMContentLoaded', () => { + const paywall = document.getElementById('cx-scrim'); + const candybar = document.getElementById('cx-candybar'); + removeDOMElement(paywall, candybar); + }); + /** setTimeout(function () { const close_button = document.querySelector('.close-btn'); if (close_button) close_button.click(); }, 2000); + **/ } } else if (window.location.href.indexOf("washingtonpost.com") !== -1) { if (location.href.includes('/gdpr-consent/')) { From 852f2f5cd99c96dec5703da00bd9346f16cb6d28 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 22 Oct 2019 15:39:48 +0200 Subject: [PATCH 13/20] Add The Telegraph to default sites --- background.js | 1 + 1 file changed, 1 insertion(+) diff --git a/background.js b/background.js index 76424e1..485c953 100644 --- a/background.js +++ b/background.js @@ -74,6 +74,7 @@ var defaultSites = { 'The Spectator': 'spectator.co.uk', 'The Seattle Times': 'seattletimes.com', 'The Sydney Morning Herald': 'smh.com.au', + 'The Telegraph': 'telegraph.co.uk', 'The Times': 'thetimes.co.uk', 'The Toronto Star': 'thestar.com', 'The Washington Post': 'washingtonpost.com', From 1adf9ce6331a074bc8edc5097cadd4a3cc04241e Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 23 Oct 2019 13:06:43 +0200 Subject: [PATCH 14/20] Add Le Monde & maintenance background.js Removing Le Monde paywall while keeping article recommendations in paywall-container. Also removes persistent cookie-banner which links to google.com (only visible with extension). Maintenance: sites only in remove_cookies settings are obsolete because cookies are erased by default (when not in allow_cookies). --- README.md | 1 + background.js | 100 +++++++++++++++++++++-------------------------- contentScript.js | 20 +++++++++- manifest.json | 18 +++++---- options.js | 1 + 5 files changed, 75 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 13f7f3d..f2980ac 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ [Inc.com](https://www.inc.com)\ [Investors Chronicle](https://www.investorschronicle.co.uk)\ [La Repubblica](https://www.repubblica.it)\ +[Le Monde](https://www.lemonde.fr)\ [Le Temps](https://www.letemps.ch)\ [Los Angeles Times](https://www.latimes.com)\ [Medium](https://www.medium.com)\ diff --git a/background.js b/background.js index 485c953..17d041e 100644 --- a/background.js +++ b/background.js @@ -31,6 +31,7 @@ var defaultSites = { 'Inc.com': 'inc.com', 'Investors Chronicle': 'investorschronicle.co.uk', 'La Repubblica': 'repubblica.it', + 'Le Monde': 'lemonde.fr', 'Le Temps': 'letemps.ch', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', @@ -74,7 +75,7 @@ var defaultSites = { 'The Spectator': 'spectator.co.uk', 'The Seattle Times': 'seattletimes.com', 'The Sydney Morning Herald': 'smh.com.au', - 'The Telegraph': 'telegraph.co.uk', + 'The Telegraph': 'telegraph.co.uk', 'The Times': 'thetimes.co.uk', 'The Toronto Star': 'thestar.com', 'The Washington Post': 'washingtonpost.com', @@ -92,78 +93,65 @@ const restrictions = { // Don't remove cookies before page load const allow_cookies = [ +'ad.nl', 'asia.nikkei.com', -'nytimes.com', -'wsj.com', -'ft.com', -'letemps.ch', -'mercurynews.com', -'economist.com', 'bostonglobe.com', 'denverpost.com', -'hacked.com', -'ocregister.com', -'newstatesman.com', -'spectator.co.uk', -'towardsdatascience.com', -'medium.com', -'theadvocate.com.au', -'examiner.com.au', -'thestar.com', -'washingtonpost.com', -'hbr.org', -'nymag.com', -'theaustralian.com.au', -'ad.nl', +'economist.com', 'ed.nl', +'examiner.com.au', +'ft.com', +'hacked.com', +'hbr.org', +'lemonde.fr', +'letemps.ch', +'medium.com', +'mercurynews.com', +'newstatesman.com', +'nymag.com', +'nytimes.com', +'ocregister.com', 'parool.nl', +'spectator.co.uk', 'telegraaf.nl', +'theadvocate.com.au', +'theaustralian.com.au', +'thestar.com', +'towardsdatascience.com', 'trouw.nl', 'vn.nl', -'volkskrant.nl' +'volkskrant.nl', +'washingtonpost.com', +'wsj.com', ] // Removes cookies after page load const remove_cookies = [ +'ad.nl', 'asia.nikkei.com', -'nytimes.com', -'ft.com', -'letemps.ch', -'mercurynews.com', -'theage.com.au', -'economist.com', 'bostonglobe.com', 'denverpost.com', -'hacked.com', -'ocregister.com', -'newstatesman.com', -'spectator.co.uk', -'towardsdatascience.com', -'medium.com', -'theadvocate.com.au', -'examiner.com.au', -'thestar.com', -'centralwesterndaily.com.au', -'theherald.com.au', -'foreignpolicy.com', -'wsj.com', -'glassdoor.com', -'cen.acs.org', -'hbr.org', -'thenewsrep.com', -'washingtonpost.com', -'nymag.com', -'nationalpost.com', -'handelsblatt.com', -'thediplomat.com', -'latimes.com', -'theatlantic.com', -'chicagobusiness.com', -'qz.com', -'ad.nl', +'economist.com', 'ed.nl', +'examiner.com.au', +'ft.com', +'hacked.com', +'hbr.org', +'letemps.ch', +'medium.com', +'mercurynews.com', +'newstatesman.com', +'nymag.com', +'nytimes.com', +'ocregister.com', +'spectator.co.uk', 'telegraaf.nl', -'vn.nl' +'theadvocate.com.au', +'thestar.com', +'towardsdatascience.com', +'vn.nl', +'washingtonpost.com', +'wsj.com', ] // Override User-Agent with Googlebot diff --git a/contentScript.js b/contentScript.js index 432ce87..bbbc6f8 100644 --- a/contentScript.js +++ b/contentScript.js @@ -127,7 +127,25 @@ if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.ind }); } -function removeDOMElement(elements) { +if (window.location.href.indexOf('lemonde.fr') !== -1) { + document.addEventListener('DOMContentLoaded', () => { + const hidden_section = document.getElementsByClassName('article__content--restricted-media')[0]; + if (hidden_section) + hidden_section.classList.remove('article__content--restricted-media'); + const longform_article_restricted = document.getElementsByClassName('article__content--restricted')[0]; + if (longform_article_restricted) + longform_article_restricted.classList.remove('article__content--restricted'); + const longform_paywall = document.getElementsByClassName('paywall--longform')[0]; + if (longform_paywall) + longform_paywall.classList.remove('paywall--longform'); + const paywall = document.getElementById('js-paywall-content'); + const friend_paywall = document.getElementsByClassName('friend--paywall')[0]; + const cookie_banner = document.getElementById('cookie-banner'); + removeDOMElement(paywall, friend_paywall, cookie_banner); + }); +} + +function removeDOMElement(...elements) { for (let element of elements) { if (element) element.remove(); } diff --git a/manifest.json b/manifest.json index 3873395..556766b 100644 --- a/manifest.json +++ b/manifest.json @@ -5,18 +5,19 @@ "content_scripts": [ { "matches": [ - "*://*.bizjournals.com/*", - "*://*.businessinsider.com/*", - "*://*.haaretz.co.il/*", - "*://*.nzherald.co.nz/*", - "*://*.repubblica.it/*", - "*://*.washingtonpost.com/*", + "*://*.bizjournals.com/*", + "*://*.bloomberg.com/*", + "*://*.businessinsider.com/*", "*://*.ed.nl/*", + "*://*.haaretz.co.il/*", + "*://*.lemonde.fr/*", + "*://*.nzherald.co.nz/*", "*://*.parool.nl/*", + "*://*.repubblica.it/*", "*://*.telegraaf.nl/*", "*://*.trouw.nl/*", "*://*.volkskrant.nl/*", - "*://*.bloomberg.com/*" + "*://*.washingtonpost.com/*" ], "js": ["contentScript.js"] } @@ -136,7 +137,8 @@ "*://*.parool.nl/*", "*://*.telegraaf.nl/*", "*://*.trouw.nl/*", - "*://*.vn.nl/*" + "*://*.vn.nl/*", + "*://*.lemonde.fr/*" ], "version": "1.5.9" } diff --git a/options.js b/options.js index dfc1a74..19a0d34 100644 --- a/options.js +++ b/options.js @@ -29,6 +29,7 @@ var defaultSites = { 'Inc.com': 'inc.com', 'Investors Chronicle': 'investorschronicle.co.uk', 'La Repubblica': 'repubblica.it', + 'Le Monde': 'lemonde.fr', 'Le Temps': 'letemps.ch', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', From 67501a72cb1e57a67663aefa3d01f4dc7094a35a Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Wed, 23 Oct 2019 13:52:04 +0200 Subject: [PATCH 15/20] Fix Quartz (qz.com) --- background.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/background.js b/background.js index 17d041e..e6bf9fe 100644 --- a/background.js +++ b/background.js @@ -112,6 +112,7 @@ const allow_cookies = [ 'nytimes.com', 'ocregister.com', 'parool.nl', +'qz.com', 'spectator.co.uk', 'telegraaf.nl', 'theadvocate.com.au', @@ -144,6 +145,7 @@ const remove_cookies = [ 'nymag.com', 'nytimes.com', 'ocregister.com', +'qz.com', 'spectator.co.uk', 'telegraaf.nl', 'theadvocate.com.au', From bc1b3d6e7435062f27d862f53ea4b02ad4f31693 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Fri, 25 Oct 2019 15:00:08 +0200 Subject: [PATCH 16/20] Fix WaPo gdpr cookie-banner (by holding on to wp_gdpr cookie) --- background.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/background.js b/background.js index e6bf9fe..bcb58a8 100644 --- a/background.js +++ b/background.js @@ -156,6 +156,18 @@ const remove_cookies = [ 'wsj.com', ] +// select specific cookie(s) to hold from remove_cookies domains +const remove_cookies_select_hold = { + '.nrc.nl': ['nmt_closed_cookiebar'], + '.washingtonpost.com': ['wp_gdpr'], + '.wsj.com': ['wsjregion'] +} + +// select only specific cookie(s) to drop from remove_cookies domains +const remove_cookies_select_drop = { + 'www.nrc.nl': ['counter'] +} + // Override User-Agent with Googlebot const use_google_bot = [ 'barrons.com', @@ -372,6 +384,17 @@ browser.webRequest.onCompleted.addListener(function(details) { if (cookies[i].firstPartyDomain !== undefined) { cookie.firstPartyDomain = cookies[i].firstPartyDomain; } + + var cookie_domain = cookies[i].domain; + // hold specific cookie(s) from remove_cookies domains + if ((cookie_domain in remove_cookies_select_hold) && remove_cookies_select_hold[cookie_domain].includes(cookies[i].name)){ + continue; // don't remove specific cookie + } + // drop only specific cookie(s) from remove_cookies domains + if ((cookie_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[cookie_domain].includes(cookies[i].name))){ + continue; // only remove specific cookie + } + browser.cookies.remove(cookie); } }); From 0fa95a8fcb6dd1b1c4467a0c98bb1a313a68d2e6 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 27 Oct 2019 16:23:58 -0700 Subject: [PATCH 17/20] Prepare for v1.6.0 release --- README.md | 2 +- manifest.json | 2 +- updates.json | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f2980ac..1f1eb7a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bypass Paywalls for Firefox -## [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi) +## [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.0/bypass_paywalls-1.6.0-an+fx.xpi) ### Bypass the following sites' paywalls with this extension diff --git a/manifest.json b/manifest.json index 556766b..052c628 100644 --- a/manifest.json +++ b/manifest.json @@ -140,5 +140,5 @@ "*://*.vn.nl/*", "*://*.lemonde.fr/*" ], - "version": "1.5.9" + "version": "1.6.0" } diff --git a/updates.json b/updates.json index f5c08fa..994ceed 100644 --- a/updates.json +++ b/updates.json @@ -30,7 +30,9 @@ { "version": "1.5.8", "update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.8/bypass_paywalls-1.5.8-an+fx.xpi" }, { "version": "1.5.9", - "update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi" } + "update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi" }, + { "version": "1.6.0", + "update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.0/bypass_paywalls-1.6.0-an+fx.xpi" } ] } } From 11424f7eb235a34d6019af1fec4fef8e55389e14 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Mon, 28 Oct 2019 19:26:52 +0100 Subject: [PATCH 18/20] Cookie-fix for The Diplomat, Chicago Business, Chemical & Engineering News, The Age Cookie-fix for The Diplomat, Chicago Business, Chemical & Engineering News, The Age. Collatoral damage of my maintenance to background.js. Until a new release you can install the Cookie Remover Add-on: https://addons.mozilla.org/en-US/firefox/addon/cookie-remover for these sites. Btw theharald.com.au has changed to newcastleherald.com.au (not changed), centralwesterndaily.com.au has no cookie-fix --- background.js | 866 +++++++++++++++++++++++++------------------------- 1 file changed, 437 insertions(+), 429 deletions(-) diff --git a/background.js b/background.js index bcb58a8..e5e6c15 100644 --- a/background.js +++ b/background.js @@ -1,429 +1,437 @@ -'use strict'; - -var defaultSites = { - 'Algemeen Dagblad': 'ad.nl', - 'Baltimore Sun': 'baltimoresun.com', - 'Barron\'s': 'barrons.com', - 'Bloomberg': 'bloomberg.com', - 'Business Insider': 'businessinsider.com', - 'Caixin': 'caixinglobal.com', - 'Chemical & Engineering News': 'cen.acs.org', - 'Chicago Tribune': 'chicagotribune.com', - 'Central Western Daily': 'centralwesterndaily.com.au', - 'Crain\'s Chicago Business': 'chicagobusiness.com', - 'Corriere Della Sera': 'corriere.it', - 'Daily Press': 'dailypress.com', - 'Denver Post': 'denverpost.com', - 'De Tijd': 'tijd.be', - 'De Groene Amsterdammer': 'groene.nl', - 'de Volkskrant': 'volkskrant.nl', - 'The Economist': 'economist.com', - 'Eindhovens Dagblad': 'ed.nl', - 'Examiner': 'examiner.com.au', - 'Financial Times': 'ft.com', - 'Foreign Policy': 'foreignpolicy.com', - 'Glassdoor': 'glassdoor.com', - 'Haaretz': 'haaretz.co.il', - 'Haaretz English': 'haaretz.com', - 'Handelsblatt': 'handelsblatt.com', - 'Hartford Courant': 'courant.com', - 'Harvard Business Review': 'hbr.org', - 'Inc.com': 'inc.com', - 'Investors Chronicle': 'investorschronicle.co.uk', - 'La Repubblica': 'repubblica.it', - 'Le Monde': 'lemonde.fr', - 'Le Temps': 'letemps.ch', - 'Los Angeles Times': 'latimes.com', - 'Medium': 'medium.com', - 'Medscape': 'medscape.com', - 'MIT Technology Review': 'technologyreview.com', - 'Mountain View Voice': 'mv-voice.com', - 'National Post': 'nationalpost.com', - 'New Statesman': 'newstatesman.com', - 'New York Magazine': 'nymag.com', - 'Nikkei Asian Review': 'asia.nikkei.com', - 'NRC': 'nrc.nl', - 'New Zealand Herald': 'nzherald.co.nz', - 'Orange County Register': 'ocregister.com', - 'Orlando Sentinel': 'orlandosentinel.com', - 'Palo Alto Online': 'paloaltoonline.com', - 'Parool': 'parool.nl', - 'Quartz': 'qz.com', - 'Quora': 'quora.com', - 'Statista': 'statista.com', - 'Telegraaf': 'telegraaf.nl', - 'SunSentinel': 'sun-sentinel.com', - 'The Advocate': 'theadvocate.com.au', - 'The Age': 'theage.com.au', - 'The Atlantic': 'theatlantic.com', - 'The Australian': 'theaustralian.com.au', - 'The Australian Financial Review': 'afr.com', - 'The Boston Globe': 'bostonglobe.com', - 'The Business Journals': 'bizjournals.com', - 'The Diplomat': 'thediplomat.com', - 'The Globe and Mail': 'theglobeandmail.com', - 'The Herald': 'theherald.com.au', - 'The Japan Times': 'japantimes.co.jp', - 'TheMarker': 'themarker.com', - 'The Mercury News': 'mercurynews.com', - 'The Morning Call': 'mcall.com', - 'The Nation': 'thenation.com', - 'The New York Times': 'nytimes.com', - 'The New Yorker': 'newyorker.com', - 'The News-Gazette': 'news-gazette.com', - 'The Saturday Paper': 'thesaturdaypaper.com.au', - 'The Spectator': 'spectator.co.uk', - 'The Seattle Times': 'seattletimes.com', - 'The Sydney Morning Herald': 'smh.com.au', - 'The Telegraph': 'telegraph.co.uk', - 'The Times': 'thetimes.co.uk', - 'The Toronto Star': 'thestar.com', - 'The Washington Post': 'washingtonpost.com', - 'The Wall Street Journal': 'wsj.com', - 'Towards Data Science': 'towardsdatascience.com', - 'Trouw': 'trouw.nl', - 'Vanity Fair': 'vanityfair.com', - 'Vrij Nederland': 'vn.nl', - 'Wired': 'wired.com' -}; - -const restrictions = { - 'barrons.com': 'barrons.com/articles' -} - -// Don't remove cookies before page load -const allow_cookies = [ -'ad.nl', -'asia.nikkei.com', -'bostonglobe.com', -'denverpost.com', -'economist.com', -'ed.nl', -'examiner.com.au', -'ft.com', -'hacked.com', -'hbr.org', -'lemonde.fr', -'letemps.ch', -'medium.com', -'mercurynews.com', -'newstatesman.com', -'nymag.com', -'nytimes.com', -'ocregister.com', -'parool.nl', -'qz.com', -'spectator.co.uk', -'telegraaf.nl', -'theadvocate.com.au', -'theaustralian.com.au', -'thestar.com', -'towardsdatascience.com', -'trouw.nl', -'vn.nl', -'volkskrant.nl', -'washingtonpost.com', -'wsj.com', -] - -// Removes cookies after page load -const remove_cookies = [ -'ad.nl', -'asia.nikkei.com', -'bostonglobe.com', -'denverpost.com', -'economist.com', -'ed.nl', -'examiner.com.au', -'ft.com', -'hacked.com', -'hbr.org', -'letemps.ch', -'medium.com', -'mercurynews.com', -'newstatesman.com', -'nymag.com', -'nytimes.com', -'ocregister.com', -'qz.com', -'spectator.co.uk', -'telegraaf.nl', -'theadvocate.com.au', -'thestar.com', -'towardsdatascience.com', -'vn.nl', -'washingtonpost.com', -'wsj.com', -] - -// select specific cookie(s) to hold from remove_cookies domains -const remove_cookies_select_hold = { - '.nrc.nl': ['nmt_closed_cookiebar'], - '.washingtonpost.com': ['wp_gdpr'], - '.wsj.com': ['wsjregion'] -} - -// select only specific cookie(s) to drop from remove_cookies domains -const remove_cookies_select_drop = { - 'www.nrc.nl': ['counter'] -} - -// Override User-Agent with Googlebot -const use_google_bot = [ -'barrons.com', -'nytimes.com', -'telegraph.co.uk', -'theaustralian.com.au', -'thetimes.co.uk', -'wsj.com', -] - -function setDefaultOptions() { - browser.storage.sync.set({ - sites: defaultSites - }, function() { - browser.runtime.openOptionsPage(); - }); -} - -const blockedRegexes = [ -/.+:\/\/.+\.tribdss\.com\//, -/thenation\.com\/.+\/paywall-script\.php/, -/haaretz\.co\.il\/htz\/js\/inter\.js/, -/nzherald\.co\.nz\/.+\/headjs\/.+\.js/ -]; - -const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)" - -var enabledSites = []; - -// Get the enabled sites -browser.storage.sync.get({ - sites: {} -}, function(items) { - var sites = items.sites; - enabledSites = Object.keys(items.sites).map(function(key) { - return items.sites[key]; - }); -}); - -// Listen for changes to options -browser.storage.onChanged.addListener(function(changes, namespace) { - var key; - for (key in changes) { - var storageChange = changes[key]; - if (key === 'sites') { - var sites = storageChange.newValue; - enabledSites = Object.keys(sites).map(function(key) { - return sites[key]; - }); - } - } -}); - -// Set and show default options on install -browser.runtime.onInstalled.addListener(function(details) { - if (details.reason == "install") { - setDefaultOptions(); - } else if (details.reason == "update") { - // User updated extension - } -}); - -/** -// WSJ bypass -browser.webRequest.onBeforeSendHeaders.addListener(function(details) { - if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { - return; - } - - var param; - var updatedUrl; - - param = getParameterByName("mod", details.url); - - if (param === null) { - updatedUrl = stripQueryStringAndHashFromPath(details.url); - updatedUrl += "?mod=rsswn"; - } else { - updatedUrl = details.url.replace(param, "rsswn"); - } - return { redirectUrl: updatedUrl}; -}, -{urls:["*://*.wsj.com/*"], types:["main_frame"]}, -["blocking"] -); -**/ - -// Disable javascript for these sites -chrome.webRequest.onBeforeRequest.addListener(function(details) { - if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { - return; - } - return {cancel: true}; - }, - { - urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*", "*://*.bostonglobe.com/*", "*://*.afr.com/*"], - types: ["script"] - }, - ["blocking"] -); - -browser.webRequest.onBeforeSendHeaders.addListener(function(details) { - if (!isSiteEnabled(details)) { - return; - } - - if (blockedRegexes.some(function(regex) { return regex.test(details.url); })) { - return { cancel: true }; - } - - var requestHeaders = details.requestHeaders; - var tabId = details.tabId; - - var useUserAgentMobile = false; - var setReferer = false; - - // if referer exists, set it to google - requestHeaders = requestHeaders.map(function(requestHeader) { - if (requestHeader.name === 'Referer') { - if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) { - // this fixes images not being loaded on cooking.nytimes.com main page - // referrer has to be *nytimes.com otherwise returns 403 - requestHeader.value = 'https://cooking.nytimes.com'; - } else if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) { - requestHeader.value = 'https://www.facebook.com/'; - } else { - requestHeader.value = 'https://www.google.com/'; - } - setReferer = true; - } - if (requestHeader.name === 'User-Agent') { - useUserAgentMobile = requestHeader.value.toLowerCase().includes("mobile"); - } - - return requestHeader; - }); - - // otherwise add it - if (!setReferer) { - if (details.url.indexOf("wsj.com") !== -1) { - requestHeaders.push({ - name: 'Referer', - value: 'https://www.facebook.com/' - }); - } else { - requestHeaders.push({ - name: 'Referer', - value: 'https://www.google.com/' - }); - } - } - - // override User-Agent to use Googlebot - var useGoogleBot = use_google_bot.filter(function(item) { - return typeof item == 'string' && details.url.indexOf(item) > -1; - }).length > 0; - - if (useGoogleBot) { - requestHeaders.push({ - "name": "User-Agent", - "value": useUserAgentMobile ? userAgentMobile : userAgentDesktop - }) - requestHeaders.push({ - "name": "X-Forwarded-For", - "value": "66.249.66.1" - }) - } - - // remove cookies before page load - requestHeaders = requestHeaders.map(function(requestHeader) { - for (var siteIndex in allow_cookies) { - if (details.url.indexOf(allow_cookies[siteIndex]) !== -1) { - return requestHeader; - } - } - if (requestHeader.name === 'Cookie') { - requestHeader.value = ''; - } - return requestHeader; - }); - - if (tabId !== -1) { - // run contentScript inside tab - browser.tabs.executeScript(tabId, { - file: 'contentScript.js', - runAt: 'document_start' - }, function(res) { - if (browser.runtime.lastError || res[0]) { - return; - } - }); - } - - return { requestHeaders: requestHeaders }; -}, { - urls: [''] -}, ['blocking', 'requestHeaders']); - -// remove cookies after page load -browser.webRequest.onCompleted.addListener(function(details) { - for (var domainIndex in remove_cookies) { - var domainVar = remove_cookies[domainIndex]; - if (!enabledSites.includes(domainVar) || details.url.indexOf(domainVar) === -1) { - continue; // don't remove cookies - } - browser.cookies.getAll({domain: domainVar}, function(cookies) { - for (var i=0; i"] -}); - -function isSiteEnabled(details) { - var isEnabled = enabledSites.some(function(enabledSite) { - var useSite = details.url.indexOf("." + enabledSite) !== -1; - if (enabledSite in restrictions) { - return useSite && details.url.indexOf(restrictions[enabledSite]) !== -1; - } - return useSite; - }); - return isEnabled; -} - -function getParameterByName(name, url) { - if (!url) url = window.location.href; - name = name.replace(/[\[\]]/g, '\\$&'); - var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), - results = regex.exec(url); - if (!results) return null; - if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, ' ')); -} - -function stripQueryStringAndHashFromPath(url) { - return url.split("?")[0].split("#")[0]; -} +'use strict'; + +var defaultSites = { + 'Algemeen Dagblad': 'ad.nl', + 'Baltimore Sun': 'baltimoresun.com', + 'Barron\'s': 'barrons.com', + 'Bloomberg': 'bloomberg.com', + 'Business Insider': 'businessinsider.com', + 'Caixin': 'caixinglobal.com', + 'Chemical & Engineering News': 'cen.acs.org', + 'Chicago Tribune': 'chicagotribune.com', + 'Central Western Daily': 'centralwesterndaily.com.au', + 'Crain\'s Chicago Business': 'chicagobusiness.com', + 'Corriere Della Sera': 'corriere.it', + 'Daily Press': 'dailypress.com', + 'Denver Post': 'denverpost.com', + 'De Tijd': 'tijd.be', + 'De Groene Amsterdammer': 'groene.nl', + 'de Volkskrant': 'volkskrant.nl', + 'The Economist': 'economist.com', + 'Eindhovens Dagblad': 'ed.nl', + 'Examiner': 'examiner.com.au', + 'Financial Times': 'ft.com', + 'Foreign Policy': 'foreignpolicy.com', + 'Glassdoor': 'glassdoor.com', + 'Haaretz': 'haaretz.co.il', + 'Haaretz English': 'haaretz.com', + 'Handelsblatt': 'handelsblatt.com', + 'Hartford Courant': 'courant.com', + 'Harvard Business Review': 'hbr.org', + 'Inc.com': 'inc.com', + 'Investors Chronicle': 'investorschronicle.co.uk', + 'La Repubblica': 'repubblica.it', + 'Le Monde': 'lemonde.fr', + 'Le Temps': 'letemps.ch', + 'Los Angeles Times': 'latimes.com', + 'Medium': 'medium.com', + 'Medscape': 'medscape.com', + 'MIT Technology Review': 'technologyreview.com', + 'Mountain View Voice': 'mv-voice.com', + 'National Post': 'nationalpost.com', + 'New Statesman': 'newstatesman.com', + 'New York Magazine': 'nymag.com', + 'Nikkei Asian Review': 'asia.nikkei.com', + 'NRC': 'nrc.nl', + 'New Zealand Herald': 'nzherald.co.nz', + 'Orange County Register': 'ocregister.com', + 'Orlando Sentinel': 'orlandosentinel.com', + 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', + 'Quartz': 'qz.com', + 'Quora': 'quora.com', + 'Statista': 'statista.com', + 'Telegraaf': 'telegraaf.nl', + 'SunSentinel': 'sun-sentinel.com', + 'The Advocate': 'theadvocate.com.au', + 'The Age': 'theage.com.au', + 'The Atlantic': 'theatlantic.com', + 'The Australian': 'theaustralian.com.au', + 'The Australian Financial Review': 'afr.com', + 'The Boston Globe': 'bostonglobe.com', + 'The Business Journals': 'bizjournals.com', + 'The Diplomat': 'thediplomat.com', + 'The Globe and Mail': 'theglobeandmail.com', + 'The Herald': 'theherald.com.au', + 'The Japan Times': 'japantimes.co.jp', + 'TheMarker': 'themarker.com', + 'The Mercury News': 'mercurynews.com', + 'The Morning Call': 'mcall.com', + 'The Nation': 'thenation.com', + 'The New York Times': 'nytimes.com', + 'The New Yorker': 'newyorker.com', + 'The News-Gazette': 'news-gazette.com', + 'The Saturday Paper': 'thesaturdaypaper.com.au', + 'The Spectator': 'spectator.co.uk', + 'The Seattle Times': 'seattletimes.com', + 'The Sydney Morning Herald': 'smh.com.au', + 'The Telegraph': 'telegraph.co.uk', + 'The Times': 'thetimes.co.uk', + 'The Toronto Star': 'thestar.com', + 'The Washington Post': 'washingtonpost.com', + 'The Wall Street Journal': 'wsj.com', + 'Towards Data Science': 'towardsdatascience.com', + 'Trouw': 'trouw.nl', + 'Vanity Fair': 'vanityfair.com', + 'Vrij Nederland': 'vn.nl', + 'Wired': 'wired.com' +}; + +const restrictions = { + 'barrons.com': 'barrons.com/articles' +} + +// Don't remove cookies before page load +const allow_cookies = [ +'ad.nl', +'asia.nikkei.com', +'bostonglobe.com', +'cen.acs.org', +'chicagobusiness.com', +'denverpost.com', +'economist.com', +'ed.nl', +'examiner.com.au', +'ft.com', +'hacked.com', +'hbr.org', +'lemonde.fr', +'letemps.ch', +'medium.com', +'mercurynews.com', +'newstatesman.com', +'nymag.com', +'nytimes.com', +'ocregister.com', +'parool.nl', +'qz.com', +'spectator.co.uk', +'telegraaf.nl', +'theadvocate.com.au', +'theage.com.au', +'theaustralian.com.au', +'thediplomat.com', +'thestar.com', +'towardsdatascience.com', +'trouw.nl', +'vn.nl', +'volkskrant.nl', +'washingtonpost.com', +'wsj.com', +] + +// Removes cookies after page load +const remove_cookies = [ +'ad.nl', +'asia.nikkei.com', +'bostonglobe.com', +'cen.acs.org', +'chicagobusiness.com', +'denverpost.com', +'economist.com', +'ed.nl', +'examiner.com.au', +'ft.com', +'hacked.com', +'hbr.org', +'letemps.ch', +'medium.com', +'mercurynews.com', +'newstatesman.com', +'nymag.com', +'nytimes.com', +'ocregister.com', +'qz.com', +'spectator.co.uk', +'telegraaf.nl', +'theadvocate.com.au', +'theage.com.au', +'thediplomat.com', +'thestar.com', +'towardsdatascience.com', +'vn.nl', +'washingtonpost.com', +'wsj.com', +] + +// select specific cookie(s) to hold from remove_cookies domains +const remove_cookies_select_hold = { + '.nrc.nl': ['nmt_closed_cookiebar'], + '.washingtonpost.com': ['wp_gdpr'], + '.wsj.com': ['wsjregion'] +} + +// select only specific cookie(s) to drop from remove_cookies domains +const remove_cookies_select_drop = { + 'www.nrc.nl': ['counter'] +} + +// Override User-Agent with Googlebot +const use_google_bot = [ +'barrons.com', +'nytimes.com', +'telegraph.co.uk', +'theaustralian.com.au', +'thetimes.co.uk', +'wsj.com', +] + +function setDefaultOptions() { + browser.storage.sync.set({ + sites: defaultSites + }, function() { + browser.runtime.openOptionsPage(); + }); +} + +const blockedRegexes = [ +/.+:\/\/.+\.tribdss\.com\//, +/thenation\.com\/.+\/paywall-script\.php/, +/haaretz\.co\.il\/htz\/js\/inter\.js/, +/nzherald\.co\.nz\/.+\/headjs\/.+\.js/ +]; + +const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" +const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)" + +var enabledSites = []; + +// Get the enabled sites +browser.storage.sync.get({ + sites: {} +}, function(items) { + var sites = items.sites; + enabledSites = Object.keys(items.sites).map(function(key) { + return items.sites[key]; + }); +}); + +// Listen for changes to options +browser.storage.onChanged.addListener(function(changes, namespace) { + var key; + for (key in changes) { + var storageChange = changes[key]; + if (key === 'sites') { + var sites = storageChange.newValue; + enabledSites = Object.keys(sites).map(function(key) { + return sites[key]; + }); + } + } +}); + +// Set and show default options on install +browser.runtime.onInstalled.addListener(function(details) { + if (details.reason == "install") { + setDefaultOptions(); + } else if (details.reason == "update") { + // User updated extension + } +}); + +/** +// WSJ bypass +browser.webRequest.onBeforeSendHeaders.addListener(function(details) { + if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { + return; + } + + var param; + var updatedUrl; + + param = getParameterByName("mod", details.url); + + if (param === null) { + updatedUrl = stripQueryStringAndHashFromPath(details.url); + updatedUrl += "?mod=rsswn"; + } else { + updatedUrl = details.url.replace(param, "rsswn"); + } + return { redirectUrl: updatedUrl}; +}, +{urls:["*://*.wsj.com/*"], types:["main_frame"]}, +["blocking"] +); +**/ + +// Disable javascript for these sites +chrome.webRequest.onBeforeRequest.addListener(function(details) { + if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { + return; + } + return {cancel: true}; + }, + { + urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*", "*://*.bostonglobe.com/*", "*://*.afr.com/*"], + types: ["script"] + }, + ["blocking"] +); + +browser.webRequest.onBeforeSendHeaders.addListener(function(details) { + if (!isSiteEnabled(details)) { + return; + } + + if (blockedRegexes.some(function(regex) { return regex.test(details.url); })) { + return { cancel: true }; + } + + var requestHeaders = details.requestHeaders; + var tabId = details.tabId; + + var useUserAgentMobile = false; + var setReferer = false; + + // if referer exists, set it to google + requestHeaders = requestHeaders.map(function(requestHeader) { + if (requestHeader.name === 'Referer') { + if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) { + // this fixes images not being loaded on cooking.nytimes.com main page + // referrer has to be *nytimes.com otherwise returns 403 + requestHeader.value = 'https://cooking.nytimes.com'; + } else if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) { + requestHeader.value = 'https://www.facebook.com/'; + } else { + requestHeader.value = 'https://www.google.com/'; + } + setReferer = true; + } + if (requestHeader.name === 'User-Agent') { + useUserAgentMobile = requestHeader.value.toLowerCase().includes("mobile"); + } + + return requestHeader; + }); + + // otherwise add it + if (!setReferer) { + if (details.url.indexOf("wsj.com") !== -1) { + requestHeaders.push({ + name: 'Referer', + value: 'https://www.facebook.com/' + }); + } else { + requestHeaders.push({ + name: 'Referer', + value: 'https://www.google.com/' + }); + } + } + + // override User-Agent to use Googlebot + var useGoogleBot = use_google_bot.filter(function(item) { + return typeof item == 'string' && details.url.indexOf(item) > -1; + }).length > 0; + + if (useGoogleBot) { + requestHeaders.push({ + "name": "User-Agent", + "value": useUserAgentMobile ? userAgentMobile : userAgentDesktop + }) + requestHeaders.push({ + "name": "X-Forwarded-For", + "value": "66.249.66.1" + }) + } + + // remove cookies before page load + requestHeaders = requestHeaders.map(function(requestHeader) { + for (var siteIndex in allow_cookies) { + if (details.url.indexOf(allow_cookies[siteIndex]) !== -1) { + return requestHeader; + } + } + if (requestHeader.name === 'Cookie') { + requestHeader.value = ''; + } + return requestHeader; + }); + + if (tabId !== -1) { + // run contentScript inside tab + browser.tabs.executeScript(tabId, { + file: 'contentScript.js', + runAt: 'document_start' + }, function(res) { + if (browser.runtime.lastError || res[0]) { + return; + } + }); + } + + return { requestHeaders: requestHeaders }; +}, { + urls: [''] +}, ['blocking', 'requestHeaders']); + +// remove cookies after page load +browser.webRequest.onCompleted.addListener(function(details) { + for (var domainIndex in remove_cookies) { + var domainVar = remove_cookies[domainIndex]; + if (!enabledSites.includes(domainVar) || details.url.indexOf(domainVar) === -1) { + continue; // don't remove cookies + } + browser.cookies.getAll({domain: domainVar}, function(cookies) { + for (var i=0; i"] +}); + +function isSiteEnabled(details) { + var isEnabled = enabledSites.some(function(enabledSite) { + var useSite = details.url.indexOf("." + enabledSite) !== -1; + if (enabledSite in restrictions) { + return useSite && details.url.indexOf(restrictions[enabledSite]) !== -1; + } + return useSite; + }); + return isEnabled; +} + +function getParameterByName(name, url) { + if (!url) url = window.location.href; + name = name.replace(/[\[\]]/g, '\\$&'); + var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, ' ')); +} + +function stripQueryStringAndHashFromPath(url) { + return url.split("?")[0].split("#")[0]; +} From 7d20c5e422084585365a54f13c28589640099de6 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 29 Oct 2019 14:05:40 +0100 Subject: [PATCH 19/20] Fix styling --- background.js | 874 +++++++++++++++++++++++++------------------------- 1 file changed, 437 insertions(+), 437 deletions(-) diff --git a/background.js b/background.js index e5e6c15..882f056 100644 --- a/background.js +++ b/background.js @@ -1,437 +1,437 @@ -'use strict'; - -var defaultSites = { - 'Algemeen Dagblad': 'ad.nl', - 'Baltimore Sun': 'baltimoresun.com', - 'Barron\'s': 'barrons.com', - 'Bloomberg': 'bloomberg.com', - 'Business Insider': 'businessinsider.com', - 'Caixin': 'caixinglobal.com', - 'Chemical & Engineering News': 'cen.acs.org', - 'Chicago Tribune': 'chicagotribune.com', - 'Central Western Daily': 'centralwesterndaily.com.au', - 'Crain\'s Chicago Business': 'chicagobusiness.com', - 'Corriere Della Sera': 'corriere.it', - 'Daily Press': 'dailypress.com', - 'Denver Post': 'denverpost.com', - 'De Tijd': 'tijd.be', - 'De Groene Amsterdammer': 'groene.nl', - 'de Volkskrant': 'volkskrant.nl', - 'The Economist': 'economist.com', - 'Eindhovens Dagblad': 'ed.nl', - 'Examiner': 'examiner.com.au', - 'Financial Times': 'ft.com', - 'Foreign Policy': 'foreignpolicy.com', - 'Glassdoor': 'glassdoor.com', - 'Haaretz': 'haaretz.co.il', - 'Haaretz English': 'haaretz.com', - 'Handelsblatt': 'handelsblatt.com', - 'Hartford Courant': 'courant.com', - 'Harvard Business Review': 'hbr.org', - 'Inc.com': 'inc.com', - 'Investors Chronicle': 'investorschronicle.co.uk', - 'La Repubblica': 'repubblica.it', - 'Le Monde': 'lemonde.fr', - 'Le Temps': 'letemps.ch', - 'Los Angeles Times': 'latimes.com', - 'Medium': 'medium.com', - 'Medscape': 'medscape.com', - 'MIT Technology Review': 'technologyreview.com', - 'Mountain View Voice': 'mv-voice.com', - 'National Post': 'nationalpost.com', - 'New Statesman': 'newstatesman.com', - 'New York Magazine': 'nymag.com', - 'Nikkei Asian Review': 'asia.nikkei.com', - 'NRC': 'nrc.nl', - 'New Zealand Herald': 'nzherald.co.nz', - 'Orange County Register': 'ocregister.com', - 'Orlando Sentinel': 'orlandosentinel.com', - 'Palo Alto Online': 'paloaltoonline.com', - 'Parool': 'parool.nl', - 'Quartz': 'qz.com', - 'Quora': 'quora.com', - 'Statista': 'statista.com', - 'Telegraaf': 'telegraaf.nl', - 'SunSentinel': 'sun-sentinel.com', - 'The Advocate': 'theadvocate.com.au', - 'The Age': 'theage.com.au', - 'The Atlantic': 'theatlantic.com', - 'The Australian': 'theaustralian.com.au', - 'The Australian Financial Review': 'afr.com', - 'The Boston Globe': 'bostonglobe.com', - 'The Business Journals': 'bizjournals.com', - 'The Diplomat': 'thediplomat.com', - 'The Globe and Mail': 'theglobeandmail.com', - 'The Herald': 'theherald.com.au', - 'The Japan Times': 'japantimes.co.jp', - 'TheMarker': 'themarker.com', - 'The Mercury News': 'mercurynews.com', - 'The Morning Call': 'mcall.com', - 'The Nation': 'thenation.com', - 'The New York Times': 'nytimes.com', - 'The New Yorker': 'newyorker.com', - 'The News-Gazette': 'news-gazette.com', - 'The Saturday Paper': 'thesaturdaypaper.com.au', - 'The Spectator': 'spectator.co.uk', - 'The Seattle Times': 'seattletimes.com', - 'The Sydney Morning Herald': 'smh.com.au', - 'The Telegraph': 'telegraph.co.uk', - 'The Times': 'thetimes.co.uk', - 'The Toronto Star': 'thestar.com', - 'The Washington Post': 'washingtonpost.com', - 'The Wall Street Journal': 'wsj.com', - 'Towards Data Science': 'towardsdatascience.com', - 'Trouw': 'trouw.nl', - 'Vanity Fair': 'vanityfair.com', - 'Vrij Nederland': 'vn.nl', - 'Wired': 'wired.com' -}; - -const restrictions = { - 'barrons.com': 'barrons.com/articles' -} - -// Don't remove cookies before page load -const allow_cookies = [ -'ad.nl', -'asia.nikkei.com', -'bostonglobe.com', -'cen.acs.org', -'chicagobusiness.com', -'denverpost.com', -'economist.com', -'ed.nl', -'examiner.com.au', -'ft.com', -'hacked.com', -'hbr.org', -'lemonde.fr', -'letemps.ch', -'medium.com', -'mercurynews.com', -'newstatesman.com', -'nymag.com', -'nytimes.com', -'ocregister.com', -'parool.nl', -'qz.com', -'spectator.co.uk', -'telegraaf.nl', -'theadvocate.com.au', -'theage.com.au', -'theaustralian.com.au', -'thediplomat.com', -'thestar.com', -'towardsdatascience.com', -'trouw.nl', -'vn.nl', -'volkskrant.nl', -'washingtonpost.com', -'wsj.com', -] - -// Removes cookies after page load -const remove_cookies = [ -'ad.nl', -'asia.nikkei.com', -'bostonglobe.com', -'cen.acs.org', -'chicagobusiness.com', -'denverpost.com', -'economist.com', -'ed.nl', -'examiner.com.au', -'ft.com', -'hacked.com', -'hbr.org', -'letemps.ch', -'medium.com', -'mercurynews.com', -'newstatesman.com', -'nymag.com', -'nytimes.com', -'ocregister.com', -'qz.com', -'spectator.co.uk', -'telegraaf.nl', -'theadvocate.com.au', -'theage.com.au', -'thediplomat.com', -'thestar.com', -'towardsdatascience.com', -'vn.nl', -'washingtonpost.com', -'wsj.com', -] - -// select specific cookie(s) to hold from remove_cookies domains -const remove_cookies_select_hold = { - '.nrc.nl': ['nmt_closed_cookiebar'], - '.washingtonpost.com': ['wp_gdpr'], - '.wsj.com': ['wsjregion'] -} - -// select only specific cookie(s) to drop from remove_cookies domains -const remove_cookies_select_drop = { - 'www.nrc.nl': ['counter'] -} - -// Override User-Agent with Googlebot -const use_google_bot = [ -'barrons.com', -'nytimes.com', -'telegraph.co.uk', -'theaustralian.com.au', -'thetimes.co.uk', -'wsj.com', -] - -function setDefaultOptions() { - browser.storage.sync.set({ - sites: defaultSites - }, function() { - browser.runtime.openOptionsPage(); - }); -} - -const blockedRegexes = [ -/.+:\/\/.+\.tribdss\.com\//, -/thenation\.com\/.+\/paywall-script\.php/, -/haaretz\.co\.il\/htz\/js\/inter\.js/, -/nzherald\.co\.nz\/.+\/headjs\/.+\.js/ -]; - -const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" -const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)" - -var enabledSites = []; - -// Get the enabled sites -browser.storage.sync.get({ - sites: {} -}, function(items) { - var sites = items.sites; - enabledSites = Object.keys(items.sites).map(function(key) { - return items.sites[key]; - }); -}); - -// Listen for changes to options -browser.storage.onChanged.addListener(function(changes, namespace) { - var key; - for (key in changes) { - var storageChange = changes[key]; - if (key === 'sites') { - var sites = storageChange.newValue; - enabledSites = Object.keys(sites).map(function(key) { - return sites[key]; - }); - } - } -}); - -// Set and show default options on install -browser.runtime.onInstalled.addListener(function(details) { - if (details.reason == "install") { - setDefaultOptions(); - } else if (details.reason == "update") { - // User updated extension - } -}); - -/** -// WSJ bypass -browser.webRequest.onBeforeSendHeaders.addListener(function(details) { - if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { - return; - } - - var param; - var updatedUrl; - - param = getParameterByName("mod", details.url); - - if (param === null) { - updatedUrl = stripQueryStringAndHashFromPath(details.url); - updatedUrl += "?mod=rsswn"; - } else { - updatedUrl = details.url.replace(param, "rsswn"); - } - return { redirectUrl: updatedUrl}; -}, -{urls:["*://*.wsj.com/*"], types:["main_frame"]}, -["blocking"] -); -**/ - -// Disable javascript for these sites -chrome.webRequest.onBeforeRequest.addListener(function(details) { - if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { - return; - } - return {cancel: true}; - }, - { - urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*", "*://*.bostonglobe.com/*", "*://*.afr.com/*"], - types: ["script"] - }, - ["blocking"] -); - -browser.webRequest.onBeforeSendHeaders.addListener(function(details) { - if (!isSiteEnabled(details)) { - return; - } - - if (blockedRegexes.some(function(regex) { return regex.test(details.url); })) { - return { cancel: true }; - } - - var requestHeaders = details.requestHeaders; - var tabId = details.tabId; - - var useUserAgentMobile = false; - var setReferer = false; - - // if referer exists, set it to google - requestHeaders = requestHeaders.map(function(requestHeader) { - if (requestHeader.name === 'Referer') { - if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) { - // this fixes images not being loaded on cooking.nytimes.com main page - // referrer has to be *nytimes.com otherwise returns 403 - requestHeader.value = 'https://cooking.nytimes.com'; - } else if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) { - requestHeader.value = 'https://www.facebook.com/'; - } else { - requestHeader.value = 'https://www.google.com/'; - } - setReferer = true; - } - if (requestHeader.name === 'User-Agent') { - useUserAgentMobile = requestHeader.value.toLowerCase().includes("mobile"); - } - - return requestHeader; - }); - - // otherwise add it - if (!setReferer) { - if (details.url.indexOf("wsj.com") !== -1) { - requestHeaders.push({ - name: 'Referer', - value: 'https://www.facebook.com/' - }); - } else { - requestHeaders.push({ - name: 'Referer', - value: 'https://www.google.com/' - }); - } - } - - // override User-Agent to use Googlebot - var useGoogleBot = use_google_bot.filter(function(item) { - return typeof item == 'string' && details.url.indexOf(item) > -1; - }).length > 0; - - if (useGoogleBot) { - requestHeaders.push({ - "name": "User-Agent", - "value": useUserAgentMobile ? userAgentMobile : userAgentDesktop - }) - requestHeaders.push({ - "name": "X-Forwarded-For", - "value": "66.249.66.1" - }) - } - - // remove cookies before page load - requestHeaders = requestHeaders.map(function(requestHeader) { - for (var siteIndex in allow_cookies) { - if (details.url.indexOf(allow_cookies[siteIndex]) !== -1) { - return requestHeader; - } - } - if (requestHeader.name === 'Cookie') { - requestHeader.value = ''; - } - return requestHeader; - }); - - if (tabId !== -1) { - // run contentScript inside tab - browser.tabs.executeScript(tabId, { - file: 'contentScript.js', - runAt: 'document_start' - }, function(res) { - if (browser.runtime.lastError || res[0]) { - return; - } - }); - } - - return { requestHeaders: requestHeaders }; -}, { - urls: [''] -}, ['blocking', 'requestHeaders']); - -// remove cookies after page load -browser.webRequest.onCompleted.addListener(function(details) { - for (var domainIndex in remove_cookies) { - var domainVar = remove_cookies[domainIndex]; - if (!enabledSites.includes(domainVar) || details.url.indexOf(domainVar) === -1) { - continue; // don't remove cookies - } - browser.cookies.getAll({domain: domainVar}, function(cookies) { - for (var i=0; i"] -}); - -function isSiteEnabled(details) { - var isEnabled = enabledSites.some(function(enabledSite) { - var useSite = details.url.indexOf("." + enabledSite) !== -1; - if (enabledSite in restrictions) { - return useSite && details.url.indexOf(restrictions[enabledSite]) !== -1; - } - return useSite; - }); - return isEnabled; -} - -function getParameterByName(name, url) { - if (!url) url = window.location.href; - name = name.replace(/[\[\]]/g, '\\$&'); - var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), - results = regex.exec(url); - if (!results) return null; - if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, ' ')); -} - -function stripQueryStringAndHashFromPath(url) { - return url.split("?")[0].split("#")[0]; -} +'use strict'; + +var defaultSites = { + 'Algemeen Dagblad': 'ad.nl', + 'Baltimore Sun': 'baltimoresun.com', + 'Barron\'s': 'barrons.com', + 'Bloomberg': 'bloomberg.com', + 'Business Insider': 'businessinsider.com', + 'Caixin': 'caixinglobal.com', + 'Chemical & Engineering News': 'cen.acs.org', + 'Chicago Tribune': 'chicagotribune.com', + 'Central Western Daily': 'centralwesterndaily.com.au', + 'Crain\'s Chicago Business': 'chicagobusiness.com', + 'Corriere Della Sera': 'corriere.it', + 'Daily Press': 'dailypress.com', + 'Denver Post': 'denverpost.com', + 'De Tijd': 'tijd.be', + 'De Groene Amsterdammer': 'groene.nl', + 'de Volkskrant': 'volkskrant.nl', + 'The Economist': 'economist.com', + 'Eindhovens Dagblad': 'ed.nl', + 'Examiner': 'examiner.com.au', + 'Financial Times': 'ft.com', + 'Foreign Policy': 'foreignpolicy.com', + 'Glassdoor': 'glassdoor.com', + 'Haaretz': 'haaretz.co.il', + 'Haaretz English': 'haaretz.com', + 'Handelsblatt': 'handelsblatt.com', + 'Hartford Courant': 'courant.com', + 'Harvard Business Review': 'hbr.org', + 'Inc.com': 'inc.com', + 'Investors Chronicle': 'investorschronicle.co.uk', + 'La Repubblica': 'repubblica.it', + 'Le Monde': 'lemonde.fr', + 'Le Temps': 'letemps.ch', + 'Los Angeles Times': 'latimes.com', + 'Medium': 'medium.com', + 'Medscape': 'medscape.com', + 'MIT Technology Review': 'technologyreview.com', + 'Mountain View Voice': 'mv-voice.com', + 'National Post': 'nationalpost.com', + 'New Statesman': 'newstatesman.com', + 'New York Magazine': 'nymag.com', + 'Nikkei Asian Review': 'asia.nikkei.com', + 'NRC': 'nrc.nl', + 'New Zealand Herald': 'nzherald.co.nz', + 'Orange County Register': 'ocregister.com', + 'Orlando Sentinel': 'orlandosentinel.com', + 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', + 'Quartz': 'qz.com', + 'Quora': 'quora.com', + 'Statista': 'statista.com', + 'Telegraaf': 'telegraaf.nl', + 'SunSentinel': 'sun-sentinel.com', + 'The Advocate': 'theadvocate.com.au', + 'The Age': 'theage.com.au', + 'The Atlantic': 'theatlantic.com', + 'The Australian': 'theaustralian.com.au', + 'The Australian Financial Review': 'afr.com', + 'The Boston Globe': 'bostonglobe.com', + 'The Business Journals': 'bizjournals.com', + 'The Diplomat': 'thediplomat.com', + 'The Globe and Mail': 'theglobeandmail.com', + 'The Herald': 'theherald.com.au', + 'The Japan Times': 'japantimes.co.jp', + 'TheMarker': 'themarker.com', + 'The Mercury News': 'mercurynews.com', + 'The Morning Call': 'mcall.com', + 'The Nation': 'thenation.com', + 'The New York Times': 'nytimes.com', + 'The New Yorker': 'newyorker.com', + 'The News-Gazette': 'news-gazette.com', + 'The Saturday Paper': 'thesaturdaypaper.com.au', + 'The Spectator': 'spectator.co.uk', + 'The Seattle Times': 'seattletimes.com', + 'The Sydney Morning Herald': 'smh.com.au', + 'The Telegraph': 'telegraph.co.uk', + 'The Times': 'thetimes.co.uk', + 'The Toronto Star': 'thestar.com', + 'The Washington Post': 'washingtonpost.com', + 'The Wall Street Journal': 'wsj.com', + 'Towards Data Science': 'towardsdatascience.com', + 'Trouw': 'trouw.nl', + 'Vanity Fair': 'vanityfair.com', + 'Vrij Nederland': 'vn.nl', + 'Wired': 'wired.com' +}; + +const restrictions = { + 'barrons.com': 'barrons.com/articles' +} + +// Don't remove cookies before page load +const allow_cookies = [ +'ad.nl', +'asia.nikkei.com', +'bostonglobe.com', +'cen.acs.org', +'chicagobusiness.com', +'denverpost.com', +'economist.com', +'ed.nl', +'examiner.com.au', +'ft.com', +'hacked.com', +'hbr.org', +'lemonde.fr', +'letemps.ch', +'medium.com', +'mercurynews.com', +'newstatesman.com', +'nymag.com', +'nytimes.com', +'ocregister.com', +'parool.nl', +'qz.com', +'spectator.co.uk', +'telegraaf.nl', +'theadvocate.com.au', +'theage.com.au', +'theaustralian.com.au', +'thediplomat.com', +'thestar.com', +'towardsdatascience.com', +'trouw.nl', +'vn.nl', +'volkskrant.nl', +'washingtonpost.com', +'wsj.com', +] + +// Removes cookies after page load +const remove_cookies = [ +'ad.nl', +'asia.nikkei.com', +'bostonglobe.com', +'cen.acs.org', +'chicagobusiness.com', +'denverpost.com', +'economist.com', +'ed.nl', +'examiner.com.au', +'ft.com', +'hacked.com', +'hbr.org', +'letemps.ch', +'medium.com', +'mercurynews.com', +'newstatesman.com', +'nymag.com', +'nytimes.com', +'ocregister.com', +'qz.com', +'spectator.co.uk', +'telegraaf.nl', +'theadvocate.com.au', +'theage.com.au', +'thediplomat.com', +'thestar.com', +'towardsdatascience.com', +'vn.nl', +'washingtonpost.com', +'wsj.com', +] + +// select specific cookie(s) to hold from remove_cookies domains +const remove_cookies_select_hold = { + '.nrc.nl': ['nmt_closed_cookiebar'], + '.washingtonpost.com': ['wp_gdpr'], + '.wsj.com': ['wsjregion'] +} + +// select only specific cookie(s) to drop from remove_cookies domains +const remove_cookies_select_drop = { + 'www.nrc.nl': ['counter'] +} + +// Override User-Agent with Googlebot +const use_google_bot = [ +'barrons.com', +'nytimes.com', +'telegraph.co.uk', +'theaustralian.com.au', +'thetimes.co.uk', +'wsj.com', +] + +function setDefaultOptions() { + browser.storage.sync.set({ + sites: defaultSites + }, function() { + browser.runtime.openOptionsPage(); + }); +} + +const blockedRegexes = [ +/.+:\/\/.+\.tribdss\.com\//, +/thenation\.com\/.+\/paywall-script\.php/, +/haaretz\.co\.il\/htz\/js\/inter\.js/, +/nzherald\.co\.nz\/.+\/headjs\/.+\.js/ +]; + +const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" +const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)" + +var enabledSites = []; + +// Get the enabled sites +browser.storage.sync.get({ + sites: {} +}, function(items) { + var sites = items.sites; + enabledSites = Object.keys(items.sites).map(function(key) { + return items.sites[key]; + }); +}); + +// Listen for changes to options +browser.storage.onChanged.addListener(function(changes, namespace) { + var key; + for (key in changes) { + var storageChange = changes[key]; + if (key === 'sites') { + var sites = storageChange.newValue; + enabledSites = Object.keys(sites).map(function(key) { + return sites[key]; + }); + } + } +}); + +// Set and show default options on install +browser.runtime.onInstalled.addListener(function(details) { + if (details.reason == "install") { + setDefaultOptions(); + } else if (details.reason == "update") { + // User updated extension + } +}); + +/** +// WSJ bypass +browser.webRequest.onBeforeSendHeaders.addListener(function(details) { + if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { + return; + } + + var param; + var updatedUrl; + + param = getParameterByName("mod", details.url); + + if (param === null) { + updatedUrl = stripQueryStringAndHashFromPath(details.url); + updatedUrl += "?mod=rsswn"; + } else { + updatedUrl = details.url.replace(param, "rsswn"); + } + return { redirectUrl: updatedUrl}; +}, +{urls:["*://*.wsj.com/*"], types:["main_frame"]}, +["blocking"] +); +**/ + +// Disable javascript for these sites +chrome.webRequest.onBeforeRequest.addListener(function(details) { + if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { + return; + } + return {cancel: true}; + }, + { + urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*", "*://*.bostonglobe.com/*", "*://*.afr.com/*"], + types: ["script"] + }, + ["blocking"] +); + +browser.webRequest.onBeforeSendHeaders.addListener(function(details) { + if (!isSiteEnabled(details)) { + return; + } + + if (blockedRegexes.some(function(regex) { return regex.test(details.url); })) { + return { cancel: true }; + } + + var requestHeaders = details.requestHeaders; + var tabId = details.tabId; + + var useUserAgentMobile = false; + var setReferer = false; + + // if referer exists, set it to google + requestHeaders = requestHeaders.map(function(requestHeader) { + if (requestHeader.name === 'Referer') { + if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) { + // this fixes images not being loaded on cooking.nytimes.com main page + // referrer has to be *nytimes.com otherwise returns 403 + requestHeader.value = 'https://cooking.nytimes.com'; + } else if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) { + requestHeader.value = 'https://www.facebook.com/'; + } else { + requestHeader.value = 'https://www.google.com/'; + } + setReferer = true; + } + if (requestHeader.name === 'User-Agent') { + useUserAgentMobile = requestHeader.value.toLowerCase().includes("mobile"); + } + + return requestHeader; + }); + + // otherwise add it + if (!setReferer) { + if (details.url.indexOf("wsj.com") !== -1) { + requestHeaders.push({ + name: 'Referer', + value: 'https://www.facebook.com/' + }); + } else { + requestHeaders.push({ + name: 'Referer', + value: 'https://www.google.com/' + }); + } + } + + // override User-Agent to use Googlebot + var useGoogleBot = use_google_bot.filter(function(item) { + return typeof item == 'string' && details.url.indexOf(item) > -1; + }).length > 0; + + if (useGoogleBot) { + requestHeaders.push({ + "name": "User-Agent", + "value": useUserAgentMobile ? userAgentMobile : userAgentDesktop + }) + requestHeaders.push({ + "name": "X-Forwarded-For", + "value": "66.249.66.1" + }) + } + + // remove cookies before page load + requestHeaders = requestHeaders.map(function(requestHeader) { + for (var siteIndex in allow_cookies) { + if (details.url.indexOf(allow_cookies[siteIndex]) !== -1) { + return requestHeader; + } + } + if (requestHeader.name === 'Cookie') { + requestHeader.value = ''; + } + return requestHeader; + }); + + if (tabId !== -1) { + // run contentScript inside tab + browser.tabs.executeScript(tabId, { + file: 'contentScript.js', + runAt: 'document_start' + }, function(res) { + if (browser.runtime.lastError || res[0]) { + return; + } + }); + } + + return { requestHeaders: requestHeaders }; +}, { + urls: [''] +}, ['blocking', 'requestHeaders']); + +// remove cookies after page load +browser.webRequest.onCompleted.addListener(function(details) { + for (var domainIndex in remove_cookies) { + var domainVar = remove_cookies[domainIndex]; + if (!enabledSites.includes(domainVar) || details.url.indexOf(domainVar) === -1) { + continue; // don't remove cookies + } + browser.cookies.getAll({domain: domainVar}, function(cookies) { + for (var i=0; i"] +}); + +function isSiteEnabled(details) { + var isEnabled = enabledSites.some(function(enabledSite) { + var useSite = details.url.indexOf("." + enabledSite) !== -1; + if (enabledSite in restrictions) { + return useSite && details.url.indexOf(restrictions[enabledSite]) !== -1; + } + return useSite; + }); + return isEnabled; +} + +function getParameterByName(name, url) { + if (!url) url = window.location.href; + name = name.replace(/[\[\]]/g, '\\$&'); + var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, ' ')); +} + +function stripQueryStringAndHashFromPath(url) { + return url.split("?")[0].split("#")[0]; +} From e4f70487fe21b8024adf445165f4e54f39374a86 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 29 Oct 2019 19:27:54 +0100 Subject: [PATCH 20/20] Fix Quora 'read more' error Fixed 'read more' error by adding quora.com to googlebot settings. --- background.js | 1 + 1 file changed, 1 insertion(+) diff --git a/background.js b/background.js index 882f056..d7d2536 100644 --- a/background.js +++ b/background.js @@ -180,6 +180,7 @@ const remove_cookies_select_drop = { const use_google_bot = [ 'barrons.com', 'nytimes.com', +'quora.com', 'telegraph.co.uk', 'theaustralian.com.au', 'thetimes.co.uk',