Created
December 7, 2012 09:38
-
-
Save larswittenberg/4232157 to your computer and use it in GitHub Desktop.
Flash Detection With One Line of 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
// Source: http://iamskwerl.com/tech/2012/11/flash-detection-with-one-line-of-javascript/ | |
var hasFlash = navigator.mimeTypes && navigator.mimeTypes.length ? Array.prototype.slice.call(navigator.mimeTypes).some(function(a) { return "application/x-shockwave-flash" == a.type; }) : /MSIE/.test(navigator.userAgent) ? eval("try { new ActiveXObject('ShockwaveFlash.ShockwaveFlash') && !0 } catch(e) { !1 };") : !1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment