From c6cd7b842d1cd77d2764521f61e72452f1850e63 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Wed, 13 Dec 2017 09:58:48 +0100 Subject: [PATCH] looks like changing the permissions prompts the user to upgrade each time --- background.js | 66 +++++++++++++++++++++++++++++++++++++++++++++++++-- manifest.json | 62 +---------------------------------------------- 2 files changed, 65 insertions(+), 63 deletions(-) diff --git a/background.js b/background.js index 907b383..1e308cd 100644 --- a/background.js +++ b/background.js @@ -1,3 +1,65 @@ +const websites = [ + "*://*.adelaidenow.com.au/*", + "*://*.baltimoresun.com/*", + "*://*.barrons.com/*", + "*://*.chicagobusiness.com/*", + "*://*.chicagotribune.com/*", + "*://*.chip.de/*", + "*://*.clarin.com/*", + "*://*.courant.com/*", + "*://*.couriermail.com.au/*", + "*://*.cricketarchive.com/*", + "*://*.dailypress.com/*", + "*://*.durangoherald.com/*", + "*://*.economist.com/*", + "*://*.fd.nl/*", + "*://*.forbes.com/*", + "*://*.ft.com/*", + "*://*.geelongadvertiser.com.au/*", + "*://*.haaretz.co.il/*", + "*://*.haaretz.com/*", + "*://*.hbr.org/*", + "*://*.heraldsun.com.au/*", + "*://*.inc.com/*", + "*://*.independent.co.uk/*", + "*://*.investingdaily.com/*", + "*://*.irishtimes.com/*", + "*://*.kansas.com/*", + "*://*.kansascity.com/*", + "*://*.latimes.com/*", + "*://*.lanacion.com.ar/*", + "*://*.letemps.ch/*", + "*://*.mcall.com/*", + "*://*.medscape.com/*", + "*://*.nationalpost.com/*", + "*://*.newsweek.com/*", + "*://*.newyorker.com/*", + "*://*.nikkei.com/*", + "*://*.nrc.nl/*", + "*://*.nyt.com/*", + "*://*.nytimes.com/*", + "*://*.ocregister.com/*", + "*://*.orlandosentinel.com/*", + "*://*.quora.com/*", + "*://*.scmp.com/*", + "*://*.seattletimes.com/*", + "*://*.slashdot.org/*", + "*://*.smh.com.au/*", + "*://*.sun-sentinel.com/*", + "*://*.technologyreview.com/*", + "*://*.theage.com.au/*", + "*://*.theaustralian.com.au/*", + "*://*.theglobeandmail.com/*", + "*://*.thenation.com/*", + "*://*.thestreet.com/*", + "*://*.thesundaytimes.co.uk/*", + "*://*.thetimes.co.uk/*", + "*://*.volkskrant.nl/*", + "*://*.washingtonpost.com/*", + "*://*.wsj.com/*", + "*://*.wsj.net/*" +] + const cookies = ([ // theaustralian.com.au 'open_token=anonymous', @@ -62,11 +124,11 @@ function blockCookies(details) { } chrome.webRequest.onBeforeSendHeaders.addListener(evadePaywalls, { - urls: [""], + urls: [...websites], types: ["main_frame", "script"], }, ["requestHeaders", "blocking"]); chrome.webRequest.onHeadersReceived.addListener(blockCookies, { - urls: [""], + urls: [...websites], types: ["main_frame", "script"], }, ["responseHeaders", "blocking"]); diff --git a/manifest.json b/manifest.json index aae5faa..2cf4033 100644 --- a/manifest.json +++ b/manifest.json @@ -2,67 +2,7 @@ "name": "Anti-Paywall", "version": "0.6", "description": "This extension will mangle your browser's requests to maximize the chances of bypassing paywalls.", - "permissions": ["webRequest", "webRequestBlocking", - "*://*.adelaidenow.com.au/*", - "*://*.baltimoresun.com/*", - "*://*.barrons.com/*", - "*://*.chicagobusiness.com/*", - "*://*.chicagotribune.com/*", - "*://*.chip.de/*", - "*://*.clarin.com/*", - "*://*.courant.com/*", - "*://*.couriermail.com.au/*", - "*://*.cricketarchive.com/*", - "*://*.dailypress.com/*", - "*://*.durangoherald.com/*", - "*://*.economist.com/*", - "*://*.fd.nl/*", - "*://*.forbes.com/*", - "*://*.ft.com/*", - "*://*.geelongadvertiser.com.au/*", - "*://*.haaretz.co.il/*", - "*://*.haaretz.com/*", - "*://*.hbr.org/*", - "*://*.heraldsun.com.au/*", - "*://*.inc.com/*", - "*://*.independent.co.uk/*", - "*://*.investingdaily.com/*", - "*://*.irishtimes.com/*", - "*://*.kansas.com/*", - "*://*.kansascity.com/*", - "*://*.latimes.com/*", - "*://*.lanacion.com.ar/*", - "*://*.letemps.ch/*", - "*://*.mcall.com/*", - "*://*.medscape.com/*", - "*://*.nationalpost.com/*", - "*://*.newsweek.com/*", - "*://*.newyorker.com/*", - "*://*.nikkei.com/*", - "*://*.nrc.nl/*", - "*://*.nyt.com/*", - "*://*.nytimes.com/*", - "*://*.ocregister.com/*", - "*://*.orlandosentinel.com/*", - "*://*.quora.com/*", - "*://*.scmp.com/*", - "*://*.seattletimes.com/*", - "*://*.slashdot.org/*", - "*://*.smh.com.au/*", - "*://*.sun-sentinel.com/*", - "*://*.technologyreview.com/*", - "*://*.theage.com.au/*", - "*://*.theaustralian.com.au/*", - "*://*.theglobeandmail.com/*", - "*://*.thenation.com/*", - "*://*.thestreet.com/*", - "*://*.thesundaytimes.co.uk/*", - "*://*.thetimes.co.uk/*", - "*://*.volkskrant.nl/*", - "*://*.washingtonpost.com/*", - "*://*.wsj.com/*", - "*://*.wsj.net/*" - ], + "permissions": ["webRequest", "webRequestBlocking", "*://*/*"], "background": { "scripts": ["background.js"] },