From 1c4fd4e50deebfb4b8c61ebab3014b79a04382a4 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Wed, 20 Mar 2024 16:16:44 +0100 Subject: [PATCH] Remove `loading` attribute before invoking `location.replace()` Fixes #994. --- src/lazysizes-core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lazysizes-core.js b/src/lazysizes-core.js index 685b9d03..a457bdc4 100644 --- a/src/lazysizes-core.js +++ b/src/lazysizes-core.js @@ -481,6 +481,7 @@ function l(window, document, Date) { // Pass in the window Date function also fo // loadMode can be also a string! if (loadMode == 0) { + elem.removeAttribute('loading'); // Avoid the browser lazy-loading `src` after the below navigation. elem.contentWindow.location.replace(src); } else if (loadMode == 1) { elem.src = src;