 <p>What you need is to detect when an element is added to a page, specifically <code>&lt;video&gt;</code> element. There is a DOM event for that, but it's been deprecated - see this <a href="http://stackoverflow.com/questions/7434685/event-when-element-added-to-page">answer</a>. The answer may be helpful to you, the accepted answer suggests <code>setInterval()</code>.</p> <p>Try this:</p> <pre><code>function checkVideo() { var videoTags = document.getElementsByTagName("video"); if (videoTags.length &gt; 0) { // do something with video } setTimeout( checkDOMChange, 1000); // schedule the next check </code></pre> <p>}</p> <p>Then just run checkVideo() when document is loaded (e.g. <code>$(document).ready(checkVideo)</code> with jQuery).</p> <p>jQuery also has a function <a href="http://api.jquery.com/live/" rel="nofollow">live()</a> which should solve your problem, but it is deprecated now.</p>