Fix Times of India (amp-images)

This commit is contained in:
magnolia1234 2023-06-24 09:49:26 +02:00
parent 405abe5fde
commit 9d1e738961
2 changed files with 13 additions and 0 deletions

View file

@ -6,6 +6,7 @@ Post-release
Fix LeScienze.it
Fix LeTelegramme.fr (css)
Fix The Athletic (timing)
Fix Times of India (amp-images)
* v3.2.1.0 (2023-06-05)
Add Boersen-zeitung.de

View file

@ -4652,6 +4652,18 @@ else if (matchDomain(timesofindia_domains)) {
removeDOMElement(paywall);
window.location.href = amphtml.href;
}
} else {
let amp_images = document.querySelectorAll('div.inline-image > div.inline-imgecontent > amp-img[src]');
for (let amp_image of amp_images) {
amp_image.parentNode.removeAttribute('class');
amp_image.parentNode.parentNode.removeAttribute('class');
let elem = document.createElement('img');
Object.assign(elem, {
src: amp_image.getAttribute('src'),
alt: amp_image.getAttribute('alt')
});
amp_image.parentNode.replaceChild(elem, amp_image);
}
}
}