From 34d8a2bb6071a408ae2ae6ea5ab077e330b40443 Mon Sep 17 00:00:00 2001 From: Tomas Cimermonas Date: Sun, 6 Oct 2019 20:28:18 +0300 Subject: [PATCH 01/11] Remove paywall from DOM --- contentScript.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contentScript.js b/contentScript.js index 154c703..f8f821a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -89,3 +89,15 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { }, 300); // Delay (in milliseconds) } } + +if (window.location.href.indexOf("bloombergquint.com") !== -1) { + const articlesLeftModal = document.getElementsByClassName('paywall-meter-module__story-paywall-container__1UgCE')[0]; + const paywall = document.getElementById('paywallDmp'); + removeDOMElement(articlesLeftModal, paywall); +} + +function removeDOMElement(...elements) { + for (let element of elements) { + if (element) element.remove(); + } +} From 6af0f1ab0b6535e0764f5c195363ac316bb2e304 Mon Sep 17 00:00:00 2001 From: Tomas Cimermonas Date: Sun, 6 Oct 2019 20:28:35 +0300 Subject: [PATCH 02/11] Add to options & update readme --- README.md | 1 + background.js | 2 ++ options.js | 1 + 3 files changed, 4 insertions(+) diff --git a/README.md b/README.md index da6ef1d..5eddf2f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [Baltimore Sun](https://www.baltimoresun.com)\ [Barron's](https://www.barrons.com)\ [Bloomberg](https://www.bloomberg.com)\ +[Bloomberg Quint]('https://www.bloombergquint.com)\ [Business Insider](https://www.businessinsider.com)\ [Caixin](https://www.caixinglobal.com)\ [Chemical & Engineering News](https://cen.acs.org)\ diff --git a/background.js b/background.js index 89e4f3a..1e90784 100644 --- a/background.js +++ b/background.js @@ -4,6 +4,7 @@ var defaultSites = { 'Baltimore Sun': 'baltimoresun.com', 'Barron\'s': 'barrons.com', 'Bloomberg': 'bloomberg.com', + 'Bloomberg Quint': 'bloombergquint.com', 'Business Insider': 'businessinsider.com', 'Caixin': 'caixinglobal.com', 'Chemical & Engineering News': 'cen.acs.org', @@ -147,6 +148,7 @@ const remove_cookies = [ 'theatlantic.com', 'chicagobusiness.com', 'qz.com', +'bloombergquint.com' ] // Override User-Agent with Googlebot diff --git a/options.js b/options.js index 694161e..699526c 100644 --- a/options.js +++ b/options.js @@ -2,6 +2,7 @@ var defaultSites = { 'Baltimore Sun': 'baltimoresun.com', 'Barron\'s': 'barrons.com', 'Bloomberg': 'bloomberg.com', + 'Bloomberg Quint': 'bloombergquint.com', 'Business Insider': 'businessinsider.com', 'Caixin': 'caixinglobal.com', 'Chemical & Engineering News': 'cen.acs.org', From 7ba7feebd2c26e3f310cc690e112d72c26114cb7 Mon Sep 17 00:00:00 2001 From: Tomas Cimermonas Date: Tue, 8 Oct 2019 18:41:09 +0300 Subject: [PATCH 03/11] Remove medium footer --- contentScript.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/contentScript.js b/contentScript.js index 154c703..fa57321 100644 --- a/contentScript.js +++ b/contentScript.js @@ -89,3 +89,25 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { }, 300); // Delay (in milliseconds) } } + +if (window.location.href.indexOf("medium.com") !== -1) { + const bottomMessageText = 'Get one more story in your member preview when you sign up. It’s free.'; + const DOMElementsToTextDiv = contains('div', bottomMessageText); + + + if(DOMElementsToTextDiv[2]) removeDOMElement(DOMElementsToTextDiv[2]); +} + +function removeDOMElement(...elements) { + for (let element of elements) { + if (element) element.remove(); + } +} + +function contains(selector, text) { + let elements = document.querySelectorAll(selector); + + return Array.prototype.filter.call(elements, function(element){ + return RegExp(text).test(element.textContent); + }); +} \ No newline at end of file From 65bb5fe79405b1a41f053a4a5e8683f34326a746 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Fri, 1 Nov 2019 18:25:06 +0100 Subject: [PATCH 04/11] Add Scientific American (fix free-article limit) No access to subscription-articles. --- README.md | 241 ++++++++++++++++++------------------- background.js | 5 +- manifest.json | 289 +++++++++++++++++++++++---------------------- options.js | 321 +++++++++++++++++++++++++------------------------- 4 files changed, 431 insertions(+), 425 deletions(-) diff --git a/README.md b/README.md index 1f1eb7a..01a7ef7 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,121 @@ -# Bypass Paywalls for Firefox - -## [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 - -[Algemeen Dagblad](https://www.ad.nl)\ -[Baltimore Sun](https://www.baltimoresun.com)\ -[Barron's](https://www.barrons.com)\ -[Bloomberg](https://www.bloomberg.com)\ -[Business Insider](https://www.businessinsider.com)\ -[Caixin](https://www.caixinglobal.com)\ -[Chemical & Engineering News](https://cen.acs.org)\ -[Central Western Daily](https://www.centralwesterndaily.com.au)\ -[Chicago Tribune](https://www.chicagotribune.com)\ -[Crain's Chicago Business](https://www.chicagobusiness.com)\ -[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)\ -[Glassdoor](https://www.glassdoor.com)\ -[Haaretz.co.il](https://www.haaretz.co.il)\ -[Haaretz.com](https://www.haaretz.com)\ -[Handelsblatt](https://www.handelsblatt.com)\ -[Hartford Courant](https://www.courant.com)\ -[Harvard Business Review](https://www.hbr.org)\ -[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)\ -[Medscape](https://www.medscape.com)\ -[MIT Technology Review](https://www.technologyreview.com)\ -[Mountain View Voice](https://www.mv-voice.com)\ -[National Post](https://www.nationalpost.com)\ -[New Statesman](https://www.newstatesman.com)\ -[New York Magazine](https://www.nymag.com)\ -[New Zealand Herald](https://www.nzherald.co.nz)\ -[Nikkei Asian Review](https://asia.nikkei.com)\ -[NRC](https://www.nrc.nl)\ -[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)\ -[The Australian](https://www.theaustralian.com.au)\ -[The Australian Financial Review](https://www.afr.com)\ -[The Boston Globe](https://www.bostonglobe.com)\ -[The Business Journals](https://www.bizjournals.com)\ -[The Diplomat](https://www.thediplomat.com)\ -[The Globe and Mail](https://www.theglobeandmail.com)\ -[The Herald](https://www.theherald.com.au)\ -[The Japan Times](https://www.japantimes.co.jp)\ -[TheMarker](https://www.themarker.com)\ -[The Mercury News](https://www.mercurynews.com)\ -[The Morning Call](https://www.mcall.com)\ -[The Nation](https://www.thenation.com)\ -[The New York Times](https://www.nytimes.com)\ -[The New Yorker](https://www.newyorker.com)\ -[The News-Gazette](https://www.news-gazette.com)\ -[The Saturday Paper](https://www.thesaturdaypaper.com.au)\ -[The Spectator](https://www.spectator.co.uk)\ -[The Seattle Times](https://www.seattletimes.com)\ -[The Sydney Morning Herald](https://www.smh.com.au)\ -[The Telegraph](https://www.telegraph.co.uk)\ -[The Times](https://www.thetimes.co.uk)\ -[The Toronto Star](https://www.thestar.com)\ -[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 -The free article limit can normally be bypassed by removing cookies for the site.* - -Install the [Cookie Remover](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/) Add-on. - -When coming across a paywall click the cookie icon to remove the cookies then refresh the page. - -_*May not always succeed_ - -### New site requests -Only large or major sites will be considered. No small sites or local newspapers. -1. Visit an article on the site you want to bypass the paywall for and copy the article title. -2. Open up a new Private window (Ctrl+Shift+P) and paste the article title into Google. -3. Click on the same article from the Google search results page. If it loads without a paywall you can [submit a request](https://github.com/iamadamdev/bypass-paywalls-firefox/issues/new) to add the site, otherwise my extension cannot bypass it either. - -Usually premium articles cannot be bypassed as they are behind a hard paywall. - -### Troubleshooting -* This add-on works best alongside [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/). -* If a site doesn't work try turning off uBlock and refreshing. - -### Pull Requesets -* PRs are welcome. - -### Show your support -* I am not asking for donations or anything like that, all I ask is that you star this repo. - -### License -Bypass Paywalls is [MIT-licensed](https://github.com/iamadamdev/bypass-paywalls-firefox/blob/master/LICENSE). +# Bypass Paywalls for Firefox + +## [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 + +[Algemeen Dagblad](https://www.ad.nl)\ +[Baltimore Sun](https://www.baltimoresun.com)\ +[Barron's](https://www.barrons.com)\ +[Bloomberg](https://www.bloomberg.com)\ +[Business Insider](https://www.businessinsider.com)\ +[Caixin](https://www.caixinglobal.com)\ +[Chemical & Engineering News](https://cen.acs.org)\ +[Central Western Daily](https://www.centralwesterndaily.com.au)\ +[Chicago Tribune](https://www.chicagotribune.com)\ +[Crain's Chicago Business](https://www.chicagobusiness.com)\ +[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)\ +[Glassdoor](https://www.glassdoor.com)\ +[Haaretz.co.il](https://www.haaretz.co.il)\ +[Haaretz.com](https://www.haaretz.com)\ +[Handelsblatt](https://www.handelsblatt.com)\ +[Hartford Courant](https://www.courant.com)\ +[Harvard Business Review](https://www.hbr.org)\ +[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)\ +[Medscape](https://www.medscape.com)\ +[MIT Technology Review](https://www.technologyreview.com)\ +[Mountain View Voice](https://www.mv-voice.com)\ +[National Post](https://www.nationalpost.com)\ +[New Statesman](https://www.newstatesman.com)\ +[New York Magazine](https://www.nymag.com)\ +[New Zealand Herald](https://www.nzherald.co.nz)\ +[Nikkei Asian Review](https://asia.nikkei.com)\ +[NRC](https://www.nrc.nl)\ +[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)\ +[Scientific American](https://scientificamerican.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)\ +[The Australian](https://www.theaustralian.com.au)\ +[The Australian Financial Review](https://www.afr.com)\ +[The Boston Globe](https://www.bostonglobe.com)\ +[The Business Journals](https://www.bizjournals.com)\ +[The Diplomat](https://www.thediplomat.com)\ +[The Globe and Mail](https://www.theglobeandmail.com)\ +[The Herald](https://www.theherald.com.au)\ +[The Japan Times](https://www.japantimes.co.jp)\ +[TheMarker](https://www.themarker.com)\ +[The Mercury News](https://www.mercurynews.com)\ +[The Morning Call](https://www.mcall.com)\ +[The Nation](https://www.thenation.com)\ +[The New York Times](https://www.nytimes.com)\ +[The New Yorker](https://www.newyorker.com)\ +[The News-Gazette](https://www.news-gazette.com)\ +[The Saturday Paper](https://www.thesaturdaypaper.com.au)\ +[The Spectator](https://www.spectator.co.uk)\ +[The Seattle Times](https://www.seattletimes.com)\ +[The Sydney Morning Herald](https://www.smh.com.au)\ +[The Telegraph](https://www.telegraph.co.uk)\ +[The Times](https://www.thetimes.co.uk)\ +[The Toronto Star](https://www.thestar.com)\ +[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 +The free article limit can normally be bypassed by removing cookies for the site.* + +Install the [Cookie Remover](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/) Add-on. + +When coming across a paywall click the cookie icon to remove the cookies then refresh the page. + +_*May not always succeed_ + +### New site requests +Only large or major sites will be considered. No small sites or local newspapers. +1. Visit an article on the site you want to bypass the paywall for and copy the article title. +2. Open up a new Private window (Ctrl+Shift+P) and paste the article title into Google. +3. Click on the same article from the Google search results page. If it loads without a paywall you can [submit a request](https://github.com/iamadamdev/bypass-paywalls-firefox/issues/new) to add the site, otherwise my extension cannot bypass it either. + +Usually premium articles cannot be bypassed as they are behind a hard paywall. + +### Troubleshooting +* This add-on works best alongside [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/). +* If a site doesn't work try turning off uBlock and refreshing. + +### Pull Requesets +* PRs are welcome. + +### Show your support +* I am not asking for donations or anything like that, all I ask is that you star this repo. + +### License +Bypass Paywalls is [MIT-licensed](https://github.com/iamadamdev/bypass-paywalls-firefox/blob/master/LICENSE). diff --git a/background.js b/background.js index d7d2536..a9bf7a4 100644 --- a/background.js +++ b/background.js @@ -50,9 +50,10 @@ var defaultSites = { 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', + 'Scientific American': 'scientificamerican.com', 'Statista': 'statista.com', - 'Telegraaf': 'telegraaf.nl', 'SunSentinel': 'sun-sentinel.com', + 'Telegraaf': 'telegraaf.nl', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', 'The Atlantic': 'theatlantic.com', @@ -115,6 +116,7 @@ const allow_cookies = [ 'ocregister.com', 'parool.nl', 'qz.com', +'scientificamerican.com', 'spectator.co.uk', 'telegraaf.nl', 'theadvocate.com.au', @@ -152,6 +154,7 @@ const remove_cookies = [ 'nytimes.com', 'ocregister.com', 'qz.com', +'scientificamerican.com', 'spectator.co.uk', 'telegraaf.nl', 'theadvocate.com.au', diff --git a/manifest.json b/manifest.json index 052c628..c56be16 100644 --- a/manifest.json +++ b/manifest.json @@ -1,144 +1,145 @@ -{ - "background": { - "scripts": ["background.js"] - }, - "content_scripts": [ - { - "matches": [ - "*://*.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/*", - "*://*.washingtonpost.com/*" - ], - "js": ["contentScript.js"] - } - ], - "applications": { - "gecko": { - "id": "bypasspaywalls@bypasspaywalls.weebly.com", - "update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-firefox/master/updates.json" - } - }, - "browser_action": { - "default_popup": "popup.html", - "default_icon": { - "128": "bypass.png" - }, - "theme_icons": [ - { - "light": "bypass-dark.png", - "dark": "bypass.png", - "size": 128 - } - ] - }, - "description": "Bypass News Sites' Paywalls", - "icons": { - "128": "bypass.png" - }, - "manifest_version": 2, - "name": "Bypass Paywalls", - "short_name": "Bypass Paywall", - "options_ui": { - "page": "options.html" - }, - "permissions": [ - "cookies", - "storage", - "webRequest", - "webRequestBlocking", - "*://*.baltimoresun.com/*", - "*://*.barrons.com/*", - "*://*.bloomberg.com/*", - "*://*.businessinsider.com/*", - "*://*.caixinglobal.com/*", - "*://*.cen.acs.org/*", - "*://*.chicagotribune.com/*", - "*://*.centralwesterndaily.com.au/*", - "*://*.chicagobusiness.com/*", - "*://*.corriere.it/*", - "*://*.dailypress.com/*", - "*://*.denverpost.com/*", - "*://*.tijd.be/*", - "*://*.volkskrant.nl/*", - "*://*.economist.com/*", - "*://*.examiner.com.au/*", - "*://*.ft.com/*", - "*://*.foreignpolicy.com/*", - "*://*.glassdoor.com/*", - "*://*.haaretz.co.il/*", - "*://*.haaretz.com/*", - "*://*.handelsblatt.com/*", - "*://*.courant.com/*", - "*://*.hbr.org/*", - "*://*.inc.com/*", - "*://*.investorschronicle.co.uk/*", - "*://*.repubblica.it/*", - "*://*.letemps.ch/*", - "*://*.latimes.com/*", - "*://*.medium.com/*", - "*://*.medscape.com/*", - "*://*.technologyreview.com/*", - "*://*.mv-voice.com/*", - "*://*.nationalpost.com/*", - "*://*.newstatesman.com/*", - "*://*.nymag.com/*", - "*://*.nzherald.co.nz/*", - "*://*.asia.nikkei.com/*", - "*://*.nrc.nl/*", - "*://*.ocregister.com/*", - "*://*.orlandosentinel.com/*", - "*://*.paloaltoonline.com/*", - "*://*.quora.com/*", - "*://*.sun-sentinel.com/*", - "*://*.theadvocate.com.au/*", - "*://*.theage.com.au/*", - "*://*.theaustralian.com.au/*", - "*://*.afr.com/*", - "*://*.bostonglobe.com/*", - "*://*.bizjournals.com/*", - "*://*.theglobeandmail.com/*", - "*://*.theherald.com.au/*", - "*://*.japantimes.co.jp/*", - "*://*.themarker.com/*", - "*://*.mercurynews.com/*", - "*://*.mcall.com/*", - "*://*.thenation.com/*", - "*://*.nytimes.com/*", - "*://*.newyorker.com/*", - "*://*.news-gazette.com/*", - "*://*.thesaturdaypaper.com.au/*", - "*://*.spectator.co.uk/*", - "*://*.seattletimes.com/*", - "*://*.smh.com.au/*", - "*://*.telegraph.co.uk/*", - "*://*.thetimes.co.uk/*", - "*://*.thestar.com/*", - "*://*.washingtonpost.com/*", - "*://*.wsj.com/*", - "*://*.towardsdatascience.com/*", - "*://*.vanityfair.com/*", - "*://*.wired.com/*", - "*://*.thediplomat.com/*", - "*://*.theatlantic.com/*", - "*://*.qz.com/*", - "*://*.ad.nl/*", - "*://*.ed.nl/*", - "*://*.groene.nl/*", - "*://*.parool.nl/*", - "*://*.telegraaf.nl/*", - "*://*.trouw.nl/*", - "*://*.vn.nl/*", - "*://*.lemonde.fr/*" - ], - "version": "1.6.0" -} +{ + "background": { + "scripts": ["background.js"] + }, + "content_scripts": [ + { + "matches": [ + "*://*.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/*", + "*://*.washingtonpost.com/*" + ], + "js": ["contentScript.js"] + } + ], + "applications": { + "gecko": { + "id": "bypasspaywalls@bypasspaywalls.weebly.com", + "update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-firefox/master/updates.json" + } + }, + "browser_action": { + "default_popup": "popup.html", + "default_icon": { + "128": "bypass.png" + }, + "theme_icons": [ + { + "light": "bypass-dark.png", + "dark": "bypass.png", + "size": 128 + } + ] + }, + "description": "Bypass News Sites' Paywalls", + "icons": { + "128": "bypass.png" + }, + "manifest_version": 2, + "name": "Bypass Paywalls", + "short_name": "Bypass Paywall", + "options_ui": { + "page": "options.html" + }, + "permissions": [ + "cookies", + "storage", + "webRequest", + "webRequestBlocking", + "*://*.baltimoresun.com/*", + "*://*.barrons.com/*", + "*://*.bloomberg.com/*", + "*://*.businessinsider.com/*", + "*://*.caixinglobal.com/*", + "*://*.cen.acs.org/*", + "*://*.chicagotribune.com/*", + "*://*.centralwesterndaily.com.au/*", + "*://*.chicagobusiness.com/*", + "*://*.corriere.it/*", + "*://*.dailypress.com/*", + "*://*.denverpost.com/*", + "*://*.tijd.be/*", + "*://*.volkskrant.nl/*", + "*://*.economist.com/*", + "*://*.examiner.com.au/*", + "*://*.ft.com/*", + "*://*.foreignpolicy.com/*", + "*://*.glassdoor.com/*", + "*://*.haaretz.co.il/*", + "*://*.haaretz.com/*", + "*://*.handelsblatt.com/*", + "*://*.courant.com/*", + "*://*.hbr.org/*", + "*://*.inc.com/*", + "*://*.investorschronicle.co.uk/*", + "*://*.repubblica.it/*", + "*://*.letemps.ch/*", + "*://*.latimes.com/*", + "*://*.medium.com/*", + "*://*.medscape.com/*", + "*://*.technologyreview.com/*", + "*://*.mv-voice.com/*", + "*://*.nationalpost.com/*", + "*://*.newstatesman.com/*", + "*://*.nymag.com/*", + "*://*.nzherald.co.nz/*", + "*://*.asia.nikkei.com/*", + "*://*.nrc.nl/*", + "*://*.ocregister.com/*", + "*://*.orlandosentinel.com/*", + "*://*.paloaltoonline.com/*", + "*://*.quora.com/*", + "*://*.sun-sentinel.com/*", + "*://*.theadvocate.com.au/*", + "*://*.theage.com.au/*", + "*://*.theaustralian.com.au/*", + "*://*.afr.com/*", + "*://*.bostonglobe.com/*", + "*://*.bizjournals.com/*", + "*://*.theglobeandmail.com/*", + "*://*.theherald.com.au/*", + "*://*.japantimes.co.jp/*", + "*://*.themarker.com/*", + "*://*.mercurynews.com/*", + "*://*.mcall.com/*", + "*://*.thenation.com/*", + "*://*.nytimes.com/*", + "*://*.newyorker.com/*", + "*://*.news-gazette.com/*", + "*://*.thesaturdaypaper.com.au/*", + "*://*.spectator.co.uk/*", + "*://*.seattletimes.com/*", + "*://*.smh.com.au/*", + "*://*.telegraph.co.uk/*", + "*://*.thetimes.co.uk/*", + "*://*.thestar.com/*", + "*://*.washingtonpost.com/*", + "*://*.wsj.com/*", + "*://*.towardsdatascience.com/*", + "*://*.vanityfair.com/*", + "*://*.wired.com/*", + "*://*.thediplomat.com/*", + "*://*.theatlantic.com/*", + "*://*.qz.com/*", + "*://*.ad.nl/*", + "*://*.ed.nl/*", + "*://*.groene.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.vn.nl/*", + "*://*.lemonde.fr/*", + "*://*.scientificamerican.com/*" + ], + "version": "1.6.0" +} diff --git a/options.js b/options.js index 19a0d34..a68eaa8 100644 --- a/options.js +++ b/options.js @@ -1,160 +1,161 @@ -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 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', - '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 (javascript disabled)': 'newstatesman.com', - 'New York Magazine': 'nymag.com', - 'New Zealand Herald': 'nzherald.co.nz', - 'Nikkei Asian Review': 'asia.nikkei.com', - 'NRC': 'nrc.nl', - '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', - 'The Australian': 'theaustralian.com.au', - 'The Australian Financial Review (javascript disabled)': 'afr.com', - 'The Boston Globe (javascript disabled)': 'bostonglobe.com', - 'The Business Journals': 'bizjournals.com', - 'The Diplomat': 'thediplomat.com', - 'The Globe and Mail (javascript disabled)': '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 (javascript disabled)': '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' -}; - -// Saves options to browser.storage -function save_options() { - var gh_url = document.getElementById('bypass_sites').value; - var inputEls = document.querySelectorAll('#bypass_sites input'); - var sites = {}; - - var sites = Array.from(inputEls).reduce(function(memo, inputEl) { - if (inputEl.checked) { - memo[inputEl.dataset.key] = inputEl.dataset.value; - } - return memo; - }, {}); - - browser.storage.sync.set({ - sites: sites - }, function() { - // Update status to let user know options were saved. - var status = document.getElementById('status'); - status.textContent = 'Options saved.'; - setTimeout(function() { - // status.textContent = ''; - window.close(); - }, 500); - }); -} - -// Restores checkbox input states using the preferences -// stored in browser.storage. -function renderOptions() { - browser.storage.sync.get({ - sites: {} - }, function(items) { - var sites = items.sites; - var sitesEl = document.getElementById('bypass_sites'); - for (var key in defaultSites) { - if (!defaultSites.hasOwnProperty(key)) { - continue; - } - - var value = defaultSites[key]; - var labelEl = document.createElement('label'); - var inputEl = document.createElement('input'); - inputEl.type = 'checkbox'; - inputEl.dataset.key = key; - inputEl.dataset.value = value; - inputEl.checked = key in sites; - - labelEl.appendChild(inputEl); - labelEl.appendChild(document.createTextNode(' '+key)); - sitesEl.appendChild(labelEl); - } - }); -} - -function selectAll() { - var inputEls = Array.from(document.querySelectorAll('input')); - inputEls.forEach(function(inputEl) { - inputEl.checked = true; - }); -} - -function selectNone() { - var inputEls = Array.from(document.querySelectorAll('input')); - inputEls.forEach(function(inputEl) { - inputEl.checked = false; - }); -} - -document.addEventListener('DOMContentLoaded', renderOptions); -document.getElementById('save').addEventListener('click', save_options); -document.getElementById('select-all').addEventListener('click', selectAll); -document.getElementById('select-none').addEventListener('click', selectNone); - +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 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', + '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 (javascript disabled)': 'newstatesman.com', + 'New York Magazine': 'nymag.com', + 'New Zealand Herald': 'nzherald.co.nz', + 'Nikkei Asian Review': 'asia.nikkei.com', + 'NRC': 'nrc.nl', + 'Orange County Register': 'ocregister.com', + 'Orlando Sentinel': 'orlandosentinel.com', + 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', + 'Quartz': 'qz.com', + 'Quora': 'quora.com', + 'Scientific American': 'scientificamerican.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', + 'The Australian': 'theaustralian.com.au', + 'The Australian Financial Review (javascript disabled)': 'afr.com', + 'The Boston Globe (javascript disabled)': 'bostonglobe.com', + 'The Business Journals': 'bizjournals.com', + 'The Diplomat': 'thediplomat.com', + 'The Globe and Mail (javascript disabled)': '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 (javascript disabled)': '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' +}; + +// Saves options to browser.storage +function save_options() { + var gh_url = document.getElementById('bypass_sites').value; + var inputEls = document.querySelectorAll('#bypass_sites input'); + var sites = {}; + + var sites = Array.from(inputEls).reduce(function(memo, inputEl) { + if (inputEl.checked) { + memo[inputEl.dataset.key] = inputEl.dataset.value; + } + return memo; + }, {}); + + browser.storage.sync.set({ + sites: sites + }, function() { + // Update status to let user know options were saved. + var status = document.getElementById('status'); + status.textContent = 'Options saved.'; + setTimeout(function() { + // status.textContent = ''; + window.close(); + }, 500); + }); +} + +// Restores checkbox input states using the preferences +// stored in browser.storage. +function renderOptions() { + browser.storage.sync.get({ + sites: {} + }, function(items) { + var sites = items.sites; + var sitesEl = document.getElementById('bypass_sites'); + for (var key in defaultSites) { + if (!defaultSites.hasOwnProperty(key)) { + continue; + } + + var value = defaultSites[key]; + var labelEl = document.createElement('label'); + var inputEl = document.createElement('input'); + inputEl.type = 'checkbox'; + inputEl.dataset.key = key; + inputEl.dataset.value = value; + inputEl.checked = key in sites; + + labelEl.appendChild(inputEl); + labelEl.appendChild(document.createTextNode(' '+key)); + sitesEl.appendChild(labelEl); + } + }); +} + +function selectAll() { + var inputEls = Array.from(document.querySelectorAll('input')); + inputEls.forEach(function(inputEl) { + inputEl.checked = true; + }); +} + +function selectNone() { + var inputEls = Array.from(document.querySelectorAll('input')); + inputEls.forEach(function(inputEl) { + inputEl.checked = false; + }); +} + +document.addEventListener('DOMContentLoaded', renderOptions); +document.getElementById('save').addEventListener('click', save_options); +document.getElementById('select-all').addEventListener('click', selectAll); +document.getElementById('select-none').addEventListener('click', selectNone); + From 3dbc7d8f6aa03ee8d7720c341b145b0e4dd0f0c0 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Fri, 1 Nov 2019 18:40:39 +0100 Subject: [PATCH 05/11] Restore styling --- README.md | 242 ++++++++++++++++++------------------- manifest.json | 290 ++++++++++++++++++++++----------------------- options.js | 322 +++++++++++++++++++++++++------------------------- 3 files changed, 427 insertions(+), 427 deletions(-) diff --git a/README.md b/README.md index 01a7ef7..f62669b 100644 --- a/README.md +++ b/README.md @@ -1,121 +1,121 @@ -# Bypass Paywalls for Firefox - -## [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 - -[Algemeen Dagblad](https://www.ad.nl)\ -[Baltimore Sun](https://www.baltimoresun.com)\ -[Barron's](https://www.barrons.com)\ -[Bloomberg](https://www.bloomberg.com)\ -[Business Insider](https://www.businessinsider.com)\ -[Caixin](https://www.caixinglobal.com)\ -[Chemical & Engineering News](https://cen.acs.org)\ -[Central Western Daily](https://www.centralwesterndaily.com.au)\ -[Chicago Tribune](https://www.chicagotribune.com)\ -[Crain's Chicago Business](https://www.chicagobusiness.com)\ -[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)\ -[Glassdoor](https://www.glassdoor.com)\ -[Haaretz.co.il](https://www.haaretz.co.il)\ -[Haaretz.com](https://www.haaretz.com)\ -[Handelsblatt](https://www.handelsblatt.com)\ -[Hartford Courant](https://www.courant.com)\ -[Harvard Business Review](https://www.hbr.org)\ -[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)\ -[Medscape](https://www.medscape.com)\ -[MIT Technology Review](https://www.technologyreview.com)\ -[Mountain View Voice](https://www.mv-voice.com)\ -[National Post](https://www.nationalpost.com)\ -[New Statesman](https://www.newstatesman.com)\ -[New York Magazine](https://www.nymag.com)\ -[New Zealand Herald](https://www.nzherald.co.nz)\ -[Nikkei Asian Review](https://asia.nikkei.com)\ -[NRC](https://www.nrc.nl)\ -[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)\ -[Scientific American](https://scientificamerican.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)\ -[The Australian](https://www.theaustralian.com.au)\ -[The Australian Financial Review](https://www.afr.com)\ -[The Boston Globe](https://www.bostonglobe.com)\ -[The Business Journals](https://www.bizjournals.com)\ -[The Diplomat](https://www.thediplomat.com)\ -[The Globe and Mail](https://www.theglobeandmail.com)\ -[The Herald](https://www.theherald.com.au)\ -[The Japan Times](https://www.japantimes.co.jp)\ -[TheMarker](https://www.themarker.com)\ -[The Mercury News](https://www.mercurynews.com)\ -[The Morning Call](https://www.mcall.com)\ -[The Nation](https://www.thenation.com)\ -[The New York Times](https://www.nytimes.com)\ -[The New Yorker](https://www.newyorker.com)\ -[The News-Gazette](https://www.news-gazette.com)\ -[The Saturday Paper](https://www.thesaturdaypaper.com.au)\ -[The Spectator](https://www.spectator.co.uk)\ -[The Seattle Times](https://www.seattletimes.com)\ -[The Sydney Morning Herald](https://www.smh.com.au)\ -[The Telegraph](https://www.telegraph.co.uk)\ -[The Times](https://www.thetimes.co.uk)\ -[The Toronto Star](https://www.thestar.com)\ -[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 -The free article limit can normally be bypassed by removing cookies for the site.* - -Install the [Cookie Remover](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/) Add-on. - -When coming across a paywall click the cookie icon to remove the cookies then refresh the page. - -_*May not always succeed_ - -### New site requests -Only large or major sites will be considered. No small sites or local newspapers. -1. Visit an article on the site you want to bypass the paywall for and copy the article title. -2. Open up a new Private window (Ctrl+Shift+P) and paste the article title into Google. -3. Click on the same article from the Google search results page. If it loads without a paywall you can [submit a request](https://github.com/iamadamdev/bypass-paywalls-firefox/issues/new) to add the site, otherwise my extension cannot bypass it either. - -Usually premium articles cannot be bypassed as they are behind a hard paywall. - -### Troubleshooting -* This add-on works best alongside [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/). -* If a site doesn't work try turning off uBlock and refreshing. - -### Pull Requesets -* PRs are welcome. - -### Show your support -* I am not asking for donations or anything like that, all I ask is that you star this repo. - -### License -Bypass Paywalls is [MIT-licensed](https://github.com/iamadamdev/bypass-paywalls-firefox/blob/master/LICENSE). +# Bypass Paywalls for Firefox + +## [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 + +[Algemeen Dagblad](https://www.ad.nl)\ +[Baltimore Sun](https://www.baltimoresun.com)\ +[Barron's](https://www.barrons.com)\ +[Bloomberg](https://www.bloomberg.com)\ +[Business Insider](https://www.businessinsider.com)\ +[Caixin](https://www.caixinglobal.com)\ +[Chemical & Engineering News](https://cen.acs.org)\ +[Central Western Daily](https://www.centralwesterndaily.com.au)\ +[Chicago Tribune](https://www.chicagotribune.com)\ +[Crain's Chicago Business](https://www.chicagobusiness.com)\ +[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)\ +[Glassdoor](https://www.glassdoor.com)\ +[Haaretz.co.il](https://www.haaretz.co.il)\ +[Haaretz.com](https://www.haaretz.com)\ +[Handelsblatt](https://www.handelsblatt.com)\ +[Hartford Courant](https://www.courant.com)\ +[Harvard Business Review](https://www.hbr.org)\ +[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)\ +[Medscape](https://www.medscape.com)\ +[MIT Technology Review](https://www.technologyreview.com)\ +[Mountain View Voice](https://www.mv-voice.com)\ +[National Post](https://www.nationalpost.com)\ +[New Statesman](https://www.newstatesman.com)\ +[New York Magazine](https://www.nymag.com)\ +[New Zealand Herald](https://www.nzherald.co.nz)\ +[Nikkei Asian Review](https://asia.nikkei.com)\ +[NRC](https://www.nrc.nl)\ +[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)\ +[Scientific American](https://scientificamerican.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)\ +[The Australian](https://www.theaustralian.com.au)\ +[The Australian Financial Review](https://www.afr.com)\ +[The Boston Globe](https://www.bostonglobe.com)\ +[The Business Journals](https://www.bizjournals.com)\ +[The Diplomat](https://www.thediplomat.com)\ +[The Globe and Mail](https://www.theglobeandmail.com)\ +[The Herald](https://www.theherald.com.au)\ +[The Japan Times](https://www.japantimes.co.jp)\ +[TheMarker](https://www.themarker.com)\ +[The Mercury News](https://www.mercurynews.com)\ +[The Morning Call](https://www.mcall.com)\ +[The Nation](https://www.thenation.com)\ +[The New York Times](https://www.nytimes.com)\ +[The New Yorker](https://www.newyorker.com)\ +[The News-Gazette](https://www.news-gazette.com)\ +[The Saturday Paper](https://www.thesaturdaypaper.com.au)\ +[The Spectator](https://www.spectator.co.uk)\ +[The Seattle Times](https://www.seattletimes.com)\ +[The Sydney Morning Herald](https://www.smh.com.au)\ +[The Telegraph](https://www.telegraph.co.uk)\ +[The Times](https://www.thetimes.co.uk)\ +[The Toronto Star](https://www.thestar.com)\ +[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 +The free article limit can normally be bypassed by removing cookies for the site.* + +Install the [Cookie Remover](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/) Add-on. + +When coming across a paywall click the cookie icon to remove the cookies then refresh the page. + +_*May not always succeed_ + +### New site requests +Only large or major sites will be considered. No small sites or local newspapers. +1. Visit an article on the site you want to bypass the paywall for and copy the article title. +2. Open up a new Private window (Ctrl+Shift+P) and paste the article title into Google. +3. Click on the same article from the Google search results page. If it loads without a paywall you can [submit a request](https://github.com/iamadamdev/bypass-paywalls-firefox/issues/new) to add the site, otherwise my extension cannot bypass it either. + +Usually premium articles cannot be bypassed as they are behind a hard paywall. + +### Troubleshooting +* This add-on works best alongside [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/). +* If a site doesn't work try turning off uBlock and refreshing. + +### Pull Requesets +* PRs are welcome. + +### Show your support +* I am not asking for donations or anything like that, all I ask is that you star this repo. + +### License +Bypass Paywalls is [MIT-licensed](https://github.com/iamadamdev/bypass-paywalls-firefox/blob/master/LICENSE). diff --git a/manifest.json b/manifest.json index c56be16..f4a3718 100644 --- a/manifest.json +++ b/manifest.json @@ -1,145 +1,145 @@ -{ - "background": { - "scripts": ["background.js"] - }, - "content_scripts": [ - { - "matches": [ - "*://*.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/*", - "*://*.washingtonpost.com/*" - ], - "js": ["contentScript.js"] - } - ], - "applications": { - "gecko": { - "id": "bypasspaywalls@bypasspaywalls.weebly.com", - "update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-firefox/master/updates.json" - } - }, - "browser_action": { - "default_popup": "popup.html", - "default_icon": { - "128": "bypass.png" - }, - "theme_icons": [ - { - "light": "bypass-dark.png", - "dark": "bypass.png", - "size": 128 - } - ] - }, - "description": "Bypass News Sites' Paywalls", - "icons": { - "128": "bypass.png" - }, - "manifest_version": 2, - "name": "Bypass Paywalls", - "short_name": "Bypass Paywall", - "options_ui": { - "page": "options.html" - }, - "permissions": [ - "cookies", - "storage", - "webRequest", - "webRequestBlocking", - "*://*.baltimoresun.com/*", - "*://*.barrons.com/*", - "*://*.bloomberg.com/*", - "*://*.businessinsider.com/*", - "*://*.caixinglobal.com/*", - "*://*.cen.acs.org/*", - "*://*.chicagotribune.com/*", - "*://*.centralwesterndaily.com.au/*", - "*://*.chicagobusiness.com/*", - "*://*.corriere.it/*", - "*://*.dailypress.com/*", - "*://*.denverpost.com/*", - "*://*.tijd.be/*", - "*://*.volkskrant.nl/*", - "*://*.economist.com/*", - "*://*.examiner.com.au/*", - "*://*.ft.com/*", - "*://*.foreignpolicy.com/*", - "*://*.glassdoor.com/*", - "*://*.haaretz.co.il/*", - "*://*.haaretz.com/*", - "*://*.handelsblatt.com/*", - "*://*.courant.com/*", - "*://*.hbr.org/*", - "*://*.inc.com/*", - "*://*.investorschronicle.co.uk/*", - "*://*.repubblica.it/*", - "*://*.letemps.ch/*", - "*://*.latimes.com/*", - "*://*.medium.com/*", - "*://*.medscape.com/*", - "*://*.technologyreview.com/*", - "*://*.mv-voice.com/*", - "*://*.nationalpost.com/*", - "*://*.newstatesman.com/*", - "*://*.nymag.com/*", - "*://*.nzherald.co.nz/*", - "*://*.asia.nikkei.com/*", - "*://*.nrc.nl/*", - "*://*.ocregister.com/*", - "*://*.orlandosentinel.com/*", - "*://*.paloaltoonline.com/*", - "*://*.quora.com/*", - "*://*.sun-sentinel.com/*", - "*://*.theadvocate.com.au/*", - "*://*.theage.com.au/*", - "*://*.theaustralian.com.au/*", - "*://*.afr.com/*", - "*://*.bostonglobe.com/*", - "*://*.bizjournals.com/*", - "*://*.theglobeandmail.com/*", - "*://*.theherald.com.au/*", - "*://*.japantimes.co.jp/*", - "*://*.themarker.com/*", - "*://*.mercurynews.com/*", - "*://*.mcall.com/*", - "*://*.thenation.com/*", - "*://*.nytimes.com/*", - "*://*.newyorker.com/*", - "*://*.news-gazette.com/*", - "*://*.thesaturdaypaper.com.au/*", - "*://*.spectator.co.uk/*", - "*://*.seattletimes.com/*", - "*://*.smh.com.au/*", - "*://*.telegraph.co.uk/*", - "*://*.thetimes.co.uk/*", - "*://*.thestar.com/*", - "*://*.washingtonpost.com/*", - "*://*.wsj.com/*", - "*://*.towardsdatascience.com/*", - "*://*.vanityfair.com/*", - "*://*.wired.com/*", - "*://*.thediplomat.com/*", - "*://*.theatlantic.com/*", - "*://*.qz.com/*", - "*://*.ad.nl/*", - "*://*.ed.nl/*", - "*://*.groene.nl/*", - "*://*.parool.nl/*", - "*://*.telegraaf.nl/*", - "*://*.trouw.nl/*", - "*://*.vn.nl/*", - "*://*.lemonde.fr/*", - "*://*.scientificamerican.com/*" - ], - "version": "1.6.0" -} +{ + "background": { + "scripts": ["background.js"] + }, + "content_scripts": [ + { + "matches": [ + "*://*.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/*", + "*://*.washingtonpost.com/*" + ], + "js": ["contentScript.js"] + } + ], + "applications": { + "gecko": { + "id": "bypasspaywalls@bypasspaywalls.weebly.com", + "update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-firefox/master/updates.json" + } + }, + "browser_action": { + "default_popup": "popup.html", + "default_icon": { + "128": "bypass.png" + }, + "theme_icons": [ + { + "light": "bypass-dark.png", + "dark": "bypass.png", + "size": 128 + } + ] + }, + "description": "Bypass News Sites' Paywalls", + "icons": { + "128": "bypass.png" + }, + "manifest_version": 2, + "name": "Bypass Paywalls", + "short_name": "Bypass Paywall", + "options_ui": { + "page": "options.html" + }, + "permissions": [ + "cookies", + "storage", + "webRequest", + "webRequestBlocking", + "*://*.baltimoresun.com/*", + "*://*.barrons.com/*", + "*://*.bloomberg.com/*", + "*://*.businessinsider.com/*", + "*://*.caixinglobal.com/*", + "*://*.cen.acs.org/*", + "*://*.chicagotribune.com/*", + "*://*.centralwesterndaily.com.au/*", + "*://*.chicagobusiness.com/*", + "*://*.corriere.it/*", + "*://*.dailypress.com/*", + "*://*.denverpost.com/*", + "*://*.tijd.be/*", + "*://*.volkskrant.nl/*", + "*://*.economist.com/*", + "*://*.examiner.com.au/*", + "*://*.ft.com/*", + "*://*.foreignpolicy.com/*", + "*://*.glassdoor.com/*", + "*://*.haaretz.co.il/*", + "*://*.haaretz.com/*", + "*://*.handelsblatt.com/*", + "*://*.courant.com/*", + "*://*.hbr.org/*", + "*://*.inc.com/*", + "*://*.investorschronicle.co.uk/*", + "*://*.repubblica.it/*", + "*://*.letemps.ch/*", + "*://*.latimes.com/*", + "*://*.medium.com/*", + "*://*.medscape.com/*", + "*://*.technologyreview.com/*", + "*://*.mv-voice.com/*", + "*://*.nationalpost.com/*", + "*://*.newstatesman.com/*", + "*://*.nymag.com/*", + "*://*.nzherald.co.nz/*", + "*://*.asia.nikkei.com/*", + "*://*.nrc.nl/*", + "*://*.ocregister.com/*", + "*://*.orlandosentinel.com/*", + "*://*.paloaltoonline.com/*", + "*://*.quora.com/*", + "*://*.sun-sentinel.com/*", + "*://*.theadvocate.com.au/*", + "*://*.theage.com.au/*", + "*://*.theaustralian.com.au/*", + "*://*.afr.com/*", + "*://*.bostonglobe.com/*", + "*://*.bizjournals.com/*", + "*://*.theglobeandmail.com/*", + "*://*.theherald.com.au/*", + "*://*.japantimes.co.jp/*", + "*://*.themarker.com/*", + "*://*.mercurynews.com/*", + "*://*.mcall.com/*", + "*://*.thenation.com/*", + "*://*.nytimes.com/*", + "*://*.newyorker.com/*", + "*://*.news-gazette.com/*", + "*://*.thesaturdaypaper.com.au/*", + "*://*.spectator.co.uk/*", + "*://*.seattletimes.com/*", + "*://*.smh.com.au/*", + "*://*.telegraph.co.uk/*", + "*://*.thetimes.co.uk/*", + "*://*.thestar.com/*", + "*://*.washingtonpost.com/*", + "*://*.wsj.com/*", + "*://*.towardsdatascience.com/*", + "*://*.vanityfair.com/*", + "*://*.wired.com/*", + "*://*.thediplomat.com/*", + "*://*.theatlantic.com/*", + "*://*.qz.com/*", + "*://*.ad.nl/*", + "*://*.ed.nl/*", + "*://*.groene.nl/*", + "*://*.parool.nl/*", + "*://*.telegraaf.nl/*", + "*://*.trouw.nl/*", + "*://*.vn.nl/*", + "*://*.lemonde.fr/*", + "*://*.scientificamerican.com/*" + ], + "version": "1.6.0" +} diff --git a/options.js b/options.js index a68eaa8..4aa1b1e 100644 --- a/options.js +++ b/options.js @@ -1,161 +1,161 @@ -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 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', - '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 (javascript disabled)': 'newstatesman.com', - 'New York Magazine': 'nymag.com', - 'New Zealand Herald': 'nzherald.co.nz', - 'Nikkei Asian Review': 'asia.nikkei.com', - 'NRC': 'nrc.nl', - 'Orange County Register': 'ocregister.com', - 'Orlando Sentinel': 'orlandosentinel.com', - 'Palo Alto Online': 'paloaltoonline.com', - 'Parool': 'parool.nl', - 'Quartz': 'qz.com', - 'Quora': 'quora.com', - 'Scientific American': 'scientificamerican.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', - 'The Australian': 'theaustralian.com.au', - 'The Australian Financial Review (javascript disabled)': 'afr.com', - 'The Boston Globe (javascript disabled)': 'bostonglobe.com', - 'The Business Journals': 'bizjournals.com', - 'The Diplomat': 'thediplomat.com', - 'The Globe and Mail (javascript disabled)': '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 (javascript disabled)': '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' -}; - -// Saves options to browser.storage -function save_options() { - var gh_url = document.getElementById('bypass_sites').value; - var inputEls = document.querySelectorAll('#bypass_sites input'); - var sites = {}; - - var sites = Array.from(inputEls).reduce(function(memo, inputEl) { - if (inputEl.checked) { - memo[inputEl.dataset.key] = inputEl.dataset.value; - } - return memo; - }, {}); - - browser.storage.sync.set({ - sites: sites - }, function() { - // Update status to let user know options were saved. - var status = document.getElementById('status'); - status.textContent = 'Options saved.'; - setTimeout(function() { - // status.textContent = ''; - window.close(); - }, 500); - }); -} - -// Restores checkbox input states using the preferences -// stored in browser.storage. -function renderOptions() { - browser.storage.sync.get({ - sites: {} - }, function(items) { - var sites = items.sites; - var sitesEl = document.getElementById('bypass_sites'); - for (var key in defaultSites) { - if (!defaultSites.hasOwnProperty(key)) { - continue; - } - - var value = defaultSites[key]; - var labelEl = document.createElement('label'); - var inputEl = document.createElement('input'); - inputEl.type = 'checkbox'; - inputEl.dataset.key = key; - inputEl.dataset.value = value; - inputEl.checked = key in sites; - - labelEl.appendChild(inputEl); - labelEl.appendChild(document.createTextNode(' '+key)); - sitesEl.appendChild(labelEl); - } - }); -} - -function selectAll() { - var inputEls = Array.from(document.querySelectorAll('input')); - inputEls.forEach(function(inputEl) { - inputEl.checked = true; - }); -} - -function selectNone() { - var inputEls = Array.from(document.querySelectorAll('input')); - inputEls.forEach(function(inputEl) { - inputEl.checked = false; - }); -} - -document.addEventListener('DOMContentLoaded', renderOptions); -document.getElementById('save').addEventListener('click', save_options); -document.getElementById('select-all').addEventListener('click', selectAll); -document.getElementById('select-none').addEventListener('click', selectNone); - +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 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', + '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 (javascript disabled)': 'newstatesman.com', + 'New York Magazine': 'nymag.com', + 'New Zealand Herald': 'nzherald.co.nz', + 'Nikkei Asian Review': 'asia.nikkei.com', + 'NRC': 'nrc.nl', + 'Orange County Register': 'ocregister.com', + 'Orlando Sentinel': 'orlandosentinel.com', + 'Palo Alto Online': 'paloaltoonline.com', + 'Parool': 'parool.nl', + 'Quartz': 'qz.com', + 'Quora': 'quora.com', + 'Scientific American': 'scientificamerican.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', + 'The Australian': 'theaustralian.com.au', + 'The Australian Financial Review (javascript disabled)': 'afr.com', + 'The Boston Globe (javascript disabled)': 'bostonglobe.com', + 'The Business Journals': 'bizjournals.com', + 'The Diplomat': 'thediplomat.com', + 'The Globe and Mail (javascript disabled)': '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 (javascript disabled)': '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' +}; + +// Saves options to browser.storage +function save_options() { + var gh_url = document.getElementById('bypass_sites').value; + var inputEls = document.querySelectorAll('#bypass_sites input'); + var sites = {}; + + var sites = Array.from(inputEls).reduce(function(memo, inputEl) { + if (inputEl.checked) { + memo[inputEl.dataset.key] = inputEl.dataset.value; + } + return memo; + }, {}); + + browser.storage.sync.set({ + sites: sites + }, function() { + // Update status to let user know options were saved. + var status = document.getElementById('status'); + status.textContent = 'Options saved.'; + setTimeout(function() { + // status.textContent = ''; + window.close(); + }, 500); + }); +} + +// Restores checkbox input states using the preferences +// stored in browser.storage. +function renderOptions() { + browser.storage.sync.get({ + sites: {} + }, function(items) { + var sites = items.sites; + var sitesEl = document.getElementById('bypass_sites'); + for (var key in defaultSites) { + if (!defaultSites.hasOwnProperty(key)) { + continue; + } + + var value = defaultSites[key]; + var labelEl = document.createElement('label'); + var inputEl = document.createElement('input'); + inputEl.type = 'checkbox'; + inputEl.dataset.key = key; + inputEl.dataset.value = value; + inputEl.checked = key in sites; + + labelEl.appendChild(inputEl); + labelEl.appendChild(document.createTextNode(' '+key)); + sitesEl.appendChild(labelEl); + } + }); +} + +function selectAll() { + var inputEls = Array.from(document.querySelectorAll('input')); + inputEls.forEach(function(inputEl) { + inputEl.checked = true; + }); +} + +function selectNone() { + var inputEls = Array.from(document.querySelectorAll('input')); + inputEls.forEach(function(inputEl) { + inputEl.checked = false; + }); +} + +document.addEventListener('DOMContentLoaded', renderOptions); +document.getElementById('save').addEventListener('click', save_options); +document.getElementById('select-all').addEventListener('click', selectAll); +document.getElementById('select-none').addEventListener('click', selectNone); + From d2821596352cc2bcf7e5bc94a3ef8672a5583630 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Sat, 2 Nov 2019 12:07:01 +0100 Subject: [PATCH 06/11] Fix Le Monde support (now all paragraphs) --- background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index a9bf7a4..ea56b40 100644 --- a/background.js +++ b/background.js @@ -31,7 +31,7 @@ var defaultSites = { 'Inc.com': 'inc.com', 'Investors Chronicle': 'investorschronicle.co.uk', 'La Repubblica': 'repubblica.it', - 'Le Monde': 'lemonde.fr', + 'Le Monde': 'lemonde.fr', 'Le Temps': 'letemps.ch', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', @@ -182,6 +182,7 @@ const remove_cookies_select_drop = { // Override User-Agent with Googlebot const use_google_bot = [ 'barrons.com', +'lemonde.fr', 'nytimes.com', 'quora.com', 'telegraph.co.uk', From d6705e843825a38f292a3498944ea2874db99fc9 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Sat, 2 Nov 2019 12:20:28 +0100 Subject: [PATCH 07/11] Add TheHindu --- README.md | 1 + background.js | 1 + manifest.json | 3 ++- options.js | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f62669b..d1aae55 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ [The Diplomat](https://www.thediplomat.com)\ [The Globe and Mail](https://www.theglobeandmail.com)\ [The Herald](https://www.theherald.com.au)\ +[The Hindu](https://www.thehindu.com)\ [The Japan Times](https://www.japantimes.co.jp)\ [TheMarker](https://www.themarker.com)\ [The Mercury News](https://www.mercurynews.com)\ diff --git a/background.js b/background.js index ea56b40..3295e05 100644 --- a/background.js +++ b/background.js @@ -64,6 +64,7 @@ var defaultSites = { 'The Diplomat': 'thediplomat.com', 'The Globe and Mail': 'theglobeandmail.com', 'The Herald': 'theherald.com.au', + 'The Hindu': 'thehindu.com', 'The Japan Times': 'japantimes.co.jp', 'TheMarker': 'themarker.com', 'The Mercury News': 'mercurynews.com', diff --git a/manifest.json b/manifest.json index f4a3718..c3b085a 100644 --- a/manifest.json +++ b/manifest.json @@ -139,7 +139,8 @@ "*://*.trouw.nl/*", "*://*.vn.nl/*", "*://*.lemonde.fr/*", - "*://*.scientificamerican.com/*" + "*://*.scientificamerican.com/*", + "*://*.thehindu.com/*" ], "version": "1.6.0" } diff --git a/options.js b/options.js index 4aa1b1e..1b55e0f 100644 --- a/options.js +++ b/options.js @@ -62,6 +62,7 @@ var defaultSites = { 'The Diplomat': 'thediplomat.com', 'The Globe and Mail (javascript disabled)': 'theglobeandmail.com', 'The Herald': 'theherald.com.au', + 'The Hindu': 'thehindu.com', 'The Japan Times': 'japantimes.co.jp', 'TheMarker': 'themarker.com', 'The Mercury News': 'mercurynews.com', From d9414b063ca16298c7e1574b06cea3a22a096404 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 5 Nov 2019 13:55:17 +0100 Subject: [PATCH 08/11] Fix default websites not checked in options Default websites with postfix like ' (javascript disabled) are not checked in options because mismatch in key. New filter to disregard any space + text in parentheses (options.js). --- options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.js b/options.js index 1b55e0f..136da36 100644 --- a/options.js +++ b/options.js @@ -132,7 +132,7 @@ function renderOptions() { inputEl.type = 'checkbox'; inputEl.dataset.key = key; inputEl.dataset.value = value; - inputEl.checked = key in sites; + inputEl.checked = key.replace(/\s\(.*\)/, '') in sites; labelEl.appendChild(inputEl); labelEl.appendChild(document.createTextNode(' '+key)); From c95becae3468c5c50e4602c8762e6bc483b6383d Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Tue, 5 Nov 2019 18:13:46 +0100 Subject: [PATCH 09/11] Fix default websites not checked in options (part 2) Now both for new install and update of options. --- options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.js b/options.js index 136da36..d912f21 100644 --- a/options.js +++ b/options.js @@ -132,7 +132,7 @@ function renderOptions() { inputEl.type = 'checkbox'; inputEl.dataset.key = key; inputEl.dataset.value = value; - inputEl.checked = key.replace(/\s\(.*\)/, '') in sites; + inputEl.checked = (key in sites) || (key.replace(/\s\(.*\)/, '') in sites); labelEl.appendChild(inputEl); labelEl.appendChild(document.createTextNode(' '+key)); From 98d97f593d79192cd87fb74ee612929a5373b169 Mon Sep 17 00:00:00 2001 From: magnolia1234 <54500520+magnolia1234@users.noreply.github.com> Date: Fri, 8 Nov 2019 23:26:06 +0100 Subject: [PATCH 10/11] Fix Bloomberg bot-alert A captcha popped up (earlier fixed for Chrome). --- contentScript.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contentScript.js b/contentScript.js index bbbc6f8..17e9c30 100644 --- a/contentScript.js +++ b/contentScript.js @@ -100,8 +100,10 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) { } if (window.location.href.indexOf("bloomberg.com") !== -1) { - const paywall = document.getElementById('paywall-banner'); - removeDOMElement(paywall); + document.addEventListener('DOMContentLoaded', () => { + const paywall = document.getElementById('paywall-banner'); + removeDOMElement(paywall); + }); } if (window.location.href.indexOf('telegraaf.nl') !== -1) { From 41018773c6a602b95830ddb4f6fd06cebb9c5cc1 Mon Sep 17 00:00:00 2001 From: Adam <36013816+iamadamdev@users.noreply.github.com> Date: Sun, 10 Nov 2019 11:39:03 -0800 Subject: [PATCH 11/11] Add space between if ( --- contentScript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contentScript.js b/contentScript.js index 502439b..a43b997 100644 --- a/contentScript.js +++ b/contentScript.js @@ -103,7 +103,7 @@ if (window.location.href.indexOf("medium.com") !== -1) { const bottomMessageText = 'Get one more story in your member preview when you sign up. It’s free.'; const DOMElementsToTextDiv = pageContains('div', bottomMessageText); - if(DOMElementsToTextDiv[2]) removeDOMElement(DOMElementsToTextDiv[2]); + if (DOMElementsToTextDiv[2]) removeDOMElement(DOMElementsToTextDiv[2]); } if (window.location.href.indexOf("bloombergquint.com") !== -1) {