Created
August 25, 2016 12:49
-
-
Save BlaM/6614a298080f126018ebf07ad408dc5a to your computer and use it in GitHub Desktop.
Detect embedded flash objects on page (JavaScript)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function containsSWFObjects() { | |
var s, | |
selectors = [ | |
'object param[name="movie"][value*=".swf"]', | |
'object param[name="src"][value*=".swf"]', | |
'embed[src*=".swf"]', | |
'object[data*=".swf"]' | |
]; | |
while (s = selectors.pop()) { | |
if (document.querySelectorAll(s).length) { | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment