fi-notes/public/scripts/load-images-before-print.js

9 lines
254 B
JavaScript

function loadAllImages() {
document.querySelectorAll('img[loading="lazy"]').forEach(img => {
img.setAttribute('loading', 'eager');
});
}
// Before printing (manually or via browser)
window.addEventListener('beforeprint', loadAllImages);