Fix Australian Financial Review

Eenable Javascript/photos.
This commit is contained in:
magnolia1234 2020-01-05 17:16:32 +01:00 committed by GitHub
parent b36da10715
commit d562914762
3 changed files with 21 additions and 3 deletions

View file

@ -258,7 +258,8 @@ const blockedRegexes = {
'foreignpolicy.com': /.+\.tinypass\.com\/.+/,
'inquirer.com': /.+\.tinypass\.com\/.+/,
'spectator.co.uk': /.+\.tinypass\.com\/.+/,
'newcastleherald.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/
'newcastleherald.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/,
'afr.com': /afr\.com\/assets\/vendorsReactRedux_client.+\.js/
};
const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
@ -307,7 +308,7 @@ chrome.webRequest.onBeforeRequest.addListener(function(details) {
return {cancel: true};
},
{
urls: ["*://*.theglobeandmail.com/*", "*://*.newstatesman.com/*", "*://*.afr.com/*"],
urls: ["*://*.theglobeandmail.com/*", "*://*.newstatesman.com/*"],
types: ["script"]
},
["blocking"]

View file

@ -257,6 +257,22 @@ if (window.location.href.indexOf("thestar.com") !== -1) {
}
}
if (window.location.href.indexOf("afr.com") !== -1) {
document.addEventListener('DOMContentLoaded', () => {
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(".gif") !== -1) {
var data_src = hidden_image[i].getAttribute("data-src");
if (data_src)
hidden_image[i].setAttribute('src', data_src);
}
}
const plista = document.querySelector('div[data-plista-placement="underArticle_Group"]');
removeDOMElement(plista);
});
}
function removeDOMElement(...elements) {
for (let element of elements) {
if (element) element.remove();

View file

@ -28,7 +28,8 @@
"*://*.theathletic.com/*",
"*://*.techinasia.com/*",
"*://*.newcastleherald.com.au/*",
"*://*.thestar.com/*"
"*://*.thestar.com/*",
"*://*.afr.com/*"
],
"js": ["contentScript.js"]
}