Add 'beef.browser.hasQuickTime()'

Merged manually from https://github.com/beefproject/beef/pull/836

Fix issue #835

starting
This commit is contained in:
bcoles
2013-02-03 05:59:06 +10:30
parent ce1cc61ac1
commit f7b55be03a

View File

@@ -671,6 +671,44 @@ return !!window.devicePixelRatio && !!window.history.replaceState && window.navi
}
},
/**
* Checks if the zombie has the QuickTime plugin installed.
* @return: {Boolean} true or false.
*
* @example: if ( beef.browser.hasQuickTime() ) { ... }
*/
hasQuickTime: function() {
var quicktime = false;
// Not Internet Explorer
if ( !this.type().IE ) {
for ( i=0; i < navigator.plugins.length; i++ ) {
if ( navigator.plugins[i].name.indexOf("QuickTime") >= 0 ) {
quicktime = true;
}
}
// Internet Explorer
} else {
try {
var qt_test = new ActiveXObject('QuickTime.QuickTime');
} catch (e) { }
if ( qt_test ) { quicktime = true; }
}
return quicktime;
},
/**
* Checks if the zombie has Java enabled.
* @return: {Boolean} true or false.