-
-
Save martinrehfeld/719973 to your computer and use it in GitHub Desktop.
Flash detection
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
var hasFlash = false; | |
if (navigator.plugins && navigator.plugins.length) { | |
if (navigator.plugins['Shockwave Flash']) { | |
hasFlash = true; | |
} | |
} else if (navigator.mimeTypes && navigator.mimeTypes.length) { | |
var mimeType = navigator.mimeTypes['application/x-shockwave-flash']; | |
hasFlash = mimeType && mimeType.enabledPlugin; | |
} else { | |
try { | |
var ax = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); | |
hasFlash = true; | |
} catch (e) { | |
// No flash | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment