Browse Source

shorten_expanded: remove loading=lazy on the js side instead

master
Andrew Dolgov 1 year ago
parent
commit
353ee40378
  1. 4
      plugins/shorten_expanded/init.js

4
plugins/shorten_expanded/init.js

@ -41,6 +41,10 @@ Plugins.Shorten_Expanded = {
[...row.querySelectorAll("img, video")].forEach((img) => {
const promise = new Promise((resolve, reject) => {
// lazy load breaks our calculations
img.removeAttribute('loading');
img.onload = () => resolve(img);
img.onloadeddata = () => resolve(img);
img.error = () => reject(new Error("unable to load video"));

Loading…
Cancel
Save