diff --git a/dashboard-ui/bower_components/fingerprintjs2/.bower.json b/dashboard-ui/bower_components/fingerprintjs2/.bower.json deleted file mode 100644 index 114aad2322..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/.bower.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "fingerprintjs2", - "description": "Modern & flexible browser fingerprinting library", - "main": "dist/fingerprint2.min.js", - "moduleType": [ - "es6" - ], - "keywords": [ - "browser", - "fingerprint", - "fingerprinting", - "security", - "privacy" - ], - "authors": [ - "Valentin Vasilev" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "spec" - ], - "homepage": "https://github.com/Valve/fingerprintjs2", - "version": "1.4.1", - "_release": "1.4.1", - "_resolution": { - "type": "version", - "tag": "1.4.1", - "commit": "6320cfa19c89aca0eb39e811d101336a2812ad61" - }, - "_source": "https://github.com/Valve/fingerprintjs2.git", - "_target": "^1.4.0", - "_originalSource": "fingerprintjs2" -} \ No newline at end of file diff --git a/dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md b/dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md deleted file mode 100644 index 7b48355048..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -Contributing to FingerprintJS2 -============================== - -## Found a bug? - -Please submit an issue. -Include in the issue: - -* List of components you received in the `get` call (make sure values are not truncated) -* If FP is different every time you call the library, include 2 versions of components -* Include your OS version -* Include steps to reproduce -* Include library call code (I need all options you used when calling the library function) - -## Want to add a feature / contribute? -* Make sure the issue/suggestion does not exist by searching existing issues -* Fork the project and make the required changes in it (don't forget to add specs) -* PRs w/out specs will not be accepted -* Run `gulp` to catch stylistic errors and produce the minified version. -* Run specs by opening the `specs/spec_runner.html` or typing `npm test` (requires phantomjs for console running). -* Make a PR. -* Make sure you only make one commit per feature you want to add -* Make sure your commit message is descriptive and tells what you changed (`Updated the library` - that's a bad commit message) - -If your code changes the list of fingerprinting sources, please update -the README. - -If you're unsure about the feature you want to add, submit an issue with -a `question` tag. - -## Want to ask? -* Please read FAQ first -* If you have not found the answer you were looking for - use gitter.im to ask your question (link is in the readme) - -Happy Coding! diff --git a/dashboard-ui/bower_components/fingerprintjs2/FAQ.md b/dashboard-ui/bower_components/fingerprintjs2/FAQ.md deleted file mode 100644 index 6cfa3281e4..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/FAQ.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Can I use this library to uniquely identify users? -##### No, you cannot. This library is built to be able to associate string identifiers with devices. Since there are a lot of identical devices, you will get a lot of identical identifiers. - -#### OK, I get it, I cannot _uniquely_ identify users, but can I identify users at all? -##### No, you cannot. This library is strictly for non-deterministic device identification. - - -#### How good is your library? Can you guarantee that different devices will have different identifiers? -##### This library is not good. It has an error margin of 10-20% - -#### Can you improve the library to be 100% accurate for device identification? -##### I don't think it is possible now and don't think it will be possible in the future. - -#### Can you improve the library to be more accurate (since you cannot make it 100% accurate)? -##### I can, but it takes a lot of time. I need a lot of devices, enviroments and more importantly - time. Since this is my hobby project, I spend very little time on it. - -#### How can I build a complete identification solution? -##### You should either use commercial services, such as https://augur.io, or develop such service yourself. If you don't know how to do it, please use StackOverflow. diff --git a/dashboard-ui/bower_components/fingerprintjs2/bower.json b/dashboard-ui/bower_components/fingerprintjs2/bower.json deleted file mode 100644 index 785147ee49..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/bower.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "fingerprintjs2", - "description": "Modern & flexible browser fingerprinting library", - "main": "dist/fingerprint2.min.js", - "moduleType": [ - "es6" - ], - "keywords": [ - "browser", - "fingerprint", - "fingerprinting", - "security", - "privacy" - ], - "authors": [ - "Valentin Vasilev" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "spec" - ] -} diff --git a/dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js b/dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js deleted file mode 100644 index 02965f6007..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/dist/fingerprint2.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t,i){"use strict";"undefined"!=typeof module&&module.exports?module.exports=i():"function"==typeof define&&define.amd?define(i):t[e]=i()}("Fingerprint2",this,function(){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var i;if(null==this)throw new TypeError("'this' is null or undefined");var a=Object(this),r=a.length>>>0;if(0===r)return-1;var n=+t||0;if(Math.abs(n)===1/0&&(n=0),n>=r)return-1;for(i=Math.max(n>=0?n:r-Math.abs(n),0);r>i;){if(i in a&&a[i]===e)return i;i++}return-1});var e=function(e){var t={swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[]};this.options=this.extend(e,t),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return e.prototype={extend:function(e,t){if(null==e)return t;for(var i in e)null!=e[i]&&t[i]!==e[i]&&(t[i]=e[i]);return t},log:function(e){window.console&&console.log(e)},get:function(e){var t=[];t=this.userAgentKey(t),t=this.languageKey(t),t=this.colorDepthKey(t),t=this.pixelRatioKey(t),t=this.screenResolutionKey(t),t=this.availableScreenResolutionKey(t),t=this.timezoneOffsetKey(t),t=this.sessionStorageKey(t),t=this.localStorageKey(t),t=this.indexedDbKey(t),t=this.addBehaviorKey(t),t=this.openDatabaseKey(t),t=this.cpuClassKey(t),t=this.platformKey(t),t=this.doNotTrackKey(t),t=this.pluginsKey(t),t=this.canvasKey(t),t=this.webglKey(t),t=this.adBlockKey(t),t=this.hasLiedLanguagesKey(t),t=this.hasLiedResolutionKey(t),t=this.hasLiedOsKey(t),t=this.hasLiedBrowserKey(t),t=this.touchSupportKey(t);var i=this;this.fontsKey(t,function(t){var a=[];i.each(t,function(e){var t=e.value;"undefined"!=typeof e.value.join&&(t=e.value.join(";")),a.push(t)});var r=i.x64hash128(a.join("~~~"),31);return e(r,t)})},userAgentKey:function(e){return this.options.excludeUserAgent||e.push({key:"user_agent",value:this.getUserAgent()}),e},getUserAgent:function(){return navigator.userAgent},languageKey:function(e){return this.options.excludeLanguage||e.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),e},colorDepthKey:function(e){return this.options.excludeColorDepth||e.push({key:"color_depth",value:screen.colorDepth}),e},pixelRatioKey:function(e){return this.options.excludePixelRatio||e.push({key:"pixel_ratio",value:this.getPixelRatio()}),e},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(e){return this.options.excludeScreenResolution?e:this.getScreenResolution(e)},getScreenResolution:function(e){var t;return t=this.options.detectScreenOrientation&&screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height],"undefined"!=typeof t&&e.push({key:"resolution",value:t}),e},availableScreenResolutionKey:function(e){return this.options.excludeAvailableScreenResolution?e:this.getAvailableScreenResolution(e)},getAvailableScreenResolution:function(e){var t;return screen.availWidth&&screen.availHeight&&(t=this.options.detectScreenOrientation?screen.availHeight>screen.availWidth?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight]:[screen.availHeight,screen.availWidth]),"undefined"!=typeof t&&e.push({key:"available_resolution",value:t}),e},timezoneOffsetKey:function(e){return this.options.excludeTimezoneOffset||e.push({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),e},sessionStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&e.push({key:"session_storage",value:1}),e},localStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&e.push({key:"local_storage",value:1}),e},indexedDbKey:function(e){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&e.push({key:"indexed_db",value:1}),e},addBehaviorKey:function(e){return document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior&&e.push({key:"add_behavior",value:1}),e},openDatabaseKey:function(e){return!this.options.excludeOpenDatabase&&window.openDatabase&&e.push({key:"open_database",value:1}),e},cpuClassKey:function(e){return this.options.excludeCpuClass||e.push({key:"cpu_class",value:this.getNavigatorCpuClass()}),e},platformKey:function(e){return this.options.excludePlatform||e.push({key:"navigator_platform",value:this.getNavigatorPlatform()}),e},doNotTrackKey:function(e){return this.options.excludeDoNotTrack||e.push({key:"do_not_track",value:this.getDoNotTrack()}),e},canvasKey:function(e){return!this.options.excludeCanvas&&this.isCanvasSupported()&&e.push({key:"canvas",value:this.getCanvasFp()}),e},webglKey:function(e){return this.options.excludeWebGL?e:this.isWebGlSupported()?(e.push({key:"webgl",value:this.getWebglFp()}),e):e},adBlockKey:function(e){return this.options.excludeAdBlock||e.push({key:"adblock",value:this.getAdBlock()}),e},hasLiedLanguagesKey:function(e){return this.options.excludeHasLiedLanguages||e.push({key:"has_lied_languages",value:this.getHasLiedLanguages()}),e},hasLiedResolutionKey:function(e){return this.options.excludeHasLiedResolution||e.push({key:"has_lied_resolution",value:this.getHasLiedResolution()}),e},hasLiedOsKey:function(e){return this.options.excludeHasLiedOs||e.push({key:"has_lied_os",value:this.getHasLiedOs()}),e},hasLiedBrowserKey:function(e){return this.options.excludeHasLiedBrowser||e.push({key:"has_lied_browser",value:this.getHasLiedBrowser()}),e},fontsKey:function(e,t){return this.options.excludeJsFonts?this.flashFontsKey(e,t):this.jsFontsKey(e,t)},flashFontsKey:function(e,t){return this.options.excludeFlashFonts?t(e):this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()?"undefined"==typeof this.options.swfPath?t(e):void this.loadSwfAndDetectFonts(function(i){e.push({key:"swf_fonts",value:i.join(";")}),t(e)}):t(e)},jsFontsKey:function(e,t){var i=this;return setTimeout(function(){var a=["monospace","sans-serif","serif"],r=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],n=["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","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","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","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","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","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","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","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","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","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","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","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","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","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 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","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","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","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","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","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","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","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"];i.options.extendedJsFonts&&(r=r.concat(n)),r=r.concat(i.options.userDefinedFonts);var o="mmmmmmmmmmlli",s="72px",l=document.getElementsByTagName("body")[0],h=document.createElement("div"),u=document.createElement("div"),d={},c={},g=function(){var e=document.createElement("span");return e.style.position="absolute",e.style.left="-9999px",e.style.fontSize=s,e.innerHTML=o,e},p=function(e,t){var i=g();return i.style.fontFamily="'"+e+"',"+t,i},f=function(){for(var e=[],t=0,i=a.length;i>t;t++){var r=g();r.style.fontFamily=a[t],h.appendChild(r),e.push(r)}return e},m=function(){for(var e={},t=0,i=r.length;i>t;t++){for(var n=[],o=0,s=a.length;s>o;o++){var l=p(r[t],a[o]);u.appendChild(l),n.push(l)}e[r[t]]=n}return e},S=function(e){for(var t=!1,i=0;ix;x++)d[a[x]]=T[x].offsetWidth,c[a[x]]=T[x].offsetHeight;var M=m();l.appendChild(u);for(var A=[],E=0,y=r.length;y>E;E++)S(M[r[E]])&&A.push(r[E]);l.removeChild(u),l.removeChild(h),e.push({key:"js_fonts",value:A}),t(e)},1)},pluginsKey:function(e){return this.options.excludePlugins||(this.isIE()?this.options.excludeIEPlugins||e.push({key:"ie_plugins",value:this.getIEPlugins()}):e.push({key:"regular_plugins",value:this.getRegularPlugins()})),e},getRegularPlugins:function(){for(var e=[],t=0,i=navigator.plugins.length;i>t;t++)e.push(navigator.plugins[t]);return this.pluginsShouldBeSorted()&&(e=e.sort(function(e,t){return e.name>t.name?1:e.namet;t++){var a=this.options.sortPluginsFor[t];if(navigator.userAgent.match(a)){e=!0;break}}return e},touchSupportKey:function(e){return this.options.excludeTouchSupport||e.push({key:"touch_support",value:this.getTouchSupport()}),e},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasIndexedDB:function(){return!!window.indexedDB},getNavigatorCpuClass:function(){return navigator.cpuClass?navigator.cpuClass:"unknown"},getNavigatorPlatform:function(){return navigator.platform?navigator.platform:"unknown"},getDoNotTrack:function(){return navigator.doNotTrack?navigator.doNotTrack:"unknown"},getTouchSupport:function(){var e=0,t=!1;"undefined"!=typeof navigator.maxTouchPoints?e=navigator.maxTouchPoints:"undefined"!=typeof navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(i){}var a="ontouchstart"in window;return[e,t,a]},getCanvasFp:function(){var e=[],t=document.createElement("canvas");t.width=2e3,t.height=200,t.style.display="inline";var i=t.getContext("2d");return i.rect(0,0,10,10),i.rect(2,2,6,6),e.push("canvas winding:"+(i.isPointInPath(5,5,"evenodd")===!1?"yes":"no")),i.textBaseline="alphabetic",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",this.options.dontUseFakeFontInCanvas?i.font="11pt Arial":i.font="11pt no-real-font-123",i.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),i.fillStyle="rgba(102, 204, 0, 0.2)",i.font="18pt Arial",i.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),i.globalCompositeOperation="multiply",i.fillStyle="rgb(255,0,255)",i.beginPath(),i.arc(50,50,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(0,255,255)",i.beginPath(),i.arc(100,50,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(255,255,0)",i.beginPath(),i.arc(75,100,50,0,2*Math.PI,!0),i.closePath(),i.fill(),i.fillStyle="rgb(255,0,255)",i.arc(75,75,75,0,2*Math.PI,!0),i.arc(75,75,25,0,2*Math.PI,!0),i.fill("evenodd"),e.push("canvas fp:"+t.toDataURL()),e.join("~")},getWebglFp:function(){var e,t=function(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"},i=function(e){var t,i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");return i?(t=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT),0===t&&(t=2),t):null};if(e=this.getWebglCanvas(),!e)return null;var a=[],r="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",n="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o);var s=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW),o.itemSize=3,o.numItems=3;var l=e.createProgram(),h=e.createShader(e.VERTEX_SHADER);e.shaderSource(h,r),e.compileShader(h);var u=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(u,n),e.compileShader(u),e.attachShader(l,h),e.attachShader(l,u),e.linkProgram(l),e.useProgram(l),l.vertexPosAttrib=e.getAttribLocation(l,"attrVertex"),l.offsetUniform=e.getUniformLocation(l,"uniformOffset"),e.enableVertexAttribArray(l.vertexPosArray),e.vertexAttribPointer(l.vertexPosAttrib,o.itemSize,e.FLOAT,!1,0,0),e.uniform2f(l.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,o.numItems),null!=e.canvas&&a.push(e.canvas.toDataURL()),a.push("extensions:"+e.getSupportedExtensions().join(";")),a.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),a.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),a.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),a.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),a.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),a.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),a.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),a.push("webgl max anisotropy:"+i(e)),a.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),a.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),a.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),a.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),a.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),a.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),a.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),a.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),a.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),a.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),a.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),a.push("webgl red bits:"+e.getParameter(e.RED_BITS)),a.push("webgl renderer:"+e.getParameter(e.RENDERER)),a.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),a.push("webgl vendor:"+e.getParameter(e.VENDOR)),a.push("webgl version:"+e.getParameter(e.VERSION)),e.getShaderPrecisionFormat?(a.push("webgl vertex shader high float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision),a.push("webgl vertex shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMin),a.push("webgl vertex shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMax),a.push("webgl vertex shader medium float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision),a.push("webgl vertex shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMin),a.push("webgl vertex shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMax),a.push("webgl vertex shader low float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).precision),a.push("webgl vertex shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMin),a.push("webgl vertex shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMax),a.push("webgl fragment shader high float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision),a.push("webgl fragment shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMin),a.push("webgl fragment shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMax),a.push("webgl fragment shader medium float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision),a.push("webgl fragment shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMin),a.push("webgl fragment shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMax),a.push("webgl fragment shader low float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).precision),a.push("webgl fragment shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMin),a.push("webgl fragment shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMax),a.push("webgl vertex shader high int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).precision),a.push("webgl vertex shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMin),a.push("webgl vertex shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMax),a.push("webgl vertex shader medium int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).precision),a.push("webgl vertex shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMin),a.push("webgl vertex shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMax),a.push("webgl vertex shader low int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).precision),a.push("webgl vertex shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMin),a.push("webgl vertex shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMax),a.push("webgl fragment shader high int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).precision),a.push("webgl fragment shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMin),a.push("webgl fragment shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMax),a.push("webgl fragment shader medium int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).precision),a.push("webgl fragment shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMin),a.push("webgl fragment shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMax),a.push("webgl fragment shader low int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).precision),a.push("webgl fragment shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMin),a.push("webgl fragment shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMax),a.join("~")):a.join("~")},getAdBlock:function(){var e=document.createElement("div");e.innerHTML=" ",e.className="adsbox";var t=!1;try{document.body.appendChild(e),t=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(e)}catch(i){t=!1}return t},getHasLiedLanguages:function(){if("undefined"!=typeof navigator.languages)try{var e=navigator.languages[0].substr(0,2);if(e!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1},getHasLiedResolution:function(){return screen.width=0?"Windows Phone":t.indexOf("win")>=0?"Windows":t.indexOf("android")>=0?"Android":t.indexOf("linux")>=0?"Linux":t.indexOf("iphone")>=0||t.indexOf("ipad")>=0?"iOS":t.indexOf("mac")>=0?"Mac":"Other";var r;if(r="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,r&&"Windows Phone"!==e&&"Android"!==e&&"iOS"!==e&&"Other"!==e)return!0;if("undefined"!=typeof i){if(i=i.toLowerCase(),i.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e)return!0;if(i.indexOf("linux")>=0&&"Linux"!==e&&"Android"!==e)return!0;if(i.indexOf("mac")>=0&&"Mac"!==e&&"iOS"!==e)return!0;if(0===i.indexOf("win")&&0===i.indexOf("linux")&&i.indexOf("mac")>=0&&"other"!==e)return!0}return a.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e?!0:(a.indexOf("linux")>=0||a.indexOf("android")>=0||a.indexOf("pike")>=0)&&"Linux"!==e&&"Android"!==e?!0:(a.indexOf("mac")>=0||a.indexOf("ipad")>=0||a.indexOf("ipod")>=0||a.indexOf("iphone")>=0)&&"Mac"!==e&&"iOS"!==e?!0:0===a.indexOf("win")&&0===a.indexOf("linux")&&a.indexOf("mac")>=0&&"other"!==e?!0:"undefined"==typeof navigator.plugins&&"Windows"!==e&&"Windows Phone"!==e},getHasLiedBrowser:function(){var e,t=navigator.userAgent.toLowerCase(),i=navigator.productSub;if(e=t.indexOf("firefox")>=0?"Firefox":t.indexOf("opera")>=0||t.indexOf("opr")>=0?"Opera":t.indexOf("chrome")>=0?"Chrome":t.indexOf("safari")>=0?"Safari":t.indexOf("trident")>=0?"Internet Explorer":"Other",("Chrome"===e||"Safari"===e||"Opera"===e)&&"20030107"!==i)return!0;var a=eval.toString().length;if(37===a&&"Safari"!==e&&"Firefox"!==e&&"Other"!==e)return!0;if(39===a&&"Internet Explorer"!==e&&"Other"!==e)return!0;if(33===a&&"Chrome"!==e&&"Opera"!==e&&"Other"!==e)return!0;var r;try{throw"a"}catch(n){try{n.toSource(),r=!0}catch(o){r=!1}}return!(!r||"Firefox"===e||"Other"===e)},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var e,t=document.createElement("canvas");try{e=t.getContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(i){e=!1}return!!window.WebGLRenderingContext&&!!e},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName?!0:!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return"undefined"!=typeof window.swfobject},hasMinFlashInstalled:function(){return swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var e=document.createElement("div");e.setAttribute("id",this.options.swfContainerId),document.body.appendChild(e)},loadSwfAndDetectFonts:function(e){var t="___fp_swf_loaded";window[t]=function(t){e(t)};var i=this.options.swfContainerId;this.addFlashDivNode();var a={onReady:t},r={allowScriptAccess:"always",menu:"false"};swfobject.embedSWF(this.options.swfPath,i,"1","1","9.0.0",!1,a,r,{})},getWebglCanvas:function(){var e=document.createElement("canvas"),t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(i){}return t||(t=null),t},each:function(e,t,i){if(null!==e)if(this.nativeForEach&&e.forEach===this.nativeForEach)e.forEach(t,i);else if(e.length===+e.length){for(var a=0,r=e.length;r>a;a++)if(t.call(i,e[a],a,e)==={})return}else for(var n in e)if(e.hasOwnProperty(n)&&t.call(i,e[n],n,e)==={})return},map:function(e,t,i){var a=[];return null==e?a:this.nativeMap&&e.map===this.nativeMap?e.map(t,i):(this.each(e,function(e,r,n){a[a.length]=t.call(i,e,r,n)}),a)},x64Add:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=e[3]+t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=e[2]+t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=e[1]+t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=e[0]+t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Multiply:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=e[3]*t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=e[2]*t[3],i[1]+=i[2]>>>16,i[2]&=65535,i[2]+=e[3]*t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=e[1]*t[3],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=e[2]*t[2],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=e[3]*t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Rotl:function(e,t){return t%=64,32===t?[e[1],e[0]]:32>t?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])},x64LeftShift:function(e,t){return t%=64,0===t?e:32>t?[e[0]<>>32-t,e[1]<>>1]),e=this.x64Multiply(e,[4283543511,3981806797]),e=this.x64Xor(e,[0,e[0]>>>1]),e=this.x64Multiply(e,[3301882366,444984403]),e=this.x64Xor(e,[0,e[0]>>>1])},x64hash128:function(e,t){e=e||"",t=t||0;for(var i=e.length%16,a=e.length-i,r=[0,t],n=[0,t],o=[0,0],s=[0,0],l=[2277735313,289559509],h=[1291169091,658871167],u=0;a>u;u+=16)o=[255&e.charCodeAt(u+4)|(255&e.charCodeAt(u+5))<<8|(255&e.charCodeAt(u+6))<<16|(255&e.charCodeAt(u+7))<<24,255&e.charCodeAt(u)|(255&e.charCodeAt(u+1))<<8|(255&e.charCodeAt(u+2))<<16|(255&e.charCodeAt(u+3))<<24],s=[255&e.charCodeAt(u+12)|(255&e.charCodeAt(u+13))<<8|(255&e.charCodeAt(u+14))<<16|(255&e.charCodeAt(u+15))<<24,255&e.charCodeAt(u+8)|(255&e.charCodeAt(u+9))<<8|(255&e.charCodeAt(u+10))<<16|(255&e.charCodeAt(u+11))<<24],o=this.x64Multiply(o,l),o=this.x64Rotl(o,31),o=this.x64Multiply(o,h),r=this.x64Xor(r,o),r=this.x64Rotl(r,27),r=this.x64Add(r,n), -r=this.x64Add(this.x64Multiply(r,[0,5]),[0,1390208809]),s=this.x64Multiply(s,h),s=this.x64Rotl(s,33),s=this.x64Multiply(s,l),n=this.x64Xor(n,s),n=this.x64Rotl(n,31),n=this.x64Add(n,r),n=this.x64Add(this.x64Multiply(n,[0,5]),[0,944331445]);switch(o=[0,0],s=[0,0],i){case 15:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+14)],48));case 14:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+13)],40));case 13:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+12)],32));case 12:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+11)],24));case 11:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+10)],16));case 10:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(u+9)],8));case 9:s=this.x64Xor(s,[0,e.charCodeAt(u+8)]),s=this.x64Multiply(s,h),s=this.x64Rotl(s,33),s=this.x64Multiply(s,l),n=this.x64Xor(n,s);case 8:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+7)],56));case 7:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+6)],48));case 6:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+5)],40));case 5:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+4)],32));case 4:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+3)],24));case 3:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+2)],16));case 2:o=this.x64Xor(o,this.x64LeftShift([0,e.charCodeAt(u+1)],8));case 1:o=this.x64Xor(o,[0,e.charCodeAt(u)]),o=this.x64Multiply(o,l),o=this.x64Rotl(o,31),o=this.x64Multiply(o,h),r=this.x64Xor(r,o)}return r=this.x64Xor(r,[0,e.length]),n=this.x64Xor(n,[0,e.length]),r=this.x64Add(r,n),n=this.x64Add(n,r),r=this.x64Fmix(r),n=this.x64Fmix(n),r=this.x64Add(r,n),n=this.x64Add(n,r),("00000000"+(r[0]>>>0).toString(16)).slice(-8)+("00000000"+(r[1]>>>0).toString(16)).slice(-8)+("00000000"+(n[0]>>>0).toString(16)).slice(-8)+("00000000"+(n[1]>>>0).toString(16)).slice(-8)}},e.VERSION="1.4.1",e}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js b/dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js deleted file mode 100644 index 95d194bb1e..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/fingerprint2.js +++ /dev/null @@ -1,1291 +0,0 @@ -/* -* Fingerprintjs2 1.4.1 - Modern & flexible browser fingerprint library v2 -* https://github.com/Valve/fingerprintjs2 -* Copyright (c) 2015 Valentin Vasilyev (valentin.vasilyev@outlook.com) -* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL VALENTIN VASILYEV BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function (name, context, definition) { - "use strict"; - if (typeof module !== "undefined" && module.exports) { module.exports = definition(); } - else if (typeof define === "function" && define.amd) { define(definition); } - else { context[name] = definition(); } -})("Fingerprint2", this, function() { - "use strict"; - // This will only be polyfilled for IE8 and older - // Taken from Mozilla MDC - if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function(searchElement, fromIndex) { - var k; - if (this == null) { - throw new TypeError("'this' is null or undefined"); - } - var O = Object(this); - var len = O.length >>> 0; - if (len === 0) { - return -1; - } - var n = +fromIndex || 0; - if (Math.abs(n) === Infinity) { - n = 0; - } - if (n >= len) { - return -1; - } - k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); - while (k < len) { - if (k in O && O[k] === searchElement) { - return k; - } - k++; - } - return -1; - }; - } - var Fingerprint2 = function(options) { - var defaultOptions = { - swfContainerId: "fingerprintjs2", - swfPath: "flash/compiled/FontList.swf", - detectScreenOrientation: true, - sortPluginsFor: [/palemoon/i], - userDefinedFonts: [] - }; - this.options = this.extend(options, defaultOptions); - this.nativeForEach = Array.prototype.forEach; - this.nativeMap = Array.prototype.map; - }; - Fingerprint2.prototype = { - extend: function(source, target) { - if (source == null) { return target; } - for (var k in source) { - if(source[k] != null && target[k] !== source[k]) { - target[k] = source[k]; - } - } - return target; - }, - log: function(msg){ - if(window.console){ - console.log(msg); - } - }, - get: function(done){ - var keys = []; - keys = this.userAgentKey(keys); - keys = this.languageKey(keys); - keys = this.colorDepthKey(keys); - keys = this.pixelRatioKey(keys); - keys = this.screenResolutionKey(keys); - keys = this.availableScreenResolutionKey(keys); - keys = this.timezoneOffsetKey(keys); - keys = this.sessionStorageKey(keys); - keys = this.localStorageKey(keys); - keys = this.indexedDbKey(keys); - keys = this.addBehaviorKey(keys); - keys = this.openDatabaseKey(keys); - keys = this.cpuClassKey(keys); - keys = this.platformKey(keys); - keys = this.doNotTrackKey(keys); - keys = this.pluginsKey(keys); - keys = this.canvasKey(keys); - keys = this.webglKey(keys); - keys = this.adBlockKey(keys); - keys = this.hasLiedLanguagesKey(keys); - keys = this.hasLiedResolutionKey(keys); - keys = this.hasLiedOsKey(keys); - keys = this.hasLiedBrowserKey(keys); - keys = this.touchSupportKey(keys); - var that = this; - this.fontsKey(keys, function(newKeys){ - var values = []; - that.each(newKeys, function(pair) { - var value = pair.value; - if (typeof pair.value.join !== "undefined") { - value = pair.value.join(";"); - } - values.push(value); - }); - var murmur = that.x64hash128(values.join("~~~"), 31); - return done(murmur, newKeys); - }); - }, - userAgentKey: function(keys) { - if(!this.options.excludeUserAgent) { - keys.push({key: "user_agent", value: this.getUserAgent()}); - } - return keys; - }, - // for tests - getUserAgent: function(){ - return navigator.userAgent; - }, - languageKey: function(keys) { - if(!this.options.excludeLanguage) { - // IE 9,10 on Windows 10 does not have the `navigator.language` property any longer - keys.push({ key: "language", value: navigator.language || navigator.userLanguage || navigator.browserLanguage || navigator.systemLanguage || "" }); - } - return keys; - }, - colorDepthKey: function(keys) { - if(!this.options.excludeColorDepth) { - keys.push({key: "color_depth", value: screen.colorDepth}); - } - return keys; - }, - pixelRatioKey: function(keys) { - if(!this.options.excludePixelRatio) { - keys.push({key: "pixel_ratio", value: this.getPixelRatio()}); - } - return keys; - }, - getPixelRatio: function() { - return window.devicePixelRatio || ""; - }, - screenResolutionKey: function(keys) { - if(!this.options.excludeScreenResolution) { - return this.getScreenResolution(keys); - } - return keys; - }, - getScreenResolution: function(keys) { - var resolution; - if(this.options.detectScreenOrientation) { - resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height]; - } else { - resolution = [screen.width, screen.height]; - } - if(typeof resolution !== "undefined") { // headless browsers - keys.push({key: "resolution", value: resolution}); - } - return keys; - }, - availableScreenResolutionKey: function(keys) { - if (!this.options.excludeAvailableScreenResolution) { - return this.getAvailableScreenResolution(keys); - } - return keys; - }, - getAvailableScreenResolution: function(keys) { - var available; - if(screen.availWidth && screen.availHeight) { - if(this.options.detectScreenOrientation) { - available = (screen.availHeight > screen.availWidth) ? [screen.availHeight, screen.availWidth] : [screen.availWidth, screen.availHeight]; - } else { - available = [screen.availHeight, screen.availWidth]; - } - } - if(typeof available !== "undefined") { // headless browsers - keys.push({key: "available_resolution", value: available}); - } - return keys; - }, - timezoneOffsetKey: function(keys) { - if(!this.options.excludeTimezoneOffset) { - keys.push({key: "timezone_offset", value: new Date().getTimezoneOffset()}); - } - return keys; - }, - sessionStorageKey: function(keys) { - if(!this.options.excludeSessionStorage && this.hasSessionStorage()) { - keys.push({key: "session_storage", value: 1}); - } - return keys; - }, - localStorageKey: function(keys) { - if(!this.options.excludeSessionStorage && this.hasLocalStorage()) { - keys.push({key: "local_storage", value: 1}); - } - return keys; - }, - indexedDbKey: function(keys) { - if(!this.options.excludeIndexedDB && this.hasIndexedDB()) { - keys.push({key: "indexed_db", value: 1}); - } - return keys; - }, - addBehaviorKey: function(keys) { - //body might not be defined at this point or removed programmatically - if(document.body && !this.options.excludeAddBehavior && document.body.addBehavior) { - keys.push({key: "add_behavior", value: 1}); - } - return keys; - }, - openDatabaseKey: function(keys) { - if(!this.options.excludeOpenDatabase && window.openDatabase) { - keys.push({key: "open_database", value: 1}); - } - return keys; - }, - cpuClassKey: function(keys) { - if(!this.options.excludeCpuClass) { - keys.push({key: "cpu_class", value: this.getNavigatorCpuClass()}); - } - return keys; - }, - platformKey: function(keys) { - if(!this.options.excludePlatform) { - keys.push({key: "navigator_platform", value: this.getNavigatorPlatform()}); - } - return keys; - }, - doNotTrackKey: function(keys) { - if(!this.options.excludeDoNotTrack) { - keys.push({key: "do_not_track", value: this.getDoNotTrack()}); - } - return keys; - }, - canvasKey: function(keys) { - if(!this.options.excludeCanvas && this.isCanvasSupported()) { - keys.push({key: "canvas", value: this.getCanvasFp()}); - } - return keys; - }, - webglKey: function(keys) { - if(this.options.excludeWebGL) { - if(typeof NODEBUG === "undefined"){ - this.log("Skipping WebGL fingerprinting per excludeWebGL configuration option"); - } - return keys; - } - if(!this.isWebGlSupported()) { - if(typeof NODEBUG === "undefined"){ - this.log("Skipping WebGL fingerprinting because it is not supported in this browser"); - } - return keys; - } - keys.push({key: "webgl", value: this.getWebglFp()}); - return keys; - }, - adBlockKey: function(keys){ - if(!this.options.excludeAdBlock) { - keys.push({key: "adblock", value: this.getAdBlock()}); - } - return keys; - }, - hasLiedLanguagesKey: function(keys){ - if(!this.options.excludeHasLiedLanguages){ - keys.push({key: "has_lied_languages", value: this.getHasLiedLanguages()}); - } - return keys; - }, - hasLiedResolutionKey: function(keys){ - if(!this.options.excludeHasLiedResolution){ - keys.push({key: "has_lied_resolution", value: this.getHasLiedResolution()}); - } - return keys; - }, - hasLiedOsKey: function(keys){ - if(!this.options.excludeHasLiedOs){ - keys.push({key: "has_lied_os", value: this.getHasLiedOs()}); - } - return keys; - }, - hasLiedBrowserKey: function(keys){ - if(!this.options.excludeHasLiedBrowser){ - keys.push({key: "has_lied_browser", value: this.getHasLiedBrowser()}); - } - return keys; - }, - fontsKey: function(keys, done) { - if (this.options.excludeJsFonts) { - return this.flashFontsKey(keys, done); - } - return this.jsFontsKey(keys, done); - }, - // flash fonts (will increase fingerprinting time 20X to ~ 130-150ms) - flashFontsKey: function(keys, done) { - if(this.options.excludeFlashFonts) { - if(typeof NODEBUG === "undefined"){ - this.log("Skipping flash fonts detection per excludeFlashFonts configuration option"); - } - return done(keys); - } - // we do flash if swfobject is loaded - if(!this.hasSwfObjectLoaded()){ - if(typeof NODEBUG === "undefined"){ - this.log("Swfobject is not detected, Flash fonts enumeration is skipped"); - } - return done(keys); - } - if(!this.hasMinFlashInstalled()){ - if(typeof NODEBUG === "undefined"){ - this.log("Flash is not installed, skipping Flash fonts enumeration"); - } - return done(keys); - } - if(typeof this.options.swfPath === "undefined"){ - if(typeof NODEBUG === "undefined"){ - this.log("To use Flash fonts detection, you must pass a valid swfPath option, skipping Flash fonts enumeration"); - } - return done(keys); - } - this.loadSwfAndDetectFonts(function(fonts){ - keys.push({key: "swf_fonts", value: fonts.join(";")}); - done(keys); - }); - }, - // kudos to http://www.lalit.org/lab/javascript-css-font-detect/ - jsFontsKey: function(keys, done) { - var that = this; - // doing js fonts detection in a pseudo-async fashion - return setTimeout(function(){ - - // a font will be compared against all the three default fonts. - // and if it doesn't match all 3 then that font is not available. - var baseFonts = ["monospace", "sans-serif", "serif"]; - - var fontList = [ - "Andale Mono", "Arial", "Arial Black", "Arial Hebrew", "Arial MT", "Arial Narrow", "Arial Rounded MT Bold", "Arial Unicode MS", - "Bitstream Vera Sans Mono", "Book Antiqua", "Bookman Old Style", - "Calibri", "Cambria", "Cambria Math", "Century", "Century Gothic", "Century Schoolbook", "Comic Sans", "Comic Sans MS", "Consolas", "Courier", "Courier New", - "Garamond", "Geneva", "Georgia", - "Helvetica", "Helvetica Neue", - "Impact", - "Lucida Bright", "Lucida Calligraphy", "Lucida Console", "Lucida Fax", "LUCIDA GRANDE", "Lucida Handwriting", "Lucida Sans", "Lucida Sans Typewriter", "Lucida Sans Unicode", - "Microsoft Sans Serif", "Monaco", "Monotype Corsiva", "MS Gothic", "MS Outlook", "MS PGothic", "MS Reference Sans Serif", "MS Sans Serif", "MS Serif", "MYRIAD", "MYRIAD PRO", - "Palatino", "Palatino Linotype", - "Segoe Print", "Segoe Script", "Segoe UI", "Segoe UI Light", "Segoe UI Semibold", "Segoe UI Symbol", - "Tahoma", "Times", "Times New Roman", "Times New Roman PS", "Trebuchet MS", - "Verdana", "Wingdings", "Wingdings 2", "Wingdings 3" - ]; - var extendedFontList = [ - "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", "Andalus", "Angsana New", "AngsanaUPC", "Antique Olive", "Aparajita", "Apple Chancery", "Apple Color Emoji", "Apple SD Gothic Neo", "Arabic Typesetting", "ARCHER", - "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", - "Blackadder ITC", "BlairMdITC TT", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni MT", "Bodoni MT Black", "Bodoni MT Condensed", "Bodoni MT Poster Compressed", - "Bookshelf Symbol 7", "Boulder", "Bradley Hand", "Bradley Hand ITC", "Bremen Bd BT", "Britannic Bold", "Broadway", "Browallia New", "BrowalliaUPC", "Brush Script MT", "Californian FB", "Calisto MT", "Calligrapher", "Candara", - "CaslonOpnface BT", "Castellar", "Centaur", "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", "Constantia", "Cooper Black", "Copperplate", "Copperplate Gothic", "Copperplate Gothic Bold", - "Copperplate Gothic Light", "CopperplGoth Bd BT", "Corbel", "Cordia New", "CordiaUPC", "Cornerstone", "Coronet", "Cuckoo", "Curlz MT", "DaunPenh", "Dauphin", "David", "DB LCD Temp", "DELICIOUS", "Denmark", - "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", - "EucrosiaUPC", "Euphemia", "Euphemia UCAS", "EUROSTILE", "Exotc350 Bd BT", "FangSong", "Felix Titling", "Fixedsys", "FONTIN", "Footlight MT Light", "Forte", - "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", "Gautami", "Geeza Pro", "Geometr231 BT", "Geometr231 Hv BT", "Geometr231 Lt BT", "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", - "Herald", "High Tower Text", "Hiragino Kaku Gothic ProN", "Hiragino Mincho ProN", "Hoefler Text", "Humanst 521 Cn BT", "Humanst521 BT", "Humanst521 Lt BT", "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", - "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 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", "Mongolian Baiti", - "MONO", "MoolBoran", "Mrs Eaves", "MS LineDraw", "MS Mincho", "MS PMincho", "MS Reference Specialty", "MS UI Gothic", "MT Extra", "MUSEO", "MV Boli", - "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", "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", "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", "Tamil Sangam MN", "Technical", "Teletype", "Telugu Sangam MN", "Tempus Sans ITC", - "Terminal", "Thonburi", "Traditional Arabic", "Trajan", "TRAJAN PRO", "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", "Vijaya", "Viner Hand ITC", "VisualUI", "Vivaldi", "Vladimir Script", "Vrinda", "Westminster", "WHITNEY", "Wide Latin", - "ZapfEllipt BT", "ZapfHumnst BT", "ZapfHumnst Dm BT", "Zapfino", "Zurich BlkEx BT", "Zurich Ex BT", "ZWAdobeF"]; - - if(that.options.extendedJsFonts) { - fontList = fontList.concat(extendedFontList); - } - - fontList = fontList.concat(that.options.userDefinedFonts); - - //we use m or w because these two characters take up the maximum width. - // And we use a LLi so that the same matching fonts can get separated - var testString = "mmmmmmmmmmlli"; - - //we test using 72px font size, we may use any size. I guess larger the better. - var testSize = "72px"; - - var h = document.getElementsByTagName("body")[0]; - - // div to load spans for the base fonts - var baseFontsDiv = document.createElement("div"); - - // div to load spans for the fonts to detect - var fontsDiv = document.createElement("div"); - - var defaultWidth = {}; - var defaultHeight = {}; - - // creates a span where the fonts will be loaded - var createSpan = function() { - var s = document.createElement("span"); - /* - * We need this css as in some weird browser this - * span elements shows up for a microSec which creates a - * bad user experience - */ - s.style.position = "absolute"; - s.style.left = "-9999px"; - s.style.fontSize = testSize; - s.innerHTML = testString; - return s; - }; - - // creates a span and load the font to detect and a base font for fallback - var createSpanWithFonts = function(fontToDetect, baseFont) { - var s = createSpan(); - s.style.fontFamily = "'" + fontToDetect + "'," + baseFont; - return s; - }; - - // creates spans for the base fonts and adds them to baseFontsDiv - var initializeBaseFontsSpans = function() { - var spans = []; - for (var index = 0, length = baseFonts.length; index < length; index++) { - var s = createSpan(); - s.style.fontFamily = baseFonts[index]; - baseFontsDiv.appendChild(s); - spans.push(s); - } - return spans; - }; - - // creates spans for the fonts to detect and adds them to fontsDiv - var initializeFontsSpans = function() { - var spans = {}; - for(var i = 0, l = fontList.length; i < l; i++) { - var fontSpans = []; - for(var j = 0, numDefaultFonts = baseFonts.length; j < numDefaultFonts; j++) { - var s = createSpanWithFonts(fontList[i], baseFonts[j]); - fontsDiv.appendChild(s); - fontSpans.push(s); - } - spans[fontList[i]] = fontSpans; // Stores {fontName : [spans for that font]} - } - return spans; - }; - - // checks if a font is available - var isFontAvailable = function(fontSpans) { - var detected = false; - for(var i = 0; i < baseFonts.length; i++) { - detected = (fontSpans[i].offsetWidth !== defaultWidth[baseFonts[i]] || fontSpans[i].offsetHeight !== defaultHeight[baseFonts[i]]); - if(detected) { - return detected; - } - } - return detected; - }; - - // create spans for base fonts - var baseFontsSpans = initializeBaseFontsSpans(); - - // add the spans to the DOM - h.appendChild(baseFontsDiv); - - // get the default width for the three base fonts - for (var index = 0, length = baseFonts.length; index < length; index++) { - defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font - defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font - } - - // create spans for fonts to detect - var fontsSpans = initializeFontsSpans(); - - // add all the spans to the DOM - h.appendChild(fontsDiv); - - // check available fonts - var available = []; - for(var i = 0, l = fontList.length; i < l; i++) { - if(isFontAvailable(fontsSpans[fontList[i]])) { - available.push(fontList[i]); - } - } - - // remove spans from DOM - h.removeChild(fontsDiv); - h.removeChild(baseFontsDiv); - - keys.push({key: "js_fonts", value: available}); - done(keys); - }, 1); - }, - pluginsKey: function(keys) { - if(!this.options.excludePlugins){ - if(this.isIE()){ - if(!this.options.excludeIEPlugins) { - keys.push({key: "ie_plugins", value: this.getIEPlugins()}); - } - } else { - keys.push({key: "regular_plugins", value: this.getRegularPlugins()}); - } - } - return keys; - }, - getRegularPlugins: function () { - var plugins = []; - for(var i = 0, l = navigator.plugins.length; i < l; i++) { - plugins.push(navigator.plugins[i]); - } - // sorting plugins only for those user agents, that we know randomize the plugins - // every time we try to enumerate them - if(this.pluginsShouldBeSorted()) { - plugins = plugins.sort(function(a, b) { - if(a.name > b.name){ return 1; } - if(a.name < b.name){ return -1; } - return 0; - }); - } - return this.map(plugins, function (p) { - var mimeTypes = this.map(p, function(mt){ - return [mt.type, mt.suffixes].join("~"); - }).join(","); - return [p.name, p.description, mimeTypes].join("::"); - }, this); - }, - getIEPlugins: function () { - var result = []; - if((Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(window, "ActiveXObject")) || ("ActiveXObject" in window)) { - var names = [ - "AcroPDF.PDF", // Adobe PDF reader 7+ - "Adodb.Stream", - "AgControl.AgControl", // Silverlight - "DevalVRXCtrl.DevalVRXCtrl.1", - "MacromediaFlashPaper.MacromediaFlashPaper", - "Msxml2.DOMDocument", - "Msxml2.XMLHTTP", - "PDF.PdfCtrl", // Adobe PDF reader 6 and earlier, brrr - "QuickTime.QuickTime", // QuickTime - "QuickTimeCheckObject.QuickTimeCheck.1", - "RealPlayer", - "RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)", - "RealVideo.RealVideo(tm) ActiveX Control (32-bit)", - "Scripting.Dictionary", - "SWCtl.SWCtl", // ShockWave player - "Shell.UIHelper", - "ShockwaveFlash.ShockwaveFlash", //flash plugin - "Skype.Detection", - "TDCCtl.TDCCtl", - "WMPlayer.OCX", // Windows media player - "rmocx.RealPlayer G2 Control", - "rmocx.RealPlayer G2 Control.1" - ]; - // starting to detect plugins in IE - result = this.map(names, function(name) { - try { - new ActiveXObject(name); // eslint-disable-no-new - return name; - } catch(e) { - return null; - } - }); - } - if(navigator.plugins) { - result = result.concat(this.getRegularPlugins()); - } - return result; - }, - pluginsShouldBeSorted: function () { - var should = false; - for(var i = 0, l = this.options.sortPluginsFor.length; i < l; i++) { - var re = this.options.sortPluginsFor[i]; - if(navigator.userAgent.match(re)) { - should = true; - break; - } - } - return should; - }, - touchSupportKey: function (keys) { - if(!this.options.excludeTouchSupport){ - keys.push({key: "touch_support", value: this.getTouchSupport()}); - } - return keys; - }, - 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 - } - }, - hasIndexedDB: function (){ - return !!window.indexedDB; - }, - getNavigatorCpuClass: function () { - if(navigator.cpuClass){ - return navigator.cpuClass; - } else { - return "unknown"; - } - }, - getNavigatorPlatform: function () { - if(navigator.platform) { - return navigator.platform; - } else { - return "unknown"; - } - }, - getDoNotTrack: function () { - if(navigator.doNotTrack) { - return navigator.doNotTrack; - } else { - return "unknown"; - } - }, - // This is a crude and primitive touch screen detection. - // It's not possible to currently reliably detect the availability of a touch screen - // with a JS, without actually subscribing to a touch event. - // http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ - // https://github.com/Modernizr/Modernizr/issues/548 - // method returns an array of 3 values: - // maxTouchPoints, the success or failure of creating a TouchEvent, - // and the availability of the 'ontouchstart' property - 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 */ } - var touchStart = "ontouchstart" in window; - return [maxTouchPoints, touchEvent, touchStart]; - }, - // https://www.browserleaks.com/canvas#how-does-it-work - getCanvasFp: function() { - var result = []; - // Very simple now, need to make it more complex (geo shapes etc) - var canvas = document.createElement("canvas"); - canvas.width = 2000; - canvas.height = 200; - canvas.style.display = "inline"; - var ctx = canvas.getContext("2d"); - // detect browser support of canvas winding - // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ - // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js - ctx.rect(0, 0, 10, 10); - ctx.rect(2, 2, 6, 6); - result.push("canvas winding:" + ((ctx.isPointInPath(5, 5, "evenodd") === false) ? "yes" : "no")); - - ctx.textBaseline = "alphabetic"; - ctx.fillStyle = "#f60"; - ctx.fillRect(125, 1, 62, 20); - ctx.fillStyle = "#069"; - // https://github.com/Valve/fingerprintjs2/issues/66 - if(this.options.dontUseFakeFontInCanvas) { - ctx.font = "11pt Arial"; - } else { - ctx.font = "11pt no-real-font-123"; - } - ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 2, 15); - ctx.fillStyle = "rgba(102, 204, 0, 0.2)"; - ctx.font = "18pt Arial"; - ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 4, 45); - - // canvas blending - // http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ - // http://jsfiddle.net/NDYV8/16/ - ctx.globalCompositeOperation = "multiply"; - ctx.fillStyle = "rgb(255,0,255)"; - ctx.beginPath(); - ctx.arc(50, 50, 50, 0, Math.PI * 2, true); - ctx.closePath(); - ctx.fill(); - ctx.fillStyle = "rgb(0,255,255)"; - ctx.beginPath(); - ctx.arc(100, 50, 50, 0, Math.PI * 2, true); - ctx.closePath(); - ctx.fill(); - ctx.fillStyle = "rgb(255,255,0)"; - ctx.beginPath(); - ctx.arc(75, 100, 50, 0, Math.PI * 2, true); - ctx.closePath(); - ctx.fill(); - ctx.fillStyle = "rgb(255,0,255)"; - // canvas winding - // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ - // http://jsfiddle.net/NDYV8/19/ - ctx.arc(75, 75, 75, 0, Math.PI * 2, true); - ctx.arc(75, 75, 25, 0, Math.PI * 2, true); - ctx.fill("evenodd"); - - result.push("canvas fp:" + canvas.toDataURL()); - return result.join("~"); - }, - - getWebglFp: function() { - var gl; - var fa2s = function(fa) { - gl.clearColor(0.0, 0.0, 0.0, 1.0); - gl.enable(gl.DEPTH_TEST); - gl.depthFunc(gl.LEQUAL); - gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); - return "[" + fa[0] + ", " + fa[1] + "]"; - }; - var maxAnisotropy = function(gl) { - var anisotropy, ext = gl.getExtension("EXT_texture_filter_anisotropic") || gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic"); - return ext ? (anisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT), 0 === anisotropy && (anisotropy = 2), anisotropy) : null; - }; - gl = this.getWebglCanvas(); - if(!gl) { return null; } - // WebGL fingerprinting is a combination of techniques, found in MaxMind antifraud script & Augur fingerprinting. - // First it draws a gradient object with shaders and convers the image to the Base64 string. - // Then it enumerates all WebGL extensions & capabilities and appends them to the Base64 string, resulting in a huge WebGL string, potentially very unique on each device - // Since iOS supports webgl starting from version 8.1 and 8.1 runs on several graphics chips, the results may be different across ios devices, but we need to verify it. - var result = []; - var vShaderTemplate = "attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"; - var fShaderTemplate = "precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"; - var vertexPosBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer); - var vertices = new Float32Array([-.2, -.9, 0, .4, -.26, 0, 0, .732134444, 0]); - gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW); - vertexPosBuffer.itemSize = 3; - vertexPosBuffer.numItems = 3; - var program = gl.createProgram(), vshader = gl.createShader(gl.VERTEX_SHADER); - gl.shaderSource(vshader, vShaderTemplate); - gl.compileShader(vshader); - var fshader = gl.createShader(gl.FRAGMENT_SHADER); - gl.shaderSource(fshader, fShaderTemplate); - gl.compileShader(fshader); - gl.attachShader(program, vshader); - gl.attachShader(program, fshader); - gl.linkProgram(program); - gl.useProgram(program); - program.vertexPosAttrib = gl.getAttribLocation(program, "attrVertex"); - program.offsetUniform = gl.getUniformLocation(program, "uniformOffset"); - gl.enableVertexAttribArray(program.vertexPosArray); - gl.vertexAttribPointer(program.vertexPosAttrib, vertexPosBuffer.itemSize, gl.FLOAT, !1, 0, 0); - gl.uniform2f(program.offsetUniform, 1, 1); - gl.drawArrays(gl.TRIANGLE_STRIP, 0, vertexPosBuffer.numItems); - if (gl.canvas != null) { result.push(gl.canvas.toDataURL()); } - result.push("extensions:" + gl.getSupportedExtensions().join(";")); - result.push("webgl aliased line width range:" + fa2s(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE))); - result.push("webgl aliased point size range:" + fa2s(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE))); - result.push("webgl alpha bits:" + gl.getParameter(gl.ALPHA_BITS)); - result.push("webgl antialiasing:" + (gl.getContextAttributes().antialias ? "yes" : "no")); - result.push("webgl blue bits:" + gl.getParameter(gl.BLUE_BITS)); - result.push("webgl depth bits:" + gl.getParameter(gl.DEPTH_BITS)); - result.push("webgl green bits:" + gl.getParameter(gl.GREEN_BITS)); - result.push("webgl max anisotropy:" + maxAnisotropy(gl)); - result.push("webgl max combined texture image units:" + gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)); - result.push("webgl max cube map texture size:" + gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)); - result.push("webgl max fragment uniform vectors:" + gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS)); - result.push("webgl max render buffer size:" + gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)); - result.push("webgl max texture image units:" + gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)); - result.push("webgl max texture size:" + gl.getParameter(gl.MAX_TEXTURE_SIZE)); - result.push("webgl max varying vectors:" + gl.getParameter(gl.MAX_VARYING_VECTORS)); - result.push("webgl max vertex attribs:" + gl.getParameter(gl.MAX_VERTEX_ATTRIBS)); - result.push("webgl max vertex texture image units:" + gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)); - result.push("webgl max vertex uniform vectors:" + gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS)); - result.push("webgl max viewport dims:" + fa2s(gl.getParameter(gl.MAX_VIEWPORT_DIMS))); - result.push("webgl red bits:" + gl.getParameter(gl.RED_BITS)); - result.push("webgl renderer:" + gl.getParameter(gl.RENDERER)); - result.push("webgl shading language version:" + gl.getParameter(gl.SHADING_LANGUAGE_VERSION)); - result.push("webgl stencil bits:" + gl.getParameter(gl.STENCIL_BITS)); - result.push("webgl vendor:" + gl.getParameter(gl.VENDOR)); - result.push("webgl version:" + gl.getParameter(gl.VERSION)); - - if (!gl.getShaderPrecisionFormat) { - if (typeof NODEBUG === "undefined") { - this.log("WebGL fingerprinting is incomplete, because your browser does not support getShaderPrecisionFormat"); - } - return result.join("~"); - } - - result.push("webgl vertex shader high float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision); - result.push("webgl vertex shader high float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT ).rangeMin); - result.push("webgl vertex shader high float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT ).rangeMax); - result.push("webgl vertex shader medium float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision); - result.push("webgl vertex shader medium float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).rangeMin); - result.push("webgl vertex shader medium float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).rangeMax); - result.push("webgl vertex shader low float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT ).precision); - result.push("webgl vertex shader low float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT ).rangeMin); - result.push("webgl vertex shader low float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT ).rangeMax); - result.push("webgl fragment shader high float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision); - result.push("webgl fragment shader high float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).rangeMin); - result.push("webgl fragment shader high float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).rangeMax); - result.push("webgl fragment shader medium float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision); - result.push("webgl fragment shader medium float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).rangeMin); - result.push("webgl fragment shader medium float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).rangeMax); - result.push("webgl fragment shader low float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT ).precision); - result.push("webgl fragment shader low float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT ).rangeMin); - result.push("webgl fragment shader low float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT ).rangeMax); - result.push("webgl vertex shader high int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT ).precision); - result.push("webgl vertex shader high int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT ).rangeMin); - result.push("webgl vertex shader high int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT ).rangeMax); - result.push("webgl vertex shader medium int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT ).precision); - result.push("webgl vertex shader medium int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT ).rangeMin); - result.push("webgl vertex shader medium int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT ).rangeMax); - result.push("webgl vertex shader low int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT ).precision); - result.push("webgl vertex shader low int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT ).rangeMin); - result.push("webgl vertex shader low int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT ).rangeMax); - result.push("webgl fragment shader high int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT ).precision); - result.push("webgl fragment shader high int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT ).rangeMin); - result.push("webgl fragment shader high int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT ).rangeMax); - result.push("webgl fragment shader medium int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT ).precision); - result.push("webgl fragment shader medium int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT ).rangeMin); - result.push("webgl fragment shader medium int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT ).rangeMax); - result.push("webgl fragment shader low int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT ).precision); - result.push("webgl fragment shader low int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT ).rangeMin); - result.push("webgl fragment shader low int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT ).rangeMax); - return result.join("~"); - }, - getAdBlock: function(){ - var ads = document.createElement("div"); - ads.innerHTML = " "; - ads.className = "adsbox"; - var result = false; - try { - // body may not exist, that's why we need try/catch - document.body.appendChild(ads); - result = document.getElementsByClassName("adsbox")[0].offsetHeight === 0; - document.body.removeChild(ads); - } catch (e) { - result = false; - } - return result; - }, - getHasLiedLanguages: function(){ - //We check if navigator.language is equal to the first language of navigator.languages - if(typeof navigator.languages !== "undefined"){ - try { - var firstLanguages = navigator.languages[0].substr(0, 2); - if(firstLanguages !== navigator.language.substr(0, 2)){ - return true; - } - } catch(err) { - return true; - } - } - return false; - }, - getHasLiedResolution: function(){ - if(screen.width < screen.availWidth){ - return true; - } - if(screen.height < screen.availHeight){ - return true; - } - return false; - }, - getHasLiedOs: function(){ - var userAgent = navigator.userAgent.toLowerCase(); - var oscpu = navigator.oscpu; - var platform = navigator.platform.toLowerCase(); - var os; - //We extract the OS from the user agent (respect the order of the if else if statement) - if(userAgent.indexOf("windows phone") >= 0){ - os = "Windows Phone"; - } else if(userAgent.indexOf("win") >= 0){ - os = "Windows"; - } else if(userAgent.indexOf("android") >= 0){ - os = "Android"; - } else if(userAgent.indexOf("linux") >= 0){ - os = "Linux"; - } else if(userAgent.indexOf("iphone") >= 0 || userAgent.indexOf("ipad") >= 0 ){ - os = "iOS"; - } else if(userAgent.indexOf("mac") >= 0){ - os = "Mac"; - } else{ - os = "Other"; - } - // We detect if the person uses a mobile device - var mobileDevice; - if (("ontouchstart" in window) || - (navigator.maxTouchPoints > 0) || - (navigator.msMaxTouchPoints > 0)) { - mobileDevice = true; - } else{ - mobileDevice = false; - } - - if(mobileDevice && os !== "Windows Phone" && os !== "Android" && os !== "iOS" && os !== "Other"){ - return true; - } - - // We compare oscpu with the OS extracted from the UA - if(typeof oscpu !== "undefined"){ - oscpu = oscpu.toLowerCase(); - if(oscpu.indexOf("win") >= 0 && os !== "Windows" && os !== "Windows Phone"){ - return true; - } else if(oscpu.indexOf("linux") >= 0 && os !== "Linux" && os !== "Android"){ - return true; - } else if(oscpu.indexOf("mac") >= 0 && os !== "Mac" && os !== "iOS"){ - return true; - } else if(oscpu.indexOf("win") === 0 && oscpu.indexOf("linux") === 0 && oscpu.indexOf("mac") >= 0 && os !== "other"){ - return true; - } - } - - //We compare platform with the OS extracted from the UA - if(platform.indexOf("win") >= 0 && os !== "Windows" && os !== "Windows Phone"){ - return true; - } else if((platform.indexOf("linux") >= 0 || platform.indexOf("android") >= 0 || platform.indexOf("pike") >= 0) && os !== "Linux" && os !== "Android"){ - return true; - } else if((platform.indexOf("mac") >= 0 || platform.indexOf("ipad") >= 0 || platform.indexOf("ipod") >= 0 || platform.indexOf("iphone") >= 0) && os !== "Mac" && os !== "iOS"){ - return true; - } else if(platform.indexOf("win") === 0 && platform.indexOf("linux") === 0 && platform.indexOf("mac") >= 0 && os !== "other"){ - return true; - } - - if(typeof navigator.plugins === "undefined" && os !== "Windows" && os !== "Windows Phone"){ - //We are are in the case where the person uses ie, therefore we can infer that it's windows - return true; - } - - return false; - }, - getHasLiedBrowser: function () { - var userAgent = navigator.userAgent.toLowerCase(); - var productSub = navigator.productSub; - - //we extract the browser from the user agent (respect the order of the tests) - var browser; - if(userAgent.indexOf("firefox") >= 0){ - browser = "Firefox"; - } else if(userAgent.indexOf("opera") >= 0 || userAgent.indexOf("opr") >= 0){ - browser = "Opera"; - } else if(userAgent.indexOf("chrome") >= 0){ - browser = "Chrome"; - } else if(userAgent.indexOf("safari") >= 0){ - browser = "Safari"; - } else if(userAgent.indexOf("trident") >= 0){ - browser = "Internet Explorer"; - } else{ - browser = "Other"; - } - - if((browser === "Chrome" || browser === "Safari" || browser === "Opera") && productSub !== "20030107"){ - return true; - } - - var tempRes = eval.toString().length; - if(tempRes === 37 && browser !== "Safari" && browser !== "Firefox" && browser !== "Other"){ - return true; - } else if(tempRes === 39 && browser !== "Internet Explorer" && browser !== "Other"){ - return true; - } else if(tempRes === 33 && browser !== "Chrome" && browser !== "Opera" && browser !== "Other"){ - return true; - } - - //We create an error to see how it is handled - var errFirefox; - try { - throw "a"; - } catch(err){ - try{ - err.toSource(); - errFirefox = true; - } catch(errOfErr){ - errFirefox = false; - } - } - if(errFirefox && browser !== "Firefox" && browser !== "Other"){ - return true; - } - return false; - }, - isCanvasSupported: function () { - var elem = document.createElement("canvas"); - return !!(elem.getContext && elem.getContext("2d")); - }, - isWebGlSupported: function() { - // code taken from Modernizr - if (!this.isCanvasSupported()) { - return false; - } - - var canvas = document.createElement("canvas"), - glContext; - - try { - glContext = canvas.getContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl")); - } catch(e) { - glContext = false; - } - - return !!window.WebGLRenderingContext && !!glContext; - }, - isIE: function () { - if(navigator.appName === "Microsoft Internet Explorer") { - return true; - } else if(navigator.appName === "Netscape" && /Trident/.test(navigator.userAgent)) { // IE 11 - return true; - } - return false; - }, - hasSwfObjectLoaded: function(){ - return typeof window.swfobject !== "undefined"; - }, - hasMinFlashInstalled: function () { - return swfobject.hasFlashPlayerVersion("9.0.0"); - }, - addFlashDivNode: function() { - var node = document.createElement("div"); - node.setAttribute("id", this.options.swfContainerId); - document.body.appendChild(node); - }, - loadSwfAndDetectFonts: function(done) { - var hiddenCallback = "___fp_swf_loaded"; - window[hiddenCallback] = function(fonts) { - done(fonts); - }; - var id = this.options.swfContainerId; - this.addFlashDivNode(); - var flashvars = { onReady: hiddenCallback}; - var flashparams = { allowScriptAccess: "always", menu: "false" }; - swfobject.embedSWF(this.options.swfPath, id, "1", "1", "9.0.0", false, flashvars, flashparams, {}); - }, - getWebglCanvas: function() { - var canvas = document.createElement("canvas"); - var gl = null; - try { - gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); - } catch(e) { /* squelch */ } - if (!gl) { gl = null; } - return gl; - }, - each: function (obj, iterator, context) { - if (obj === null) { - return; - } - if (this.nativeForEach && obj.forEach === this.nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === {}) { return; } - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (iterator.call(context, obj[key], key, obj) === {}) { return; } - } - } - } - }, - - map: function(obj, iterator, context) { - var results = []; - // Not using strict equality so that this acts as a - // shortcut to checking for `null` and `undefined`. - if (obj == null) { return results; } - if (this.nativeMap && obj.map === this.nativeMap) { return obj.map(iterator, context); } - this.each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }, - - /// MurmurHash3 related functions - - // - // Given two 64bit ints (as an array of two 32bit ints) returns the two - // added together as a 64bit int (as an array of two 32bit ints). - // - x64Add: function(m, n) { - m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; - n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; - var o = [0, 0, 0, 0]; - o[3] += m[3] + n[3]; - o[2] += o[3] >>> 16; - o[3] &= 0xffff; - o[2] += m[2] + n[2]; - o[1] += o[2] >>> 16; - o[2] &= 0xffff; - o[1] += m[1] + n[1]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; - o[0] += m[0] + n[0]; - o[0] &= 0xffff; - return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; - }, - - // - // Given two 64bit ints (as an array of two 32bit ints) returns the two - // multiplied together as a 64bit int (as an array of two 32bit ints). - // - x64Multiply: function(m, n) { - m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; - n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; - var o = [0, 0, 0, 0]; - o[3] += m[3] * n[3]; - o[2] += o[3] >>> 16; - o[3] &= 0xffff; - o[2] += m[2] * n[3]; - o[1] += o[2] >>> 16; - o[2] &= 0xffff; - o[2] += m[3] * n[2]; - o[1] += o[2] >>> 16; - o[2] &= 0xffff; - o[1] += m[1] * n[3]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; - o[1] += m[2] * n[2]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; - o[1] += m[3] * n[1]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; - o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]); - o[0] &= 0xffff; - return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; - }, - // - // Given a 64bit int (as an array of two 32bit ints) and an int - // representing a number of bit positions, returns the 64bit int (as an - // array of two 32bit ints) rotated left by that number of positions. - // - x64Rotl: function(m, n) { - n %= 64; - if (n === 32) { - return [m[1], m[0]]; - } - else if (n < 32) { - return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))]; - } - else { - n -= 32; - return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))]; - } - }, - // - // Given a 64bit int (as an array of two 32bit ints) and an int - // representing a number of bit positions, returns the 64bit int (as an - // array of two 32bit ints) shifted left by that number of positions. - // - x64LeftShift: function(m, n) { - n %= 64; - if (n === 0) { - return m; - } - else if (n < 32) { - return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n]; - } - else { - return [m[1] << (n - 32), 0]; - } - }, - // - // Given two 64bit ints (as an array of two 32bit ints) returns the two - // xored together as a 64bit int (as an array of two 32bit ints). - // - x64Xor: function(m, n) { - return [m[0] ^ n[0], m[1] ^ n[1]]; - }, - // - // Given a block, returns murmurHash3's final x64 mix of that block. - // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the - // only place where we need to right shift 64bit ints.) - // - x64Fmix: function(h) { - h = this.x64Xor(h, [0, h[0] >>> 1]); - h = this.x64Multiply(h, [0xff51afd7, 0xed558ccd]); - h = this.x64Xor(h, [0, h[0] >>> 1]); - h = this.x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]); - h = this.x64Xor(h, [0, h[0] >>> 1]); - return h; - }, - - // - // Given a string and an optional seed as an int, returns a 128 bit - // hash using the x64 flavor of MurmurHash3, as an unsigned hex. - // - x64hash128: function (key, seed) { - key = key || ""; - seed = seed || 0; - var remainder = key.length % 16; - var bytes = key.length - remainder; - var h1 = [0, seed]; - var h2 = [0, seed]; - var k1 = [0, 0]; - var k2 = [0, 0]; - var c1 = [0x87c37b91, 0x114253d5]; - var c2 = [0x4cf5ad43, 0x2745937f]; - for (var i = 0; i < bytes; i = i + 16) { - k1 = [((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24), ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24)]; - k2 = [((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24), ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24)]; - k1 = this.x64Multiply(k1, c1); - k1 = this.x64Rotl(k1, 31); - k1 = this.x64Multiply(k1, c2); - h1 = this.x64Xor(h1, k1); - h1 = this.x64Rotl(h1, 27); - h1 = this.x64Add(h1, h2); - h1 = this.x64Add(this.x64Multiply(h1, [0, 5]), [0, 0x52dce729]); - k2 = this.x64Multiply(k2, c2); - k2 = this.x64Rotl(k2, 33); - k2 = this.x64Multiply(k2, c1); - h2 = this.x64Xor(h2, k2); - h2 = this.x64Rotl(h2, 31); - h2 = this.x64Add(h2, h1); - h2 = this.x64Add(this.x64Multiply(h2, [0, 5]), [0, 0x38495ab5]); - } - k1 = [0, 0]; - k2 = [0, 0]; - switch(remainder) { - case 15: - k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 14)], 48)); - case 14: - k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 13)], 40)); - case 13: - k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 12)], 32)); - case 12: - k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 11)], 24)); - case 11: - k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 10)], 16)); - case 10: - k2 = this.x64Xor(k2, this.x64LeftShift([0, key.charCodeAt(i + 9)], 8)); - case 9: - k2 = this.x64Xor(k2, [0, key.charCodeAt(i + 8)]); - k2 = this.x64Multiply(k2, c2); - k2 = this.x64Rotl(k2, 33); - k2 = this.x64Multiply(k2, c1); - h2 = this.x64Xor(h2, k2); - case 8: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 7)], 56)); - case 7: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 6)], 48)); - case 6: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 5)], 40)); - case 5: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 4)], 32)); - case 4: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 3)], 24)); - case 3: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 2)], 16)); - case 2: - k1 = this.x64Xor(k1, this.x64LeftShift([0, key.charCodeAt(i + 1)], 8)); - case 1: - k1 = this.x64Xor(k1, [0, key.charCodeAt(i)]); - k1 = this.x64Multiply(k1, c1); - k1 = this.x64Rotl(k1, 31); - k1 = this.x64Multiply(k1, c2); - h1 = this.x64Xor(h1, k1); - } - h1 = this.x64Xor(h1, [0, key.length]); - h2 = this.x64Xor(h2, [0, key.length]); - h1 = this.x64Add(h1, h2); - h2 = this.x64Add(h2, h1); - h1 = this.x64Fmix(h1); - h2 = this.x64Fmix(h2); - h1 = this.x64Add(h1, h2); - h2 = this.x64Add(h2, h1); - return ("00000000" + (h1[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h1[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[1] >>> 0).toString(16)).slice(-8); - } - }; - Fingerprint2.VERSION = "1.4.1"; - return Fingerprint2; -}); diff --git a/dashboard-ui/bower_components/fingerprintjs2/gulpfile.js b/dashboard-ui/bower_components/fingerprintjs2/gulpfile.js deleted file mode 100644 index a1360ca16f..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/gulpfile.js +++ /dev/null @@ -1,29 +0,0 @@ -var gulp = require("gulp"), - eslint = require("gulp-eslint"), - rename = require("gulp-rename"), - uglify = require("gulp-uglify"); - -gulp.task("lint", function() { - return gulp - .src("fingerprint2.js") - .pipe(eslint()) - .pipe(eslint.format()) - .pipe(eslint.failOnError()); -}); - -gulp.task("minify", function() { - return gulp - .src("fingerprint2.js") - .pipe(rename({suffix: ".min"})) - .pipe(uglify({ - compress: { - global_defs: { - NODEBUG: true - } - } - })) - .pipe(gulp.dest("dist/")); -}); - - -gulp.task("default", ["lint", "minify"], function() {}); diff --git a/dashboard-ui/bower_components/fingerprintjs2/index.html b/dashboard-ui/bower_components/fingerprintjs2/index.html deleted file mode 100644 index b8b573b466..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/index.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - Fingerprintjs2 test - - - - - - -
- - -

