Skip to content

Instantly share code, notes, and snippets.

@jwalsh
Created September 17, 2013 17:36
Show Gist options
  • Save jwalsh/6597743 to your computer and use it in GitHub Desktop.
Save jwalsh/6597743 to your computer and use it in GitHub Desktop.
fortyone=new function(){this.e=(new Date(2005,0,15)).getTimezoneOffset();this.f=(new Date(2005,6,15)).getTimezoneOffset();this.plugins=[];this.d={Flash:["ShockwaveFlash.ShockwaveFlash",function(b){return b.getVariable("$version")}],Director:["SWCtl.SWCtl",function(b){return b.ShockwaveVersion("")}]};this.r=function(b){var c;try{c=document.getElementById(b)}catch(d){}if(c===null||typeof c==="undefined")try{c=document.getElementsByName(b)[0]}catch(e){}if(c===null||typeof c==="undefined")for(var f=0;f<
document.forms.length;f++)for(var g=document.forms[f],h=0;h<g.elements.length;h++){var a=g[h];if(a.name===b||a.id===b)return a}return c};this.b=function(b){var c="";try{if(typeof this.c.getComponentVersion!=="undefined")c=this.c.getComponentVersion(b,"ComponentID")}catch(d){b=d.message.length;b=b>40?40:b;c=escape(d.message.substr(0,b))}return c};this.exec=function(b){for(var c=0;c<b.length;c++)try{var d=eval(b[c]);if(d)return d}catch(e){}return""};this.p=function(b){var c="";try{if(navigator.plugins&&
navigator.plugins.length){var d=RegExp(b+".* ([0-9._]+)");for(b=0;b<navigator.plugins.length;b++){var e=d.exec(navigator.plugins[b].name);if(e===null)e=d.exec(navigator.plugins[b].description);if(e)c=e[1]}}else if(window.ActiveXObject&&this.d[b])try{var f=new ActiveXObject(this.d[b][0]);c=this.d[b][1](f)}catch(g){c=""}}catch(h){c=h.message}return c};this.q=function(){for(var b=["Acrobat","Flash","QuickTime","Java Plug-in","Director","Office"],c=0;c<b.length;c++){var d=b[c];this.plugins[d]=this.p(d)}};
this.g=function(){return Math.abs(this.e-this.f)};this.h=function(){return this.g()!==0};this.i=function(b){var c=Math.min(this.e,this.f);return this.h()&&b.getTimezoneOffset()===c};this.n=function(b){var c=0;c=0;if(this.i(b))c=this.g();return c=-(b.getTimezoneOffset()+c)/60};this.j=function(b,c,d,e){if(typeof e!=="boolean")e=false;for(var f=true,g;(g=b.indexOf(c))>=0&&(e||f);){b=b.substr(0,g)+d+b.substr(g+c.length);f=false}return b};this.m=function(){return(new Date(2005,5,7,21,33,44,888)).toLocaleString()};
this.k=function(b){var c=new Date,d=[function(){return"TF1"},function(){return"015"},function(){return ScriptEngineMajorVersion()},function(){return ScriptEngineMinorVersion()},function(){return ScriptEngineBuildVersion()},function(a){return a.b("{7790769C-0471-11D2-AF11-00C04FA35D02}")},function(a){return a.b("{89820200-ECBD-11CF-8B85-00AA005B4340}")},function(a){return a.b("{283807B5-2C60-11D0-A31D-00AA00B92C03}")},function(a){return a.b("{4F216970-C90C-11D1-B5C7-0000F8051515}")},function(a){return a.b("{44BBA848-CC51-11CF-AAFA-00AA00B6015C}")},
function(a){return a.b("{9381D8F2-0288-11D0-9501-00AA00B911A5}")},function(a){return a.b("{4F216970-C90C-11D1-B5C7-0000F8051515}")},function(a){return a.b("{5A8D6EE0-3E18-11D0-821E-444553540000}")},function(a){return a.b("{89820200-ECBD-11CF-8B85-00AA005B4383}")},function(a){return a.b("{08B0E5C0-4FCB-11CF-AAA5-00401C608555}")},function(a){return a.b("{45EA75A0-A269-11D1-B5BF-0000F8051515}")},function(a){return a.b("{DE5AED00-A4BF-11D1-9948-00C04F98BBC9}")},function(a){return a.b("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}")},
function(a){return a.b("{44BBA842-CC51-11CF-AAFA-00AA00B6015B}")},function(a){return a.b("{3AF36230-A269-11D1-B5BF-0000F8051515}")},function(a){return a.b("{44BBA840-CC51-11CF-AAFA-00AA00B6015C}")},function(a){return a.b("{CC2A9BA0-3BDD-11D0-821E-444553540000}")},function(a){return a.b("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}")},function(){return eval("navigator.appCodeName")},function(){return eval("navigator.appName")},function(){return eval("navigator.appVersion")},function(a){return a.exec(["navigator.productSub",
"navigator.appMinorVersion"])},function(){return eval("navigator.browserLanguage")},function(){return eval("navigator.cookieEnabled")},function(a){return a.exec(["navigator.oscpu","navigator.cpuClass"])},function(){return eval("navigator.onLine")},function(){return eval("navigator.platform")},function(){return eval("navigator.systemLanguage")},function(){return eval("navigator.userAgent")},function(a){return a.exec(["navigator.language","navigator.userLanguage"])},function(){return eval("document.defaultCharset")},
function(){return eval("document.domain")},function(){return eval("screen.deviceXDPI")},function(){return eval("screen.deviceYDPI")},function(){return eval("screen.fontSmoothingEnabled")},function(){return eval("screen.updateInterval")},function(a){return a.h()},function(a){return a.i(c)},function(){return"@UTC@"},function(a){return a.n(c)},function(a){return a.m()},function(){return eval("screen.width")},function(){return eval("screen.height")},function(a){return a.plugins.Acrobat},function(a){return a.plugins.Flash},
function(a){return a.plugins.QuickTime},function(a){return a.plugins["Java Plug-in"]},function(a){return a.plugins.Director},function(a){return a.plugins.Office},function(){return(new Date).getTime()-c.getTime()},function(a){return a.e},function(a){return a.f},function(){return c.toLocaleString()},function(){return eval("screen.colorDepth")},function(){return eval("window.screen.availWidth")},function(){return eval("window.screen.availHeight")},function(){return eval("window.screen.availLeft")},function(){return eval("window.screen.availTop")},
function(a){return a.a("Acrobat")},function(a){return a.a("Adobe SVG")},function(a){return a.a("Authorware")},function(a){return a.a("Citrix ICA")},function(a){return a.a("Director")},function(a){return a.a("Flash")},function(a){return a.a("MapGuide")},function(a){return a.a("MetaStream")},function(a){return a.a("PDFViewer")},function(a){return a.a("QuickTime")},function(a){return a.a("RealOne")},function(a){return a.a("RealPlayer Enterprise")},function(a){return a.a("RealPlayer Plugin")},function(a){return a.a("Seagate Software Report")},
function(a){return a.a("Silverlight")},function(a){return a.a("Windows Media")},function(a){return a.a("iPIX")},function(a){return a.a("nppdf.so")},function(a){return a.o()}];this.q();for(var e="",f=0;f<d.length;f++){if(b){e+=this.j(d[f].toString(),'"',"'",true);e+="="}var g;try{g=d[f](this)}catch(h){g=""}e+=b?g:escape(g);e+=";";if(b)e+="\\n"}return e=this.j(e,escape("@UTC@"),(new Date).getTime())};this.l=function(b){try{if(!b)return this.k();var c;c=this.r(b);if(c!==null)try{c.value=this.k()}catch(d){c.value=
escape(d.message)}}catch(e){}};this.a=function(b){try{if(navigator.plugins&&navigator.plugins.length)for(var c=0;c<navigator.plugins.length;c++){var d=navigator.plugins[c];if(d.name.indexOf(b)>=0)return d.name+(d.description?"|"+d.description:"")}}catch(e){}return""};this.o=function(){var b=document.createElement("span");b.innerHTML="&nbsp;";b.style.position="absolute";b.style.left="-9999px";document.body.appendChild(b);var c=b.offsetHeight;document.body.removeChild(b);return c}};
try{fortyone.c=document.createElement("span");typeof fortyone.c.addBehavior!=="undefined"&&fortyone.c.addBehavior("#default#clientCaps")}catch(i){}window.fortyone=fortyone;window.fortyone.collect=fortyone.l;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment