Add Scientific American (fix free-article limit)

No access to subscription-articles.
master
magnolia1234 2019-11-01 18:25:06 +01:00 committed by GitHub
parent e4f70487fe
commit 65bb5fe794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 431 additions and 425 deletions

241
README.md
View File

@ -1,120 +1,121 @@
# Bypass Paywalls for Firefox # 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) ## [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 ### Bypass the following sites' paywalls with this extension
[Algemeen Dagblad](https://www.ad.nl)\ [Algemeen Dagblad](https://www.ad.nl)\
[Baltimore Sun](https://www.baltimoresun.com)\ [Baltimore Sun](https://www.baltimoresun.com)\
[Barron's](https://www.barrons.com)\ [Barron's](https://www.barrons.com)\
[Bloomberg](https://www.bloomberg.com)\ [Bloomberg](https://www.bloomberg.com)\
[Business Insider](https://www.businessinsider.com)\ [Business Insider](https://www.businessinsider.com)\
[Caixin](https://www.caixinglobal.com)\ [Caixin](https://www.caixinglobal.com)\
[Chemical & Engineering News](https://cen.acs.org)\ [Chemical & Engineering News](https://cen.acs.org)\
[Central Western Daily](https://www.centralwesterndaily.com.au)\ [Central Western Daily](https://www.centralwesterndaily.com.au)\
[Chicago Tribune](https://www.chicagotribune.com)\ [Chicago Tribune](https://www.chicagotribune.com)\
[Crain's Chicago Business](https://www.chicagobusiness.com)\ [Crain's Chicago Business](https://www.chicagobusiness.com)\
[Corriere Della Sera](https://www.corriere.it)\ [Corriere Della Sera](https://www.corriere.it)\
[Daily Press](https://www.dailypress.com)\ [Daily Press](https://www.dailypress.com)\
[Denver Post](https://www.denverpost.com)\ [Denver Post](https://www.denverpost.com)\
[De Groene Amsterdammer](https://www.groene.nl)\ [De Groene Amsterdammer](https://www.groene.nl)\
[De Tijd](https://www.tijd.be)\ [De Tijd](https://www.tijd.be)\
[de Volkskrant](https://www.volkskrant.nl)\ [de Volkskrant](https://www.volkskrant.nl)\
[The Economist](https://www.economist.com)\ [The Economist](https://www.economist.com)\
[Eindhovens Dagblad](https://ed.nl)\ [Eindhovens Dagblad](https://ed.nl)\
[Examiner](https://www.examiner.com.au)\ [Examiner](https://www.examiner.com.au)\
[Financial Times](https://www.ft.com)\ [Financial Times](https://www.ft.com)\
[Foreign Policy](https://www.foreignpolicy.com)\ [Foreign Policy](https://www.foreignpolicy.com)\
[Glassdoor](https://www.glassdoor.com)\ [Glassdoor](https://www.glassdoor.com)\
[Haaretz.co.il](https://www.haaretz.co.il)\ [Haaretz.co.il](https://www.haaretz.co.il)\
[Haaretz.com](https://www.haaretz.com)\ [Haaretz.com](https://www.haaretz.com)\
[Handelsblatt](https://www.handelsblatt.com)\ [Handelsblatt](https://www.handelsblatt.com)\
[Hartford Courant](https://www.courant.com)\ [Hartford Courant](https://www.courant.com)\
[Harvard Business Review](https://www.hbr.org)\ [Harvard Business Review](https://www.hbr.org)\
[Inc.com](https://www.inc.com)\ [Inc.com](https://www.inc.com)\
[Investors Chronicle](https://www.investorschronicle.co.uk)\ [Investors Chronicle](https://www.investorschronicle.co.uk)\
[La Repubblica](https://www.repubblica.it)\ [La Repubblica](https://www.repubblica.it)\
[Le Monde](https://www.lemonde.fr)\ [Le Monde](https://www.lemonde.fr)\
[Le Temps](https://www.letemps.ch)\ [Le Temps](https://www.letemps.ch)\
[Los Angeles Times](https://www.latimes.com)\ [Los Angeles Times](https://www.latimes.com)\
[Medium](https://www.medium.com)\ [Medium](https://www.medium.com)\
[Medscape](https://www.medscape.com)\ [Medscape](https://www.medscape.com)\
[MIT Technology Review](https://www.technologyreview.com)\ [MIT Technology Review](https://www.technologyreview.com)\
[Mountain View Voice](https://www.mv-voice.com)\ [Mountain View Voice](https://www.mv-voice.com)\
[National Post](https://www.nationalpost.com)\ [National Post](https://www.nationalpost.com)\
[New Statesman](https://www.newstatesman.com)\ [New Statesman](https://www.newstatesman.com)\
[New York Magazine](https://www.nymag.com)\ [New York Magazine](https://www.nymag.com)\
[New Zealand Herald](https://www.nzherald.co.nz)\ [New Zealand Herald](https://www.nzherald.co.nz)\
[Nikkei Asian Review](https://asia.nikkei.com)\ [Nikkei Asian Review](https://asia.nikkei.com)\
[NRC](https://www.nrc.nl)\ [NRC](https://www.nrc.nl)\
[Orange County Register](https://www.ocregister.com)\ [Orange County Register](https://www.ocregister.com)\
[Orlando Sentinel](https://www.orlandosentinel.com)\ [Orlando Sentinel](https://www.orlandosentinel.com)\
[Palo Alto Online](https://www.paloaltoonline.com)\ [Palo Alto Online](https://www.paloaltoonline.com)\
[Parool](https://www.parool.nl)\ [Parool](https://www.parool.nl)\
[Quartz](https://qz.com)\ [Quartz](https://qz.com)\
[Quora](https://www.quora.com)\ [Quora](https://www.quora.com)\
[Statista](https://www.statista.com)\ [Scientific American](https://scientificamerican.com)\
[SunSentinel](https://www.sun-sentinel.com)\ [Statista](https://www.statista.com)\
[Telegraaf](https://telegraaf.nl)\ [SunSentinel](https://www.sun-sentinel.com)\
[The Advocate](https://www.theadvocate.com.au)\ [Telegraaf](https://telegraaf.nl)\
[The Age](https://www.theage.com.au)\ [The Advocate](https://www.theadvocate.com.au)\
[The Atlantic](https://www.theatlantic.com)\ [The Age](https://www.theage.com.au)\
[The Australian](https://www.theaustralian.com.au)\ [The Atlantic](https://www.theatlantic.com)\
[The Australian Financial Review](https://www.afr.com)\ [The Australian](https://www.theaustralian.com.au)\
[The Boston Globe](https://www.bostonglobe.com)\ [The Australian Financial Review](https://www.afr.com)\
[The Business Journals](https://www.bizjournals.com)\ [The Boston Globe](https://www.bostonglobe.com)\
[The Diplomat](https://www.thediplomat.com)\ [The Business Journals](https://www.bizjournals.com)\
[The Globe and Mail](https://www.theglobeandmail.com)\ [The Diplomat](https://www.thediplomat.com)\
[The Herald](https://www.theherald.com.au)\ [The Globe and Mail](https://www.theglobeandmail.com)\
[The Japan Times](https://www.japantimes.co.jp)\ [The Herald](https://www.theherald.com.au)\
[TheMarker](https://www.themarker.com)\ [The Japan Times](https://www.japantimes.co.jp)\
[The Mercury News](https://www.mercurynews.com)\ [TheMarker](https://www.themarker.com)\
[The Morning Call](https://www.mcall.com)\ [The Mercury News](https://www.mercurynews.com)\
[The Nation](https://www.thenation.com)\ [The Morning Call](https://www.mcall.com)\
[The New York Times](https://www.nytimes.com)\ [The Nation](https://www.thenation.com)\
[The New Yorker](https://www.newyorker.com)\ [The New York Times](https://www.nytimes.com)\
[The News-Gazette](https://www.news-gazette.com)\ [The New Yorker](https://www.newyorker.com)\
[The Saturday Paper](https://www.thesaturdaypaper.com.au)\ [The News-Gazette](https://www.news-gazette.com)\
[The Spectator](https://www.spectator.co.uk)\ [The Saturday Paper](https://www.thesaturdaypaper.com.au)\
[The Seattle Times](https://www.seattletimes.com)\ [The Spectator](https://www.spectator.co.uk)\
[The Sydney Morning Herald](https://www.smh.com.au)\ [The Seattle Times](https://www.seattletimes.com)\
[The Telegraph](https://www.telegraph.co.uk)\ [The Sydney Morning Herald](https://www.smh.com.au)\
[The Times](https://www.thetimes.co.uk)\ [The Telegraph](https://www.telegraph.co.uk)\
[The Toronto Star](https://www.thestar.com)\ [The Times](https://www.thetimes.co.uk)\
[The Washington Post](https://www.washingtonpost.com)\ [The Toronto Star](https://www.thestar.com)\
[The Wall Street Journal](https://www.wsj.com)\ [The Washington Post](https://www.washingtonpost.com)\
[Towards Data Science](https://www.towardsdatascience.com)\ [The Wall Street Journal](https://www.wsj.com)\
[Trouw](https://www.trouw.nl)\ [Towards Data Science](https://www.towardsdatascience.com)\
[Vanity Fair](https://www.vanityfair.com)\ [Trouw](https://www.trouw.nl)\
[Vrij Nederland](https://www.vn.nl)\ [Vanity Fair](https://www.vanityfair.com)\
[Wired](https://www.wired.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.* ### 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.
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.
When coming across a paywall click the cookie icon to remove the cookies then refresh the page.
_*May not always succeed_
_*May not always succeed_
### New site requests
Only large or major sites will be considered. No small sites or local newspapers. ### New site requests
1. Visit an article on the site you want to bypass the paywall for and copy the article title. Only large or major sites will be considered. No small sites or local newspapers.
2. Open up a new Private window (Ctrl+Shift+P) and paste the article title into Google. 1. Visit an article on the site you want to bypass the paywall for and copy the article title.
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. 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.
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/). ### Troubleshooting
* If a site doesn't work try turning off uBlock and refreshing. * 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. ### 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. ### 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). ### License
Bypass Paywalls is [MIT-licensed](https://github.com/iamadamdev/bypass-paywalls-firefox/blob/master/LICENSE).

View File

@ -50,9 +50,10 @@ var defaultSites = {
'Parool': 'parool.nl', 'Parool': 'parool.nl',
'Quartz': 'qz.com', 'Quartz': 'qz.com',
'Quora': 'quora.com', 'Quora': 'quora.com',
'Scientific American': 'scientificamerican.com',
'Statista': 'statista.com', 'Statista': 'statista.com',
'Telegraaf': 'telegraaf.nl',
'SunSentinel': 'sun-sentinel.com', 'SunSentinel': 'sun-sentinel.com',
'Telegraaf': 'telegraaf.nl',
'The Advocate': 'theadvocate.com.au', 'The Advocate': 'theadvocate.com.au',
'The Age': 'theage.com.au', 'The Age': 'theage.com.au',
'The Atlantic': 'theatlantic.com', 'The Atlantic': 'theatlantic.com',
@ -115,6 +116,7 @@ const allow_cookies = [
'ocregister.com', 'ocregister.com',
'parool.nl', 'parool.nl',
'qz.com', 'qz.com',
'scientificamerican.com',
'spectator.co.uk', 'spectator.co.uk',
'telegraaf.nl', 'telegraaf.nl',
'theadvocate.com.au', 'theadvocate.com.au',
@ -152,6 +154,7 @@ const remove_cookies = [
'nytimes.com', 'nytimes.com',
'ocregister.com', 'ocregister.com',
'qz.com', 'qz.com',
'scientificamerican.com',
'spectator.co.uk', 'spectator.co.uk',
'telegraaf.nl', 'telegraaf.nl',
'theadvocate.com.au', 'theadvocate.com.au',

View File

@ -1,144 +1,145 @@
{ {
"background": { "background": {
"scripts": ["background.js"] "scripts": ["background.js"]
}, },
"content_scripts": [ "content_scripts": [
{ {
"matches": [ "matches": [
"*://*.bizjournals.com/*", "*://*.bizjournals.com/*",
"*://*.bloomberg.com/*", "*://*.bloomberg.com/*",
"*://*.businessinsider.com/*", "*://*.businessinsider.com/*",
"*://*.ed.nl/*", "*://*.ed.nl/*",
"*://*.haaretz.co.il/*", "*://*.haaretz.co.il/*",
"*://*.lemonde.fr/*", "*://*.lemonde.fr/*",
"*://*.nzherald.co.nz/*", "*://*.nzherald.co.nz/*",
"*://*.parool.nl/*", "*://*.parool.nl/*",
"*://*.repubblica.it/*", "*://*.repubblica.it/*",
"*://*.telegraaf.nl/*", "*://*.telegraaf.nl/*",
"*://*.trouw.nl/*", "*://*.trouw.nl/*",
"*://*.volkskrant.nl/*", "*://*.volkskrant.nl/*",
"*://*.washingtonpost.com/*" "*://*.washingtonpost.com/*"
], ],
"js": ["contentScript.js"] "js": ["contentScript.js"]
} }
], ],
"applications": { "applications": {
"gecko": { "gecko": {
"id": "bypasspaywalls@bypasspaywalls.weebly.com", "id": "bypasspaywalls@bypasspaywalls.weebly.com",
"update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-firefox/master/updates.json" "update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-firefox/master/updates.json"
} }
}, },
"browser_action": { "browser_action": {
"default_popup": "popup.html", "default_popup": "popup.html",
"default_icon": { "default_icon": {
"128": "bypass.png" "128": "bypass.png"
}, },
"theme_icons": [ "theme_icons": [
{ {
"light": "bypass-dark.png", "light": "bypass-dark.png",
"dark": "bypass.png", "dark": "bypass.png",
"size": 128 "size": 128
} }
] ]
}, },
"description": "Bypass News Sites' Paywalls", "description": "Bypass News Sites' Paywalls",
"icons": { "icons": {
"128": "bypass.png" "128": "bypass.png"
}, },
"manifest_version": 2, "manifest_version": 2,
"name": "Bypass Paywalls", "name": "Bypass Paywalls",
"short_name": "Bypass Paywall", "short_name": "Bypass Paywall",
"options_ui": { "options_ui": {
"page": "options.html" "page": "options.html"
}, },
"permissions": [ "permissions": [
"cookies", "cookies",
"storage", "storage",
"webRequest", "webRequest",
"webRequestBlocking", "webRequestBlocking",
"*://*.baltimoresun.com/*", "*://*.baltimoresun.com/*",
"*://*.barrons.com/*", "*://*.barrons.com/*",
"*://*.bloomberg.com/*", "*://*.bloomberg.com/*",
"*://*.businessinsider.com/*", "*://*.businessinsider.com/*",
"*://*.caixinglobal.com/*", "*://*.caixinglobal.com/*",
"*://*.cen.acs.org/*", "*://*.cen.acs.org/*",
"*://*.chicagotribune.com/*", "*://*.chicagotribune.com/*",
"*://*.centralwesterndaily.com.au/*", "*://*.centralwesterndaily.com.au/*",
"*://*.chicagobusiness.com/*", "*://*.chicagobusiness.com/*",
"*://*.corriere.it/*", "*://*.corriere.it/*",
"*://*.dailypress.com/*", "*://*.dailypress.com/*",
"*://*.denverpost.com/*", "*://*.denverpost.com/*",
"*://*.tijd.be/*", "*://*.tijd.be/*",
"*://*.volkskrant.nl/*", "*://*.volkskrant.nl/*",
"*://*.economist.com/*", "*://*.economist.com/*",
"*://*.examiner.com.au/*", "*://*.examiner.com.au/*",
"*://*.ft.com/*", "*://*.ft.com/*",
"*://*.foreignpolicy.com/*", "*://*.foreignpolicy.com/*",
"*://*.glassdoor.com/*", "*://*.glassdoor.com/*",
"*://*.haaretz.co.il/*", "*://*.haaretz.co.il/*",
"*://*.haaretz.com/*", "*://*.haaretz.com/*",
"*://*.handelsblatt.com/*", "*://*.handelsblatt.com/*",
"*://*.courant.com/*", "*://*.courant.com/*",
"*://*.hbr.org/*", "*://*.hbr.org/*",
"*://*.inc.com/*", "*://*.inc.com/*",
"*://*.investorschronicle.co.uk/*", "*://*.investorschronicle.co.uk/*",
"*://*.repubblica.it/*", "*://*.repubblica.it/*",
"*://*.letemps.ch/*", "*://*.letemps.ch/*",
"*://*.latimes.com/*", "*://*.latimes.com/*",
"*://*.medium.com/*", "*://*.medium.com/*",
"*://*.medscape.com/*", "*://*.medscape.com/*",
"*://*.technologyreview.com/*", "*://*.technologyreview.com/*",
"*://*.mv-voice.com/*", "*://*.mv-voice.com/*",
"*://*.nationalpost.com/*", "*://*.nationalpost.com/*",
"*://*.newstatesman.com/*", "*://*.newstatesman.com/*",
"*://*.nymag.com/*", "*://*.nymag.com/*",
"*://*.nzherald.co.nz/*", "*://*.nzherald.co.nz/*",
"*://*.asia.nikkei.com/*", "*://*.asia.nikkei.com/*",
"*://*.nrc.nl/*", "*://*.nrc.nl/*",
"*://*.ocregister.com/*", "*://*.ocregister.com/*",
"*://*.orlandosentinel.com/*", "*://*.orlandosentinel.com/*",
"*://*.paloaltoonline.com/*", "*://*.paloaltoonline.com/*",
"*://*.quora.com/*", "*://*.quora.com/*",
"*://*.sun-sentinel.com/*", "*://*.sun-sentinel.com/*",
"*://*.theadvocate.com.au/*", "*://*.theadvocate.com.au/*",
"*://*.theage.com.au/*", "*://*.theage.com.au/*",
"*://*.theaustralian.com.au/*", "*://*.theaustralian.com.au/*",
"*://*.afr.com/*", "*://*.afr.com/*",
"*://*.bostonglobe.com/*", "*://*.bostonglobe.com/*",
"*://*.bizjournals.com/*", "*://*.bizjournals.com/*",
"*://*.theglobeandmail.com/*", "*://*.theglobeandmail.com/*",
"*://*.theherald.com.au/*", "*://*.theherald.com.au/*",
"*://*.japantimes.co.jp/*", "*://*.japantimes.co.jp/*",
"*://*.themarker.com/*", "*://*.themarker.com/*",
"*://*.mercurynews.com/*", "*://*.mercurynews.com/*",
"*://*.mcall.com/*", "*://*.mcall.com/*",
"*://*.thenation.com/*", "*://*.thenation.com/*",
"*://*.nytimes.com/*", "*://*.nytimes.com/*",
"*://*.newyorker.com/*", "*://*.newyorker.com/*",
"*://*.news-gazette.com/*", "*://*.news-gazette.com/*",
"*://*.thesaturdaypaper.com.au/*", "*://*.thesaturdaypaper.com.au/*",
"*://*.spectator.co.uk/*", "*://*.spectator.co.uk/*",
"*://*.seattletimes.com/*", "*://*.seattletimes.com/*",
"*://*.smh.com.au/*", "*://*.smh.com.au/*",
"*://*.telegraph.co.uk/*", "*://*.telegraph.co.uk/*",
"*://*.thetimes.co.uk/*", "*://*.thetimes.co.uk/*",
"*://*.thestar.com/*", "*://*.thestar.com/*",
"*://*.washingtonpost.com/*", "*://*.washingtonpost.com/*",
"*://*.wsj.com/*", "*://*.wsj.com/*",
"*://*.towardsdatascience.com/*", "*://*.towardsdatascience.com/*",
"*://*.vanityfair.com/*", "*://*.vanityfair.com/*",
"*://*.wired.com/*", "*://*.wired.com/*",
"*://*.thediplomat.com/*", "*://*.thediplomat.com/*",
"*://*.theatlantic.com/*", "*://*.theatlantic.com/*",
"*://*.qz.com/*", "*://*.qz.com/*",
"*://*.ad.nl/*", "*://*.ad.nl/*",
"*://*.ed.nl/*", "*://*.ed.nl/*",
"*://*.groene.nl/*", "*://*.groene.nl/*",
"*://*.parool.nl/*", "*://*.parool.nl/*",
"*://*.telegraaf.nl/*", "*://*.telegraaf.nl/*",
"*://*.trouw.nl/*", "*://*.trouw.nl/*",
"*://*.vn.nl/*", "*://*.vn.nl/*",
"*://*.lemonde.fr/*" "*://*.lemonde.fr/*",
], "*://*.scientificamerican.com/*"
"version": "1.6.0" ],
} "version": "1.6.0"
}

View File

@ -1,160 +1,161 @@
var defaultSites = { var defaultSites = {
'Algemeen Dagblad': 'ad.nl', 'Algemeen Dagblad': 'ad.nl',
'Baltimore Sun': 'baltimoresun.com', 'Baltimore Sun': 'baltimoresun.com',
'Barron\'s': 'barrons.com', 'Barron\'s': 'barrons.com',
'Bloomberg': 'bloomberg.com', 'Bloomberg': 'bloomberg.com',
'Business Insider': 'businessinsider.com', 'Business Insider': 'businessinsider.com',
'Caixin': 'caixinglobal.com', 'Caixin': 'caixinglobal.com',
'Chemical & Engineering News': 'cen.acs.org', 'Chemical & Engineering News': 'cen.acs.org',
'Chicago Tribune': 'chicagotribune.com', 'Chicago Tribune': 'chicagotribune.com',
'Central Western Daily': 'centralwesterndaily.com.au', 'Central Western Daily': 'centralwesterndaily.com.au',
'Crain\'s Chicago Business': 'chicagobusiness.com', 'Crain\'s Chicago Business': 'chicagobusiness.com',
'Corriere Della Sera': 'corriere.it', 'Corriere Della Sera': 'corriere.it',
'Daily Press': 'dailypress.com', 'Daily Press': 'dailypress.com',
'Denver Post': 'denverpost.com', 'Denver Post': 'denverpost.com',
'De Groene Amsterdammer': 'groene.nl', 'De Groene Amsterdammer': 'groene.nl',
'De Tijd': 'tijd.be', 'De Tijd': 'tijd.be',
'de Volkskrant': 'volkskrant.nl', 'de Volkskrant': 'volkskrant.nl',
'The Economist (javascript disabled)': 'economist.com', 'The Economist (javascript disabled)': 'economist.com',
'Eindhovens Dagblad': 'ed.nl', 'Eindhovens Dagblad': 'ed.nl',
'Examiner': 'examiner.com.au', 'Examiner': 'examiner.com.au',
'Financial Times': 'ft.com', 'Financial Times': 'ft.com',
'Foreign Policy': 'foreignpolicy.com', 'Foreign Policy': 'foreignpolicy.com',
'Glassdoor': 'glassdoor.com', 'Glassdoor': 'glassdoor.com',
'Haaretz': 'haaretz.co.il', 'Haaretz': 'haaretz.co.il',
'Haaretz English': 'haaretz.com', 'Haaretz English': 'haaretz.com',
'Handelsblatt': 'handelsblatt.com', 'Handelsblatt': 'handelsblatt.com',
'Hartford Courant': 'courant.com', 'Hartford Courant': 'courant.com',
'Harvard Business Review': 'hbr.org', 'Harvard Business Review': 'hbr.org',
'Inc.com': 'inc.com', 'Inc.com': 'inc.com',
'Investors Chronicle': 'investorschronicle.co.uk', 'Investors Chronicle': 'investorschronicle.co.uk',
'La Repubblica': 'repubblica.it', 'La Repubblica': 'repubblica.it',
'Le Monde': 'lemonde.fr', 'Le Monde': 'lemonde.fr',
'Le Temps': 'letemps.ch', 'Le Temps': 'letemps.ch',
'Los Angeles Times': 'latimes.com', 'Los Angeles Times': 'latimes.com',
'Medium': 'medium.com', 'Medium': 'medium.com',
'Medscape': 'medscape.com', 'Medscape': 'medscape.com',
'MIT Technology Review': 'technologyreview.com', 'MIT Technology Review': 'technologyreview.com',
'Mountain View Voice': 'mv-voice.com', 'Mountain View Voice': 'mv-voice.com',
'National Post': 'nationalpost.com', 'National Post': 'nationalpost.com',
'New Statesman (javascript disabled)': 'newstatesman.com', 'New Statesman (javascript disabled)': 'newstatesman.com',
'New York Magazine': 'nymag.com', 'New York Magazine': 'nymag.com',
'New Zealand Herald': 'nzherald.co.nz', 'New Zealand Herald': 'nzherald.co.nz',
'Nikkei Asian Review': 'asia.nikkei.com', 'Nikkei Asian Review': 'asia.nikkei.com',
'NRC': 'nrc.nl', 'NRC': 'nrc.nl',
'Orange County Register': 'ocregister.com', 'Orange County Register': 'ocregister.com',
'Orlando Sentinel': 'orlandosentinel.com', 'Orlando Sentinel': 'orlandosentinel.com',
'Palo Alto Online': 'paloaltoonline.com', 'Palo Alto Online': 'paloaltoonline.com',
'Parool': 'parool.nl', 'Parool': 'parool.nl',
'Quartz': 'qz.com', 'Quartz': 'qz.com',
'Quora': 'quora.com', 'Quora': 'quora.com',
'Statista': 'statista.com', 'Scientific American': 'scientificamerican.com',
'SunSentinel': 'sun-sentinel.com', 'Statista': 'statista.com',
'Telegraaf': 'telegraaf.nl', 'SunSentinel': 'sun-sentinel.com',
'The Advocate': 'theadvocate.com.au', 'Telegraaf': 'telegraaf.nl',
'The Age': 'theage.com.au', 'The Advocate': 'theadvocate.com.au',
'The Atlantic': 'theatlantic.com', 'The Age': 'theage.com.au',
'The Australian': 'theaustralian.com.au', 'The Atlantic': 'theatlantic.com',
'The Australian Financial Review (javascript disabled)': 'afr.com', 'The Australian': 'theaustralian.com.au',
'The Boston Globe (javascript disabled)': 'bostonglobe.com', 'The Australian Financial Review (javascript disabled)': 'afr.com',
'The Business Journals': 'bizjournals.com', 'The Boston Globe (javascript disabled)': 'bostonglobe.com',
'The Diplomat': 'thediplomat.com', 'The Business Journals': 'bizjournals.com',
'The Globe and Mail (javascript disabled)': 'theglobeandmail.com', 'The Diplomat': 'thediplomat.com',
'The Herald': 'theherald.com.au', 'The Globe and Mail (javascript disabled)': 'theglobeandmail.com',
'The Japan Times': 'japantimes.co.jp', 'The Herald': 'theherald.com.au',
'TheMarker': 'themarker.com', 'The Japan Times': 'japantimes.co.jp',
'The Mercury News': 'mercurynews.com', 'TheMarker': 'themarker.com',
'The Morning Call': 'mcall.com', 'The Mercury News': 'mercurynews.com',
'The Nation': 'thenation.com', 'The Morning Call': 'mcall.com',
'The New York Times': 'nytimes.com', 'The Nation': 'thenation.com',
'The New Yorker': 'newyorker.com', 'The New York Times': 'nytimes.com',
'The News-Gazette': 'news-gazette.com', 'The New Yorker': 'newyorker.com',
'The Saturday Paper': 'thesaturdaypaper.com.au', 'The News-Gazette': 'news-gazette.com',
'The Spectator': 'spectator.co.uk', 'The Saturday Paper': 'thesaturdaypaper.com.au',
'The Seattle Times': 'seattletimes.com', 'The Spectator': 'spectator.co.uk',
'The Sydney Morning Herald': 'smh.com.au', 'The Seattle Times': 'seattletimes.com',
'The Telegraph': 'telegraph.co.uk', 'The Sydney Morning Herald': 'smh.com.au',
'The Times': 'thetimes.co.uk', 'The Telegraph': 'telegraph.co.uk',
'The Toronto Star (javascript disabled)': 'thestar.com', 'The Times': 'thetimes.co.uk',
'The Washington Post': 'washingtonpost.com', 'The Toronto Star (javascript disabled)': 'thestar.com',
'The Wall Street Journal': 'wsj.com', 'The Washington Post': 'washingtonpost.com',
'Towards Data Science': 'towardsdatascience.com', 'The Wall Street Journal': 'wsj.com',
'Trouw': 'trouw.nl', 'Towards Data Science': 'towardsdatascience.com',
'Vanity Fair': 'vanityfair.com', 'Trouw': 'trouw.nl',
'Vrij Nederland': 'vn.nl', 'Vanity Fair': 'vanityfair.com',
'Wired': 'wired.com' 'Vrij Nederland': 'vn.nl',
}; 'Wired': 'wired.com'
};
// Saves options to browser.storage
function save_options() { // Saves options to browser.storage
var gh_url = document.getElementById('bypass_sites').value; function save_options() {
var inputEls = document.querySelectorAll('#bypass_sites input'); var gh_url = document.getElementById('bypass_sites').value;
var sites = {}; var inputEls = document.querySelectorAll('#bypass_sites input');
var sites = {};
var sites = Array.from(inputEls).reduce(function(memo, inputEl) {
if (inputEl.checked) { var sites = Array.from(inputEls).reduce(function(memo, inputEl) {
memo[inputEl.dataset.key] = inputEl.dataset.value; if (inputEl.checked) {
} memo[inputEl.dataset.key] = inputEl.dataset.value;
return memo; }
}, {}); return memo;
}, {});
browser.storage.sync.set({
sites: sites browser.storage.sync.set({
}, function() { sites: sites
// Update status to let user know options were saved. }, function() {
var status = document.getElementById('status'); // Update status to let user know options were saved.
status.textContent = 'Options saved.'; var status = document.getElementById('status');
setTimeout(function() { status.textContent = 'Options saved.';
// status.textContent = ''; setTimeout(function() {
window.close(); // status.textContent = '';
}, 500); window.close();
}); }, 500);
} });
}
// Restores checkbox input states using the preferences
// stored in browser.storage. // Restores checkbox input states using the preferences
function renderOptions() { // stored in browser.storage.
browser.storage.sync.get({ function renderOptions() {
sites: {} browser.storage.sync.get({
}, function(items) { sites: {}
var sites = items.sites; }, function(items) {
var sitesEl = document.getElementById('bypass_sites'); var sites = items.sites;
for (var key in defaultSites) { var sitesEl = document.getElementById('bypass_sites');
if (!defaultSites.hasOwnProperty(key)) { for (var key in defaultSites) {
continue; if (!defaultSites.hasOwnProperty(key)) {
} continue;
}
var value = defaultSites[key];
var labelEl = document.createElement('label'); var value = defaultSites[key];
var inputEl = document.createElement('input'); var labelEl = document.createElement('label');
inputEl.type = 'checkbox'; var inputEl = document.createElement('input');
inputEl.dataset.key = key; inputEl.type = 'checkbox';
inputEl.dataset.value = value; inputEl.dataset.key = key;
inputEl.checked = key in sites; inputEl.dataset.value = value;
inputEl.checked = key in sites;
labelEl.appendChild(inputEl);
labelEl.appendChild(document.createTextNode(' '+key)); labelEl.appendChild(inputEl);
sitesEl.appendChild(labelEl); labelEl.appendChild(document.createTextNode(' '+key));
} sitesEl.appendChild(labelEl);
}); }
} });
}
function selectAll() {
var inputEls = Array.from(document.querySelectorAll('input')); function selectAll() {
inputEls.forEach(function(inputEl) { var inputEls = Array.from(document.querySelectorAll('input'));
inputEl.checked = true; inputEls.forEach(function(inputEl) {
}); inputEl.checked = true;
} });
}
function selectNone() {
var inputEls = Array.from(document.querySelectorAll('input')); function selectNone() {
inputEls.forEach(function(inputEl) { var inputEls = Array.from(document.querySelectorAll('input'));
inputEl.checked = false; inputEls.forEach(function(inputEl) {
}); inputEl.checked = false;
} });
}
document.addEventListener('DOMContentLoaded', renderOptions);
document.getElementById('save').addEventListener('click', save_options); document.addEventListener('DOMContentLoaded', renderOptions);
document.getElementById('select-all').addEventListener('click', selectAll); document.getElementById('save').addEventListener('click', save_options);
document.getElementById('select-none').addEventListener('click', selectNone); document.getElementById('select-all').addEventListener('click', selectAll);
document.getElementById('select-none').addEventListener('click', selectNone);