Fingerprintjs2

- -

Your browser fingerprint:

-

- - - - Fork me on GitHub - - - - - diff --git a/dashboard-ui/bower_components/fingerprintjs2/package.json b/dashboard-ui/bower_components/fingerprintjs2/package.json deleted file mode 100644 index 58c5c583a3..0000000000 --- a/dashboard-ui/bower_components/fingerprintjs2/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "fingerprintjs2", - "version": "1.4.1", - "description": "Modern & flexible browser fingerprinting library", - "main": "dist/fingerprint2.min.js", - "devDependencies": { - "gulp": "^3.8.11", - "eslint": "^0.14.1", - "gulp-eslint": "^0.4.2", - "gulp-rename": "^1.2.2", - "gulp-uglify": "^1.1.0" - }, - "scripts": { - "test": "specs/phantomjs.runner.sh specs/spec_runner.html" - }, - "repository": { - "type": "git", - "url": "https://github.com/Valve/fingerprintjs2.git" - }, - "keywords": [ - "browser", - "identification", - "fingerprint", - "fingerprinting", - "privacy" - ], - "author": "Valentin Vasilyev", - "license": "MIT", - "bugs": { - "url": "https://github.com/Valve/fingerprintjs2/issues" - }, - "homepage": "https://github.com/Valve/fingerprintjs2" -} diff --git a/dashboard-ui/components/apphost.js b/dashboard-ui/components/apphost.js index 660acf401a..1aeb2a9a66 100644 --- a/dashboard-ui/components/apphost.js +++ b/dashboard-ui/components/apphost.js @@ -21,12 +21,13 @@ define(['appStorage', 'browser'], function (appStorage, browser) { function generateDeviceId() { return new Promise(function (resolve, reject) { - require(['fingerprintjs2'], function (Fingerprint2) { + require(["cryptojs-sha1"], function () { - new Fingerprint2().get(function (result, components) { - console.log('Generated device id: ' + result); //a hash, representing your device fingerprint - resolve(result); - }); + var keys = []; + keys.push(navigator.userAgent); + keys.push(new Date().getTime()); + + resolve(CryptoJS.SHA1(keys.join('|')).toString()); }); }); } diff --git a/dashboard-ui/css/chromecast.css b/dashboard-ui/css/chromecast.css index eee1b5f40e..5671d88342 100644 --- a/dashboard-ui/css/chromecast.css +++ b/dashboard-ui/css/chromecast.css @@ -1,5 +1,5 @@ .btnActiveCast { - color: #2ad !important; + color: #52B54B !important; } .headerSelectedPlayer { diff --git a/dashboard-ui/devices/ios/ios.css b/dashboard-ui/devices/ios/ios.css index d54bc64d24..6464a3626d 100644 --- a/dashboard-ui/devices/ios/ios.css +++ b/dashboard-ui/devices/ios/ios.css @@ -54,11 +54,6 @@ body:not(.dashboardDocument) .mainDrawerButton { color: #52B54B !important; } -.ui-body-b .paperList:not(.criticReviewPaperList) { - background-color: transparent; - box-shadow: none; -} - .criticReviewPaperList { background-color: #262626; } @@ -75,10 +70,6 @@ body:not(.dashboardDocument) .mainDrawerButton { } } -.btnActiveCast { - color: #52B54B !important; -} - .libraryViewNav { font-size: 12px; } @@ -128,10 +119,6 @@ h1, h1 a { padding-top: 50px !important; } -.localSyncStatus .labelSyncStatus { - display: none !important; -} - .videoSubtitles { font-size: 200% !important; } diff --git a/dashboard-ui/scripts/localsync.js b/dashboard-ui/scripts/localsync.js index c5b4961667..710e9ea8ef 100644 --- a/dashboard-ui/scripts/localsync.js +++ b/dashboard-ui/scripts/localsync.js @@ -2,7 +2,7 @@ var syncPromise; - window.LocalSync = { + return { sync: function (options) { diff --git a/dashboard-ui/scripts/mysync.js b/dashboard-ui/scripts/mysync.js index 56449ef355..f4c96efcec 100644 --- a/dashboard-ui/scripts/mysync.js +++ b/dashboard-ui/scripts/mysync.js @@ -1,4 +1,4 @@ -define(['loading', 'apphost', 'globalize', 'syncJobList', 'events', 'localsync', 'emby-button', 'paper-icon-button-light'], function (loading, appHost, globalize, syncJobList, events) { +define(['loading', 'apphost', 'globalize', 'syncJobList', 'events', 'localsync', 'emby-button', 'paper-icon-button-light'], function (loading, appHost, globalize, syncJobList, events, localSync) { function initSupporterInfo(view, params) { @@ -38,7 +38,7 @@ if (isLocalSyncManagement()) { - var status = LocalSync.getSyncStatus(); + var status = localSync.getSyncStatus(); page.querySelector('.labelSyncStatus').innerHTML = Globalize.translate('LabelLocalSyncStatusValue', status); if (status == 'Active') { @@ -58,7 +58,7 @@ function syncNow(page) { - LocalSync.sync(); + localSync.sync(); require(['toast'], function (toast) { toast(Globalize.translate('MessageSyncStarted')); }); diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js index c87ce734b8..28eda53682 100644 --- a/dashboard-ui/scripts/nowplayingbar.js +++ b/dashboard-ui/scripts/nowplayingbar.js @@ -424,7 +424,7 @@ } } - var timeText = datetime.getDisplayRunningTime(playState.PositionTicks); + var timeText = playState.PositionTicks == null ? '--:--' : datetime.getDisplayRunningTime(playState.PositionTicks); if (nowPlayingItem.RunTimeTicks) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 400f1721e9..df174193ce 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1205,7 +1205,7 @@ var AppInfo = {}; } function createMainContentHammer(Hammer) { - + var hammer = new Hammer(document.querySelector('.mainDrawerPanelContent'), null); return hammer; } @@ -1432,7 +1432,6 @@ var AppInfo = {}; define('fetch', [bowerPath + '/fetch/fetch']); define('objectassign', [embyWebComponentsBowerPath + '/objectassign']); define('native-promise-only', [bowerPath + '/native-promise-only/lib/npo.src']); - define("fingerprintjs2", [bowerPath + '/fingerprintjs2/fingerprint2'], returnFirstDependency); define("clearButtonStyle", ['css!' + embyWebComponentsBowerPath + '/clearbutton']); define("userdataButtons", [embyWebComponentsBowerPath + "/userdatabuttons/userdatabuttons"], returnFirstDependency); define("listView", [embyWebComponentsBowerPath + "/listview/listview"], returnFirstDependency); @@ -2773,6 +2772,7 @@ var AppInfo = {}; require(postInitDependencies); upgradeLayouts(); + initAutoSync(); }); } @@ -2786,6 +2786,16 @@ var AppInfo = {}; } } + function initAutoSync() { + require(['serverNotifications', 'events'], function (serverNotifications, events) { + events.on(serverNotifications, 'SyncJobItemReady', function (e, apiClient, data) { + require(['localsync'], function (localSync) { + localSync.sync({}); + }); + }); + }); + } + initRequire(); function onWebComponentsReady() {