0

I have an HTML page which contains Iframe with canvas, i want to capture the event of canvas finish drawing.

<html>
   <head></head>
   <body>
       <iframe id="myIframe" src="link"/>
   </body>
</html>

i tried to use myIframe.onload = () => {}

But it runs before canvas rendring. thanks for Help

  • Possible duplicate of [HTML5 Canvas: Get Event when drawing is finished](https://stackoverflow.com/questions/11207606/html5-canvas-get-event-when-drawing-is-finished) – it4Astuces Jan 18 '19 at 10:27
  • You can use https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage to send a message back to the parent once the process in the iframe stops drawing – zuckerburg Jan 18 '19 at 10:28
  • [This thread might help you access the canvas inside your iframe,](https://stackoverflow.com/questions/1088544/get-element-from-within-an-iframe) [and this thread will help you know when your canvas element has finished rendering.](https://stackoverflow.com/questions/11207606/html5-canvas-get-event-when-drawing-is-finished) – Saraband Jan 18 '19 at 10:31
  • the iframe and the canvas don't belong to me, so can't change their code, i can get iframe load but not canvas drawing finish. – StraightforwardDev Jan 18 '19 at 10:56

0 Answers0