diff options
author | Andrew Dolgov <[email protected]> | 2021-03-10 17:51:06 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-10 17:51:06 +0300 |
commit | 353ee4037833d796e3e7d332a4b4ec71ee8c4901 (patch) | |
tree | d805e7543cde7961a36d8236a9fbc8b1e3a7077b /plugins/shorten_expanded | |
parent | 668b0ac7a675c0ea49e4223d716cc1db0e64056c (diff) |
shorten_expanded: remove loading=lazy on the js side instead
Diffstat (limited to 'plugins/shorten_expanded')
-rw-r--r-- | plugins/shorten_expanded/init.js | 4 |
1 files changed, 4 insertions, 0 deletions
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")); |