Created
November 16, 2014 16:50
-
-
Save karlhorky/6557ea67925eaaadeea0 to your computer and use it in GitHub Desktop.
Flash Feature Detect
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
<!doctype html> | |
<html class="no-flash" lang="en"> | |
<head> | |
<script> | |
(function() { | |
var hasFlash = false; | |
try { | |
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); | |
if (fo) { | |
hasFlash = true; | |
} | |
} catch (e) { | |
if (navigator.mimeTypes | |
&& navigator.mimeTypes['application/x-shockwave-flash'] != undefined | |
&& navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) { | |
hasFlash = true; | |
} | |
} | |
if (hasFlash) { | |
html = document.getElementsByTagName('html')[0]; | |
html.className = html.className.replace('no-flash', ''); | |
} | |
})() | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment