Last active
December 16, 2015 16:19
-
-
Save CoryDuncan/5462052 to your computer and use it in GitHub Desktop.
Extends jQuery.support to check for flash support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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