Skip to content

Instantly share code, notes, and snippets.

@qpre
Created December 9, 2014 10:57
Show Gist options
  • Save qpre/3712b36d06fcbbf15ca8 to your computer and use it in GitHub Desktop.
Save qpre/3712b36d06fcbbf15ca8 to your computer and use it in GitHub Desktop.
Javascript Flash support detection
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment