iframe load event not getting captured in React
I am developing a React component in Next.js that uses an iframe for ad rendering. The current implementation directly sets the src
attribute of the iframe and attaches a load
event listener via useEffect
. Upon deployment to production, I observed that the handleIframeLoad
method is not getting executed for high number of requests. Below is the relevant code snippet:
iframe load event not getting captured in React
I am developing a React component in Next.js that uses an iframe for ad rendering. The current implementation directly sets the src
attribute of the iframe and attaches a load
event listener via useEffect
. Upon deployment to production, I observed that the handleIframeLoad
method is not getting executed for high number of requests. Below is the relevant code snippet:
Cant access iframe document in a react application
Im trying to implement 3d secure, I have html code and I can open it in iframe as srcDoc (html string).And I want to access the form inside the iframe by using useref and close the iframe if form is posted.But I always got this error “react-dom.development.js:20724 Uncaught DOMException: Failed to read a named property ‘document’ from ‘Window’: Blocked a frame with origin “http://localhost:3000″ from accessing a cross-origin frame.” (by the way ,I enable cross origin in config ,and try –disable-web-security in chrome but still same error…
Any help is appricated,thx.