lozad and yt workarounds

This commit is contained in:
wicknix 2022-02-26 15:06:53 -06:00 committed by GitHub
parent 8e8607dd0b
commit 993dc6a76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,6 +396,21 @@ var AboutReaderListener = {
}
break;
case "DOMContentLoaded":
// Post-load fixups can go here.
// TenFourFox issue 654: defeat lozad.js lazy image loading.
Array.forEach(content.document.getElementsByTagName('img'),
function(i) {
try {
// Convert data-src to src.
if (i.getAttribute("data-src")) {
i.src = i.getAttribute("data-src");
i.setAttribute("data-loaded") = "true";
}
} catch(e) { }
});
// Do this last.
this.updateReaderButton();
break;