bedak Posted April 22, 2020 Share Posted April 22, 2020 Would be nice to have the possibility to add the (new) attribute `loading` to images and/or iframes. <img loading="lazy" src="..." alt="" /> Just adding this attribut with the value "lazy" saves megas on pages with lots of images, esp. on smartphones (where images are often displayed in 1 column), - without any lazy-loader Js-lib! Browser-Support: https://caniuse.com/#search=loading Link to comment Share on other sites More sharing options...
Jan Romero Posted April 22, 2020 Share Posted April 22, 2020 I agree that’s a great feature, but what is your request exactly? Link to comment Share on other sites More sharing options...
zoeck Posted April 23, 2020 Share Posted April 23, 2020 I think this can already be used, since it actually only affects the front-end. And the front-end is created by the developer anyway ? Link to comment Share on other sites More sharing options...
jacmaes Posted April 23, 2020 Share Posted April 23, 2020 @bedak might be referring to images in CKEditor fields, which would all probably benefit from being lazy loaded. By the way, it looks like we developers should not be using the "loading" attribute on iframes until it's part of the spec. Yes, Chrome has implemented it, but they went ahead as usual without much consideration for cross-browser interoperability ("innovation first, standards later" seems like their M.O., even if that's caused problems a few times before). Quote Please note <iframe loading=lazy> is currently non-standard. While implemented in Chromium, it does not yet have a specification and is subject to future change when this does happen. We suggest not to lazy-load iframes using the loading attribute until it becomes part of the specification. 1 Link to comment Share on other sites More sharing options...
bedak Posted August 24, 2020 Author Share Posted August 24, 2020 On 4/23/2020 at 1:03 PM, jacmaes said: @bedak might be referring to images in CKEditor fields, which would all probably benefit from being lazy loaded. By the way, it looks like we developers should not be using the "loading" attribute on iframes until it's part of the spec. Yes, Chrome has implemented it, but they went ahead as usual without much consideration for cross-browser interoperability ("innovation first, standards later" seems like their M.O., even if that's caused problems a few times before). Yes, I had CKEditor in mind or an additional option within the fieldtype 'images'. And thanx for your information about not using the "loading" attribute on iFrames! Link to comment Share on other sites More sharing options...
cb2004 Posted October 4, 2022 Share Posted October 4, 2022 Agreed, I have requested this: https://github.com/processwire/processwire-requests/issues/455 I don't want to add a text formatter or a hook to achieve this as it is such a big optimisation for every site. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now