Closed vipul-nema closed 2 years ago
IntersectionObserverEntry.prototype.intersectionRatio = undefined IntersectionObserverEntry.prototype.isIntersecting = undefined
add this to intersection-observer.js
How common is it to load the polyfill multiple times on the same page?
Thinking about this some more, I recommend we close this as an unsupported use case - I worry if we want to support multiple polyfills in the same page, we need to consider different versions as well. It seems like the better solution is to ensure you're only loading it once, for UAs without a native implementation.
This polyfill first checks support present in the browser or not. In that check this is one condition 'intersectionRatio' in window.IntersectionObserverEntry.prototype
but once polyfill loaded, it is not adding intersectionRatio method in that prototype object instead it adds in "this" child (object). that by if multiple times polyfill come by different scripts, it again defined whole things. that may be error-prone.