mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 05:17:46 +01:00
Fix Globe and Mail (update)
Clear in-memory cache for Webrequest to work correctly (block or not block specific G&B-Javascript).
This commit is contained in:
parent
95061e9ed4
commit
5058018836
2 changed files with 9 additions and 3 deletions
|
@ -310,8 +310,8 @@ browser.runtime.onInstalled.addListener(function(details) {
|
|||
});
|
||||
|
||||
// Disable javascript for these sites
|
||||
chrome.webRequest.onBeforeRequest.addListener(function(details) {
|
||||
if (!isSiteEnabled(details) || details.url.indexOf("mod=rsswn") !== -1) {
|
||||
browser.webRequest.onBeforeRequest.addListener(function(details) {
|
||||
if (!isSiteEnabled(details)) {
|
||||
return;
|
||||
}
|
||||
return {cancel: true};
|
||||
|
@ -342,6 +342,9 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|||
if (details.url.indexOf('meter.bostonglobe.com/js/') !== -1 && (header_referer === 'https://www.bostonglobe.com/'
|
||||
|| header_referer.indexOf('/?p1=BGHeader_') !== -1 || header_referer.indexOf('/?p1=BGMenu_') !== -1)) {
|
||||
break;
|
||||
} else if (header_referer.indexOf('theglobeandmail.com') !== -1 && !(header_referer.indexOf('/article-') !== -1)) {
|
||||
browser.webRequest.handlerBehaviorChanged(function () {});
|
||||
break;
|
||||
}
|
||||
return { cancel: true };
|
||||
}
|
||||
|
|
|
@ -272,10 +272,13 @@ if (window.location.href.indexOf("theglobeandmail.com") !== -1) {
|
|||
const hidden_image = document.querySelectorAll('img');
|
||||
for (let i = 0; i < hidden_image.length; i++) {
|
||||
var src = hidden_image[i].src;
|
||||
if ('src: ' + src.indexOf("image/gif") !== -1) {
|
||||
if (src.indexOf("data:image/gif") !== -1) {
|
||||
var data_src = hidden_image[i].getAttribute("data-src");
|
||||
if (data_src)
|
||||
hidden_image[i].setAttribute('src', data_src);
|
||||
var data_bg = hidden_image[i].getAttribute("data-bg");
|
||||
if (data_bg)
|
||||
hidden_image[i].setAttribute('src', data_bg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue