Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find Flash content with JavaScript?

How can I find Flash content with JavaScript?

Tools like adblockers or gimme bar seem to do this.

like image 768
Alexander Avatar asked Jul 13 '26 23:07

Alexander


2 Answers

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.

like image 91
Ashley Strout Avatar answered Jul 15 '26 12:07

Ashley Strout


maybe this code can help:

<script>
var length = document.getElementsByTagName('object').length;
alert(length);
</script>

add your end of page..