blob: 3676760e356eda9f896ab1f86be753cef36e0757 [file] [log] [blame]
<!DOCTYPE html>
<div id="target" style="height: 100px; background-color: green;"></div>
<script>
const observer = new IntersectionObserver(records => {
records.forEach(record => {
if (record.isIntersecting) {
window.top.postMessage(record.isIntersecting, "*");
}
});
}, {});
observer.observe(target);
window.addEventListener("load", () => {
window.top.postMessage("ready", "*");
});
</script>