Skip to content

Instantly share code, notes, and snippets.

@bgerrissen
Created December 17, 2010 13:02
Show Gist options
  • Save bgerrissen/744897 to your computer and use it in GitHub Desktop.
Save bgerrissen/744897 to your computer and use it in GitHub Desktop.
// pluginDetection
// don't put this under a too global namespace object aka. "support"
define( [] , function () {
var pluginDetection = {}
// SILVERLIGHT
, getSilverlightVersion = function(){}
, silverlight = function ( version ) {
// check if any plugin exists
// ... code
// if yes, and we have a version parameter, check if version is correct
if ( version && version === getSilverlightVersion () ) {
return true;
}
}
// FLASH
// ... code
// mashup
// I tend to combine later on for easier API overview, it also minifies better than literal object notation.
silverlight.version = getSilverlightVersion;
flash.version = getFlashVersion;
pluginDetection.silverlight = silverlight;
pluginDetection.flash = flash;
return pluginDetection ;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment