From 353ee4037833d796e3e7d332a4b4ec71ee8c4901 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Mar 2021 17:51:06 +0300 Subject: [PATCH] shorten_expanded: remove loading=lazy on the js side instead --- plugins/shorten_expanded/init.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/shorten_expanded/init.js b/plugins/shorten_expanded/init.js index d7bd6ef91..1463f9808 100644 --- a/plugins/shorten_expanded/init.js +++ b/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"));