Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/_.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@

var idCounter = 0;
var nav = navigator, plugins = nav.plugins, ua = nav.userAgent, idCounter = 0;

var _ = {

hasFlash: ((typeof navigator.plugins != 'undefined' &&
typeof navigator.plugins['Shockwave Flash'] == 'object') ||
(window.ActiveXObject && (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) !== false)),
hasFlash: (function (){
var a, hasFlash = false;
if(!!plugins && typeof plugins['Shockwave Flash'] == 'object') {
hasFlash = !hasFlash;
}else if ( !!window.ActiveXObject ) {
try {
a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(a){
hasFlash = !hasFlash;
}
}catch(e){}
}
return hasFlash;
})(),

isIE: !!navigator.userAgent.match(/msie/i) ||
!!navigator.userAgent.match(/Trident\/7\./),
isIE: !!ua.match(/msie/i) || !!ua.match(/Trident\/7\./),

uniqueId: function(prefix) {
var id = idCounter++;
Expand Down