Skip to content

Instantly share code, notes, and snippets.

@larswittenberg
Created December 7, 2012 09:38
Show Gist options
  • Save larswittenberg/4232157 to your computer and use it in GitHub Desktop.
Save larswittenberg/4232157 to your computer and use it in GitHub Desktop.
Flash Detection With One Line of Javascript
// 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