Merge branch 'master' into feature/Add-bloomberg-qunit

This commit is contained in:
Tom 2019-10-31 23:11:49 +02:00 committed by GitHub
commit 9c3214339d
6 changed files with 187 additions and 60 deletions

View file

@ -1,9 +1,10 @@
# Bypass Paywalls for Firefox
## [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi)
## [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.0/bypass_paywalls-1.6.0-an+fx.xpi)
### Bypass the following sites' paywalls with this extension
[Algemeen Dagblad](https://www.ad.nl)\
[Baltimore Sun](https://www.baltimoresun.com)\
[Barron's](https://www.barrons.com)\
[Bloomberg](https://www.bloomberg.com)\
@ -17,9 +18,11 @@
[Corriere Della Sera](https://www.corriere.it)\
[Daily Press](https://www.dailypress.com)\
[Denver Post](https://www.denverpost.com)\
[De Groene Amsterdammer](https://www.groene.nl)\
[De Tijd](https://www.tijd.be)\
[de Volkskrant](https://www.volkskrant.nl)\
[The Economist](https://www.economist.com)\
[Eindhovens Dagblad](https://ed.nl)\
[Examiner](https://www.examiner.com.au)\
[Financial Times](https://www.ft.com)\
[Foreign Policy](https://www.foreignpolicy.com)\
@ -32,6 +35,7 @@
[Inc.com](https://www.inc.com)\
[Investors Chronicle](https://www.investorschronicle.co.uk)\
[La Repubblica](https://www.repubblica.it)\
[Le Monde](https://www.lemonde.fr)\
[Le Temps](https://www.letemps.ch)\
[Los Angeles Times](https://www.latimes.com)\
[Medium](https://www.medium.com)\
@ -47,10 +51,12 @@
[Orange County Register](https://www.ocregister.com)\
[Orlando Sentinel](https://www.orlandosentinel.com)\
[Palo Alto Online](https://www.paloaltoonline.com)\
[Parool](https://www.parool.nl)\
[Quartz](https://qz.com)\
[Quora](https://www.quora.com)\
[Statista](https://www.statista.com)\
[SunSentinel](https://www.sun-sentinel.com)\
[Telegraaf](https://telegraaf.nl)\
[The Advocate](https://www.theadvocate.com.au)\
[The Age](https://www.theage.com.au)\
[The Atlantic](https://www.theatlantic.com)\
@ -79,7 +85,9 @@
[The Washington Post](https://www.washingtonpost.com)\
[The Wall Street Journal](https://www.wsj.com)\
[Towards Data Science](https://www.towardsdatascience.com)\
[Trouw](https://www.trouw.nl)\
[Vanity Fair](https://www.vanityfair.com)\
[Vrij Nederland](https://www.vn.nl)\
[Wired](https://www.wired.com)
### Sites with limited number of free articles

View file

@ -1,6 +1,7 @@
'use strict';
var defaultSites = {
'Algemeen Dagblad': 'ad.nl',
'Baltimore Sun': 'baltimoresun.com',
'Barron\'s': 'barrons.com',
'Bloomberg': 'bloomberg.com',
@ -15,8 +16,10 @@ var defaultSites = {
'Daily Press': 'dailypress.com',
'Denver Post': 'denverpost.com',
'De Tijd': 'tijd.be',
'De Groene Amsterdammer': 'groene.nl',
'de Volkskrant': 'volkskrant.nl',
'The Economist': 'economist.com',
'Eindhovens Dagblad': 'ed.nl',
'Examiner': 'examiner.com.au',
'Financial Times': 'ft.com',
'Foreign Policy': 'foreignpolicy.com',
@ -29,6 +32,7 @@ var defaultSites = {
'Inc.com': 'inc.com',
'Investors Chronicle': 'investorschronicle.co.uk',
'La Repubblica': 'repubblica.it',
'Le Monde': 'lemonde.fr',
'Le Temps': 'letemps.ch',
'Los Angeles Times': 'latimes.com',
'Medium': 'medium.com',
@ -44,9 +48,11 @@ var defaultSites = {
'Orange County Register': 'ocregister.com',
'Orlando Sentinel': 'orlandosentinel.com',
'Palo Alto Online': 'paloaltoonline.com',
'Parool': 'parool.nl',
'Quartz': 'qz.com',
'Quora': 'quora.com',
'Statista': 'statista.com',
'Telegraaf': 'telegraaf.nl',
'SunSentinel': 'sun-sentinel.com',
'The Advocate': 'theadvocate.com.au',
'The Age': 'theage.com.au',
@ -70,12 +76,15 @@ var defaultSites = {
'The Spectator': 'spectator.co.uk',
'The Seattle Times': 'seattletimes.com',
'The Sydney Morning Herald': 'smh.com.au',
'The Telegraph': 'telegraph.co.uk',
'The Times': 'thetimes.co.uk',
'The Toronto Star': 'thestar.com',
'The Washington Post': 'washingtonpost.com',
'The Wall Street Journal': 'wsj.com',
'Towards Data Science': 'towardsdatascience.com',
'Trouw': 'trouw.nl',
'Vanity Fair': 'vanityfair.com',
'Vrij Nederland': 'vn.nl',
'Wired': 'wired.com'
};
@ -85,78 +94,99 @@ const restrictions = {
// Don't remove cookies before page load
const allow_cookies = [
'ad.nl',
'asia.nikkei.com',
'nytimes.com',
'wsj.com',
'ft.com',
'letemps.ch',
'mercurynews.com',
'economist.com',
'bostonglobe.com',
'cen.acs.org',
'chicagobusiness.com',
'denverpost.com',
'hacked.com',
'ocregister.com',
'newstatesman.com',
'spectator.co.uk',
'towardsdatascience.com',
'medium.com',
'theadvocate.com.au',
'economist.com',
'ed.nl',
'examiner.com.au',
'thestar.com',
'washingtonpost.com',
'ft.com',
'hacked.com',
'hbr.org',
'lemonde.fr',
'letemps.ch',
'medium.com',
'mercurynews.com',
'newstatesman.com',
'nymag.com',
'nytimes.com',
'ocregister.com',
'parool.nl',
'qz.com',
'spectator.co.uk',
'telegraaf.nl',
'theadvocate.com.au',
'theage.com.au',
'theaustralian.com.au',
'thediplomat.com',
'thestar.com',
'towardsdatascience.com',
'trouw.nl',
'vn.nl',
'volkskrant.nl',
'washingtonpost.com',
'wsj.com',
]
// Removes cookies after page load
const remove_cookies = [
'ad.nl',
'asia.nikkei.com',
'nytimes.com',
'ft.com',
'letemps.ch',
'mercurynews.com',
'theage.com.au',
'economist.com',
'bostonglobe.com',
'denverpost.com',
'hacked.com',
'ocregister.com',
'newstatesman.com',
'spectator.co.uk',
'towardsdatascience.com',
'medium.com',
'theadvocate.com.au',
'examiner.com.au',
'thestar.com',
'centralwesterndaily.com.au',
'theherald.com.au',
'foreignpolicy.com',
'wsj.com',
'glassdoor.com',
'cen.acs.org',
'hbr.org',
'thenewsrep.com',
'washingtonpost.com',
'nymag.com',
'nationalpost.com',
'volkskrant.nl',
'handelsblatt.com',
'thediplomat.com',
'latimes.com',
'theatlantic.com',
'chicagobusiness.com',
'denverpost.com',
'economist.com',
'ed.nl',
'examiner.com.au',
'ft.com',
'hacked.com',
'hbr.org',
'letemps.ch',
'medium.com',
'mercurynews.com',
'newstatesman.com',
'nymag.com',
'nytimes.com',
'ocregister.com',
'qz.com',
'spectator.co.uk',
'telegraaf.nl',
'theadvocate.com.au',
'theage.com.au',
'thediplomat.com',
'thestar.com',
'towardsdatascience.com',
'vn.nl',
'washingtonpost.com',
'wsj.com',
'bloombergquint.com'
]
// select specific cookie(s) to hold from remove_cookies domains
const remove_cookies_select_hold = {
'.nrc.nl': ['nmt_closed_cookiebar'],
'.washingtonpost.com': ['wp_gdpr'],
'.wsj.com': ['wsjregion']
}
// select only specific cookie(s) to drop from remove_cookies domains
const remove_cookies_select_drop = {
'www.nrc.nl': ['counter']
}
// Override User-Agent with Googlebot
const use_google_bot = [
'theaustralian.com.au',
'telegraph.co.uk',
'thetimes.co.uk',
'barrons.com',
'nytimes.com',
'quora.com',
'telegraph.co.uk',
'theaustralian.com.au',
'thetimes.co.uk',
'wsj.com',
]
function setDefaultOptions() {
@ -212,9 +242,10 @@ browser.runtime.onInstalled.addListener(function(details) {
}
});
/**
// WSJ bypass
browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) {
if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1 || details.url.indexOf("/print-edition/") !== -1) {
return;
}
@ -234,6 +265,7 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
{urls:["*://*.wsj.com/*"], types:["main_frame"]},
["blocking"]
);
**/
// Disable javascript for these sites
chrome.webRequest.onBeforeRequest.addListener(function(details) {
@ -363,6 +395,17 @@ browser.webRequest.onCompleted.addListener(function(details) {
if (cookies[i].firstPartyDomain !== undefined) {
cookie.firstPartyDomain = cookies[i].firstPartyDomain;
}
var cookie_domain = cookies[i].domain;
// hold specific cookie(s) from remove_cookies domains
if ((cookie_domain in remove_cookies_select_hold) && remove_cookies_select_hold[cookie_domain].includes(cookies[i].name)){
continue; // don't remove specific cookie
}
// drop only specific cookie(s) from remove_cookies domains
if ((cookie_domain in remove_cookies_select_drop) && !(remove_cookies_select_drop[cookie_domain].includes(cookies[i].name))){
continue; // only remove specific cookie
}
browser.cookies.remove(cookie);
}
});

View file

@ -69,9 +69,18 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) {
}
} else if (window.location.href.indexOf("wsj.com") !== -1) {
if (location.href.includes('/articles/')) {
document.addEventListener('DOMContentLoaded', () => {
const paywall = document.getElementById('cx-scrim');
const candybar = document.getElementById('cx-candybar');
removeDOMElement(paywall, candybar);
});
/**
setTimeout(function () {
document.querySelector('.close-btn').click();
const close_button = document.querySelector('.close-btn');
if (close_button)
close_button.click();
}, 2000);
**/
}
} else if (window.location.href.indexOf("washingtonpost.com") !== -1) {
if (location.href.includes('/gdpr-consent/')) {
@ -97,11 +106,51 @@ if (window.location.href.indexOf("bloombergquint.com") !== -1) {
}
if (window.location.href.indexOf("bloomberg.com") !== -1) {
console.log('inside bloomberg')
const paywall = document.getElementById('paywall-banner');
removeDOMElement(paywall);
}
if (window.location.href.indexOf('telegraaf.nl') !== -1) {
const paywall = document.getElementById('TEMPRORARY_METERING_ID');
if (paywall) {
window.location.reload(1);
}
}
if (window.location.href.indexOf('ed.nl') !== -1) {
const paywall = document.querySelector('.article__component.article__component--paywall-module-notification');
if (paywall) {
paywall.remove();
paywall = null;
}
}
if (window.location.href.indexOf("parool.nl") !== -1 || window.location.href.indexOf("trouw.nl") !== -1 || window.location.href.indexOf("volkskrant.nl") !== -1) {
document.addEventListener('DOMContentLoaded', () => {
const paywall = document.querySelector('div[data-temptation-position="ARTICLE_BOTTOM"]');
const hidden_section = document.querySelector('div[data-temptation-position="ARTICLE_INLINE"]');
removeDOMElement(paywall, hidden_section);
});
}
if (window.location.href.indexOf('lemonde.fr') !== -1) {
document.addEventListener('DOMContentLoaded', () => {
const hidden_section = document.getElementsByClassName('article__content--restricted-media')[0];
if (hidden_section)
hidden_section.classList.remove('article__content--restricted-media');
const longform_article_restricted = document.getElementsByClassName('article__content--restricted')[0];
if (longform_article_restricted)
longform_article_restricted.classList.remove('article__content--restricted');
const longform_paywall = document.getElementsByClassName('paywall--longform')[0];
if (longform_paywall)
longform_paywall.classList.remove('paywall--longform');
const paywall = document.getElementById('js-paywall-content');
const friend_paywall = document.getElementsByClassName('friend--paywall')[0];
const cookie_banner = document.getElementById('cookie-banner');
removeDOMElement(paywall, friend_paywall, cookie_banner);
});
}
function removeDOMElement(...elements) {
for (let element of elements) {
if (element) element.remove();

View file

@ -5,10 +5,19 @@
"content_scripts": [
{
"matches": [
"*://*.bizjournals.com/*",
"*://*.businessinsider.com/*",
"*://*.haaretz.co.il/*",
"*://*.repubblica.it/*"
"*://*.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"]
}
@ -121,7 +130,15 @@
"*://*.wired.com/*",
"*://*.thediplomat.com/*",
"*://*.theatlantic.com/*",
"*://*.qz.com/*"
"*://*.qz.com/*",
"*://*.ad.nl/*",
"*://*.ed.nl/*",
"*://*.groene.nl/*",
"*://*.parool.nl/*",
"*://*.telegraaf.nl/*",
"*://*.trouw.nl/*",
"*://*.vn.nl/*",
"*://*.lemonde.fr/*"
],
"version": "1.5.9"
"version": "1.6.0"
}

View file

@ -1,4 +1,5 @@
var defaultSites = {
'Algemeen Dagblad': 'ad.nl',
'Baltimore Sun': 'baltimoresun.com',
'Barron\'s': 'barrons.com',
'Bloomberg': 'bloomberg.com',
@ -12,9 +13,11 @@ var defaultSites = {
'Corriere Della Sera': 'corriere.it',
'Daily Press': 'dailypress.com',
'Denver Post': 'denverpost.com',
'De Groene Amsterdammer': 'groene.nl',
'De Tijd': 'tijd.be',
'de Volkskrant': 'volkskrant.nl',
'The Economist (javascript disabled)': 'economist.com',
'Eindhovens Dagblad': 'ed.nl',
'Examiner': 'examiner.com.au',
'Financial Times': 'ft.com',
'Foreign Policy': 'foreignpolicy.com',
@ -27,6 +30,7 @@ var defaultSites = {
'Inc.com': 'inc.com',
'Investors Chronicle': 'investorschronicle.co.uk',
'La Repubblica': 'repubblica.it',
'Le Monde': 'lemonde.fr',
'Le Temps': 'letemps.ch',
'Los Angeles Times': 'latimes.com',
'Medium': 'medium.com',
@ -42,10 +46,12 @@ var defaultSites = {
'Orange County Register': 'ocregister.com',
'Orlando Sentinel': 'orlandosentinel.com',
'Palo Alto Online': 'paloaltoonline.com',
'Parool': 'parool.nl',
'Quartz': 'qz.com',
'Quora': 'quora.com',
'Statista': 'statista.com',
'SunSentinel': 'sun-sentinel.com',
'Telegraaf': 'telegraaf.nl',
'The Advocate': 'theadvocate.com.au',
'The Age': 'theage.com.au',
'The Atlantic': 'theatlantic.com',
@ -74,7 +80,9 @@ var defaultSites = {
'The Washington Post': 'washingtonpost.com',
'The Wall Street Journal': 'wsj.com',
'Towards Data Science': 'towardsdatascience.com',
'Trouw': 'trouw.nl',
'Vanity Fair': 'vanityfair.com',
'Vrij Nederland': 'vn.nl',
'Wired': 'wired.com'
};

View file

@ -30,7 +30,9 @@
{ "version": "1.5.8",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.8/bypass_paywalls-1.5.8-an+fx.xpi" },
{ "version": "1.5.9",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi" }
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.9/bypass_paywalls-1.5.9-an+fx.xpi" },
{ "version": "1.6.0",
"update_link": "https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.6.0/bypass_paywalls-1.6.0-an+fx.xpi" }
]
}
}