Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Browser feature inference
browser = {
ieVersion: function () {
var undef;
var v = 3;
var div = document.createElement('div');
var all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', all[0]);
return v > 4 ? v : undef;
},
hasFlash: function () {
try {
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash') ? true : false;
} catch (e) {
return navigator.mimeTypes["application/x-shockwave-flash"] !== undefined ? true : false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.