Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martinrehfeld/719973 to your computer and use it in GitHub Desktop.
Save martinrehfeld/719973 to your computer and use it in GitHub Desktop.
Flash detection
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