Block general paywall-scripts (also in options)
Block paywall-scripts like TinyPass/Piano (Economist, Spectator, Foreign Policy etc.) and Poool.fr (Challenges.fr). New seperate option for these scripts (or in future always by default?).
This commit is contained in:
parent
4c647ff484
commit
0147dfd9c7
@ -82,13 +82,16 @@ var blockedRegexes = {
|
||||
'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)/,
|
||||
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/
|
||||
|
||||
};
|
||||
/** obsolete
|
||||
'economist.com': /.+\.tinypass\.com\/.+/,
|
||||
'lrb.co.uk': /.+\.tinypass\.com\/.+/,
|
||||
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/,
|
||||
'foreignpolicy.com': /.+\.tinypass\.com\/.+/,
|
||||
'inquirer.com': /.+\.tinypass\.com\/.+/,
|
||||
'spectator.co.uk': /.+\.tinypass\.com\/.+/
|
||||
};
|
||||
**/
|
||||
|
||||
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)"
|
||||
@ -193,7 +196,7 @@ chrome.webRequest.onBeforeRequest.addListener(function (details) {
|
||||
);
|
||||
**/
|
||||
|
||||
// Disable javascript for these sites
|
||||
// Disable javascript for these sites/general paywall-scripts
|
||||
chrome.webRequest.onBeforeRequest.addListener(function(details) {
|
||||
if (!isSiteEnabled(details)) {
|
||||
return;
|
||||
@ -201,7 +204,8 @@ chrome.webRequest.onBeforeRequest.addListener(function(details) {
|
||||
return {cancel: true};
|
||||
},
|
||||
{
|
||||
urls: ["*://*.thestar.com/*", "*://*.theglobeandmail.com/*", "*://*.afr.com/*"],
|
||||
urls: ["*://*.thestar.com/*", "*://*.theglobeandmail.com/*", "*://*.afr.com/*",
|
||||
"*://*.tinypass.com/*", "*://assets.poool.fr/*"],
|
||||
types: ["script"]
|
||||
},
|
||||
["blocking"]
|
||||
@ -363,7 +367,7 @@ _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);
|
||||
//var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
function isSiteEnabled(details) {
|
||||
|
@ -103,5 +103,8 @@
|
||||
"Volkskrant": "volkskrant.nl",
|
||||
"Vrij Nederland": "vn.nl",
|
||||
"Winston-Salem Journal": "journalnow.com",
|
||||
"Wired": "wired.com"
|
||||
"Wired": "wired.com",
|
||||
"----- Block Paywall-scripts -----": "",
|
||||
"Poool.fr": "assets.poool.fr",
|
||||
"TinyPass/Piano": "tinypass.com"
|
||||
}
|
@ -4,5 +4,8 @@
|
||||
"Dark Reading": "darkreading.com",
|
||||
"Pittsburgh Post Gazette": "post-gazette.com",
|
||||
"The Sacramento Bee (free articles only)": "sacbee.com",
|
||||
"Tubantia": "tubantia.nl"
|
||||
"Tubantia": "tubantia.nl",
|
||||
"----- Block Paywall-scripts -----": "",
|
||||
"Poool.fr": "assets.poool.fr",
|
||||
"TinyPass/Piano": "tinypass.com"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user