Merge remote-tracking branch 'origin/master' into ft-banner-removal

# Conflicts:
#	contentScript.js
This commit is contained in:
Kha Nguyen 2020-04-05 11:02:42 +10:00
commit a69a30cd16
14 changed files with 828 additions and 426 deletions

View File

@ -1,4 +1,4 @@
# Bypass Paywalls for Chrome
# Bypass Paywalls browser extension
### Installation Instructions
**Google Chrome**
@ -8,10 +8,13 @@
1. Enable Developer Mode.
1. Drag the `bypass-paywalls-chrome-master` folder anywhere on the page to import it (do not delete the folder afterwards).
**Mozilla Firefox**
1. [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.9/bypass_paywalls-1.6.9-an+fx.xpi)
**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.
* This extension works best alongside the adblocker uBlock Origin.
### Bypass the following sites' paywalls with this extension
@ -20,15 +23,18 @@
[American Banker](https://www.americanbanker.com)\
[Baltimore Sun](https://www.baltimoresun.com)\
[Barron's](https://www.barrons.com)\
[Bloomberg](https://www.bloomberg.com)\
[Bloomberg Quint](https://www.bloombergquint.com)\
[Bloomberg](https://www.bloomberg.com)\
[Business Insider](https://www.businessinsider.com)\
[Caixin](https://www.caixinglobal.com)\
[Central Western Daily](https://www.centralwesterndaily.com.au)\
[Chemical & Engineering News](https://cen.acs.org)\
[Chicago Tribune](https://www.chicagotribune.com)\
[Corriere Della Sera](https://www.corriere.it)\
[Crain's Chicago Business](https://www.chicagobusiness.com)\
[Dagens Nyheter](https://www.dn.se)\
[Daily Press](https://www.dailypress.com)\
[De Groene Amsterdammer](https://www.groene.nl)\
[De Tijd](https://www.tijd.be)\
[De Volkskrant](https://www.volkskrant.nl)\
[DeMorgen](https://www.demorgen.be)\
[Denver Post](https://www.denverpost.com)\
@ -36,12 +42,12 @@
[Eindhovens Dagblad](https://www.ed.nl)\
[El Pais](https://www.elpais.com/)\
[Encyclopedia Britannica](https://www.britannica.com)\
[ET Prime](https://prime.economictimes.indiatimes.com/)\
[Examiner](https://www.examiner.com.au)\
[First Things](https://www.firstthings.com)\
[Financial News](https://www.fnlondon.com)\
[Financial Times](https://www.ft.com)\
[First Things](https://www.firstthings.com)\
[Foreign Policy](https://www.foreignpolicy.com)\
[Fortune](https://www.fortune.com)\
[Glassdoor](https://www.glassdoor.com)\
[Haaretz.co.il](https://www.haaretz.co.il)\
[Haaretz.com](https://www.haaretz.com)\
@ -51,11 +57,13 @@
[Harvard Business Review](https://www.hbr.org)\
[Het Financieel Dagblad](https://fd.nl)\
[Inc.com](https://www.inc.com)\
[Investors Chronicle](https://www.investorschronicle.co.uk)\
[L'Écho](https://www.lecho.be)\
[L.A. Business Journal](https://labusinessjournal.com)\
[La Nación](https://www.lanacion.com.ar)\
[La Repubblica](https://www.repubblica.it)\
[La Stampa](https://www.lastampa.it)\
[La Tercera](https://www.latercera.com)\
[L'Écho](https://www.lecho.be)\
[Le Devoir](https://www.ledevoir.com)\
[Le Monde](https://www.lemonde.fr)\
[Le Parisien](http://www.leparisien.fr)\
@ -67,22 +75,26 @@
[MIT Technology Review](https://www.technologyreview.com)\
[Medium](https://www.medium.com)\
[Mexicon News Daily](https://mexiconewsdaily.com)\
[Mountain View Voice](https://www.mv-voice.com)\
[NRC Handelsblad](https://www.nrc.nl)\
[National Post](https://www.nationalpost.com)\
[New York Magazine](https://www.nymag.com)\
[New Zealand Herald](https://www.nzherald.co.nz)\
[Nikkei Asian Review](https://asia.nikkei.com)\
[NRC Handelsblad](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)\
[SOFREP](https://sofrep.com)\
[San Diego Union Tribune](https://www.sandiegouniontribune.com)\
[San Francisco Chronicle](https://www.sfchronicle.com)\
[Scientific American](https://www.scientificamerican.com)\
[Seeking Alpha](https://seekingalpha.com)\
[SOFREP](https://sofrep.com)\
[Statista](https://www.statista.com)\
[SunSentinel](https://www.sun-sentinel.com)\
[Tech in Asia](https://www.techinasia.com)\
[Telegraaf](https://www.telegraaf.nl)\
[The Advocate](https://www.theadvocate.com.au)\
[The Age](https://www.theage.com.au)\
@ -95,13 +107,16 @@
[The Business Journals](https://www.bizjournals.com)\
[The Canberra Times](https://www.canberratimes.com.au)\
[The Courier](https://www.thecourier.com.au)\
[The Daily Telegraph](https://www.dailytelegraph.com.au)\
[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 Hindu](https://www.thehindu.com)\
[The Irish Times](https://www.irishtimes.com)\
[The Japan Times](https://www.japantimes.co.jp)\
[The Mercury News](https://www.mercurynews.com)\
[The Mercury Tasmania](https://www.themercury.com.au)\
[The Morning Call](https://www.mcall.com)\
[The Nation](https://www.thenation.com)\
[The New Statesman](https://www.newstatesman.com)\
@ -109,9 +124,10 @@
[The New Yorker](https://www.newyorker.com)\
[The News-Gazette](https://www.news-gazette.com)\
[The Philadelphia Inquirer](https://www.inquirer.com)\
[The Saturday Paper](https://www.thesaturdaypaper.com.au)\
[The Seattle Times](https://www.seattletimes.com)\
[The Spectator](https://www.spectator.co.uk)\
[The Spectator Australia](https://www.spectator.com.au)\
[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)\
@ -123,14 +139,15 @@
[Towards Data Science](https://www.towardsdatascience.com)\
[Trouw](https://www.trouw.nl)\
[Vanity Fair](https://www.vanityfair.com)\
[Winston-Salem Journal](https://journalnow.com)\
[Vrij Nederland](https://www.vn.nl)\
[Winston-Salem Journal](https://journalnow.com)\
[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://chrome.google.com/webstore/detail/cookie-remover/kcgpggonjhmeaejebeoeomdlohicfhce) extension. Please rate it 5 stars if you find it useful.
Install the Cookie Remover extension [for Google Chrome](https://chrome.google.com/webstore/detail/cookie-remover/kcgpggonjhmeaejebeoeomdlohicfhce) or [for Mozilla Firefox](https://addons.mozilla.org/en-US/firefox/addon/cookie-remover/). Please rate it 5 stars if you find it useful.
When coming across a paywall click the cookie icon to remove the cookies then refresh the page.
@ -139,16 +156,16 @@ _*May not always succeed_
### New site requests
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 incognito window (Ctrl+Shift+N) and paste the article title into Google.
2. Open up a new incognito window (Ctrl+Shift+N on Chrome) or Private window (Ctrl+Shift+P on Firefox), 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 extension works best alongside [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm).
* This extension works best alongside uBlock Origin [for Google Chrome](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm) or [for Mozilla Firefox](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/).
* 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 get unselected).
* Make sure you're running the latest version of Bypass Paywalls.
* Make sure you're running the latest version of Bypass Paywalls.
* If a site is having problems try unchecking "\*General Paywall Bypass\*" in Options.
* If none of these work, you can submit an issue [here](https://github.com/iamadamdev/bypass-paywalls-chrome/issues).

View File

@ -2,125 +2,8 @@
'use strict';
// Cookies from this list are blocked by default
var defaultSites = {
'Adweek': 'adweek.com',
'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',
'Crain\'s Chicago Business': 'chicagobusiness.com',
'Chicago Tribune': 'chicagotribune.com',
'Corriere Della Sera': 'corriere.it',
'Daily Press': 'dailypress.com',
'Dagens Nyheter': 'dn.se',
'De Groene Amsterdammer': 'groene.nl',
'De Volkskrant': 'volkskrant.nl',
'DeMorgen': 'demorgen.be',
'Denver Post': 'denverpost.com',
'Dynamed Plus': 'dynamed.com',
'Eindhovens Dagblad': 'ed.nl',
'El Pais': 'elpais.com',
'Encyclopedia Britannica': 'britannica.com',
'ET Prime': 'prime.economictimes.indiatimes.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',
'Harper\'s Magazine': 'harpers.org',
'Hartford Courant': 'courant.com',
'Harvard Business Review': 'hbr.org',
'Het Financieele Dagblad': 'fd.nl',
'Inc.com': 'inc.com',
'La Nacion': 'lanacion.com.ar',
'La Repubblica': 'repubblica.it',
'La Tercera': 'latercera.com',
'L\'Echo': 'lecho.be',
'Le Devoir': 'ledevoir.com',
'Le Monde': 'lemonde.fr',
'Le Parisien': 'leparisien.fr',
'Les Echos': 'lesechos.fr',
'Loeb Classical Library': 'loebclassics.com',
'London Review of Books': 'lrb.co.uk',
'Los Angeles Business Journal': 'labusinessjournal.com',
'Los Angeles Times': 'latimes.com',
'Medium': 'medium.com',
'Mexico News Daily': 'mexiconewsdaily.com',
'MIT Sloan Management Review': 'sloanreview.mit.edu',
'MIT Technology Review': 'technologyreview.com',
'National Post': 'nationalpost.com',
'New York Magazine': 'nymag.com',
'Nikkei Asian Review': 'asia.nikkei.com',
'NRC': 'nrc.nl',
'New Zealand Herald': 'nzherald.co.nz',
'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',
'Seeking Alpha': 'seekingalpha.com',
'SOFREP': 'sofrep.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 Athletic': 'theathletic.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 Canberra Times': 'canberratimes.com.au',
'The Courier': 'thecourier.com.au',
'The Diplomat': 'thediplomat.com',
'The Economist': 'economist.com',
'The Globe and Mail': 'theglobeandmail.com',
'The Hindu': 'thehindu.com',
'The Irish Times': 'irishtimes.com',
'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 Philadelphia Inquirer': 'inquirer.com',
'The Seattle Times': 'seattletimes.com',
'The Spectator': 'spectator.co.uk',
'The Spectator Australia': 'spectator.com.au',
'The Sydney Morning Herald': 'smh.com.au',
'The Telegraph': 'telegraph.co.uk',
'The Times': 'thetimes.co.uk',
'The Toronto Star': 'thestar.com',
'The Washington Post': 'washingtonpost.com',
'The Wall Street Journal': 'wsj.com',
'Times Literary Supplement': 'the-tls.co.uk',
'Towards Data Science': 'towardsdatascience.com',
'Trouw': 'trouw.nl',
'Winston-Salem Journal': 'journalnow.com',
'Vanity Fair': 'vanityfair.com',
'Vrij Nederland': 'vn.nl',
'Wired': 'wired.com',
'*General Paywall Bypass*': 'generalpaywallbypass'
};
const restrictions = {
'barrons.com': /.+barrons\.com\/articles\/.+/,
'prime.economictimes.indiatimes.com': /.+prime\.economictimes\.indiatimes\.com\/news\/[0-9]{8}\/.+/,
'wsj.com': /(.+wsj\.com\/articles\/.+|.+blogs\.wsj\.com\/.+)/
}
@ -130,53 +13,62 @@ const allow_cookies = [
'asia.nikkei.com',
'bostonglobe.com',
'canberratimes.com.au',
'cen.acs.org',
'chicagobusiness.com',
'demorgen.be',
'denverpost.com',
'economist.com',
'ed.nl',
'examiner.com.au',
'fd.nl',
'ft.com',
'harpers.org',
'hbr.org',
'lemonde.fr',
'lesechos.fr',
'lrb.co.uk',
'medium.com',
'mercurynews.com',
'mexiconewsdaily.com',
'newstatesman.com',
'nrc.nl',
'nymag.com',
'nytimes.com',
'ocregister.com',
'parool.nl',
'qz.com',
'scientificamerican.com',
'seattletimes.com',
'seekingalpha.com',
'sofrep.com',
'spectator.co.uk',
'techinasia.com',
'telegraaf.nl',
'the-american-interest.com',
'theadvocate.com.au',
'theage.com.au',
'theathletic.com',
'theatlantic.com',
'theaustralian.com.au',
'thediplomat.com',
'themercury.com.au',
'thestar.com',
'towardsdatascience.com',
'trouw.nl',
'vn.nl',
'volkskrant.nl',
'washingtonpost.com',
'wired.com',
'wsj.com',
'lrb.co.uk',
'theathletic.com',
'fd.nl',
'seekingalpha.com',
]
// Removes cookies after page load
const remove_cookies = [
'ad.nl',
'asia.nikkei.com',
'bloombergquint.com',
'bostonglobe.com',
'canberratimes.com.au',
'cen.acs.org',
'chicagobusiness.com',
'demorgen.be',
'denverpost.com',
@ -190,86 +82,101 @@ const remove_cookies = [
'medium.com',
'mercurynews.com',
'mexiconewsdaily.com',
'newstatesman.com',
'nrc.nl',
'nymag.com',
'nytimes.com',
'ocregister.com',
'qz.com',
'scientificamerican.com',
'seattletimes.com',
'sofrep.com',
'spectator.co.uk',
'telegraaf.nl',
'theadvocate.com.au',
'theage.com.au',
'theatlantic.com',
'thediplomat.com',
'thestar.com',
'towardsdatascience.com',
'vn.nl',
'washingtonpost.com',
'wired.com',
'wsj.com',
]
// select specific cookie(s) to hold from remove_cookies domains
const remove_cookies_select_hold = {
'washingtonpost.com': ['wp_gdpr'],
'qz.com': ['gdpr']
'qz.com': ['gdpr'],
'washingtonpost.com': ['wp_gdpr'],
'wsj.com': ['wsjregion'],
}
// select only specific cookie(s) to drop from remove_cookies domains
const remove_cookies_select_drop = {
'ad.nl': ['temptationTrackingId'],
'demorgen.be': ['TID_ID'],
'economist.com': ['rvuuid'],
'ed.nl': ['temptationTrackingId'],
'nrc.nl': ['counter']
'ad.nl': ['temptationTrackingId'],
'bostonglobe.com': ['FMPaywall'],
'demorgen.be': ['TID_ID'],
'economist.com': ['rvuuid'],
'ed.nl': ['temptationTrackingId'],
'nrc.nl': ['counter'],
}
// Override User-Agent with Googlebot
const use_google_bot = [
'barrons.com',
'dailytelegraph.com.au',
'fd.nl',
'haaretz.co.il',
'haaretz.com',
'lemonde.fr',
'mexiconewsdaily.com',
'nytimes.com',
'quora.com',
'seekingalpha.com',
'telegraph.co.uk',
'theathletic.com',
'theaustralian.com.au',
'themarker.com',
'themercury.com.au',
'thetimes.co.uk',
'wsj.com',
'haaretz.co.il',
'haaretz.com',
'themarker.com',
'prime.economictimes.indiatimes.com',
'theathletic.com',
'fd.nl',
'seekingalpha.com',
]
function setDefaultOptions() {
chrome.storage.sync.set({
sites: defaultSites
var initSites = defaultSites;
// Disable Daily Average User tracking by default on FF
if (typeof browser === 'object' && extension_api === browser)
Object.keys(initSites).forEach(key => initSites[key] == 'allowDAU' && delete initSites[key]);
extension_api.storage.sync.set({
sites: initSites,
}, function() {
chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });
extension_api.runtime.openOptionsPage();
});
}
var blockedRegexes = {
// to block external script also add domain to Firefox manifest.json (permissions)
const blockedRegexes = {
'adweek.com': /.+\.lightboxcdn\.com\/.+/,
'afr.com': /afr\.com\/assets\/vendorsReactRedux_client.+\.js/,
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/,
'businessinsider.com': /(.+\.tinypass\.com\/.+|cdn\.onesignal\.com\/sdks\/.+\.js)/,
'chicagotribune.com': /.+:\/\/.+\.tribdss\.com\//,
'thenation.com': /thenation\.com\/.+\/paywall-script\.php/,
'economist.com': /(.+\.tinypass\.com\/.+|economist\.com\/_next\/static\/runtime\/main.+\.js)/,
'foreignpolicy.com': /.+\.tinypass\.com\/.+/,
'haaretz.co.il': /haaretz\.co\.il\/htz\/js\/inter\.js/,
'haaretz.com': /haaretz\.com\/hdc\/web\/js\/minified\/header-scripts-int.js.+/,
'nzherald.co.nz': /nzherald\.co\.nz\/.+\/headjs\/.+\.js/,
'businessinsider.com': /(.+\.tinypass\.com\/.+|cdn\.onesignal\.com\/sdks\/.+\.js)/,
'economist.com': /(.+\.tinypass\.com\/.+|economist\.com\/_next\/static\/runtime\/main.+\.js)/,
'lrb.co.uk': /.+\.tinypass\.com\/.+/,
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/,
'foreignpolicy.com': /.+\.tinypass\.com\/.+/,
'inquirer.com': /.+\.tinypass\.com\/.+/,
'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/,
'lrb.co.uk': /.+\.tinypass\.com\/.+/,
'nzherald.co.nz': /nzherald\.co\.nz\/.+\/headjs\/.+\.js/,
'repubblica.it': /scripts\.repubblica\.it\/pw\/pw\.js.+/,
'spectator.co.uk': /.+\.tinypass\.com\/.+/,
'spectator.com.au': /.+\.tinypass\.com\/.+/,
'theglobeandmail.com': /theglobeandmail\.com\/pb\/resources\/scripts\/build\/chunk-bootstraps\/.+\.js/,
'adweek.com': /.+\.lightboxcdn\.com\/.+/,
'thecourier.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/,
'afr.com': /afr\.com\/assets\/vendorsReactRedux_client.+\.js/
'theglobeandmail.com': /theglobeandmail\.com\/pb\/resources\/scripts\/build\/chunk-bootstraps\/.+\.js/,
'thenation.com': /thenation\.com\/.+\/paywall-script\.php/,
};
const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
@ -278,17 +185,20 @@ const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ;
var enabledSites = [];
// Get the enabled sites
chrome.storage.sync.get({
extension_api.storage.sync.get({
sites: {}
}, function(items) {
var sites = items.sites;
enabledSites = Object.keys(items.sites).map(function(key) {
return items.sites[key];
});
if (extension_api === chrome) {
init_GA();
}
});
// Listen for changes to options
chrome.storage.onChanged.addListener(function(changes, namespace) {
extension_api.storage.onChanged.addListener(function(changes, namespace) {
var key;
for (key in changes) {
var storageChange = changes[key];
@ -302,7 +212,7 @@ chrome.storage.onChanged.addListener(function(changes, namespace) {
});
// Set and show default options on install
chrome.runtime.onInstalled.addListener(function (details) {
extension_api.runtime.onInstalled.addListener(function (details) {
if (details.reason == "install") {
setDefaultOptions();
} else if (details.reason == "update") {
@ -310,9 +220,30 @@ chrome.runtime.onInstalled.addListener(function (details) {
}
});
extension_api.tabs.onUpdated.addListener(updateBadge);
extension_api.tabs.onActivated.addListener(updateBadge);
function updateBadge() {
extension_api.tabs.query({
active: true,
currentWindow: true
}, function (arrayOfTabs) {
var activeTab = arrayOfTabs[0];
if (!activeTab)
return;
var badgeText = getBadgeText(activeTab.url);
extension_api.browserAction.setBadgeBackgroundColor({color: "blue"});
extension_api.browserAction.setBadgeText({text: badgeText});
});
}
function getBadgeText(currentUrl) {
return currentUrl && isSiteEnabled({url: currentUrl}) ? 'ON' : '';
}
/**
// WSJ bypass
chrome.webRequest.onBeforeRequest.addListener(function (details) {
extension_api.webRequest.onBeforeRequest.addListener(function (details) {
if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) {
return;
}
@ -336,57 +267,68 @@ chrome.webRequest.onBeforeRequest.addListener(function (details) {
**/
// Disable javascript for these sites
chrome.webRequest.onBeforeRequest.addListener(function(details) {
extension_api.webRequest.onBeforeRequest.addListener(function(details) {
if (!isSiteEnabled(details) && !enabledSites.some(function(enabledSite) {
return enabledSite.indexOf("generalpaywallbypass") !== -1
})) {
return;
}
return {cancel: true};
return {cancel: true};
},
{
urls: ["*://*.tinypass.com/*", "*://*.poool.fr/*", "*://*.piano.io/*", "*://*.outbrain.com/*"],
types: ["script"]
urls: [
"*://*.newstatesman.com/*",
"*://*.outbrain.com/*",
"*://*.piano.io/*",
"*://*.poool.fr/*",
"*://*.tinypass.com/*",
],
types: ["script"],
},
["blocking"]
);
chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
var extraInfoSpec = ['blocking', 'requestHeaders'];
if (extension_api.webRequest.OnBeforeSendHeadersOptions.hasOwnProperty('EXTRA_HEADERS'))
extraInfoSpec.push('extraHeaders');
extension_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
var requestHeaders = details.requestHeaders;
var header_referer = '';
for (var n in requestHeaders) {
if (requestHeaders[n].name.toLowerCase() == 'referer') {
header_referer = requestHeaders[n].value;
continue;
}
if (requestHeaders[n].name.toLowerCase() == 'referer') {
header_referer = requestHeaders[n].value;
continue;
}
}
// remove cookies for sites medium platform (mainfest.json needs in permissions: <all_urls>)
if (isSiteEnabled({url: '.medium.com'}) && details.url.indexOf('cdn-client.medium.com') !== -1 && header_referer.indexOf('.medium.com') === -1) {
var domainVar = new URL(header_referer).hostname;
chrome.cookies.getAll({domain: domainVar}, function(cookies) {
for (var i=0; i<cookies.length; i++) {
chrome.cookies.remove({url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path, name: cookies[i].name});
}
});
var domainVar = new URL(header_referer).hostname;
extension_api.cookies.getAll({domain: domainVar}, function(cookies) {
for (var i=0; i<cookies.length; i++) {
extension_api.cookies.remove({url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path, name: cookies[i].name});
}
});
}
// check for blocked regular expression: domain enabled, match regex, block on an internal or external regex
for (var domain in blockedRegexes) {
if ((isSiteEnabled({url: '.'+ domain}) || isSiteEnabled({url: header_referer})) && details.url.match(blockedRegexes[domain])) {
if (details.url.indexOf(domain) !== -1 || header_referer.indexOf(domain) !== -1) {
if ((isSiteEnabled({url: '.'+ domain}) || isSiteEnabled({url: header_referer})) && details.url.match(blockedRegexes[domain])) {
// allow BG paywall-script to set cookies in homepage/sections (else no article-text)
if (details.url.indexOf(domain) !== -1 || header_referer.indexOf(domain) !== -1) {
if (details.url.indexOf('meter.bostonglobe.com/js/') !== -1 && (header_referer === 'https://www.bostonglobe.com/'
|| header_referer.indexOf('/?p1=BGHeader_') !== -1 || header_referer.indexOf('/?p1=BGMenu_') !== -1)) {
chrome.webRequest.handlerBehaviorChanged(function () {});
extension_api.webRequest.handlerBehaviorChanged(function () {});
break;
} else if (header_referer.indexOf('theglobeandmail.com') !== -1 && !(header_referer.indexOf('/article-') !== -1)) {
chrome.webRequest.handlerBehaviorChanged(function () {});
} else if (header_referer.indexOf('theglobeandmail.com') !== -1 && !(header_referer.indexOf('/article-') !== -1)) {
extension_api.webRequest.handlerBehaviorChanged(function () {});
break;
}
return { cancel: true };
}
}
return { cancel: true };
}
}
}
if (!isSiteEnabled(details)) {
@ -399,9 +341,13 @@ chrome.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("ft.com") !== -1) {
if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) {
// this fixes images not being loaded on cooking.nytimes.com main page
// referrer has to be *nytimes.com otherwise returns 403
requestHeader.value = 'https://cooking.nytimes.com';
} else if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) {
requestHeader.value = 'https://www.facebook.com/';
} else {
requestHeader.value = 'https://www.google.com/';
@ -417,7 +363,7 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
// otherwise add it
if (!setReferer) {
if (details.url.indexOf("ft.com") !== -1) {
if (details.url.indexOf("wsj.com") !== -1 || details.url.indexOf("ft.com") !== -1) {
requestHeaders.push({
name: 'Referer',
value: 'https://www.facebook.com/'
@ -432,7 +378,7 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
// override User-Agent to use Googlebot
var useGoogleBot = use_google_bot.filter(function(item) {
return typeof item == 'string' && details.url.indexOf(item) > -1;
return typeof item == 'string' && details.url.indexOf(item) > -1;
}).length > 0;
if (useGoogleBot) {
@ -461,11 +407,11 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
if (tabId !== -1) {
// run contentScript inside tab
chrome.tabs.executeScript(tabId, {
extension_api.tabs.executeScript(tabId, {
file: 'contentScript.js',
runAt: 'document_start'
}, function(res) {
if (chrome.runtime.lastError || res[0]) {
if (extension_api.runtime.lastError || res[0]) {
return;
}
});
@ -474,44 +420,57 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
return { requestHeaders: requestHeaders };
}, {
urls: ['<all_urls>']
}, ['blocking', 'requestHeaders', 'extraHeaders']);
}, extraInfoSpec);
// remove cookies after page load
chrome.webRequest.onCompleted.addListener(function(details) {
extension_api.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
}
chrome.cookies.getAll({domain: domainVar}, function(cookies) {
for (var i=0; i<cookies.length; i++) {
var cookie_domain = cookies[i].domain;
var rc_domain = cookie_domain.replace(/^(\.?www\.|\.)/, '');
// hold specific cookie(s) from remove_cookies domains
if ((rc_domain in remove_cookies_select_hold) && remove_cookies_select_hold[rc_domain].includes(cookies[i].name)) {
continue; // don't remove specific cookie
}
// drop only specific cookie(s) from remove_cookies domains
if ((rc_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[rc_domain].includes(cookies[i].name))) {
continue; // only remove specific cookie
}
chrome.cookies.remove({url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path, name: cookies[i].name});
}
extension_api.cookies.getAll({domain: domainVar}, function(cookies) {
for (var i=0; i<cookies.length; i++) {
var cookie = {
url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path,
name: cookies[i].name,
storeId: cookies[i].storeId
};
// .firstPartyDomain = undefined on Chrome (doesn't support it)
if (cookies[i].firstPartyDomain !== undefined) {
cookie.firstPartyDomain = cookies[i].firstPartyDomain;
}
var cookie_domain = cookies[i].domain;
var rc_domain = cookie_domain.replace(/^(\.?www\.|\.)/, '');
// hold specific cookie(s) from remove_cookies domains
if ((rc_domain in remove_cookies_select_hold) && remove_cookies_select_hold[rc_domain].includes(cookies[i].name)){
continue; // don't remove specific cookie
}
// drop only specific cookie(s) from remove_cookies domains
if ((rc_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[rc_domain].includes(cookies[i].name))){
continue; // only remove specific cookie
}
extension_api.cookies.remove(cookie);
}
});
}
}, {
urls: ["<all_urls>"]
});
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-69824169-2']);
_gaq.push(['_trackPageview']);
// Google Analytics to track DAU
function init_GA() {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-69824169-2']);
_gaq.push (['_gat._anonymizeIp']);
_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() {
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) {

21
build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
JS_FILES="background.js common.js contentScript.js options.js version.js"
HTML_FILES="options.html popup.html"
DOC_FILES="LICENSE README.md"
IMG_FILES="bypass.png"
GEN_FILES="$JS_FILES $HTML_FILES $DOC_FILES $IMG_FILES"
CH_FILES="$GEN_FILES manifest.json updates.xml"
FF_FILES="$GEN_FILES manifest-ff.json updates.json bypass-dark.png"
NAME="bypass-paywalls"
rm -f $NAME.crx $NAME.xpi
# Chrome .crx extension package
7z a -tzip -mx9 $NAME.crx $CH_FILES
7z rn $NAME.crx manifest-ch.json manifest.json # doesn't exist yet; fails harmlessly
# Firefox .xpi extension package (different manifest & update metadata)
7z a -tzip -mx9 $NAME.xpi $FF_FILES
7z rn $NAME.xpi manifest-ff.json manifest.json

BIN
bypass-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

137
common.js Normal file
View File

@ -0,0 +1,137 @@
const extension_api =
(typeof browser === 'object' &&
typeof browser.runtime === 'object' &&
typeof browser.runtime.getManifest === 'function') ? browser :
(typeof chrome === 'object' &&
typeof chrome.runtime === 'object' &&
typeof chrome.runtime.getManifest === 'function') ? chrome :
console.log('Cannot find extension_api under namespace "browser" or "chrome"');
// Cookies from this list are blocked by default
const defaultSites = {
'Adweek': 'adweek.com',
'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',
'Central Western Daily': 'centralwesterndaily.com.au', // articles blanked
'Chemical & Engineering News': 'cen.acs.org', // '2/3 free articles' banner, keeps asking about cookies
'Chicago Tribune': 'chicagotribune.com',
'Corriere Della Sera': 'corriere.it',
'Crain\'s Chicago Business': 'chicagobusiness.com',
'Daily Press': 'dailypress.com',
'De Groene Amsterdammer': 'groene.nl',
'DeMorgen': 'demorgen.be',
'Denver Post': 'denverpost.com',
'De Tijd': 'tijd.be',
'de Volkskrant': 'volkskrant.nl',
'Dynamed Plus': 'dynamed.com',
'Eindhovens Dagblad': 'ed.nl',
'El Pais': 'elpais.com',
'Encyclopedia Britannica': 'britannica.com',
'Examiner': 'examiner.com.au',
'Financial News': 'fnlondon.com',
'Financial Times': 'ft.com',
'First Things': 'firstthings.com',
'Foreign Policy': 'foreignpolicy.com',
'Fortune': 'fortune.com',
'Glassdoor': 'glassdoor.com',
'Haaretz English': 'haaretz.com',
'Haaretz': 'haaretz.co.il',
'Handelsblatt': 'handelsblatt.com',
'Harper\'s Magazine': 'harpers.org',
'Hartford Courant': 'courant.com',
'Harvard Business Review': 'hbr.org',
'Het Financieele Dagblad': 'fd.nl',
'Inc.com': 'inc.com',
'Investors Chronicle': 'investorschronicle.co.uk',
'La Nacion': 'lanacion.com.ar',
'La Repubblica': 'repubblica.it',
'La Stampa': 'lastampa.it',
'La Tercera': 'latercera.com',
'L\'Echo': 'lecho.be',
'Le Devoir': 'ledevoir.com',
'Le Monde': 'lemonde.fr',
'Le Parisien': 'leparisien.fr',
'Les Echos': 'lesechos.fr',
'Loeb Classical Library': 'loebclassics.com',
'London Review of Books': 'lrb.co.uk',
'Los Angeles Business Journal': 'labusinessjournal.com',
'Los Angeles Times': 'latimes.com',
'Medium': 'medium.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',
'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',
'San Diego Union Tribune': 'sandiegouniontribune.com',
'San Francisco Chronicle': 'sfchronicle.com',
'Scientific American': 'scientificamerican.com',
'Seeking Alpha': 'seekingalpha.com',
'SOFREP': 'sofrep.com',
'Statista': 'statista.com',
'SunSentinel': 'sun-sentinel.com',
'Tech in Asia': 'techinasia.com',
'Telegraaf': 'telegraaf.nl',
'The Advocate': 'theadvocate.com.au',
'The Age': 'theage.com.au',
'The American Interest': 'the-american-interest.com',
'The Athletic': 'theathletic.com',
'The Atlantic': 'theatlantic.com',
'The Australian Financial Review': 'afr.com',
'The Australian': 'theaustralian.com.au',
'The Boston Globe': 'bostonglobe.com',
'The Business Journals': 'bizjournals.com',
'The Canberra Times': 'canberratimes.com.au',
'The Courier': 'thecourier.com.au',
'The Daily Telegraph': 'dailytelegraph.com.au',
'The Diplomat': 'thediplomat.com',
'The Economist': 'economist.com',
'The Globe and Mail': 'theglobeandmail.com',
'The Herald': 'theherald.com.au',
'The Hindu': 'thehindu.com',
'The Irish Times (free articles only)': 'irishtimes.com',
'The Japan Times': 'japantimes.co.jp',
'TheMarker': 'themarker.com',
'The Mercury News': 'mercurynews.com',
'The Mercury Tasmania': 'themercury.com.au',
'The Morning Call': 'mcall.com',
'The Nation': 'thenation.com',
'The News-Gazette': 'news-gazette.com',
'The New Yorker': 'newyorker.com',
'The New York Times': 'nytimes.com',
'The Philadelphia Inquirer': 'inquirer.com',
'The Saturday Paper': 'thesaturdaypaper.com.au',
'The Seattle Times': 'seattletimes.com',
'The Spectator Australia': 'spectator.com.au',
'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': 'thestar.com',
'The Wall Street Journal': 'wsj.com',
'The Washington Post': 'washingtonpost.com',
'Times Literary Supplement': 'the-tls.co.uk',
'Towards Data Science': 'towardsdatascience.com',
'Trouw': 'trouw.nl',
'Vanity Fair': 'vanityfair.com',
'Vrij Nederland': 'vn.nl',
'Winston-Salem Journal': 'journalnow.com',
'Wired': 'wired.com',
'*General Paywall Bypass*': 'generalpaywallbypass',
};

View File

@ -1,4 +1,4 @@
var arr_localstorage_hold = ['sfchronicle.com'];
var arr_localstorage_hold = ['sfchronicle.com', 'cen.acs.org'];
var localstorage_hold = arr_localstorage_hold.some(function(url) {
return window.location.href.indexOf(url) !== -1;
});
@ -7,12 +7,12 @@ if (!localstorage_hold){
window.localStorage.clear();
}
if (location.hostname.endsWith('rep.repubblica.it')) {
if (location.href.includes('/pwa/')) {
location.href = location.href.replace('/pwa/', '/ws/detail/');
if (matchDomain('rep.repubblica.it')) {
if (window.location.href.includes('/pwa/')) {
window.location.href = window.location.href.replace('/pwa/', '/ws/detail/');
}
if (location.href.includes('/ws/detail/')) {
if (window.location.href.includes('/ws/detail/')) {
const paywall = document.querySelector('.paywall[subscriptions-section="content"]');
if (paywall) {
paywall.removeAttribute('subscriptions-section');
@ -24,28 +24,56 @@ if (location.hostname.endsWith('rep.repubblica.it')) {
}
}
if (window.location.href.indexOf("americanbanker.com") !== -1) {
if (matchDomain('americanbanker.com')) {
const paywall = document.getElementsByClassName('embargo-content')[0];
if (paywall)
paywall.classList.remove('embargo-content');
}
if (window.location.href.indexOf('telegraaf.nl') !== -1) {
setTimeout(function () {
const paywall = document.getElementById('TEMPRORARY_METERING_ID');
if (paywall) {
window.location.reload(true);
if (matchDomain('telegraaf.nl')) {
if (window.location.href.startsWith('https://www.telegraaf.nl/error?ref=/')) {
window.location.href = window.location.href.split('&')[0].replace('error?ref=/', '');
}
let article_wrapper = document.querySelector('.ArticlePageWrapper__uid');
let spotx_banner = document.querySelector('.ArticleBodyBlocks__inlineArticleSpotXBanner');
let paywall = document.querySelector('.PopupBackdrop__block');
removeDOMElement(spotx_banner, paywall);
let premium = document.querySelector('.PremiumLabelWithLine__body');
let article_id = article_wrapper ? article_wrapper.innerText : '123';
let article_body_done = document.querySelector('#articleBody' + article_id);
if (premium && !article_body_done) {
let article_body_old = document.querySelector('[id^=articleBody]');
removeDOMElement(article_body_old);
let json = document.querySelector('script[type="application/ld+json"][data-react-helmet="true"]');
if (json) {
json_text = JSON.parse(json.text).articleBody;
let article_body = document.querySelector('section.TextArticlePage__bodyText');
if (article_body) {
let div_main = document.createElement("div");
div_main.setAttribute('id', 'articleBody' + article_id);
let div_elem = document.createElement("div");
div_elem.setAttribute('data-element', 'articleBodyBlocks');
let text_array = json_text.split('\n\n');
text_array.forEach(p_text => {
let p_div = document.createElement("p");
p_div.setAttribute('class', 'ArticleBodyBlocks__paragraph ArticleBodyBlocks__paragraph--nieuws');
p_div.innerText = p_text;
div_elem.appendChild(p_div);
});
div_main.appendChild(div_elem);
article_body.appendChild(div_main);
}
}
}, 1000); // Delay (in milliseconds)
}
}
if (window.location.href.indexOf('ad.nl') !== -1 || window.location.href.indexOf('ed.nl') !== -1) {
if (matchDomain(['ad.nl', 'ed.nl'])) {
let paywall = document.querySelector('.article__component.article__component--paywall-module-notification');
removeDOMElement(paywall);
}
if (window.location.href.indexOf("washingtonpost.com") !== -1) {
if (location.href.includes('/gdpr-consent/')) {
if (matchDomain('washingtonpost.com')) {
if (window.location.href.includes('/gdpr-consent/')) {
const free_button = document.querySelector('.gdpr-consent-container .continue-btn.button.free');
if (free_button)
free_button.click();
@ -62,19 +90,19 @@ if (window.location.href.indexOf("washingtonpost.com") !== -1) {
}
}
if (window.location.href.indexOf("wsj.com") !== -1) {
if (location.href.includes('/articles/')) {
if (matchDomain('wsj.com')) {
if (window.location.href.includes('/articles/')) {
const close_button = document.querySelector('.close-btn');
if (close_button)
close_button.click();
}
}
if (window.location.href.indexOf("sloanreview.mit.edu") !== -1) {
if (matchDomain('sloanreview.mit.edu')) {
document.querySelector('#cboxClose').click();
}
if (window.location.href.indexOf("mexiconewsdaily.com") !== -1) {
if (matchDomain('mexiconewsdaily.com')) {
document.addEventListener('DOMContentLoaded', () => {
const sideNotification = document.querySelector('.pigeon-widget-prompt');
const subMessage = document.querySelector('.sub_message_container');
@ -85,7 +113,7 @@ if (window.location.href.indexOf("mexiconewsdaily.com") !== -1) {
});
}
if (window.location.href.indexOf("theathletic.com") !== -1) {
if (matchDomain('theathletic.com')) {
const landing_banner = document.querySelector('.logged-out-landing-banner');
const sample_banner = document.querySelector('.main-sample-banner');
const bottom_banner = document.querySelector('.border-bottom-cc');
@ -93,12 +121,12 @@ if (window.location.href.indexOf("theathletic.com") !== -1) {
removeDOMElement(landing_banner, sample_banner, bottom_banner, subscribe);
}
if (window.location.href.indexOf("the-american-interest.com") !== -1) {
if (matchDomain('the-american-interest.com')) {
const counter = document.getElementById('article-counter');
removeDOMElement(counter);
}
if (window.location.href.indexOf("nzherald.co.nz") !== -1) {
if (matchDomain('nzherald.co.nz')) {
const paywall = document.getElementById('article-content');
if (paywall) {
const premium = document.getElementsByClassName('premium-sub')[0];
@ -107,7 +135,7 @@ if (window.location.href.indexOf("nzherald.co.nz") !== -1) {
paywall.classList.add('full-content');
removeClassesByPrefix(paywall, 'QUnW');
var paras = paywall.querySelectorAll("p, span, h2, div");
for (var i = 0; i < paras.length; i++){
for (var i = 0; i < paras.length; i++) {
removeClassesByPrefix(paras[i], 'QUnW');
paras[i].classList.remove("ellipsis");
paras[i].removeAttribute('style');
@ -115,7 +143,7 @@ if (window.location.href.indexOf("nzherald.co.nz") !== -1) {
}
}
if (window.location.href.indexOf("thestar.com") !== -1) {
if (matchDomain('thestar.com')) {
const paywall = document.querySelector('.basic-paywall-new');
removeDOMElement(paywall);
const tbc = document.querySelectorAll('.text-block-container');
@ -124,7 +152,7 @@ if (window.location.href.indexOf("thestar.com") !== -1) {
}
}
if (window.location.href.indexOf("afr.com") !== -1) {
if (matchDomain('afr.com')) {
document.addEventListener('DOMContentLoaded', () => {
const hidden_image = document.querySelectorAll('img');
for (let i = 0; i < hidden_image.length; i++) {
@ -140,7 +168,7 @@ if (window.location.href.indexOf("afr.com") !== -1) {
});
}
if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) {
if (matchDomain(['parool.nl', 'trouw.nl', 'volkskrant.nl', 'demorgen.be'])) {
document.addEventListener('DOMContentLoaded', () => {
const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]');
const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]');
@ -148,12 +176,33 @@ if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.ind
});
}
if (window.location.href.indexOf("firstthings.com") !== -1) {
if (matchDomain('firstthings.com')) {
const paywall = document.getElementsByClassName('paywall')[0];
removeDOMElement(paywall);
}
if (window.location.href.indexOf("bloomberg.com") !== -1) {
if (matchDomain('fortune.com')) {
document.addEventListener('DOMContentLoaded', () => {
const paywall = document.getElementById('freestar-instream-content');
if (paywall){
paywall.classList.remove('tp-container-inner');
}
const paywallJunk = document.getElementById('article_overlay');
if (paywallJunk){
paywallJunk.classList.remove('ntv-moap');
}
const ptags = paywallJunk.getElementsByTagName('p');
const h3tags = paywallJunk.getElementsByTagName('h3');
for (let i = 0; i < ptags.length; i++) {
ptags[i].removeAttribute('style');
}
for (let i = 0; i < h3tags.length; i++) {
h3tags[i].removeAttribute('style');
}
});
}
if (matchDomain('bloomberg.com')) {
document.addEventListener('DOMContentLoaded', () => {
const fence = document.querySelector('.fence-body');
if (fence){
@ -164,19 +213,19 @@ if (window.location.href.indexOf("bloomberg.com") !== -1) {
});
}
if (window.location.href.indexOf("bloombergquint.com") !== -1) {
if (matchDomain('bloombergquint.com')) {
const articlesLeftModal = document.getElementsByClassName('paywall-meter-module__story-paywall-container__1UgCE')[0];
const paywall = document.getElementById('paywallDmp');
removeDOMElement(articlesLeftModal, paywall);
}
if (window.location.href.indexOf("medium.com") !== -1) {
if (matchDomain('medium.com')) {
const bottomMessageText = 'Get one more story in your member preview when you sign up. Its free.';
const DOMElementsToTextDiv = pageContains('div', bottomMessageText);
if (DOMElementsToTextDiv[2]) removeDOMElement(DOMElementsToTextDiv[2]);
}
if (window.location.href.indexOf("theglobeandmail.com") !== -1) {
if (matchDomain('theglobeandmail.com')) {
document.addEventListener('DOMContentLoaded', () => {
const lazy_image = document.querySelectorAll('.js-lazyimage');
for (let i = 0; i < lazy_image.length; i++) {
@ -197,7 +246,7 @@ if (window.location.href.indexOf("theglobeandmail.com") !== -1) {
});
}
if (window.location.href.indexOf("examiner.com.au") !== -1 || window.location.href.indexOf("thecourier.com.au") !== -1) {
if (matchDomain(['examiner.com.au', 'thecourier.com.au', 'theadvocate.com.au'])) {
const subscribe_truncate = document.querySelector('.subscribe-truncate');
if (subscribe_truncate)
subscribe_truncate.classList.remove('subscribe-truncate');
@ -207,7 +256,7 @@ if (window.location.href.indexOf("examiner.com.au") !== -1 || window.location.hr
}
}
if (window.location.href.indexOf('lemonde.fr') !== -1) {
if (matchDomain('lemonde.fr')) {
document.addEventListener('DOMContentLoaded', () => {
const hidden_section = document.getElementsByClassName('article__content--restricted-media')[0];
if (hidden_section)
@ -225,7 +274,7 @@ if (window.location.href.indexOf('lemonde.fr') !== -1) {
});
}
if (window.location.href.indexOf("canberratimes.com.au") !== -1) {
if (matchDomain('canberratimes.com.au')) {
const paywall = document.querySelector('.subscribe-article.news-article-body.article__body');
paywall.classList.remove('subscribe-article');
var subscribe = document.getElementsByClassName('subscriber-container')[0];
@ -236,33 +285,33 @@ if (window.location.href.indexOf("canberratimes.com.au") !== -1) {
}
}
if (window.location.href.includes('asia.nikkei.com')) {
if (matchDomain('asia.nikkei.com')) {
const cookie_banner = document.querySelector('.pw-widget');
removeDOMElement(cookie_banner);
}
if (window.location.href.indexOf("ledevoir.com") !== -1) {
if (matchDomain('ledevoir.com')) {
const counter = document.querySelector('.full.hidden-print.popup-msg');
removeDOMElement(counter);
}
if (window.location.href.includes('ft.com')) {
if (matchDomain('ft.com')) {
const cookie_banner = document.querySelector('.cookie-banner');
removeDOMElement(cookie_banner);
}
if (window.location.href.indexOf("thehindu.com") !== -1) {
if (matchDomain('thehindu.com')) {
const paywall = document.getElementById('test');
removeDOMElement(paywall);
}
if (window.location.href.indexOf("nytimes.com") !== -1) {
if (matchDomain('nytimes.com')) {
const preview_button = document.querySelector('.css-3s1ce0');
if (preview_button)
preview_button.click();
}
if (window.location.href.indexOf("leparisien.fr") !== -1) {
if (matchDomain('leparisien.fr')) {
window.removeEventListener('scroll', this.scrollListener);
const paywall = document.querySelector('.relative.piano-paywall.below_nav.sticky');
removeDOMElement(paywall);
@ -274,22 +323,49 @@ if (window.location.href.indexOf("leparisien.fr") !== -1) {
}, 300); // Delay (in milliseconds)
}
if (window.location.href.indexOf("economist.com") !== -1) {
if (matchDomain('caixinglobal.com')) {
const pay_tip = document.querySelectorAll('.cons-pay-tip');
for (let i = 0; i < pay_tip.length; i++) {
pay_tip[i].removeAttribute('style');
}
const appContent = document.getElementById('appContent');
if (appContent) {
const p_hidden = document.querySelectorAll('p:not([style="display:block;"]');
for (let i = 0; i < p_hidden.length; i++) {
p_hidden[i].setAttribute('style', 'display:block;');
}
}
}
if (matchDomain('economist.com')) {
document.addEventListener('DOMContentLoaded', () => {
const subscribe = document.querySelector('.subscription-proposition');
const advert = document.querySelector('.advert');
const wrapper = document.getElementById('bottom-page-wrapper');
removeDOMElement(subscribe, advert, wrapper);
setTimeout(function () {
const paywall = document.querySelector('.layout-article-regwall');;
if (paywall) {
window.location.reload(true);
}
}, 500); // Delay (in milliseconds)
});
const wrapper = document.getElementById('bottom-page-wrapper');
removeDOMElement(subscribe, advert, wrapper);
setTimeout(function () {
const paywall = document.querySelector('.layout-article-regwall'); ;
if (paywall) {
window.location.reload(true);
}
}, 500); // Delay (in milliseconds)
const p_article = document.querySelectorAll('p.article__body-text');
var href;
for (let i = 0; i < p_article.length; i++) {
const anchor = document.querySelectorAll('a');
href = '';
for (let j = 0; j < anchor.length; j++) {
if (anchor[j].href) {
href = anchor[j].href;
} else {
anchor[j].href = href;
}
}
}
});
}
if (window.location.href.indexOf("bizjournals.com") !== -1) {
if (matchDomain('bizjournals.com')) {
const sheet_overlay = document.querySelector('.sheet-overlay');
const chunk_paywall = document.querySelector('.chunk--paywall');
removeDOMElement(sheet_overlay, chunk_paywall);
@ -301,12 +377,17 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) {
body_hidden.removeAttribute('style');
}
if (window.location.href.indexOf("the-tls.co.uk") !== -1) {
if (matchDomain('the-tls.co.uk')) {
const paywall = document.querySelector('.tls-subscriptions-banner__closed-skin');
removeDOMElement(paywall);
}
if (window.location.href.indexOf("elpais.com") !== -1) {
if (matchDomain('cen.acs.org')) {
const paywall = document.querySelector('.meteredBar');
removeDOMElement(paywall);
}
if (matchDomain('elpais.com')) {
setTimeout(function () {
const paywall = document.querySelector('.fc-ab-root');
const body = document.querySelector('.salida_articulo');
@ -316,6 +397,23 @@ if (window.location.href.indexOf("elpais.com") !== -1) {
}, 500); // Delay (in milliseconds)
}
if (matchDomain('techinasia.com')) {
const paywall = document.querySelector('.paywall-content');
if (paywall) {
paywall.classList.remove('paywall-content');
}
const splash_subscribe = document.querySelector('.splash-subscribe');
const paywall_hard = document.querySelector('.paywall-hard');
removeDOMElement(splash_subscribe, paywall_hard);
}
function matchDomain(domains) {
var hostname = window.location.hostname;
if (typeof domains === 'string')
domains = [domains];
return domains.some(domain => hostname === domain || hostname.endsWith('.' + domain));
}
function removeDOMElement(...elements) {
for (let element of elements) {
if (element)

213
manifest-ff.json Normal file
View File

@ -0,0 +1,213 @@
{
"background": {
"scripts": [
"common.js",
"background.js"
]
},
"content_scripts": [
{
"matches": [
"*://*.ad.nl/*",
"*://*.afr.com/*",
"*://*.americanbanker.com/*",
"*://*.bizjournals.com/*",
"*://*.bloomberg.com/*",
"*://*.bloombergquint.com/*",
"*://*.businessinsider.com/*",
"*://*.caixinglobal.com/*",
"*://*.canberratimes.com.au/*",
"*://*.economist.com/*",
"*://*.ed.nl/*",
"*://*.elpais.com/*",
"*://*.examiner.com.au/*",
"*://*.firstthings.com/*",
"*://*.ft.com/*",
"*://*.haaretz.co.il/*",
"*://*.ledevoir.com/*",
"*://*.lemonde.fr/*",
"*://*.leparisien.fr/*",
"*://*.medium.com/*",
"*://*.mexiconewsdaily.com/*",
"*://*.nytimes.com/*",
"*://*.nzherald.co.nz/*",
"*://*.parool.nl/*",
"*://*.repubblica.it/*",
"*://*.sfchronicle.com/*",
"*://*.sloanreview.mit.edu/*",
"*://*.techinasia.com/*",
"*://*.telegraaf.nl/*",
"*://*.the-american-interest.com/*",
"*://*.the-tls.co.uk/*",
"*://*.theadvocate.com.au/*",
"*://*.theathletic.com/*",
"*://*.thecourier.com.au/*",
"*://*.theglobeandmail.com/*",
"*://*.thehindu.com/*",
"*://*.thestar.com/*",
"*://*.trouw.nl/*",
"*://*.volkskrant.nl/*",
"*://*.washingtonpost.com/*",
"*://*.wsj.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": {
"theme_icons": [
{
"light": "bypass-dark.png",
"dark": "bypass.png",
"size": 128
}
],
"default_popup": "popup.html",
"default_icon": {
"128": "bypass.png"
}
},
"description": "Bypass News Sites' Paywalls",
"homepage_url": "https://github.com/iamadamdev/bypass-paywalls-chrome/blob/master/README.md",
"icons": {
"128": "bypass.png"
},
"manifest_version": 2,
"name": "Bypass Paywalls",
"short_name": "Bypass Paywall",
"options_ui": {
"page": "options.html"
},
"permissions": [
"cookies",
"storage",
"tabs",
"webRequest",
"webRequestBlocking",
"*://*.outbrain.com/*",
"*://*.piano.io/*",
"*://*.poool.fr/*",
"*://*.tinypass.com/*",
"*://*.ad.nl/*",
"*://*.adweek.com/*",
"*://*.afr.com/*",
"*://*.asia.nikkei.com/*",
"*://*.baltimoresun.com/*",
"*://*.barrons.com/*",
"*://*.bizjournals.com/*",
"*://*.bloomberg.com/*",
"*://*.bloombergquint.com/*",
"*://*.bostonglobe.com/*",
"*://*.britannica.com/*",
"*://*.businessinsider.com/*",
"*://*.caixinglobal.com/*",
"*://*.cen.acs.org/*",
"*://*.centralwesterndaily.com.au/*",
"*://*.chicagobusiness.com/*",
"*://*.chicagotribune.com/*",
"*://*.corriere.it/*",
"*://*.courant.com/*",
"*://*.dailypress.com/*",
"*://*.dailytelegraph.com.au/*",
"*://*.demorgen.be/*",
"*://*.denverpost.com/*",
"*://*.dynamed.com/*",
"*://*.economist.com/*",
"*://*.ed.nl/*",
"*://*.examiner.com.au/*",
"*://*.fd.nl/*",
"*://*.fnlondon.com/*",
"*://*.foreignpolicy.com/*",
"*://*.fortune.com/*",
"*://*.ft.com/*",
"*://*.glassdoor.com/*",
"*://*.groene.nl/*",
"*://*.haaretz.co.il/*",
"*://*.haaretz.com/*",
"*://*.handelsblatt.com/*",
"*://*.harpers.org/*",
"*://*.hbr.org/*",
"*://*.inc.com/*",
"*://*.inquirer.com/*",
"*://*.investorschronicle.co.uk/*",
"*://*.irishtimes.com/*",
"*://*.japantimes.co.jp/*",
"*://*.journalnow.com/*",
"*://*.labusinessjournal.com/*",
"*://*.lanacion.com.ar/*",
"*://*.lastampa.it/*",
"*://*.latercera.com/*",
"*://*.latimes.com/*",
"*://*.lecho.be/*",
"*://*.lemonde.fr/*",
"*://*.leparisien.fr/*",
"*://*.lesechos.fr/*",
"*://*.loebclassics.com/*",
"*://*.lrb.co.uk/*",
"*://*.mcall.com/*",
"*://*.medium.com/*",
"*://*.medscape.com/*",
"*://*.mercurynews.com/*",
"*://*.mv-voice.com/*",
"*://*.nationalpost.com/*",
"*://*.news-gazette.com/*",
"*://*.newstatesman.com/*",
"*://*.newyorker.com/*",
"*://*.nrc.nl/*",
"*://*.nymag.com/*",
"*://*.nytimes.com/*",
"*://*.nzherald.co.nz/*",
"*://*.ocregister.com/*",
"*://*.orlandosentinel.com/*",
"*://*.paloaltoonline.com/*",
"*://*.parool.nl/*",
"*://*.quora.com/*",
"*://*.qz.com/*",
"*://*.repubblica.it/*",
"*://*.sandiegouniontribune.com/*",
"*://*.scientificamerican.com/*",
"*://*.seattletimes.com/*",
"*://*.seekingalpha.com/*",
"*://*.smh.com.au/*",
"*://*.sofrep.com/*",
"*://*.spectator.co.uk/*",
"*://*.spectator.com.au/*",
"*://*.statista.com/*",
"*://*.sun-sentinel.com/*",
"*://*.techinasia.com/*",
"*://*.technologyreview.com/*",
"*://*.telegraaf.nl/*",
"*://*.telegraph.co.uk/*",
"*://*.the-tls.co.uk/*",
"*://*.theadvocate.com.au/*",
"*://*.theage.com.au/*",
"*://*.theathletic.com/*",
"*://*.theatlantic.com/*",
"*://*.theaustralian.com.au/*",
"*://*.thediplomat.com/*",
"*://*.theglobeandmail.com/*",
"*://*.theherald.com.au/*",
"*://*.thehindu.com/*",
"*://*.themarker.com/*",
"*://*.themercury.com.au/*",
"*://*.thenation.com/*",
"*://*.thesaturdaypaper.com.au/*",
"*://*.thestar.com/*",
"*://*.thetimes.co.uk/*",
"*://*.tijd.be/*",
"*://*.towardsdatascience.com/*",
"*://*.trouw.nl/*",
"*://*.vanityfair.com/*",
"*://*.vn.nl/*",
"*://*.volkskrant.nl/*",
"*://*.washingtonpost.com/*",
"*://*.wired.com/*",
"*://*.wsj.com/*"
],
"version": "1.7.0"
}

View File

@ -1,25 +1,37 @@
{
"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",
"homepage_url": "https://github.com/iamadamdev/bypass-paywalls-chrome/blob/master/README.md",
"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", "<all_urls>", "storage", "webRequest", "webRequestBlocking"],
"version": "1.6.3"
"background": {
"scripts": [
"common.js",
"background.js"
]
},
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"128": "bypass.png"
}
},
"description": "Bypass News Sites' Paywalls",
"homepage_url": "https://github.com/iamadamdev/bypass-paywalls-chrome/blob/master/README.md",
"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",
"<all_urls>"
],
"version": "1.7.0"
}

View File

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bypass Paywalls Options</title>
<style>
#bypass_sites label {
@ -15,7 +16,7 @@
<body>
<div>
Selected sites will have their cookies cleared and referer set to Google. You should
uncheck sites you have an account with or else you will be logged out at every visit.
uncheck sites you are logged in to otherwise you will be logged out on every visit.
</div>
<br/>
<div id='bypass_sites'>
@ -31,6 +32,8 @@
<button id="select-all">Select all</button>
<button id="select-none">Select none</button>
</span>
<br/><br/>
<script src="common.js"></script>
<script src="options.js"></script>
</body>
</html>

View File

@ -1,119 +1,4 @@
var defaultSites = {
'Adweek': 'adweek.com',
'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',
'Crain\'s Chicago Business': 'chicagobusiness.com',
'Chicago Tribune': 'chicagotribune.com',
'Corriere Della Sera': 'corriere.it',
'Daily Press': 'dailypress.com',
'Dagens Nyheter': 'dn.se',
'De Groene Amsterdammer': 'groene.nl',
'De Volkskrant': 'volkskrant.nl',
'DeMorgen': 'demorgen.be',
'Denver Post': 'denverpost.com',
'Dynamed Plus': 'dynamed.com',
'Encyclopedia Britannica': 'britannica.com',
'Eindhovens Dagblad': 'ed.nl',
'El Pais': 'elpais.com',
'ET Prime': 'prime.economictimes.indiatimes.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',
'Harper\'s Magazine': 'harpers.org',
'Hartford Courant': 'courant.com',
'Harvard Business Review': 'hbr.org',
'Het Financieele Dagblad': 'fd.nl',
'Inc.com': 'inc.com',
'La Nacion': 'lanacion.com.ar',
'La Repubblica': 'repubblica.it',
'La Tercera': 'latercera.com',
'L\'Echo': 'lecho.be',
'Le Devoir': 'ledevoir.com',
'Le Monde': 'lemonde.fr',
'Le Parisien': 'leparisien.fr',
'Les Echos': 'lesechos.fr',
'Loeb Classical Library': 'loebclassics.com',
'London Review of Books': 'lrb.co.uk',
'Los Angeles Business Journal': 'labusinessjournal.com',
'Los Angeles Times': 'latimes.com',
'Medium': 'medium.com',
'Mexico News Daily': 'mexiconewsdaily.com',
'MIT Sloan Management Review': 'sloanreview.mit.edu',
'MIT Technology Review': 'technologyreview.com',
'National Post': 'nationalpost.com',
'New York Magazine': 'nymag.com',
'Nikkei Asian Review': 'asia.nikkei.com',
'NRC': 'nrc.nl',
'New Zealand Herald': 'nzherald.co.nz',
'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',
'Seeking Alpha': 'seekingalpha.com',
'SOFREP': 'sofrep.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 Athletic': 'theathletic.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 Canberra Times': 'canberratimes.com.au',
'The Courier': 'thecourier.com.au',
'The Diplomat': 'thediplomat.com',
'The Economist': 'economist.com',
'The Globe and Mail': 'theglobeandmail.com',
'The Hindu': 'thehindu.com',
'The Irish Times (free articles only)': 'irishtimes.com',
'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 Philadelphia Inquirer': 'inquirer.com',
'The Seattle Times': 'seattletimes.com',
'The Spectator': 'spectator.co.uk',
'The Spectator Australia': 'spectator.com.au',
'The Sydney Morning Herald': 'smh.com.au',
'The Telegraph': 'telegraph.co.uk',
'The Times': 'thetimes.co.uk',
'The Toronto Star': 'thestar.com',
'The Washington Post': 'washingtonpost.com',
'The Wall Street Journal': 'wsj.com',
'Times Literary Supplement': 'the-tls.co.uk',
'Towards Data Science': 'towardsdatascience.com',
'Trouw': 'trouw.nl',
'Winston-Salem Journal': 'journalnow.com',
'Vanity Fair': 'vanityfair.com',
'Vrij Nederland': 'vn.nl',
'Wired': 'wired.com',
'*General Paywall Bypass*': 'generalpaywallbypass'
};
// Saves options to chrome.storage
// Saves options to extension_api.storage
function save_options() {
var gh_url = document.getElementById('bypass_sites').value;
var inputEls = document.querySelectorAll('#bypass_sites input');
@ -126,7 +11,7 @@ function save_options() {
return memo;
}, {});
chrome.storage.sync.set({
extension_api.storage.sync.set({
sites: sites
}, function() {
// Update status to let user know options were saved.
@ -140,9 +25,9 @@ function save_options() {
}
// Restores checkbox input states using the preferences
// stored in chrome.storage.
// stored in extension_api.storage.
function renderOptions() {
chrome.storage.sync.get({
extension_api.storage.sync.get({
sites: {}
}, function(items) {
var sites = items.sites;

View File

@ -1,8 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div style="width:150px;">Bypass Paywalls by Adam
<br><a href="options.html">Options</a> | <a href="https://github.com/iamadamdev/bypass-paywalls-chrome" target=”_blank”>GitHub</a> | <span id="version"></span></div>
<div style="width:180px;">Bypass Paywalls by Adam
<br><a href="options.html">Options</a> | <a href="https://github.com/iamadamdev/bypass-paywalls-chrome" target="_blank">GitHub</a> | <span id="version"></span></div>
<script src="common.js"></script>
<script src="version.js"></script>
</body>
</html>
</html>

53
updates.json Normal file
View File

@ -0,0 +1,53 @@
{
"addons": {
"bypasspaywalls@bypasspaywalls.weebly.com": {
"updates": [
{ "version": "1.4.5",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.4.5/bypass_paywalls-1.4.5-an+fx.xpi" },
{ "version": "1.4.6",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.4.6/bypass_paywalls-1.4.6-an+fx.xpi" },
{ "version": "1.4.7",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.4.7/bypass_paywalls-1.4.7-an+fx.xpi" },
{ "version": "1.4.8",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.4.8/bypass_paywalls-1.4.8-an+fx.xpi" },
{ "version": "1.4.9",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.4.9/bypass_paywalls-1.4.9-an+fx.xpi" },
{ "version": "1.5.0",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.0/bypass_paywalls-1.5.0-an+fx.xpi" },
{ "version": "1.5.1",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.1/bypass_paywalls-1.5.1-an+fx.xpi" },
{ "version": "1.5.2",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.2/bypass_paywalls-1.5.2-an+fx.xpi" },
{ "version": "1.5.3",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.3/bypass_paywalls-1.5.3-an+fx.xpi" },
{ "version": "1.5.5",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.5/bypass_paywalls-1.5.5-an+fx.xpi" },
{ "version": "1.5.6",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.6/bypass_paywalls-1.5.6-an+fx.xpi" },
{ "version": "1.5.7",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.7/bypass_paywalls-1.5.7-an+fx.xpi" },
{ "version": "1.5.8",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.8/bypass_paywalls-1.5.8-an+fx.xpi" },
{ "version": "1.5.9",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi" },
{ "version": "1.6.0",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.0/bypass_paywalls-1.6.0-an+fx.xpi" },
{ "version": "1.6.2",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.2/bypass_paywalls-1.6.2-an+fx.xpi" },
{ "version": "1.6.3",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.3/bypass_paywalls-1.6.3-an+fx.xpi" },
{ "version": "1.6.4",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.4/bypass_paywalls-1.6.4-an+fx.xpi" },
{ "version": "1.6.5",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.5/bypass_paywalls-1.6.5-an+fx.xpi" },
{ "version": "1.6.6",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.6/bypass_paywalls-1.6.6-an+fx.xpi" },
{ "version": "1.6.9",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.9/bypass_paywalls-1.6.9-an+fx.xpi" },
{ "version": "1.7.0",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.7.0/bypass_paywalls-1.7.0-an+fx.xpi" }
]
}
}
}

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='dcpihecpambacapedldabdbpakmachpb'>
<updatecheck codebase='https://github.com/iamadamdev/bypass-paywalls-chrome/releases/download/v1.6.3/bypass-paywalls-chrome.crx' version='1.6.3' />
<updatecheck codebase='https://github.com/iamadamdev/bypass-paywalls-chrome/releases/download/v1.7.0/bypass-paywalls-chrome.crx' version='1.7.0' />
</app>
</gupdate>

View File

@ -1,3 +1,3 @@
var manifestData = chrome.runtime.getManifest();
var manifestData = extension_api.runtime.getManifest();
var versionString = 'v' + manifestData.version;
document.getElementById('version').innerText = versionString;
document.getElementById('version').innerText = versionString;