cloudinary / cloudinary_js

Cloudinary JavaScript library
MIT License
328 stars 224 forks source link

Fix native lazyloading detection #258

Closed taijuten closed 2 years ago

taijuten commented 4 years ago

Currently the Native Lazyloading detection is broken (at least on 84.0.4147.125).

When running previous implementation of

typeof HTMLImageElement === "object" && HTMLImageElement.prototype.loading;

It results in false. This is at least in part due to typeof HTMLImageElement resulting in "function".

I have copied the implementation from the polyfill for loading attribute, here: https://github.com/mfranzke/loading-attribute-polyfill/blob/master/loading-attribute-polyfill.js

taijuten commented 4 years ago

Is anyone able to review this PR? It would be great to have native lazyloading working as intended with this library

patrick-tolosa commented 4 years ago

Hey @taijuten , your PR hasn't gone unnoticed, we are however in the process of taking a closer at this area, to make it a better fit for our future plans.

We appreciate the importance of this feature to you, and your patience.

patrick-tolosa commented 2 years ago

@taijuten Please see the comment of your original issue - at this point we will not add new functionality to the this project.