Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Images don't load on Safari - How to disable lazyload on it? #21

Open
Jany-M opened this issue Apr 23, 2020 · 2 comments
Open

Images don't load on Safari - How to disable lazyload on it? #21

Jany-M opened this issue Apr 23, 2020 · 2 comments

Comments

@Jany-M
Copy link

Jany-M commented Apr 23, 2020

Simply put, images load fine on any browser except Safari, which unfortunately still exists.
Both on iOS and desktop.

Is there a way to disable lazyload for it? A filter maybe?

@cr0ybot
Copy link

cr0ybot commented Apr 24, 2020

[Duplicating my post from the WP plugin support forum]

I'm seeing (or, rather, not seeing) the same thing. Safari (13.0.5 (15608.5.11)) is not loading any images.

No errors or output of any kind in the console. The lazyload.js file is loaded, the images src attribute have all been replaced with the placeholder.svg, and the native-lazyload-js-fallback class is applied.

By the way, this is with SCRIPT_DEBUG on as well.

@cr0ybot
Copy link

cr0ybot commented Apr 24, 2020

I've sorted it out. I have a no-js class in my html element that for some reason is not being removed properly by my theme's JavaScript. Removing the no-js class fixes the issue.

FYI I made a silly mistake in my JS replacing the no-js class. I had:

document.documentElement.className.replace( /(?:^|\s)no-js(?!\S)/g, '');
document.documentElement.className += ' js';

The replace method returns a string, it does not act on it directly. It should be:

document.documentElement.className = document.documentElement.className.replace( /(?:^|\s)no-js(?!\S)/g, '') + ' js';

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants