Skip to content

Instantly share code, notes, and snippets.

@sublimecoder
Created May 5, 2014 16:52
Show Gist options
  • Save sublimecoder/a3c3ef3b7c716477916e to your computer and use it in GitHub Desktop.
Save sublimecoder/a3c3ef3b7c716477916e to your computer and use it in GitHub Desktop.
Simple script for checking if the browser has flash enabled. Most often used for swapping a slide show element.
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment