1// awstats_misc_tracker.js 2//------------------------------------------------------------------- 3// You can add this file onto some of your web pages (main home page can 4// be enough) by adding the following HTML code to your page body: 5// 6// <script type="text/javascript" src="/js/awstats_misc_tracker.js"></script> 7// <noscript><p><img src="/js/awstats_misc_tracker.js?nojs=y" alt="" height="0" width="0" style="display: none" /></p></noscript> 8 9// 10// * This must be added after the <body> tag, not placed within the 11// <head> tags, or the resulting tracking <img> tag will not be handled 12// correctly by all browsers. Internet explorer will also not report 13// screen height and width attributes until it begins to render the 14// body. 15// 16// This allows AWStats to be enhanced with some miscellanous features: 17// - Screen size detection (TRKscreen) 18// - Browser size detection (TRKwinsize) 19// - Screen color depth detection (TRKcdi) 20// - Java enabled detection (TRKjava) 21// - Macromedia Director plugin detection (TRKshk) 22// - Macromedia Shockwave plugin detection (TRKfla) 23// - Realplayer G2 plugin detection (TRKrp) 24// - QuickTime plugin detection (TRKmov) 25// - Mediaplayer plugin detection (TRKwma) 26// - Acrobat PDF plugin detection (TRKpdf) 27//------------------------------------------------------------------- 28 29var awstatsmisctrackerurl = "/StaticContent/Scripts/awstats_misc_tracker.js"; 30 31var TRKresult; 32var TRKscreen, TRKwinsize, TRKcdi, TRKjava, TRKshk, TRKsvg, TRKfla; 33var TRKrp, TRKmov, TRKwma, TRKpdf, TRKpdfver, TRKuserid, TRKsessionid; 34var TRKnow, TRKbegin, TRKend; 35var TRKnse, TRKn; 36 37function awstats_setCookie(TRKNameOfCookie, TRKvalue, TRKexpirehours) { 38 TRKExpireDate = new Date (); 39 TRKExpireDate.setTime(TRKExpireDate.getTime() + (TRKexpirehours * 3600 * 1000)); 40 //N.B. SR1289477 41 //Forced the cookie to be a secure cookie! 42 document.cookie = TRKNameOfCookie + "=" + escape(TRKvalue) + "; path=/" + ((TRKexpirehours == null) ? "" : "; expires=" + TRKExpireDate.toGMTString()) + "; secure"; // 43} 44 45function awstats_detectIE(TRKClassID) { 46 TRKresult = false; // !!! Adding var in front of TRKresult break detection !!!
47 document.write('<SCR' + 'IPT LANGUAGE="VBScript">\n on error resume next \n TRKresult = IsObject(CreateObject("' + TRKClassID + '")) \n </SCR' + 'IPT>\n'); 48 if (TRKresult) return 'y'; 49 else return 'n'; 50} 51 52function awstats_detectNS(TRKClassID) { 53 TRKn = "n"; 54 if (TRKnse.indexOf(TRKClassID) != -1) if (navigator.mimeTypes[TRKClassID].enabledPlugin != null) TRKn = "y"; 55 return TRKn; 56} 57 58function awstats_getCookie(TRKNameOfCookie){ 59 if (document.cookie.length > 0){ 60 TRKbegin = document.cookie.indexOf(TRKNameOfCookie+"="); 61 if (TRKbegin != -1) { 62 TRKbegin += TRKNameOfCookie.length+1; 63 TRKend = document.cookie.indexOf(";", TRKbegin); 64 if (TRKend == -1) TRKend = document.cookie.length; 65 return unescape(document.cookie.substring(TRKbegin, TRKend)); 66 } 67 return null; 68 } 69 return null; 70} 71 72if (window.location.search == "" || window.location.search == "?") { 73 // If no query string 74 TRKnow = new Date(); 75 TRKscreen=screen.width+"x"+screen.height; 76 if (navigator.appName != "Netscape") { TRKcdi=screen.colorDepth; } 77 else {TRKcdi=screen.pixelDepth}; 78 TRKjava=navigator.javaEnabled(); 79 TRKuserid=awstats_getCookie("AWSUSER_ID"); 80 TRKsessionid=awstats_getCookie("AWSSESSION_ID"); 81 var TRKrandomnumber=Math.floor(Math.random()*10000); 82 if (TRKuserid == null || (TRKuserid=="")) { TRKuserid = "awsuser_id" + TRKnow.getTime() +"r"+ TRKrandomnumber; } 83 if (TRKsessionid == null || (TRKsessionid=="")) { TRKsessionid = "awssession_id" + TRKnow.getTime() +"r"+ TRKrandomnumber; } 84 awstats_setCookie("AWSUSER_ID", TRKuserid, 10000); 85 awstats_setCookie("AWSSESSION_ID", TRKsessionid, 1); 86 TRKuserid=""; TRKuserid=awstats_getCookie("AWSUSER_ID"); 87 TRKsessionid=""; TRKsessionid=awstats_getCookie("AWSSESSION_ID"); 88 89 var TRKnav=navigator.appName.toLowerCase(); // "internet explorer" or "netscape" 90 var TRKagt=navigator.userAgent.toLowerCase(); // "msie...", "mozilla...", "firefox..." 91 //alert(TRKnav); alert(TRKagt); 92 93 var TRKwin = ((TRKagt.indexOf("win")!=-1) || (TRKagt.indexOf("32bit")!=-1)); 94 var TRKmac = (TRKagt.indexOf("mac")!=-1); 95 96 var TRKns = (TRKnav.indexOf("netscape") != -1); 97 var TRKopera= (TRKnav.indexOf("opera") != -1); 98 var TRKie = (TRKagt.indexOf("msie") != -1); 99 100 // Detect the browser internal width and height 101 var TRKwinsize; 102 if (document.documentElement && document.documentElement.clientWidth) 103 TRKwinsize = document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight; 104 else if (document.body && document.body.clientWidth) 105 TRKwinsize = document.body.clientWidth + 'x' + document.body.clientHeight; 106 else 107 TRKwinsize = window.innerWidth + 'x' + window.innerHeight; 108 109 if (TRKie && TRKwin) { 110 TRKshk = awstats_detectIE("SWCtl.SWCtl.1"); 111 TRKsvg = awstats_detectIE("Adobe.SVGCtl"); 112 TRKfla = awstats_detectIE("ShockwaveFlash.ShockwaveFlash.1"); 113 TRKrp = awstats_detectIE("rmocx.RealPlayer G2 Control.1"); 114 TRKmov = awstats_detectIE("Quicktime.Quicktime"); 115 TRKwma = awstats_detectIE("wmplayer.ocx"); 116 TRKpdf = 'n'; TRKpdfver=''; 117 if (awstats_detectIE("PDF.PdfCtrl.1") == 'y') { TRKpdf = 'y'; TRKpdfver='4'; } // Acrobat 4 118 if (awstats_detectIE('PDF.PdfCtrl.5') == 'y') { TRKpdf = 'y'; TRKpdfver='5'; } // Acrobat 5 119 if (awstats_detectIE('PDF.PdfCtrl.6') == 'y') { TRKpdf = 'y'; TRKpdfver='6'; } // Acrobat 6 120 if (awstats_detectIE('AcroPDF.PDF.1') == 'y') { TRKpdf = 'y'; TRKpdfver='7'; } // Acrobat 7 121 } 122 if (TRKns || !TRKwin) { 123 TRKnse = ""; 124 for (var TRKi=0;TRKi<navigator.mimeTypes.length;TRKi++) TRKnse += navigator.mimeTypes[TRKi].type.toLowerCase(); 125 TRKshk = awstats_detectNS("application/x-director",""); 126 TRKsvg = awstats_detectNS("image/svg+xml",""); 127 if (document.implementation.hasFeature("org.w3c.dom.svg", "")) {TRKsvg = "y"; } 128 TRKfla = awstats_detectNS("application/x-shockwave-flash"); // ou lire dans naviagtor.plugins si on trouve "Shockwave Flash" ou "Shockwav Flash 2.0" 129 TRKrp = awstats_detectNS("audio/x-pn-realaudio-plugin"); 130 TRKmov = awstats_detectNS("video/quicktime"); 131 TRKwma = awstats_detectNS("application/x-mplayer2"); 132 TRKpdf = awstats_detectNS("application/pdf"); 133 TRKpdfver=''; 134 } 135 136 var imgsrc1 = awstatsmisctrackerurl+'?screen='+TRKscreen+'&win='+TRKwinsize+'&cdi='+TRKcdi+'&java='+TRKjava; 137 var imgsrc2 = '&shk='+TRKshk+'&svg='+TRKsvg+'&fla='+TRKfla+'&rp='+TRKrp+'&mov='+TRKmov+'&wma='+TRKwma+'&pdf='+TRKpdf+'&uid='+TRKuserid+'&sid='+TRKsessionid; 138 //alert(imgsrc1); 139 //alert(imgsrc2); 140 var imgsrc=imgsrc1+imgsrc2; 141 if( document.createElementNS ) { 142 var l=document.createElementNS("http://www.w3.org/1999/xhtml","img"); 143 l.setAttribute("src", imgsrc ); 144 l.setAttribute("height", "0"); 145 l.setAttribute("width", "0"); 146 l.setAttribute("border", "0"); 147 l.setAttribute("alt", "awstat" ); 148 document.getElementsByTagName("body")[0].appendChild(l); 149 } else {
150 document.write('<img style="display:none;" src="'+ imgsrc +'" height="0" width="0" border="0" />') 151 } 152 153}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.