/*
*** Digital Fingerprint using JavaScript
o. Connection
Below attributes are collected from server.
a. accept-language
b. content encoding
c. content languate
d. IP Address
e. Cookie
*/
/* Utils - start */
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;
if (this.length == 0) return hash;
for (i = 0, len = this.length; i < len; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
};
strSep = "|";
strPair = ":"
strOnError = "Error";
/* Utils - end */
/* DFP - Start */
getDfp=function(){
strDFP="US:"+getUA() + strSep + "Language:"+ getLaunguage() + strSep + "Display:"+ getDisplay() + "Canvas:" + getCanvas() + strSep + "Fonts:" + getFonts() + strSep + "Timezone:" + getTimezone() + strSep + "Touch:" + getTouch() + strSep + "BrowserDetails:" + getBrowserDetails() + strSep + "WebGL:" + getWebGlSupport() + strSep + "Pulgins:" + getPlugins() + strSep + "Geolocation:" + getGeoLocation();
}
/*
UserAgent
Passed as part of HTTP Request - so no need to take this and pass it separately. Get this from server.
Send a hash value of the user agent from browser and compare this hash at the server end to be sure that the data is not manipulated.
*/
getUA = function(){
strUserAgent = navigator.userAgent.toLowerCase();
alert(strUserAgent);
alert(strUserAgent.hashCode());
return strUserAgent.hashCode();
}
/*
Language - default, browser, system, user languages
*/
getLaunguage=function(){
strLang = "";
strTypeLng = typeof (navigator.language);
strTypeBrLng = typeof (navigator.browserLanguage);
strTypeSysLng = typeof (navigator.systemLanguage);
strTypeUsrLng = typeof (navigator.userLanguage);
if (strTypeLng !== "undefined") {
strLang = "lang" + strPair + navigator.language + strSep;
}
if (strTypeBrLng !== "undefined") {
strLang = "lang" + strPair + navigator.browserLanguage + strSep;
}
if (strTypeSysLng !== "undefined") {
strLang += "syslang" + strPair + navigator.systemLanguage + strSep;
}
if (strTypeUsrLng !== "undefined") {
strLang += "userlang" + strPair + navigator.userLanguage;
}
alert(strLang);
return(strLang);
}
/* Display: Color Depth, Resolution
Numeric values of the color depth of the screen, the width and height of the screen, and the available width and height of the screen.
*/
getDisplay=function() {
strScreen = null;
strDisplay = null;
try {
strScreen = window.screen;
if (strScreen) {
strDisplay = strScreen.colorDepth + strSep + strScreen.width + strSep + strScreen.height + strSep + strScreen.availWidth + strSep + strScreen.availHeight;
}
return strDisplay;
} catch (err) {
return "error";
}
}
/* Canvas - browser rendering engine, the graphics driver and GPU
Only works with browsers supporting the canvas element. This will not work with Android Browser 2.x and earlier, Internet Explorer 8.0 and earlier, or Opera Mini 7.0 and earlier.
Returns: A base 64 encoded fingerprint. It is recommended to hash the output prior to using due to length.
*/
getCanvas=function() {
"use strict";
var canvas, strCText, strText, strOut;
canvas = null;
strCText = null;
strText = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~1!2@3#4$5%6^7&8*9(0)-_=+[{]}|;:',<.>/?";
strOut = null;
try {
canvas = document.createElement('canvas');
strCText = canvas.getContext('2d');
strCText.textBaseline = "top";
strCText.font = "14px 'Arial'";
strCText.textBaseline = "alphabetic";
strCText.fillStyle = "#f60";
strCText.fillRect(125, 1, 62, 20);
strCText.fillStyle = "#069";
strCText.fillText(strText, 2, 15);
strCText.fillStyle = "rgba(102, 204, 0, 0.7)";
strCText.fillText(strText, 4, 17);
strOut = canvas.toDataURL();
return strOut;
} catch (err) {
return strOnError;
}
}
/* Fonts
Returns: Hash value of a comma delimited list of fonts installed. The fonts are picked up from a master list.
*/
getFonts=function() {
var style, fonts, count, template, fragment, divs, i, font, div, body, result, e;
style = null;
fonts = null;
font = null;
count = 0;
template = null;
divs = null;
e = null;
div = null;
body = null;
i = 0;
try {
style = "position: absolute; visibility: hidden; display: block !important";
fonts = ["Abadi MT Condensed Light", "Academy Engraved LET", "ADOBE CASLON PRO", "Adobe Garamond", "ADOBE GARAMOND PRO", "Agency FB", "Aharoni", "Albertus Extra Bold", "Albertus Medium", "Algerian", "Amazone BT", "American Typewriter", "American Typewriter Condensed", "AmerType Md BT", "Andale Mono", "Andalus", "Angsana New", "AngsanaUPC", "Antique Olive", "Aparajita", "Apple Chancery", "Apple Color Emoji", "Apple SD Gothic Neo", "Arabic Typesetting", "ARCHER", "Arial", "Arial Black", "Arial Hebrew", "Arial MT", "Arial Narrow", "Arial Rounded MT Bold", "Arial Unicode MS", "ARNO PRO", "Arrus BT", "Aurora Cn BT", "AvantGarde Bk BT", "AvantGarde Md BT", "AVENIR", "Ayuthaya", "Bandy", "Bangla Sangam MN", "Bank Gothic", "BankGothic Md BT", "Baskerville", "Baskerville Old Face", "Batang", "BatangChe", "Bauer Bodoni", "Bauhaus 93", "Bazooka", "Bell MT", "Bembo", "Benguiat Bk BT", "Berlin Sans FB", "Berlin Sans FB Demi", "Bernard MT Condensed", "BernhardFashion BT", "BernhardMod BT", "Big Caslon", "BinnerD", "Bitstream Vera Sans Mono", "Blackadder ITC", "BlairMdITC TT", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni MT", "Bodoni MT Black", "Bodoni MT Condensed", "Bodoni MT Poster Compressed", "Book Antiqua", "Bookman Old Style", "Bookshelf Symbol 7", "Boulder", "Bradley Hand", "Bradley Hand ITC", "Bremen Bd BT", "Britannic Bold", "Broadway", "Browallia New", "BrowalliaUPC", "Brush Script MT", "Calibri", "Californian FB", "Calisto MT", "Calligrapher", "Cambria", "Cambria Math", "Candara", "CaslonOpnface BT", "Castellar", "Centaur", "Century", "Century Gothic", "Century Schoolbook", "Cezanne", "CG Omega", "CG Times", "Chalkboard", "Chalkboard SE", "Chalkduster", "Charlesworth", "Charter Bd BT", "Charter BT", "Chaucer", "ChelthmITC Bk BT", "Chiller", "Clarendon", "Clarendon Condensed", "CloisterBlack BT", "Cochin", "Colonna MT", "Comic Sans", "Comic Sans MS", "Consolas", "Constantia", "Cooper Black", "Copperplate", "Copperplate Gothic", "Copperplate Gothic Bold", "Copperplate Gothic Light", "CopperplGoth Bd BT", "Corbel", "Cordia New", "CordiaUPC", "Cornerstone", "Coronet", "Courier", "Courier New", "Cuckoo", "Curlz MT", "DaunPenh", "Dauphin", "David", "DB LCD Temp", "DELICIOUS", "Denmark", "Devanagari Sangam MN", "DFKai-SB", "Didot", "DilleniaUPC", "DIN", "DokChampa", "Dotum", "DotumChe", "Ebrima", "Edwardian Script ITC", "Elephant", "English 111 Vivace BT", "Engravers MT", "EngraversGothic BT", "Eras Bold ITC", "Eras Demi ITC", "Eras Light ITC", "Eras Medium ITC", "Estrangelo Edessa", "EucrosiaUPC", "Euphemia", "Euphemia UCAS", "EUROSTILE", "Exotc350 Bd BT", "FangSong", "Felix Titling", "Fixedsys", "FONTIN", "Footlight MT Light", "Forte", "Franklin Gothic", "Franklin Gothic Book", "Franklin Gothic Demi", "Franklin Gothic Demi Cond", "Franklin Gothic Heavy", "Franklin Gothic Medium", "Franklin Gothic Medium Cond", "FrankRuehl", "Fransiscan", "Freefrm721 Blk BT", "FreesiaUPC", "Freestyle Script", "French Script MT", "FrnkGothITC Bk BT", "Fruitger", "FRUTIGER", "Futura", "Futura Bk BT", "Futura Lt BT", "Futura Md BT", "Futura ZBlk BT", "FuturaBlack BT", "Gabriola", "Galliard BT", "Garamond", "Gautami", "Geeza Pro", "Geneva", "Geometr231 BT", "Geometr231 Hv BT", "Geometr231 Lt BT", "Georgia", "GeoSlab 703 Lt BT", "GeoSlab 703 XBd BT", "Gigi", "Gill Sans", "Gill Sans MT", "Gill Sans MT Condensed", "Gill Sans MT Ext Condensed Bold", "Gill Sans Ultra Bold", "Gill Sans Ultra Bold Condensed", "Gisha", "Gloucester MT Extra Condensed", "GOTHAM", "GOTHAM BOLD", "Goudy Old Style", "Goudy Stout", "GoudyHandtooled BT", "GoudyOLSt BT", "Gujarati Sangam MN", "Gulim", "GulimChe", "Gungsuh", "GungsuhChe", "Gurmukhi MN", "Haettenschweiler", "Harlow Solid Italic", "Harrington", "Heather", "Heiti SC", "Heiti TC", "HELV", "Helvetica", "Helvetica Neue", "Herald", "High Tower Text", "Hiragino Kaku Gothic ProN", "Hiragino Mincho ProN", "Hoefler Text", "Humanst 521 Cn BT", "Humanst521 BT", "Humanst521 Lt BT", "Impact", "Imprint MT Shadow", "Incised901 Bd BT", "Incised901 BT", "Incised901 Lt BT", "INCONSOLATA", "Informal Roman", "Informal011 BT", "INTERSTATE", "IrisUPC", "Iskoola Pota", "JasmineUPC", "Jazz LET", "Jenson", "Jester", "Jokerman", "Juice ITC", "Kabel Bk BT", "Kabel Ult BT", "Kailasa", "KaiTi", "Kalinga", "Kannada Sangam MN", "Kartika", "Kaufmann Bd BT", "Kaufmann BT", "Khmer UI", "KodchiangUPC", "Kokila", "Korinna BT", "Kristen ITC", "Krungthep", "Kunstler Script", "Lao UI", "Latha", "Leelawadee", "Letter Gothic", "Levenim MT", "LilyUPC", "Lithograph", "Lithograph Light", "Long Island", "Lucida Bright", "Lucida Calligraphy", "Lucida Console", "Lucida Fax", "LUCIDA GRANDE", "Lucida Handwriting", "Lucida Sans", "Lucida Sans Typewriter", "Lucida Sans Unicode", "Lydian BT", "Magneto", "Maiandra GD", "Malayalam Sangam MN", "Malgun Gothic", "Mangal", "Marigold", "Marion", "Marker Felt", "Market", "Marlett", "Matisse ITC", "Matura MT Script Capitals", "Meiryo", "Meiryo UI", "Microsoft Himalaya", "Microsoft JhengHei", "Microsoft New Tai Lue", "Microsoft PhagsPa", "Microsoft Sans Serif", "Microsoft Tai Le", "Microsoft Uighur", "Microsoft YaHei", "Microsoft Yi Baiti", "MingLiU", "MingLiU_HKSCS", "MingLiU_HKSCS-ExtB", "MingLiU-ExtB", "Minion", "Minion Pro", "Miriam", "Miriam Fixed", "Mistral", "Modern", "Modern No. 20", "Mona Lisa Solid ITC TT", "Monaco", "Mongolian Baiti", "MONO", "Monotype Corsiva", "MoolBoran", "Mrs Eaves", "MS Gothic", "MS LineDraw", "MS Mincho", "MS Outlook", "MS PGothic", "MS PMincho", "MS Reference Sans Serif", "MS Reference Specialty", "MS Sans Serif", "MS Serif", "MS UI Gothic", "MT Extra", "MUSEO", "MV Boli", "MYRIAD", "MYRIAD PRO", "Nadeem", "Narkisim", "NEVIS", "News Gothic", "News GothicMT", "NewsGoth BT", "Niagara Engraved", "Niagara Solid", "Noteworthy", "NSimSun", "Nyala", "OCR A Extended", "Old Century", "Old English Text MT", "Onyx", "Onyx BT", "OPTIMA", "Oriya Sangam MN", "OSAKA", "OzHandicraft BT", "Palace Script MT", "Palatino", "Palatino Linotype", "Papyrus", "Parchment", "Party LET", "Pegasus", "Perpetua", "Perpetua Titling MT", "PetitaBold", "Pickwick", "Plantagenet Cherokee", "Playbill", "PMingLiU", "PMingLiU-ExtB", "Poor Richard", "Poster", "PosterBodoni BT", "PRINCETOWN LET", "Pristina", "PTBarnum BT", "Pythagoras", "Raavi", "Rage Italic", "Ravie", "Ribbon131 Bd BT", "Rockwell", "Rockwell Condensed", "Rockwell Extra Bold", "Rod", "Roman", "Sakkal Majalla", "Santa Fe LET", "Savoye LET", "Sceptre", "Script", "Script MT Bold", "SCRIPTINA", "Segoe Print", "Segoe Script", "Segoe UI", "Segoe UI Light", "Segoe UI Semibold", "Segoe UI Symbol", "Serifa", "Serifa BT", "Serifa Th BT", "ShelleyVolante BT", "Sherwood", "Shonar Bangla", "Showcard Gothic", "Shruti", "Signboard", "SILKSCREEN", "SimHei", "Simplified Arabic", "Simplified Arabic Fixed", "SimSun", "SimSun-ExtB", "Sinhala Sangam MN", "Sketch Rockwell", "Skia", "Small Fonts", "Snap ITC", "Snell Roundhand", "Socket", "Souvenir Lt BT", "Staccato222 BT", "Steamer", "Stencil", "Storybook", "Styllo", "Subway", "Swis721 BlkEx BT", "Swiss911 XCm BT", "Sylfaen", "Synchro LET", "System", "Tahoma", "Tamil Sangam MN", "Technical", "Teletype", "Telugu Sangam MN", "Tempus Sans ITC", "Terminal", "Thonburi", "Times", "Times New Roman", "Times New Roman PS", "Traditional Arabic", "Trajan", "TRAJAN PRO", "Trebuchet MS", "Tristan", "Tubular", "Tunga", "Tw Cen MT", "Tw Cen MT Condensed", "Tw Cen MT Condensed Extra Bold", "TypoUpright BT", "Unicorn", "Univers", "Univers CE 55 Medium", "Univers Condensed", "Utsaah", "Vagabond", "Vani", "Verdana", "Vijaya", "Viner Hand ITC", "VisualUI", "Vivaldi", "Vladimir Script", "Vrinda", "Westminster", "WHITNEY", "Wide Latin", "Wingdings", "Wingdings 2", "Wingdings 3", "ZapfEllipt BT", "ZapfHumnst BT", "ZapfHumnst Dm BT", "Zapfino", "Zurich BlkEx BT", "Zurich Ex BT", "ZWAdobeF"];
count = fonts.length;
template = '<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',sans-serif !important">ww</b>' + '<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',monospace !important">ww</b>';
fragment = document.createDocumentFragment();
divs = [];
for (i = 0; i < count; i = i + 1) {
font = fonts[i];
div = document.createElement('div');
font = font.replace(/['"<>]/g, '');
div.innerHTML = template.replace(/X/g, font);
div.style.cssText = style;
fragment.appendChild(div);
divs.push(div);
}
body = document.body;
body.insertBefore(fragment, body.firstChild);
result = [];
for (i = 0; i < count; i = i + 1) {
e = divs[i].getElementsByTagName('b');
if (e[0].offsetWidth === e[1].offsetWidth) {
result.push(fonts[i]);
}
}
// do not combine these two loops, remove child will cause reflow
// and induce severe performance hit
for (i = 0; i < count; i = i + 1) {
body.removeChild(divs[i]);
}
return result.hashCode();
} catch (err) {
return strOnError;
}
}
/*
Timezone on the client's device.
*/
getTimezone=function() {
"use strict";
var strOnError, dtDate, numOffset, numGMTHours, numOut;
strOnError = "Error";
dtDate = null;
numOffset = null;
numGMTHours = null;
numOut = null;
try {
dtDate = new Date();
numOffset = dtDate.getTimezoneOffset();
numGMTHours = (numOffset / 60) * (-1);
numOut = numGMTHours;
return numOut;
} catch (err) {
return strOnError;
}
}
/* Touch support */
getTouch=function() {
"use strict";
var bolTouchEnabled, bolOut;
bolTouchEnabled = false;
bolOut = null;
try {
if (document.createEvent("TouchEvent")) {
bolTouchEnabled = true;
}
bolOut = bolTouchEnabled;
return bolOut;
} catch (ignore) {
bolOut = bolTouchEnabled
return bolOut;
}
}
getTouchSupport: function () {
var maxTouchPoints = 0;
var touchEvent = false;
if(typeof navigator.maxTouchPoints !== "undefined") {
maxTouchPoints = navigator.maxTouchPoints;
} else if (typeof navigator.msMaxTouchPoints !== "undefined") {
maxTouchPoints = navigator.msMaxTouchPoints;
}
try {
document.createEvent("TouchEvent");
touchEvent = true;
} catch(_) { /* squelch */ }
return [maxTouchPoints, touchEvent, touchStart];
},
/* True Browser */
getBrowserDetails=function(){
strBrowserDetails = "truebrowser:" + navigator.vendor + ";" + navigator.appName + ";" + navigator.appCodeName + ";" + navigator.product + ";" + navigator.platform + ";" + navigator.navigatorCpuClass;
return strBrowserDetails;
}
/* Web GL */
getWebGlSupport: function() {
/*
WebGL Vendor "Google Inc."
WebGL Renderer "ANGLE (Intel(R) HD Graphics 3000 Direct3D11 vs_4_1 ps_4_1)"
*/
// code taken from Modernizr
if (!this.isCanvasSupported())
var elem = document.createElement("canvas");
if(!(elem.getContext && elem.getContext("2d"))){
return false;
}
var canvas = document.createElement("canvas"),
glContext;
try {
glContext = canvas.getContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl"));
} catch(e) {
glContext = false;
}
return ("webgl:" + !!window.WebGLRenderingContext && !!glContext);
}
/* Plugins */
getPlugins=function () {
"use strict";
var htIEComponents, strKey, strName, strVersion, strTemp, bolFirst, iCount, strMimeType, strOut;
try {
/* Create hashtable of IE components */
htIEComponents = new Hashtable();
htIEComponents.put('7790769C-0471-11D2-AF11-00C04FA35D02', 'AddressBook'); // Address Book
htIEComponents.put('47F67D00-9E55-11D1-BAEF-00C04FC2D130', 'AolArtFormat'); // AOL ART Image Format Support
htIEComponents.put('76C19B38-F0C8-11CF-87CC-0020AFEECF20', 'ArabicDS'); // Arabic Text Display Support
htIEComponents.put('76C19B34-F0C8-11CF-87CC-0020AFEECF20', 'ChineseSDS'); // Chinese (Simplified) Text Display Support
htIEComponents.put('76C19B33-F0C8-11CF-87CC-0020AFEECF20', 'ChineseTDS'); // Chinese (traditional) Text Display Support
htIEComponents.put('238F6F83-B8B4-11CF-8771-00A024541EE3', 'CitrixICA'); // Citrix ICA Client
htIEComponents.put('283807B5-2C60-11D0-A31D-00AA00B92C03', 'DirectAnim'); // DirectAnimation
htIEComponents.put('44BBA848-CC51-11CF-AAFA-00AA00B6015C', 'DirectShow'); // DirectShow
htIEComponents.put('9381D8F2-0288-11D0-9501-00AA00B911A5', 'DynHTML'); // Dynamic HTML Data Binding
htIEComponents.put('4F216970-C90C-11D1-B5C7-0000F8051515', 'DynHTML4Java'); // Dynamic HTML Data Binding for Java
htIEComponents.put('D27CDB6E-AE6D-11CF-96B8-444553540000', 'Flash'); // Macromedia Flash
htIEComponents.put('76C19B36-F0C8-11CF-87CC-0020AFEECF20', 'HebrewDS'); // Hebrew Text Display Support
htIEComponents.put('630B1DA0-B465-11D1-9948-00C04F98BBC9', 'IEBrwEnh'); // Internet Explorer Browsing Enhancements
htIEComponents.put('08B0E5C0-4FCB-11CF-AAA5-00401C608555', 'IEClass4Java'); // Internet Explorer Classes for Java
htIEComponents.put('45EA75A0-A269-11D1-B5BF-0000F8051515', 'IEHelp'); // Internet Explorer Help
htIEComponents.put('DE5AED00-A4BF-11D1-9948-00C04F98BBC9', 'IEHelpEng'); // Internet Explorer Help Engine
htIEComponents.put('89820200-ECBD-11CF-8B85-00AA005B4383', 'IE5WebBrw'); // Internet Explorer 5/6 Web Browser
htIEComponents.put('5A8D6EE0-3E18-11D0-821E-444553540000', 'InetConnectionWiz'); // Internet Connection Wizard
htIEComponents.put('76C19B30-F0C8-11CF-87CC-0020AFEECF20', 'JapaneseDS'); // Japanese Text Display Support
htIEComponents.put('76C19B31-F0C8-11CF-87CC-0020AFEECF20', 'KoreanDS'); // Korean Text Display Support
htIEComponents.put('76C19B50-F0C8-11CF-87CC-0020AFEECF20', 'LanguageAS'); // Language Auto-Selection
htIEComponents.put('08B0E5C0-4FCB-11CF-AAA5-00401C608500', 'MsftVM'); // Microsoft virtual machine
htIEComponents.put('5945C046-LE7D-LLDL-BC44-00C04FD912BE', 'MSNMessengerSrv'); // MSN Messenger Service
htIEComponents.put('44BBA842-CC51-11CF-AAFA-00AA00B6015B', 'NetMeetingNT'); // NetMeeting NT
htIEComponents.put('3AF36230-A269-11D1-B5BF-0000F8051515', 'OfflineBrwPack'); // Offline Browsing Pack
htIEComponents.put('44BBA840-CC51-11CF-AAFA-00AA00B6015C', 'OutlookExpress'); // Outlook Express
htIEComponents.put('76C19B32-F0C8-11CF-87CC-0020AFEECF20', 'PanEuropeanDS'); // Pan-European Text Display Support
htIEComponents.put('4063BE15-3B08-470D-A0D5-B37161CFFD69', 'QuickTime'); // Apple Quick Time
htIEComponents.put('DE4AF3B0-F4D4-11D3-B41A-0050DA2E6C21', 'QuickTimeCheck'); // Apple Quick Time Check
htIEComponents.put('3049C3E9-B461-4BC5-8870-4C09146192CA', 'RealPlayer'); // RealPlayer Download and Record Plugin for IE
htIEComponents.put('2A202491-F00D-11CF-87CC-0020AFEECF20', 'ShockwaveDir'); // Macromedia Shockwave Director
htIEComponents.put('3E01D8E0-A72B-4C9F-99BD-8A6E7B97A48D', 'Skype'); // Skype
htIEComponents.put('CC2A9BA0-3BDD-11D0-821E-444553540000', 'TaskScheduler'); // Task Scheduler
htIEComponents.put('76C19B35-F0C8-11CF-87CC-0020AFEECF20', 'ThaiDS'); // Thai Text Display Support
htIEComponents.put('3BF42070-B3B1-11D1-B5C5-0000F8051515', 'Uniscribe'); // Uniscribe
htIEComponents.put('4F645220-306D-11D2-995D-00C04F98BBC9', 'VBScripting'); // Visual Basic Scripting Support v5.6
htIEComponents.put('76C19B37-F0C8-11CF-87CC-0020AFEECF20', 'VietnameseDS'); // Vietnamese Text Display Support
htIEComponents.put('10072CEC-8CC1-11D1-986E-00A0C955B42F', 'VML'); // Vector Graphics Rendering (VML)
htIEComponents.put('90E2BA2E-DD1B-4CDE-9134-7A8B86D33CA7', 'WebEx'); // WebEx Productivity Tools
htIEComponents.put('73FA19D0-2D75-11D2-995D-00C04F98BBC9', 'WebFolders'); // Web Folders
htIEComponents.put('89820200-ECBD-11CF-8B85-00AA005B4340', 'WinDesktopUpdateNT'); // Windows Desktop Update NT
htIEComponents.put('9030D464-4C02-4ABF-8ECC-5164760863C6', 'WinLive'); // Windows Live ID Sign-in Helper
htIEComponents.put('6BF52A52-394A-11D3-B153-00C04F79FAA6', 'WinMediaPlayer'); // Windows Media Player (Versions 7, 8 or 9)
htIEComponents.put('22D6F312-B0F6-11D0-94AB-0080C74C7E95', 'WinMediaPlayerTrad'); // Windows Media Player (Traditional Versions)
strTemp = "";
bolFirst = true;
if (navigator.plugins.length > 0) {
for (iCount = 0; iCount < navigator.plugins.length; iCount = iCount + 1) {
if (bolFirst === true) {
strTemp += navigator.plugins[iCount].name;
bolFirst = false;
} else {
strTemp += glbSep + navigator.plugins[iCount].name;
}
}
} else if (navigator.mimeTypes.length > 0) {
strMimeType = navigator.mimeTypes;
for (iCount = 0; iCount < strMimeType.length; iCount = iCount + 1) {
if (bolFirst === true) {
strTemp += strMimeType[iCount].description;
bolFirst = false;
} else {
strTemp += glbSep + strMimeType[iCount].description;
}
}
} else {
document.body.addBehavior("#default#clientCaps");
strKey = htIEComponents.keys();
for (iCount = 0; iCount < htIEComponents.size(); iCount = iCount + 1) {
strVersion = activeXDetect(strKey[iCount]);
strName = htIEComponents.get(strKey[iCount]);
if (strVersion) {
if (bolFirst === true) {
strTemp = strName + glbPair + strVersion;
bolFirst = false;
} else {
strTemp += glbSep + strName + glbPair + strVersion;
}
}
}
strTemp = strTemp.replace(/,/g, ".");
}
if (strTemp === "") {
strTemp = "None";
}
strOut = strTemp;
return strOut;
} catch (err) {
return glbOnError;
}
}
/*
geolocation
returns the latitude and longitude
*/
getGeoLocation = function(){
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(getGeoPosition,getGeoError);
}
else{
return "error";
}
}
function getGeoPosition(position) {
return "Latitude: " + position.coords.latitude + ";Longitude: " + position.coords.longitude;
}
function getGeoError(){
return "error";
}
getStorage = function(){
return "sessionstorage:" + hasSessionStorage() + ";" + "localstorage:" + hasLocalStorage();
}
hasSessionStorage: function () {
try {
return !!window.sessionStorage;
} catch(e) {
return true; // SecurityError when referencing it means it exists
}
}
// https://bugzilla.mozilla.org/show_bug.cgi?id=781447
hasLocalStorage: function () {
try {
return !!window.localStorage;
} catch(e) {
return true; // SecurityError when referencing it means it exists
}
}
*** Digital Fingerprint using JavaScript
o. Connection
Below attributes are collected from server.
a. accept-language
b. content encoding
c. content languate
d. IP Address
e. Cookie
*/
/* Utils - start */
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;
if (this.length == 0) return hash;
for (i = 0, len = this.length; i < len; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
};
strSep = "|";
strPair = ":"
strOnError = "Error";
/* Utils - end */
/* DFP - Start */
getDfp=function(){
strDFP="US:"+getUA() + strSep + "Language:"+ getLaunguage() + strSep + "Display:"+ getDisplay() + "Canvas:" + getCanvas() + strSep + "Fonts:" + getFonts() + strSep + "Timezone:" + getTimezone() + strSep + "Touch:" + getTouch() + strSep + "BrowserDetails:" + getBrowserDetails() + strSep + "WebGL:" + getWebGlSupport() + strSep + "Pulgins:" + getPlugins() + strSep + "Geolocation:" + getGeoLocation();
}
/*
UserAgent
Passed as part of HTTP Request - so no need to take this and pass it separately. Get this from server.
Send a hash value of the user agent from browser and compare this hash at the server end to be sure that the data is not manipulated.
*/
getUA = function(){
strUserAgent = navigator.userAgent.toLowerCase();
alert(strUserAgent);
alert(strUserAgent.hashCode());
return strUserAgent.hashCode();
}
/*
Language - default, browser, system, user languages
*/
getLaunguage=function(){
strLang = "";
strTypeLng = typeof (navigator.language);
strTypeBrLng = typeof (navigator.browserLanguage);
strTypeSysLng = typeof (navigator.systemLanguage);
strTypeUsrLng = typeof (navigator.userLanguage);
if (strTypeLng !== "undefined") {
strLang = "lang" + strPair + navigator.language + strSep;
}
if (strTypeBrLng !== "undefined") {
strLang = "lang" + strPair + navigator.browserLanguage + strSep;
}
if (strTypeSysLng !== "undefined") {
strLang += "syslang" + strPair + navigator.systemLanguage + strSep;
}
if (strTypeUsrLng !== "undefined") {
strLang += "userlang" + strPair + navigator.userLanguage;
}
alert(strLang);
return(strLang);
}
/* Display: Color Depth, Resolution
Numeric values of the color depth of the screen, the width and height of the screen, and the available width and height of the screen.
*/
getDisplay=function() {
strScreen = null;
strDisplay = null;
try {
strScreen = window.screen;
if (strScreen) {
strDisplay = strScreen.colorDepth + strSep + strScreen.width + strSep + strScreen.height + strSep + strScreen.availWidth + strSep + strScreen.availHeight;
}
return strDisplay;
} catch (err) {
return "error";
}
}
/* Canvas - browser rendering engine, the graphics driver and GPU
Only works with browsers supporting the canvas element. This will not work with Android Browser 2.x and earlier, Internet Explorer 8.0 and earlier, or Opera Mini 7.0 and earlier.
Returns: A base 64 encoded fingerprint. It is recommended to hash the output prior to using due to length.
*/
getCanvas=function() {
"use strict";
var canvas, strCText, strText, strOut;
canvas = null;
strCText = null;
strText = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~1!2@3#4$5%6^7&8*9(0)-_=+[{]}|;:',<.>/?";
strOut = null;
try {
canvas = document.createElement('canvas');
strCText = canvas.getContext('2d');
strCText.textBaseline = "top";
strCText.font = "14px 'Arial'";
strCText.textBaseline = "alphabetic";
strCText.fillStyle = "#f60";
strCText.fillRect(125, 1, 62, 20);
strCText.fillStyle = "#069";
strCText.fillText(strText, 2, 15);
strCText.fillStyle = "rgba(102, 204, 0, 0.7)";
strCText.fillText(strText, 4, 17);
strOut = canvas.toDataURL();
return strOut;
} catch (err) {
return strOnError;
}
}
/* Fonts
Returns: Hash value of a comma delimited list of fonts installed. The fonts are picked up from a master list.
*/
getFonts=function() {
var style, fonts, count, template, fragment, divs, i, font, div, body, result, e;
style = null;
fonts = null;
font = null;
count = 0;
template = null;
divs = null;
e = null;
div = null;
body = null;
i = 0;
try {
style = "position: absolute; visibility: hidden; display: block !important";
fonts = ["Abadi MT Condensed Light", "Academy Engraved LET", "ADOBE CASLON PRO", "Adobe Garamond", "ADOBE GARAMOND PRO", "Agency FB", "Aharoni", "Albertus Extra Bold", "Albertus Medium", "Algerian", "Amazone BT", "American Typewriter", "American Typewriter Condensed", "AmerType Md BT", "Andale Mono", "Andalus", "Angsana New", "AngsanaUPC", "Antique Olive", "Aparajita", "Apple Chancery", "Apple Color Emoji", "Apple SD Gothic Neo", "Arabic Typesetting", "ARCHER", "Arial", "Arial Black", "Arial Hebrew", "Arial MT", "Arial Narrow", "Arial Rounded MT Bold", "Arial Unicode MS", "ARNO PRO", "Arrus BT", "Aurora Cn BT", "AvantGarde Bk BT", "AvantGarde Md BT", "AVENIR", "Ayuthaya", "Bandy", "Bangla Sangam MN", "Bank Gothic", "BankGothic Md BT", "Baskerville", "Baskerville Old Face", "Batang", "BatangChe", "Bauer Bodoni", "Bauhaus 93", "Bazooka", "Bell MT", "Bembo", "Benguiat Bk BT", "Berlin Sans FB", "Berlin Sans FB Demi", "Bernard MT Condensed", "BernhardFashion BT", "BernhardMod BT", "Big Caslon", "BinnerD", "Bitstream Vera Sans Mono", "Blackadder ITC", "BlairMdITC TT", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni MT", "Bodoni MT Black", "Bodoni MT Condensed", "Bodoni MT Poster Compressed", "Book Antiqua", "Bookman Old Style", "Bookshelf Symbol 7", "Boulder", "Bradley Hand", "Bradley Hand ITC", "Bremen Bd BT", "Britannic Bold", "Broadway", "Browallia New", "BrowalliaUPC", "Brush Script MT", "Calibri", "Californian FB", "Calisto MT", "Calligrapher", "Cambria", "Cambria Math", "Candara", "CaslonOpnface BT", "Castellar", "Centaur", "Century", "Century Gothic", "Century Schoolbook", "Cezanne", "CG Omega", "CG Times", "Chalkboard", "Chalkboard SE", "Chalkduster", "Charlesworth", "Charter Bd BT", "Charter BT", "Chaucer", "ChelthmITC Bk BT", "Chiller", "Clarendon", "Clarendon Condensed", "CloisterBlack BT", "Cochin", "Colonna MT", "Comic Sans", "Comic Sans MS", "Consolas", "Constantia", "Cooper Black", "Copperplate", "Copperplate Gothic", "Copperplate Gothic Bold", "Copperplate Gothic Light", "CopperplGoth Bd BT", "Corbel", "Cordia New", "CordiaUPC", "Cornerstone", "Coronet", "Courier", "Courier New", "Cuckoo", "Curlz MT", "DaunPenh", "Dauphin", "David", "DB LCD Temp", "DELICIOUS", "Denmark", "Devanagari Sangam MN", "DFKai-SB", "Didot", "DilleniaUPC", "DIN", "DokChampa", "Dotum", "DotumChe", "Ebrima", "Edwardian Script ITC", "Elephant", "English 111 Vivace BT", "Engravers MT", "EngraversGothic BT", "Eras Bold ITC", "Eras Demi ITC", "Eras Light ITC", "Eras Medium ITC", "Estrangelo Edessa", "EucrosiaUPC", "Euphemia", "Euphemia UCAS", "EUROSTILE", "Exotc350 Bd BT", "FangSong", "Felix Titling", "Fixedsys", "FONTIN", "Footlight MT Light", "Forte", "Franklin Gothic", "Franklin Gothic Book", "Franklin Gothic Demi", "Franklin Gothic Demi Cond", "Franklin Gothic Heavy", "Franklin Gothic Medium", "Franklin Gothic Medium Cond", "FrankRuehl", "Fransiscan", "Freefrm721 Blk BT", "FreesiaUPC", "Freestyle Script", "French Script MT", "FrnkGothITC Bk BT", "Fruitger", "FRUTIGER", "Futura", "Futura Bk BT", "Futura Lt BT", "Futura Md BT", "Futura ZBlk BT", "FuturaBlack BT", "Gabriola", "Galliard BT", "Garamond", "Gautami", "Geeza Pro", "Geneva", "Geometr231 BT", "Geometr231 Hv BT", "Geometr231 Lt BT", "Georgia", "GeoSlab 703 Lt BT", "GeoSlab 703 XBd BT", "Gigi", "Gill Sans", "Gill Sans MT", "Gill Sans MT Condensed", "Gill Sans MT Ext Condensed Bold", "Gill Sans Ultra Bold", "Gill Sans Ultra Bold Condensed", "Gisha", "Gloucester MT Extra Condensed", "GOTHAM", "GOTHAM BOLD", "Goudy Old Style", "Goudy Stout", "GoudyHandtooled BT", "GoudyOLSt BT", "Gujarati Sangam MN", "Gulim", "GulimChe", "Gungsuh", "GungsuhChe", "Gurmukhi MN", "Haettenschweiler", "Harlow Solid Italic", "Harrington", "Heather", "Heiti SC", "Heiti TC", "HELV", "Helvetica", "Helvetica Neue", "Herald", "High Tower Text", "Hiragino Kaku Gothic ProN", "Hiragino Mincho ProN", "Hoefler Text", "Humanst 521 Cn BT", "Humanst521 BT", "Humanst521 Lt BT", "Impact", "Imprint MT Shadow", "Incised901 Bd BT", "Incised901 BT", "Incised901 Lt BT", "INCONSOLATA", "Informal Roman", "Informal011 BT", "INTERSTATE", "IrisUPC", "Iskoola Pota", "JasmineUPC", "Jazz LET", "Jenson", "Jester", "Jokerman", "Juice ITC", "Kabel Bk BT", "Kabel Ult BT", "Kailasa", "KaiTi", "Kalinga", "Kannada Sangam MN", "Kartika", "Kaufmann Bd BT", "Kaufmann BT", "Khmer UI", "KodchiangUPC", "Kokila", "Korinna BT", "Kristen ITC", "Krungthep", "Kunstler Script", "Lao UI", "Latha", "Leelawadee", "Letter Gothic", "Levenim MT", "LilyUPC", "Lithograph", "Lithograph Light", "Long Island", "Lucida Bright", "Lucida Calligraphy", "Lucida Console", "Lucida Fax", "LUCIDA GRANDE", "Lucida Handwriting", "Lucida Sans", "Lucida Sans Typewriter", "Lucida Sans Unicode", "Lydian BT", "Magneto", "Maiandra GD", "Malayalam Sangam MN", "Malgun Gothic", "Mangal", "Marigold", "Marion", "Marker Felt", "Market", "Marlett", "Matisse ITC", "Matura MT Script Capitals", "Meiryo", "Meiryo UI", "Microsoft Himalaya", "Microsoft JhengHei", "Microsoft New Tai Lue", "Microsoft PhagsPa", "Microsoft Sans Serif", "Microsoft Tai Le", "Microsoft Uighur", "Microsoft YaHei", "Microsoft Yi Baiti", "MingLiU", "MingLiU_HKSCS", "MingLiU_HKSCS-ExtB", "MingLiU-ExtB", "Minion", "Minion Pro", "Miriam", "Miriam Fixed", "Mistral", "Modern", "Modern No. 20", "Mona Lisa Solid ITC TT", "Monaco", "Mongolian Baiti", "MONO", "Monotype Corsiva", "MoolBoran", "Mrs Eaves", "MS Gothic", "MS LineDraw", "MS Mincho", "MS Outlook", "MS PGothic", "MS PMincho", "MS Reference Sans Serif", "MS Reference Specialty", "MS Sans Serif", "MS Serif", "MS UI Gothic", "MT Extra", "MUSEO", "MV Boli", "MYRIAD", "MYRIAD PRO", "Nadeem", "Narkisim", "NEVIS", "News Gothic", "News GothicMT", "NewsGoth BT", "Niagara Engraved", "Niagara Solid", "Noteworthy", "NSimSun", "Nyala", "OCR A Extended", "Old Century", "Old English Text MT", "Onyx", "Onyx BT", "OPTIMA", "Oriya Sangam MN", "OSAKA", "OzHandicraft BT", "Palace Script MT", "Palatino", "Palatino Linotype", "Papyrus", "Parchment", "Party LET", "Pegasus", "Perpetua", "Perpetua Titling MT", "PetitaBold", "Pickwick", "Plantagenet Cherokee", "Playbill", "PMingLiU", "PMingLiU-ExtB", "Poor Richard", "Poster", "PosterBodoni BT", "PRINCETOWN LET", "Pristina", "PTBarnum BT", "Pythagoras", "Raavi", "Rage Italic", "Ravie", "Ribbon131 Bd BT", "Rockwell", "Rockwell Condensed", "Rockwell Extra Bold", "Rod", "Roman", "Sakkal Majalla", "Santa Fe LET", "Savoye LET", "Sceptre", "Script", "Script MT Bold", "SCRIPTINA", "Segoe Print", "Segoe Script", "Segoe UI", "Segoe UI Light", "Segoe UI Semibold", "Segoe UI Symbol", "Serifa", "Serifa BT", "Serifa Th BT", "ShelleyVolante BT", "Sherwood", "Shonar Bangla", "Showcard Gothic", "Shruti", "Signboard", "SILKSCREEN", "SimHei", "Simplified Arabic", "Simplified Arabic Fixed", "SimSun", "SimSun-ExtB", "Sinhala Sangam MN", "Sketch Rockwell", "Skia", "Small Fonts", "Snap ITC", "Snell Roundhand", "Socket", "Souvenir Lt BT", "Staccato222 BT", "Steamer", "Stencil", "Storybook", "Styllo", "Subway", "Swis721 BlkEx BT", "Swiss911 XCm BT", "Sylfaen", "Synchro LET", "System", "Tahoma", "Tamil Sangam MN", "Technical", "Teletype", "Telugu Sangam MN", "Tempus Sans ITC", "Terminal", "Thonburi", "Times", "Times New Roman", "Times New Roman PS", "Traditional Arabic", "Trajan", "TRAJAN PRO", "Trebuchet MS", "Tristan", "Tubular", "Tunga", "Tw Cen MT", "Tw Cen MT Condensed", "Tw Cen MT Condensed Extra Bold", "TypoUpright BT", "Unicorn", "Univers", "Univers CE 55 Medium", "Univers Condensed", "Utsaah", "Vagabond", "Vani", "Verdana", "Vijaya", "Viner Hand ITC", "VisualUI", "Vivaldi", "Vladimir Script", "Vrinda", "Westminster", "WHITNEY", "Wide Latin", "Wingdings", "Wingdings 2", "Wingdings 3", "ZapfEllipt BT", "ZapfHumnst BT", "ZapfHumnst Dm BT", "Zapfino", "Zurich BlkEx BT", "Zurich Ex BT", "ZWAdobeF"];
count = fonts.length;
template = '<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',sans-serif !important">ww</b>' + '<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',monospace !important">ww</b>';
fragment = document.createDocumentFragment();
divs = [];
for (i = 0; i < count; i = i + 1) {
font = fonts[i];
div = document.createElement('div');
font = font.replace(/['"<>]/g, '');
div.innerHTML = template.replace(/X/g, font);
div.style.cssText = style;
fragment.appendChild(div);
divs.push(div);
}
body = document.body;
body.insertBefore(fragment, body.firstChild);
result = [];
for (i = 0; i < count; i = i + 1) {
e = divs[i].getElementsByTagName('b');
if (e[0].offsetWidth === e[1].offsetWidth) {
result.push(fonts[i]);
}
}
// do not combine these two loops, remove child will cause reflow
// and induce severe performance hit
for (i = 0; i < count; i = i + 1) {
body.removeChild(divs[i]);
}
return result.hashCode();
} catch (err) {
return strOnError;
}
}
/*
Timezone on the client's device.
*/
getTimezone=function() {
"use strict";
var strOnError, dtDate, numOffset, numGMTHours, numOut;
strOnError = "Error";
dtDate = null;
numOffset = null;
numGMTHours = null;
numOut = null;
try {
dtDate = new Date();
numOffset = dtDate.getTimezoneOffset();
numGMTHours = (numOffset / 60) * (-1);
numOut = numGMTHours;
return numOut;
} catch (err) {
return strOnError;
}
}
/* Touch support */
getTouch=function() {
"use strict";
var bolTouchEnabled, bolOut;
bolTouchEnabled = false;
bolOut = null;
try {
if (document.createEvent("TouchEvent")) {
bolTouchEnabled = true;
}
bolOut = bolTouchEnabled;
return bolOut;
} catch (ignore) {
bolOut = bolTouchEnabled
return bolOut;
}
}
getTouchSupport: function () {
var maxTouchPoints = 0;
var touchEvent = false;
if(typeof navigator.maxTouchPoints !== "undefined") {
maxTouchPoints = navigator.maxTouchPoints;
} else if (typeof navigator.msMaxTouchPoints !== "undefined") {
maxTouchPoints = navigator.msMaxTouchPoints;
}
try {
document.createEvent("TouchEvent");
touchEvent = true;
} catch(_) { /* squelch */ }
return [maxTouchPoints, touchEvent, touchStart];
},
/* True Browser */
getBrowserDetails=function(){
strBrowserDetails = "truebrowser:" + navigator.vendor + ";" + navigator.appName + ";" + navigator.appCodeName + ";" + navigator.product + ";" + navigator.platform + ";" + navigator.navigatorCpuClass;
return strBrowserDetails;
}
/* Web GL */
getWebGlSupport: function() {
/*
WebGL Vendor "Google Inc."
WebGL Renderer "ANGLE (Intel(R) HD Graphics 3000 Direct3D11 vs_4_1 ps_4_1)"
*/
// code taken from Modernizr
if (!this.isCanvasSupported())
var elem = document.createElement("canvas");
if(!(elem.getContext && elem.getContext("2d"))){
return false;
}
var canvas = document.createElement("canvas"),
glContext;
try {
glContext = canvas.getContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl"));
} catch(e) {
glContext = false;
}
return ("webgl:" + !!window.WebGLRenderingContext && !!glContext);
}
/* Plugins */
getPlugins=function () {
"use strict";
var htIEComponents, strKey, strName, strVersion, strTemp, bolFirst, iCount, strMimeType, strOut;
try {
/* Create hashtable of IE components */
htIEComponents = new Hashtable();
htIEComponents.put('7790769C-0471-11D2-AF11-00C04FA35D02', 'AddressBook'); // Address Book
htIEComponents.put('47F67D00-9E55-11D1-BAEF-00C04FC2D130', 'AolArtFormat'); // AOL ART Image Format Support
htIEComponents.put('76C19B38-F0C8-11CF-87CC-0020AFEECF20', 'ArabicDS'); // Arabic Text Display Support
htIEComponents.put('76C19B34-F0C8-11CF-87CC-0020AFEECF20', 'ChineseSDS'); // Chinese (Simplified) Text Display Support
htIEComponents.put('76C19B33-F0C8-11CF-87CC-0020AFEECF20', 'ChineseTDS'); // Chinese (traditional) Text Display Support
htIEComponents.put('238F6F83-B8B4-11CF-8771-00A024541EE3', 'CitrixICA'); // Citrix ICA Client
htIEComponents.put('283807B5-2C60-11D0-A31D-00AA00B92C03', 'DirectAnim'); // DirectAnimation
htIEComponents.put('44BBA848-CC51-11CF-AAFA-00AA00B6015C', 'DirectShow'); // DirectShow
htIEComponents.put('9381D8F2-0288-11D0-9501-00AA00B911A5', 'DynHTML'); // Dynamic HTML Data Binding
htIEComponents.put('4F216970-C90C-11D1-B5C7-0000F8051515', 'DynHTML4Java'); // Dynamic HTML Data Binding for Java
htIEComponents.put('D27CDB6E-AE6D-11CF-96B8-444553540000', 'Flash'); // Macromedia Flash
htIEComponents.put('76C19B36-F0C8-11CF-87CC-0020AFEECF20', 'HebrewDS'); // Hebrew Text Display Support
htIEComponents.put('630B1DA0-B465-11D1-9948-00C04F98BBC9', 'IEBrwEnh'); // Internet Explorer Browsing Enhancements
htIEComponents.put('08B0E5C0-4FCB-11CF-AAA5-00401C608555', 'IEClass4Java'); // Internet Explorer Classes for Java
htIEComponents.put('45EA75A0-A269-11D1-B5BF-0000F8051515', 'IEHelp'); // Internet Explorer Help
htIEComponents.put('DE5AED00-A4BF-11D1-9948-00C04F98BBC9', 'IEHelpEng'); // Internet Explorer Help Engine
htIEComponents.put('89820200-ECBD-11CF-8B85-00AA005B4383', 'IE5WebBrw'); // Internet Explorer 5/6 Web Browser
htIEComponents.put('5A8D6EE0-3E18-11D0-821E-444553540000', 'InetConnectionWiz'); // Internet Connection Wizard
htIEComponents.put('76C19B30-F0C8-11CF-87CC-0020AFEECF20', 'JapaneseDS'); // Japanese Text Display Support
htIEComponents.put('76C19B31-F0C8-11CF-87CC-0020AFEECF20', 'KoreanDS'); // Korean Text Display Support
htIEComponents.put('76C19B50-F0C8-11CF-87CC-0020AFEECF20', 'LanguageAS'); // Language Auto-Selection
htIEComponents.put('08B0E5C0-4FCB-11CF-AAA5-00401C608500', 'MsftVM'); // Microsoft virtual machine
htIEComponents.put('5945C046-LE7D-LLDL-BC44-00C04FD912BE', 'MSNMessengerSrv'); // MSN Messenger Service
htIEComponents.put('44BBA842-CC51-11CF-AAFA-00AA00B6015B', 'NetMeetingNT'); // NetMeeting NT
htIEComponents.put('3AF36230-A269-11D1-B5BF-0000F8051515', 'OfflineBrwPack'); // Offline Browsing Pack
htIEComponents.put('44BBA840-CC51-11CF-AAFA-00AA00B6015C', 'OutlookExpress'); // Outlook Express
htIEComponents.put('76C19B32-F0C8-11CF-87CC-0020AFEECF20', 'PanEuropeanDS'); // Pan-European Text Display Support
htIEComponents.put('4063BE15-3B08-470D-A0D5-B37161CFFD69', 'QuickTime'); // Apple Quick Time
htIEComponents.put('DE4AF3B0-F4D4-11D3-B41A-0050DA2E6C21', 'QuickTimeCheck'); // Apple Quick Time Check
htIEComponents.put('3049C3E9-B461-4BC5-8870-4C09146192CA', 'RealPlayer'); // RealPlayer Download and Record Plugin for IE
htIEComponents.put('2A202491-F00D-11CF-87CC-0020AFEECF20', 'ShockwaveDir'); // Macromedia Shockwave Director
htIEComponents.put('3E01D8E0-A72B-4C9F-99BD-8A6E7B97A48D', 'Skype'); // Skype
htIEComponents.put('CC2A9BA0-3BDD-11D0-821E-444553540000', 'TaskScheduler'); // Task Scheduler
htIEComponents.put('76C19B35-F0C8-11CF-87CC-0020AFEECF20', 'ThaiDS'); // Thai Text Display Support
htIEComponents.put('3BF42070-B3B1-11D1-B5C5-0000F8051515', 'Uniscribe'); // Uniscribe
htIEComponents.put('4F645220-306D-11D2-995D-00C04F98BBC9', 'VBScripting'); // Visual Basic Scripting Support v5.6
htIEComponents.put('76C19B37-F0C8-11CF-87CC-0020AFEECF20', 'VietnameseDS'); // Vietnamese Text Display Support
htIEComponents.put('10072CEC-8CC1-11D1-986E-00A0C955B42F', 'VML'); // Vector Graphics Rendering (VML)
htIEComponents.put('90E2BA2E-DD1B-4CDE-9134-7A8B86D33CA7', 'WebEx'); // WebEx Productivity Tools
htIEComponents.put('73FA19D0-2D75-11D2-995D-00C04F98BBC9', 'WebFolders'); // Web Folders
htIEComponents.put('89820200-ECBD-11CF-8B85-00AA005B4340', 'WinDesktopUpdateNT'); // Windows Desktop Update NT
htIEComponents.put('9030D464-4C02-4ABF-8ECC-5164760863C6', 'WinLive'); // Windows Live ID Sign-in Helper
htIEComponents.put('6BF52A52-394A-11D3-B153-00C04F79FAA6', 'WinMediaPlayer'); // Windows Media Player (Versions 7, 8 or 9)
htIEComponents.put('22D6F312-B0F6-11D0-94AB-0080C74C7E95', 'WinMediaPlayerTrad'); // Windows Media Player (Traditional Versions)
strTemp = "";
bolFirst = true;
if (navigator.plugins.length > 0) {
for (iCount = 0; iCount < navigator.plugins.length; iCount = iCount + 1) {
if (bolFirst === true) {
strTemp += navigator.plugins[iCount].name;
bolFirst = false;
} else {
strTemp += glbSep + navigator.plugins[iCount].name;
}
}
} else if (navigator.mimeTypes.length > 0) {
strMimeType = navigator.mimeTypes;
for (iCount = 0; iCount < strMimeType.length; iCount = iCount + 1) {
if (bolFirst === true) {
strTemp += strMimeType[iCount].description;
bolFirst = false;
} else {
strTemp += glbSep + strMimeType[iCount].description;
}
}
} else {
document.body.addBehavior("#default#clientCaps");
strKey = htIEComponents.keys();
for (iCount = 0; iCount < htIEComponents.size(); iCount = iCount + 1) {
strVersion = activeXDetect(strKey[iCount]);
strName = htIEComponents.get(strKey[iCount]);
if (strVersion) {
if (bolFirst === true) {
strTemp = strName + glbPair + strVersion;
bolFirst = false;
} else {
strTemp += glbSep + strName + glbPair + strVersion;
}
}
}
strTemp = strTemp.replace(/,/g, ".");
}
if (strTemp === "") {
strTemp = "None";
}
strOut = strTemp;
return strOut;
} catch (err) {
return glbOnError;
}
}
/*
geolocation
returns the latitude and longitude
*/
getGeoLocation = function(){
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(getGeoPosition,getGeoError);
}
else{
return "error";
}
}
function getGeoPosition(position) {
return "Latitude: " + position.coords.latitude + ";Longitude: " + position.coords.longitude;
}
function getGeoError(){
return "error";
}
getStorage = function(){
return "sessionstorage:" + hasSessionStorage() + ";" + "localstorage:" + hasLocalStorage();
}
hasSessionStorage: function () {
try {
return !!window.sessionStorage;
} catch(e) {
return true; // SecurityError when referencing it means it exists
}
}
// https://bugzilla.mozilla.org/show_bug.cgi?id=781447
hasLocalStorage: function () {
try {
return !!window.localStorage;
} catch(e) {
return true; // SecurityError when referencing it means it exists
}
}