Fix NyTeknik (images)

This commit is contained in:
magnolia1234 2021-09-05 18:47:28 +02:00
parent 31cc550610
commit bc719a40e1
4 changed files with 13 additions and 5 deletions

View file

@ -8,6 +8,7 @@ Fix Gestion & El Comercio (Peru)
Fix Handelsblatt (only non-premium articles)
Fix Il Fatto Quotidiano
Fix Il Secolo XIX (mobile)
Fix NyTeknik (images)
Fix NzHerald
Fix shz.de & svz.de

View file

@ -2306,12 +2306,10 @@ else if (matchDomain('nybooks.com')) {
}
else if (matchDomain('nyteknik.se')) {
// plus code in contentScript_once.js
let locked_article = document.querySelector('div.locked-article');
if (locked_article)
locked_article.classList.remove('locked-article');
let hidden_images = document.querySelectorAll('img[src=""][data-proxy-image]');
for (let hidden_image of hidden_images)
hidden_image.setAttribute('src', hidden_image.getAttribute('data-proxy-image').replace('_320', '_640'));
}
else if (matchDomain('nytimes.com')) {

View file

@ -12,6 +12,14 @@ if (matchDomain('nationalgeographic.com')) {
waitDOMElement('div[id^="fittPortal"]', 'DIV', natgeo_func, false);
}
else if (matchDomain('nyteknik.se')) {
window.setTimeout(function () {
let hidden_images = document.querySelectorAll('img[src=""][data-proxy-image]');
for (let hidden_image of hidden_images)
hidden_image.setAttribute('src', hidden_image.getAttribute('data-proxy-image').replace('_320', '_640'));
}, 2000); // Delay (in milliseconds)
}
function matchDomain(domains, hostname) {
var matched_domain = false;
if (!hostname)

View file

@ -39,7 +39,8 @@
],
"content_scripts": [{
"matches": [
"*://*.nationalgeographic.com/*"
"*://*.nationalgeographic.com/*",
"*://*.nyteknik.se/*"
],
"run_at": "document_start",
"js": ["contentScript_once.js"]
@ -553,5 +554,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.3.5.5"
"version": "2.3.5.6"
}