URL: http://www.apple.com/pt/shop/goto/bag
const observerCallback = function (entries, observer) { entries.forEach((entry) => { if (entry.isIntersecting) { lastIntersectedTime = performance.now(); } observer.unobserve(entry.target); }); observer.disconnect(); // Dispatch time for last intersecting object with viewport createAndDispatchEchoEvent({ id: "viewportLoad", performanceNow: lastIntersectedTime, }); }; if (window.IntersectionObserver) { // get all the els on page const itemsInViewport = document.querySelectorAll('*'); // instantiate const intersectionObserver = new IntersectionObserver(observerCallback, { root: null, rootMargin: "0px 0px 0px 0px", threshold: 0.0, }); // iterate over all els and observe each one itemsInViewport.forEach(el => { intersectionObserver.observe(el); }); } //END window.IntersectionObserver } //END document.readyState === "interactive" });