I am have displayed a website that is not of the same domain in the iframe through a modal popup. In the modal popup, there will be button at the footer in disable state initially. And, now I'm trying to detect scroll down event of the iframe document and when scroll down of the iframe document reaches the end, the button at the footer of the modal popup gets enabled.
But I couldn't detect the scroll inside the iframe document using onscroll method
const iframeDocument = document.getElementById("websiteIframe");
iframeDocument.onscroll = () => {
return console.log("scrolling page")
}