From 5f689df1b784e8fa4a93be8dc564d1e565806ecf Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Sun, 26 Nov 2017 12:11:25 +0100 Subject: [PATCH] v0.3: Send the required cookies and set X-Forwarded-For --- background.js | 18 ++++++++++++++++++ manifest.json | 4 +--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index 8fba098..8968cef 100644 --- a/background.js +++ b/background.js @@ -1,3 +1,10 @@ +const cookies = ([ +// theaustralian.com.au + 'open_token=anonymous', + 'sr=true', + 'n_regis=123456789' +]).join('; ').trim() + function evadePaywalls(details) { var reqHeaders = details.requestHeaders.filter(function(header) { // drop cookies, referer and UA @@ -18,6 +25,17 @@ function evadePaywalls(details) { "value": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" }) + reqHeaders.push({ + "name": "Cookie", + "value": cookies + }) + + // This seems to do the trick just fine for WSJ + reqHeaders.push({ + "name": "X-Forwarded-For", + "value": "66.249.66.1" + }) + return {requestHeaders: reqHeaders}; } diff --git a/manifest.json b/manifest.json index 48e7678..b5e0dc9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Anti-Paywall", - "version": "0.2", + "version": "0.3", "description": "This will prevent cookies from being stored, spoof the user-agent and mangle the referrer to maximize the chances of bypassing paywalls.", "permissions": ["webRequest", "webRequestBlocking", "*://*.adelaidenow.com.au/*", @@ -19,7 +19,6 @@ "*://*.forbes.com/*", "*://*.ft.com/*", "*://*.geelongadvertiser.com.au/*", - "*://*.glassdoor.com/*", "*://*.haaretz.co.il/*", "*://*.haaretz.com/*", "*://*.hbr.org/*", @@ -35,7 +34,6 @@ "*://*.nationalpost.com/*", "*://*.newsweek.com/*", "*://*.newyorker.com/*", - "*://*.nnsl.com/*", "*://*.nrc.nl/*", "*://*.nytimes.com/*", "*://*.ocregister.com/*",