Add theaustralian.com.au, telegraph.co.uk, thetimes.co.uk

master
Adam 2019-04-06 16:34:30 -07:00
parent 8ab032a2f0
commit 0de00645fb
3 changed files with 33 additions and 10 deletions

View File

@ -1,14 +1,9 @@
# Bypass Paywalls for Firefox
## [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.1/bypass_paywalls-1.5.1-an+fx.xpi)
### 2019-02-10: WSJ bypass fixed!
### 2019-02-02: The Wall Street Journal (wsj.com) bypass is currently not working. WSJ seems to have changed their algorithm.
## [Download and install the latest version](https://github.com/iamadamdev/bypass-paywalls-firefox/releases/download/v1.5.2/bypass_paywalls-1.5.2-an+fx.xpi)
### Bypass the following sites' paywalls with this extension:
The Age (theage.com.au)\
Baltimore Sun (baltimoresun.com)\
Barron's (barrons.com)\
Bloomberg (bloomberg.com)\
@ -53,6 +48,8 @@ Quora (quora.com)\
SunSentinel (sun-sentinel.com)\
Tech in Asia (techinasia.com)\
The Advocate (theadvocate.com.au)\
The Age (theage.com.au)\
The Australian (theaustralian.com.au)\
The Australian Financial Review (afr.com)\
The Boston Globe (bostonglobe.com)\
The Globe and Mail (theglobeandmail.com)\
@ -70,6 +67,8 @@ The Spectator (spectator.co.uk)\
The Business Journals (bizjournals.com)\
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)\

View File

@ -1,7 +1,6 @@
'use strict';
var defaultSites = {
'The Age': 'theage.com.au',
'Baltimore Sun': 'baltimoresun.com',
'Barron\'s': 'barrons.com',
'Bloomberg': 'bloomberg.com',
@ -48,6 +47,8 @@ var defaultSites = {
'SunSentinel': 'sun-sentinel.com',
'Tech in Asia': 'techinasia.com',
'The Advocate': 'theadvocate.com.au',
'The Age': 'theage.com.au',
'The Australian': 'theaustralian.com.au',
'The Australian Financial Review': 'afr.com',
'The Boston Globe': 'bostonglobe.com',
'The Business Journals': 'bizjournals.com',
@ -65,6 +66,7 @@ var defaultSites = {
'The Spectator': 'spectator.co.uk',
'The Seattle Times': 'seattletimes.com',
'The Sydney Morning Herald': 'smh.com.au',
'The Times': 'thetimes.co.uk',
'The Toronto Star': 'thestar.com',
'The Washington Post': 'washingtonpost.com',
'The Wall Street Journal': 'wsj.com',
@ -155,6 +157,9 @@ const blockedRegexes = [
/haaretz\.co\.il\/htz\/js\/inter\.js/
];
const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
const userAgentMobile = "Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible ; Googlebot/2.1 ; +http://www.google.com/bot.html)"
var enabledSites = [];
// Get the enabled sites
@ -225,6 +230,7 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
var requestHeaders = details.requestHeaders;
var tabId = details.tabId;
var useUserAgentMobile = false;
var setReferer = false;
// if referer exists, set it to google
@ -239,9 +245,12 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
} else {
requestHeader.value = 'https://www.google.com/';
}
setReferer = true;
}
if (requestHeader.name === 'User-Agent') {
useUserAgentMobile = requestHeader.value.toLowerCase().includes("mobile");
}
return requestHeader;
});
@ -258,9 +267,21 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
value: 'https://www.google.com/'
});
}
}
// override User-Agent except on medium.com
if (details.url.indexOf("medium.com") === -1) {
requestHeaders.push({
"name": "User-Agent",
"value": useUserAgentMobile ? userAgentMobile : userAgentDesktop
})
}
requestHeaders.push({
"name": "X-Forwarded-For",
"value": "66.249.66.1"
})
// remove cookies before page load
requestHeaders = requestHeaders.map(function(requestHeader) {
for (var siteIndex in allow_cookies) {

View File

@ -1,5 +1,4 @@
var defaultSites = {
'The Age': 'theage.com.au',
'Baltimore Sun': 'baltimoresun.com',
'Barron\'s': 'barrons.com',
'Bloomberg': 'bloomberg.com',
@ -46,6 +45,8 @@ var defaultSites = {
'SunSentinel': 'sun-sentinel.com',
'Tech in Asia': 'techinasia.com',
'The Advocate': 'theadvocate.com.au',
'The Age': 'theage.com.au',
'The Australian': 'theaustralian.com.au',
'The Australian Financial Review': 'afr.com',
'The Boston Globe': 'bostonglobe.com',
'The Business Journals': 'bizjournals.com',
@ -63,6 +64,8 @@ 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',