diff --git a/README.md b/README.md index f62669b..5d8550e 100644 --- a/README.md +++ b/README.md @@ -1,121 +1,144 @@ -# Bypass Paywalls for Firefox +# Bypass Paywalls for Chrome -## [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) +### Installation Instructions +**Google Chrome** +1. Download this repo as a [ZIP file from GitHub](https://github.com/iamadamdev/bypass-paywalls-chrome/archive/master.zip). +1. Unzip the file and you should have a folder named `bypass-paywalls-chrome-master`. +1. In Chrome go to the extensions page (`chrome://extensions`). +1. Enable Developer Mode. +1. Drag the `bypass-paywalls-chrome-master` folder anywhere on the page to import it. + +**Notes** +* Every time you open Chrome it may warn you about running extensions in developer mode, just click 🗙 to keep the extension enabled. +* You will be logged out for any site you have checked. +* This extension works best along side the adblocker uBlock Origin. ### Bypass the following sites' paywalls with this extension [Algemeen Dagblad](https://www.ad.nl)\ +[American Banker](https://americanbanker.com)\ [Baltimore Sun](https://www.baltimoresun.com)\ [Barron's](https://www.barrons.com)\ [Bloomberg](https://www.bloomberg.com)\ +[Bloomberg Quint](https://bloombergquint.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)\ +[Crain's Chicago Business](https://www.chicagobusiness.com)\ +[Dagens Nyheter](https://dn.se)\ [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)\ +[De Volkskrant](https://www.volkskrant.nl)\ +[DeMorgen](https://demorgen.be)\ +[Denver Post](https://www.denverpost.com)\ +[Dynamed Plus](https://dynamed.com)\ [Eindhovens Dagblad](https://ed.nl)\ -[Examiner](https://www.examiner.com.au)\ +[Encyclopedia Britannica](https://britannica.com)\ +[Examiner](https://examiner.com.au)\ +[First Things](https://www.firstthings.com)\ +[Financial News](https://fnlondon.com)\ [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)\ +[Harper's Magazine](https://harpers.org)\ [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)\ +[Irish Times](https://www.irishtimes.com)\ +[L.A. Business Journal](https://labusinessjournal.com)\ +[La Nación](https://www.lanacion.com.ar)\ [La Repubblica](https://www.repubblica.it)\ +[La Tercera](https://latercera.com)\ +[L'Écho](https://lecho.be)\ [Le Monde](https://www.lemonde.fr)\ -[Le Temps](https://www.letemps.ch)\ +[Le Parisien](http://www.leparisien.fr)\ +[Les Échos](https://lesechos.fr)\ +[Libération](https://liberation.fr)\ +[Loeb Classical Library](https://www.loebclassics.com)\ [Los Angeles Times](https://www.latimes.com)\ -[Medium](https://www.medium.com)\ -[Medscape](https://www.medscape.com)\ +[MIT Sloan Management Review](https://sloanreview.mit.edu)\ [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)\ +[Medium](https://www.medium.com)\ +[Mexicon News Daily](https://mexiconewsdaily.com)\ +[NRC](https://www.nrc.nl)\ [New York Magazine](https://www.nymag.com)\ [New Zealand Herald](https://www.nzherald.co.nz)\ +[Newsrep](https://thenewsrep.com)\ [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)\ +[San Diego Union Tribune](https://sandiegouniontribune.com)\ +[San Francisco Chronicle](https://sfchronicle.com)\ [Scientific American](https://scientificamerican.com)\ -[Statista](https://www.statista.com)\ +[Statista](https://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 American Interest](https://www.the-american-interest.com)\ +[The Atlantic](https://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 Business Journals](https://www.bizjournals.com)\ -[The Diplomat](https://www.thediplomat.com)\ +[The Economist](https://www.economist.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 Statesman](https://newstatesman.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 Philadelphia Inquirer](inquirer.com)\ [The Seattle Times](https://www.seattletimes.com)\ +[The Spectator](https://www.spectator.co.uk)\ [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)\ +[The Washington Post](https://www.washingtonpost.com)\ +[TheMarker](https://www.themarker.com)\ [Trouw](https://www.trouw.nl)\ [Vanity Fair](https://www.vanityfair.com)\ -[Vrij Nederland](https://www.vn.nl)\ -[Wired](https://www.wired.com) +[Winston-Salem Journal](https://journalnow.com)\ +[Vrij Nederland](https://vn.nl)\ +[Wired](https://www.wired.com)\ +[Zeit Online](https://www.zeit.de) ### 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://chrome.google.com/webstore/detail/cookie-remover/kcgpggonjhmeaejebeoeomdlohicfhce) extension. 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. +Only large or major sites will be considered. 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. +2. Open up a new incognito window (Ctrl+Shift+N) 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-chrome/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/). +* This extension works best alongside [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm). * If a site doesn't work try turning off uBlock and refreshing. +* Make sure the site is checked under Options (on macOS sometimes the sites are unselected). -### Pull Requesets +### Pull Requests * 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 is [MIT-licensed](https://github.com/iamadamdev/bypass-paywalls-chrome/blob/master/LICENSE). diff --git a/background.js b/background.js index a9bf7a4..79cfb64 100644 --- a/background.js +++ b/background.js @@ -1,91 +1,105 @@ +/* Please respect alphabetical order when adding a site in any list */ + 'use strict'; +// Cookies from this list are blocked by default var defaultSites = { 'Algemeen Dagblad': 'ad.nl', + 'American Banker': 'americanbanker.com', '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', - 'Chicago Tribune': 'chicagotribune.com', - 'Central Western Daily': 'centralwesterndaily.com.au', 'Crain\'s Chicago Business': 'chicagobusiness.com', + 'Chicago Tribune': 'chicagotribune.com', 'Corriere Della Sera': 'corriere.it', 'Daily Press': 'dailypress.com', - 'Denver Post': 'denverpost.com', - 'De Tijd': 'tijd.be', + 'Dagens Nyheter': 'dn.se', 'De Groene Amsterdammer': 'groene.nl', - 'de Volkskrant': 'volkskrant.nl', - 'The Economist': 'economist.com', + 'De Volkskrant': 'volkskrant.nl', + 'DeMorgen': 'demorgen.be', + 'Denver Post': 'denverpost.com', + 'Dynamed Plus': 'dynamed.com', 'Eindhovens Dagblad': 'ed.nl', + 'Encyclopedia Britannica': 'britannica.com', 'Examiner': 'examiner.com.au', + 'First Things': 'firstthings.com', + 'Financial News': 'fnlondon.com', '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', + 'Harper\'s Magazine': 'harpers.org', 'Harvard Business Review': 'hbr.org', 'Inc.com': 'inc.com', - 'Investors Chronicle': 'investorschronicle.co.uk', + 'Irish Times': 'irishtimes.com', + 'La Nacion': 'lanacion.com.ar', 'La Repubblica': 'repubblica.it', + 'La Tercera': 'latercera.com', + 'L\'Echo': 'lecho.be', 'Le Monde': 'lemonde.fr', - 'Le Temps': 'letemps.ch', + 'Le Parisien': 'leparisien.fr', + 'Les Echos': 'lesechos.fr', + 'Liberation': 'liberation.fr', + 'Loeb Classical Library': 'loebclassics.com', + 'Los Angeles Business Journal': 'labusinessjournal.com', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', - 'Medscape': 'medscape.com', + 'Mexico News Daily': 'mexiconewsdaily.com', + 'MIT Sloan Management Review': 'sloanreview.mit.edu', 'MIT Technology Review': 'technologyreview.com', - 'Mountain View Voice': 'mv-voice.com', - 'National Post': 'nationalpost.com', - 'New Statesman': 'newstatesman.com', + 'Newsrep': 'thenewsrep.com', 'New York Magazine': 'nymag.com', 'Nikkei Asian Review': 'asia.nikkei.com', 'NRC': 'nrc.nl', 'New Zealand Herald': 'nzherald.co.nz', - 'Orange County Register': 'ocregister.com', - 'Orlando Sentinel': 'orlandosentinel.com', - 'Palo Alto Online': 'paloaltoonline.com', + 'OrlandoSentinel': 'orlandosentinel.com', 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', + 'San Diego Union Tribune': 'sandiegouniontribune.com', + 'San Francisco Chronicle': 'sfchronicle.com', 'Scientific American': 'scientificamerican.com', - 'Statista': 'statista.com', 'SunSentinel': 'sun-sentinel.com', + 'Statista':'statista.com', 'Telegraaf': 'telegraaf.nl', 'The Advocate': 'theadvocate.com.au', 'The Age': 'theage.com.au', + 'The American Interest': 'the-american-interest.com', 'The Atlantic': 'theatlantic.com', 'The Australian': 'theaustralian.com.au', 'The Australian Financial Review': 'afr.com', 'The Boston Globe': 'bostonglobe.com', 'The Business Journals': 'bizjournals.com', - 'The Diplomat': 'thediplomat.com', + 'The Economist': 'economist.com', 'The Globe and Mail': 'theglobeandmail.com', - 'The Herald': 'theherald.com.au', 'The Japan Times': 'japantimes.co.jp', 'TheMarker': 'themarker.com', 'The Mercury News': 'mercurynews.com', 'The Morning Call': 'mcall.com', 'The Nation': 'thenation.com', + 'The News-Gazette': 'news-gazette.com', + 'The New Statesman': 'newstatesman.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 Philadelphia Inquirer': 'inquirer.com', 'The Seattle Times': 'seattletimes.com', + 'The Spectator': 'spectator.co.uk', 'The Sydney Morning Herald': 'smh.com.au', - 'The Telegraph': 'telegraph.co.uk', + 'The Telegraph': 'telegraph.co.uk', 'The Times': 'thetimes.co.uk', 'The Toronto Star': 'thestar.com', 'The Washington Post': 'washingtonpost.com', 'The Wall Street Journal': 'wsj.com', - 'Towards Data Science': 'towardsdatascience.com', 'Trouw': 'trouw.nl', + 'Winston-Salem Journal': 'journalnow.com', 'Vanity Fair': 'vanityfair.com', 'Vrij Nederland': 'vn.nl', - 'Wired': 'wired.com' + 'Wired': 'wired.com', + 'Zeit Online': 'zeit.de' }; const restrictions = { @@ -97,39 +111,37 @@ const allow_cookies = [ 'ad.nl', 'asia.nikkei.com', 'bostonglobe.com', -'cen.acs.org', 'chicagobusiness.com', +'demorgen.be', 'denverpost.com', 'economist.com', 'ed.nl', 'examiner.com.au', 'ft.com', -'hacked.com', +'harpers.org', 'hbr.org', 'lemonde.fr', -'letemps.ch', +'lesechos.fr', 'medium.com', 'mercurynews.com', -'newstatesman.com', +'mexiconewsdaily.com', +'nrc.nl', 'nymag.com', 'nytimes.com', -'ocregister.com', 'parool.nl', 'qz.com', 'scientificamerican.com', -'spectator.co.uk', +'seattletimes.com', 'telegraaf.nl', +'the-american-interest.com', 'theadvocate.com.au', 'theage.com.au', 'theaustralian.com.au', -'thediplomat.com', -'thestar.com', -'towardsdatascience.com', 'trouw.nl', 'vn.nl', 'volkskrant.nl', 'washingtonpost.com', -'wsj.com', +'wsj.com' ] // Removes cookies after page load @@ -137,34 +149,30 @@ const remove_cookies = [ 'ad.nl', 'asia.nikkei.com', 'bostonglobe.com', -'cen.acs.org', 'chicagobusiness.com', +'demorgen.be', 'denverpost.com', 'economist.com', 'ed.nl', 'examiner.com.au', 'ft.com', -'hacked.com', +'harpers.org', 'hbr.org', -'letemps.ch', +'lesechos.fr', 'medium.com', 'mercurynews.com', -'newstatesman.com', +'mexiconewsdaily.com', +'nrc.nl', 'nymag.com', -'nytimes.com', -'ocregister.com', 'qz.com', 'scientificamerican.com', -'spectator.co.uk', +'seattletimes.com', 'telegraaf.nl', 'theadvocate.com.au', 'theage.com.au', -'thediplomat.com', -'thestar.com', -'towardsdatascience.com', 'vn.nl', 'washingtonpost.com', -'wsj.com', +'wsj.com' ] // select specific cookie(s) to hold from remove_cookies domains @@ -182,23 +190,27 @@ const remove_cookies_select_drop = { // Override User-Agent with Googlebot const use_google_bot = [ 'barrons.com', +'lemonde.fr', +'mexiconewsdaily.com', 'nytimes.com', 'quora.com', 'telegraph.co.uk', 'theaustralian.com.au', 'thetimes.co.uk', 'wsj.com', +'zeit.de', ] function setDefaultOptions() { - browser.storage.sync.set({ + chrome.storage.sync.set({ sites: defaultSites }, function() { - browser.runtime.openOptionsPage(); + chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id }); }); } -const blockedRegexes = [ + +var blockedRegexes = [ /.+:\/\/.+\.tribdss\.com\//, /thenation\.com\/.+\/paywall-script\.php/, /haaretz\.co\.il\/htz\/js\/inter\.js/, @@ -211,7 +223,7 @@ const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; var enabledSites = []; // Get the enabled sites -browser.storage.sync.get({ +chrome.storage.sync.get({ sites: {} }, function(items) { var sites = items.sites; @@ -221,7 +233,7 @@ browser.storage.sync.get({ }); // Listen for changes to options -browser.storage.onChanged.addListener(function(changes, namespace) { +chrome.storage.onChanged.addListener(function(changes, namespace) { var key; for (key in changes) { var storageChange = changes[key]; @@ -235,7 +247,7 @@ browser.storage.onChanged.addListener(function(changes, namespace) { }); // Set and show default options on install -browser.runtime.onInstalled.addListener(function(details) { +chrome.runtime.onInstalled.addListener(function (details) { if (details.reason == "install") { setDefaultOptions(); } else if (details.reason == "update") { @@ -245,8 +257,8 @@ browser.runtime.onInstalled.addListener(function(details) { /** // WSJ bypass -browser.webRequest.onBeforeSendHeaders.addListener(function(details) { - if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) { +chrome.webRequest.onBeforeRequest.addListener(function (details) { + if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { return; } @@ -273,16 +285,16 @@ chrome.webRequest.onBeforeRequest.addListener(function(details) { if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) { return; } - return {cancel: true}; + return {cancel: true}; }, { - urls: ["*://*.theglobeandmail.com/*", "*://*.economist.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*", "*://*.bostonglobe.com/*", "*://*.afr.com/*"], + urls: ["*://*.thestar.com/*", "*://*.economist.com/*", "*://*.theglobeandmail.com/*", "*://*.afr.com/*", "*://*.bizjournals.com/*", "*://*.businessinsider.com/*", "*://*.bostonglobe.com/*"], types: ["script"] }, ["blocking"] ); -browser.webRequest.onBeforeSendHeaders.addListener(function(details) { +chrome.webRequest.onBeforeSendHeaders.addListener(function(details) { if (!isSiteEnabled(details)) { return; } @@ -298,13 +310,9 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) { var setReferer = false; // if referer exists, set it to google - requestHeaders = requestHeaders.map(function(requestHeader) { + requestHeaders = requestHeaders.map(function (requestHeader) { if (requestHeader.name === 'Referer') { - if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) { - // this fixes images not being loaded on cooking.nytimes.com main page - // referrer has to be *nytimes.com otherwise returns 403 - requestHeader.value = 'https://cooking.nytimes.com'; - } else if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) { + if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) { requestHeader.value = 'https://www.facebook.com/'; } else { requestHeader.value = 'https://www.google.com/'; @@ -331,11 +339,12 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) { value: 'https://www.google.com/' }); } + } // override User-Agent to use Googlebot var useGoogleBot = use_google_bot.filter(function(item) { - return typeof item == 'string' && details.url.indexOf(item) > -1; + return typeof item == 'string' && details.url.indexOf(item) > -1; }).length > 0; if (useGoogleBot) { @@ -364,11 +373,11 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) { if (tabId !== -1) { // run contentScript inside tab - browser.tabs.executeScript(tabId, { + chrome.tabs.executeScript(tabId, { file: 'contentScript.js', runAt: 'document_start' }, function(res) { - if (browser.runtime.lastError || res[0]) { + if (chrome.runtime.lastError || res[0]) { return; } }); @@ -377,44 +386,44 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) { return { requestHeaders: requestHeaders }; }, { urls: [''] -}, ['blocking', 'requestHeaders']); +}, ['blocking', 'requestHeaders', 'extraHeaders']); // remove cookies after page load -browser.webRequest.onCompleted.addListener(function(details) { +chrome.webRequest.onCompleted.addListener(function(details) { for (var domainIndex in remove_cookies) { var domainVar = remove_cookies[domainIndex]; if (!enabledSites.includes(domainVar) || details.url.indexOf(domainVar) === -1) { continue; // don't remove cookies } - browser.cookies.getAll({domain: domainVar}, function(cookies) { - for (var i=0; i"] }); +var _gaq = _gaq || []; +_gaq.push(['_setAccount', 'UA-69824169-2']); +_gaq.push(['_trackPageview']); + +(function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = 'https://ssl.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); +})(); + function isSiteEnabled(details) { var isEnabled = enabledSites.some(function(enabledSite) { var useSite = details.url.indexOf("." + enabledSite) !== -1; diff --git a/manifest.json b/manifest.json index f4a3718..6eee755 100644 --- a/manifest.json +++ b/manifest.json @@ -1,145 +1,24 @@ { - "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_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'", + "browser_action": { + "default_popup": "popup.html" + }, + "description": "Bypass News Sites' Paywalls", + "icons": { + "128": "bypass.png" + }, + "manifest_version": 2, + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PRmcRnHFZwHUlCgoTAdBjc9nUjmJo8l8kvkl/OZV6biZFAGUQGdxF1xoGhRccWA7qfQrZdPwcM1VQoVS/1F+87XiutKTe/HNsTAFvOcVS0tjCSH6DOHpewkMUBZujwTIeo7UXUVmCPQ1UbVd6m8KmHYtSHYlaX0uXRcguWhLmO5hASxw4onvAD0uql/t/ntxsIATwn4hVApg0VZhy0QAbMany8/5ByKPa19mCQwsIdRkcpG+PNHTLWPDgeGoDL7S0DxIduraRhTlrDX/zy5ETu6NWq6r+/jRzmXAjx+vSDCU5Ps2YG8QwdCL4Zl+CNVdQrnqz4X1zfPFJ1FFmUSpwIDAQAB", + "name": "Bypass Paywalls", + "update_url": "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml", + "short_name": "Bypass Paywall", + "options_ui": { + "chrome_style": true, + "page": "options.html" + }, + "permissions": [ "cookies", "", "storage", "webRequest", "webRequestBlocking"], + "version": "1.5.6" } diff --git a/options.js b/options.js index 4aa1b1e..6d6cde0 100644 --- a/options.js +++ b/options.js @@ -1,92 +1,103 @@ var defaultSites = { 'Algemeen Dagblad': 'ad.nl', + 'American Banker': 'americanbanker.com', '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', + 'Bloomberg Quint': 'bloombergquint.com', + 'Business Insider (javascript disabled)': 'businessinsider.com', 'Crain\'s Chicago Business': 'chicagobusiness.com', + 'Chicago Tribune': 'chicagotribune.com', 'Corriere Della Sera': 'corriere.it', 'Daily Press': 'dailypress.com', - 'Denver Post': 'denverpost.com', + 'Dagens Nyheter': 'dn.se', 'De Groene Amsterdammer': 'groene.nl', - 'De Tijd': 'tijd.be', - 'de Volkskrant': 'volkskrant.nl', - 'The Economist (javascript disabled)': 'economist.com', + 'De Volkskrant': 'volkskrant.nl', + 'DeMorgen': 'demorgen.be', + 'Denver Post': 'denverpost.com', + 'Dynamed Plus': 'dynamed.com', + 'Encyclopedia Britannica': 'britannica.com', 'Eindhovens Dagblad': 'ed.nl', 'Examiner': 'examiner.com.au', + 'First Things': 'firstthings.com', + 'Financial News': 'fnlondon.com', 'Financial Times': 'ft.com', 'Foreign Policy': 'foreignpolicy.com', 'Glassdoor': 'glassdoor.com', 'Haaretz': 'haaretz.co.il', 'Haaretz English': 'haaretz.com', - 'Handelsblatt': 'handelsblatt.com', + 'Harper\'s Magazine': 'harpers.org', 'Hartford Courant': 'courant.com', 'Harvard Business Review': 'hbr.org', 'Inc.com': 'inc.com', - 'Investors Chronicle': 'investorschronicle.co.uk', + 'Irish Times': 'irishtimes.com', + 'La Nacion': 'lanacion.com.ar', 'La Repubblica': 'repubblica.it', + 'La Tercera': 'latercera.com', + 'L\'Echo': 'lecho.be', 'Le Monde': 'lemonde.fr', - 'Le Temps': 'letemps.ch', + 'Le Parisien': 'leparisien.fr', + 'Les Echos': 'lesechos.fr', + 'Liberation': 'liberation.fr', + 'Loeb Classical Library': 'loebclassics.com', + 'Los Angeles Business Journal': 'labusinessjournal.com', 'Los Angeles Times': 'latimes.com', 'Medium': 'medium.com', - 'Medscape': 'medscape.com', + 'Mexico News Daily': 'mexiconewsdaily.com', + 'MIT Sloan Management Review': 'sloanreview.mit.edu', 'MIT Technology Review': 'technologyreview.com', - 'Mountain View Voice': 'mv-voice.com', - 'National Post': 'nationalpost.com', - 'New Statesman (javascript disabled)': 'newstatesman.com', + 'Newsrep': 'thenewsrep.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', + 'New Zealand Herald': 'nzherald.co.nz', + 'OrlandoSentinel': 'orlandosentinel.com', 'Parool': 'parool.nl', 'Quartz': 'qz.com', 'Quora': 'quora.com', - 'Scientific American': 'scientificamerican.com', + 'San Diego Union Tribune': 'sandiegouniontribune.com', + 'San Francisco Chronicle': 'sfchronicle.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 American Interest': 'the-american-interest.com', '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 Business Journals (javascript disabled)': 'bizjournals.com', + 'The Economist (javascript disabled)': 'economist.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 News-Gazette': 'news-gazette.com', + 'The New Statesman': 'newstatesman.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 Philadelphia Inquirer': 'inquirer.com', 'The Seattle Times': 'seattletimes.com', + 'The Spectator': 'spectator.co.uk', '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', + 'Winston-Salem Journal': 'journalnow.com', 'Vanity Fair': 'vanityfair.com', 'Vrij Nederland': 'vn.nl', - 'Wired': 'wired.com' + 'Wired': 'wired.com', + 'Zeit Online': 'zeit.de' }; -// Saves options to browser.storage +// Saves options to chrome.storage function save_options() { var gh_url = document.getElementById('bypass_sites').value; var inputEls = document.querySelectorAll('#bypass_sites input'); @@ -99,23 +110,23 @@ function save_options() { return memo; }, {}); - browser.storage.sync.set({ + chrome.storage.sync.set({ sites: sites }, function() { // Update status to let user know options were saved. var status = document.getElementById('status'); - status.textContent = 'Options saved.'; + status.textContent = 'Options saved.'; setTimeout(function() { - // status.textContent = ''; + status.textContent = ''; window.close(); - }, 500); + }, 800); }); } // Restores checkbox input states using the preferences -// stored in browser.storage. +// stored in chrome.storage. function renderOptions() { - browser.storage.sync.get({ + chrome.storage.sync.get({ sites: {} }, function(items) { var sites = items.sites; @@ -158,4 +169,3 @@ 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); -