Closed darius-heavy closed 2 years ago
Could you give more details on how to reproduce the issue? Is iframe navigation stored in the parent's history in Firefox?
It's not shown as a history entry, but seeing how the back button is acting it's obvious that something strange is happening. I have to say that only happens in Firefox. You can repoduce it in the video iframe (youtube, vimeo, ...) demo. http://ressio.github.io/lazy-load-xt/demo/youtube-iframe.htm
1 - Navigate to the demo page 2 - When page is loaded, scroll down. 3 - When the iframes are loaded, you can see how back button works.
Merged, but I'm thinking about replacing your patch with the following code:
objData = el.contentWindow; /* reuse objData variable */
if (objData) {
objData.location.replace(src);
} else {
el.src = src;
}
Being minified, the original code is transformed to something like
"IFRAME"===A.tagName?A.contentWindow.location.replace(B):A.src=B
and the above сode to
(C=A.contentWindow)?C.location.replace(B):A.src=B
that is 15 bytes shorter (I'm trying to keep the minified version as short as possible).
I see it well. Works the same, and is lighter... it's better.
Avoid the back button problem with Iframes in Firefox, which causes the need to double click to return to the previous page when Lazyload-xt has already loaded the iframe.