mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 04:01:58 +01:00
Fix images not being loaded on cooking.nytimes.com main page
This commit is contained in:
parent
f0147e41ad
commit
e7128a2577
1 changed files with 14 additions and 10 deletions
|
@ -220,18 +220,22 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|||
var setReferer = false;
|
||||
|
||||
// if referer exists, set it to google
|
||||
requestHeaders = requestHeaders.map(function(requestHeader) {
|
||||
requestHeaders = requestHeaders.map(function (requestHeader) {
|
||||
if (requestHeader.name === 'Referer') {
|
||||
if (details.url.indexOf("wsj.com") !== -1) {
|
||||
requestHeader.value = 'https://www.facebook.com/';
|
||||
} else {
|
||||
requestHeader.value = 'https://www.google.com/';
|
||||
}
|
||||
if (details.url.indexOf("cooking.nytimes.com/api/v1/users/bootstrap") !== -1) {
|
||||
// this fixes images not being loaded on cooking.nytimes.com main page
|
||||
// referrer has to be *nytimes.com otherwise returns 403
|
||||
requestHeader.value = 'https://cooking.nytimes.com';
|
||||
} else if (details.url.indexOf("wsj.com") !== -1) {
|
||||
requestHeader.value = 'https://www.facebook.com/';
|
||||
} else {
|
||||
requestHeader.value = 'https://www.google.com/';
|
||||
}
|
||||
|
||||
setReferer = true;
|
||||
}
|
||||
return requestHeader;
|
||||
});
|
||||
setReferer = true;
|
||||
}
|
||||
return requestHeader;
|
||||
});
|
||||
|
||||
// otherwise add it
|
||||
if (!setReferer) {
|
||||
|
|
Loading…
Reference in a new issue