Merge branch 'master' into feature/remove-medium-footer

master
Tom 2019-10-31 23:01:39 +02:00 committed by GitHub
commit 5a36178d7c
6 changed files with 127 additions and 76 deletions

View File

@ -47,9 +47,12 @@
[Harvard Business Review](https://www.hbr.org)\
[Inc.com](https://www.inc.com)\
[Irish Times](https://www.irishtimes.com)\
[LA Business Journal](labusinessjournal.com)\
[L.A. Business Journal](https://labusinessjournal.com)\
[La Nación](https://www.lanacion.com.ar)\
[La Repubblica](https://www.repubblica.it)\
[La Tercera](latercera.com)\
[La Tercera](https://latercera.com)\
[L'Écho](https://lecho.be)\
[Le Monde](https://www.lemonde.fr)\
[Les Échos](https://lesechos.fr)\
[Libération](https://liberation.fr)\
[Loeb Classical Library](https://www.loebclassics.com)\
@ -57,7 +60,7 @@
[MIT Sloan Management Review](https://sloanreview.mit.edu)\
[MIT Technology Review](https://www.technologyreview.com)\
[Medium](https://www.medium.com)\
[Mexicon News Daily](mexiconewsdaily.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)\
@ -67,7 +70,7 @@
[Parool](https://www.parool.nl)\
[Quartz](https://qz.com)\
[Quora](https://www.quora.com)\
[San Diego Union Tribune](sandiegouniontribune.com)\
[San Diego Union Tribune](https://sandiegouniontribune.com)\
[San Francisco Chronicle](https://sfchronicle.com)\
[Scientific American](https://scientificamerican.com)\
[Statista](https://statista.com)\
@ -130,7 +133,7 @@ Usually premium articles cannot be bypassed as they are behind a hard paywall.
* 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

View File

@ -1,5 +1,8 @@
/* 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',
@ -18,8 +21,6 @@ var defaultSites = {
'DeMorgen': 'demorgen.be',
'Denver Post': 'denverpost.com',
'Dynamed Plus': 'dynamed.com',
'The Economist': 'economist.com',
'Les Echos': 'lesechos.fr',
'Eindhovens Dagblad': 'ed.nl',
'Encyclopedia Britannica': 'britannica.com',
'Examiner': 'examiner.com.au',
@ -35,11 +36,15 @@ var defaultSites = {
'Harvard Business Review': 'hbr.org',
'Inc.com': 'inc.com',
'Irish Times': 'irishtimes.com',
'LA Business Journal': 'labusinessjournal.com',
'La Nacion': 'lanacion.com.ar',
'La Repubblica': 'repubblica.it',
'La Tercera': 'latercera.com',
'L\'Echo': 'lecho.be',
'Le Monde': 'lemonde.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',
'Mexico News Daily': 'mexiconewsdaily.com',
@ -68,6 +73,7 @@ var defaultSites = {
'The Australian Financial Review': 'afr.com',
'The Boston Globe': 'bostonglobe.com',
'The Business Journals': 'bizjournals.com',
'The Economist': 'economist.com',
'The Globe and Mail': 'theglobeandmail.com',
'The Japan Times': 'japantimes.co.jp',
'TheMarker': 'themarker.com',
@ -101,86 +107,95 @@ const restrictions = {
// Don't remove cookies before page load
const allow_cookies = [
'asia.nikkei.com',
'nytimes.com',
'wsj.com',
'ft.com',
'ad.nl',
'asia.nikkei.com',
'bostonglobe.com',
'chicagobusiness.com',
'demorgen.be',
'denverpost.com',
'economist.com',
'ed.nl',
'examiner.com.au',
'ft.com',
'harpers.org',
'hbr.org',
'lemonde.fr',
'lesechos.fr',
'medium.com',
'mercurynews.com',
'mexiconewsdaily.com',
'nrc.nl',
'nymag.com',
'nytimes.com',
'parool.nl',
'qz.com',
'scientificamerican.com',
'seattletimes.com',
'telegraaf.nl',
'the-american-interest.com',
'theadvocate.com.au',
'theage.com.au',
'theaustralian.com.au',
'trouw.nl',
'vn.nl',
'volkskrant.nl',
'mercurynews.com',
'theage.com.au',
'economist.com',
'bostonglobe.com',
'denverpost.com',
'chicagobusiness.com',
'theadvocate.com.au',
'examiner.com.au',
'hbr.org',
'medium.com',
'washingtonpost.com',
'nymag.com',
'theaustralian.com.au',
'telegraaf.nl', // keep accept cookies
'demorgen.be',
'mexiconewsdaily.com',
'the-american-interest.com'
'wsj.com'
]
// Removes cookies after page load
const remove_cookies = [
'asia.nikkei.com',
'ad.nl',
'ed.nl',
'vn.nl',
'ft.com',
'mercurynews.com',
'theage.com.au',
'economist.com',
'asia.nikkei.com',
'bostonglobe.com',
'wired.com',
'denverpost.com',
'chicagobusiness.com',
'harpers.org',
'theadvocate.com.au',
'examiner.com.au',
'lesechos.fr',
'liberation.fr',
'hbr.org',
'theatlantic.com',
'medium.com',
'mexiconewsdaily.com',
'foreignpolicy.com',
'wsj.com',
'seattletimes.com',
'thenewsrep.com',
'washingtonpost.com',
'sfchronicle.com',
'nymag.com',
'scientificamerican.com',
'telegraaf.nl',
'thestar.com',
'qz.com',
'demorgen.be',
'sloanreview.mit.edu',
'zeit.de',
'firstthings.com',
'bloombergquint.com'
'denverpost.com',
'economist.com',
'ed.nl',
'examiner.com.au',
'ft.com',
'harpers.org',
'hbr.org',
'lesechos.fr',
'medium.com',
'mercurynews.com',
'mexiconewsdaily.com',
'nrc.nl',
'nymag.com',
'qz.com',
'scientificamerican.com',
'seattletimes.com',
'telegraaf.nl',
'theadvocate.com.au',
'theage.com.au',
'vn.nl',
'washingtonpost.com',
'wsj.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',
'barrons.com',
'telegraph.co.uk',
'zeit.de',
'nytimes.com',
'mexiconewsdaily.com',
'nytimes.com',
'telegraph.co.uk',
'theaustralian.com.au',
'thetimes.co.uk',
'wsj.com',
'zeit.de',
]
function setDefaultOptions() {
@ -237,6 +252,7 @@ chrome.runtime.onInstalled.addListener(function (details) {
}
});
/**
// WSJ bypass
chrome.webRequest.onBeforeRequest.addListener(function (details) {
if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) {
@ -259,6 +275,7 @@ chrome.webRequest.onBeforeRequest.addListener(function (details) {
{urls:["*://*.wsj.com/*"], types:["main_frame"]},
["blocking"]
);
**/
// Disable javascript for these sites
chrome.webRequest.onBeforeRequest.addListener(function(details) {
@ -376,9 +393,18 @@ chrome.webRequest.onCompleted.addListener(function(details) {
continue; // don't remove cookies
}
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});
}
for (var i=0; i<cookies.length; i++) {
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
}
chrome.cookies.remove({url: (cookies[i].secure ? "https://" : "http://") + cookies[i].domain + cookies[i].path, name: cookies[i].name});
}
});
}
}, {

View File

@ -61,7 +61,9 @@ if (window.location.href.indexOf("washingtonpost.com") !== -1) {
if (window.location.href.indexOf("wsj.com") !== -1) {
if (location.href.includes('/articles/')) {
document.querySelector('.close-btn').click();
const close_button = document.querySelector('.close-btn');
if (close_button)
close_button.click();
}
}
@ -139,11 +141,29 @@ if (window.location.href.indexOf("medium.com") !== -1) {
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 (DOMElementsToTextDiv[2]) removeDOMElement(DOMElementsToTextDiv[2]);
}
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 (var element of elements) {
for (let element of elements) {
if (element)
element.remove();
}

View File

@ -20,5 +20,5 @@
"page": "options.html"
},
"permissions": [ "cookies", "<all_urls>", "storage", "webRequest", "webRequestBlocking"],
"version": "1.5.5"
"version": "1.5.6"
}

View File

@ -16,7 +16,6 @@ var defaultSites = {
'DeMorgen': 'demorgen.be',
'Denver Post': 'denverpost.com',
'Dynamed Plus': 'dynamed.com',
'The Economist (javascript disabled)': 'economist.com',
'Encyclopedia Britannica': 'britannica.com',
'Eindhovens Dagblad': 'ed.nl',
'Examiner': 'examiner.com.au',
@ -32,12 +31,15 @@ var defaultSites = {
'Harvard Business Review': 'hbr.org',
'Inc.com': 'inc.com',
'Irish Times': 'irishtimes.com',
'LA Business Journal': 'labusinessjournal.com',
'La Nacion': 'lanacion.com.ar',
'La Repubblica': 'repubblica.it',
'La Tercera': 'latercera.com',
'L\'Echo': 'lecho.be',
'Le Monde': 'lemonde.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',
'Mexico News Daily': 'mexiconewsdaily.com',
@ -66,6 +68,7 @@ var defaultSites = {
'The Australian Financial Review (javascript disabled)': 'afr.com',
'The Boston Globe (javascript disabled)': 'bostonglobe.com',
'The Business Journals (javascript disabled)': 'bizjournals.com',
'The Economist (javascript disabled)': 'economist.com',
'The Globe and Mail (javascript disabled)': 'theglobeandmail.com',
'The Japan Times': 'japantimes.co.jp',
'TheMarker': 'themarker.com',
@ -165,4 +168,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);

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.5.5/bypass-paywalls-chrome.crx' version='1.5.5' />
<updatecheck codebase='https://github.com/iamadamdev/bypass-paywalls-chrome/releases/download/v1.5.6/bypass-paywalls-chrome.crx' version='1.5.6' />
</app>
</gupdate>