Skip to content

Instantly share code, notes, and snippets.

@CoryDuncan
Last active December 16, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CoryDuncan/5462052 to your computer and use it in GitHub Desktop.
Save CoryDuncan/5462052 to your computer and use it in GitHub Desktop.
Extends jQuery.support to check for flash support
$.support.flash = (function() {
var isSupported = false;
if (window.ActiveXObject) {
try {
new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
isSupported = true;
} catch ( e ) {
isSupported = false;
}
} else {
$.each(navigator.plugins, function () {
if ( this.name.match(/flash/gim) ) {
isSupported = true;
return false;
} else {
isSupported = false;
}
});
}
return isSupported;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment