How can I find Flash content with JavaScript?
Tools like adblockers or gimme bar seem to do this.
Flash uses <object> and <embed> tags. Do a getElementsByTagName on those two Flash tags:
var flash1=document.getElementsByTagName("object");
var flash2=document.getElementsByTagName("embed");
Note that YouTube embeds use <iframe> elements, so its harder to capture those. Also, make sure you run this after all elements have loaded (a.k.a. window.onload), otherwise you'll miss some or all.
maybe this code can help:
<script>
var length = document.getElementsByTagName('object').length;
alert(length);
</script>
add your end of page..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With