1Fingerprint2.excludePixelRatio = false; 2Fingerprint2.excludeDoNotTrack = false; 3 4Fingerprint2.get({ 5 excludes: { 6 enumerateDevices: true, 7 pixelRatio: false, 8 doNotTrack: false, 9 fontsFlash: true, 10 }, 11}, function (components) { 12 13 var device = {}; 14 device.hash = Fingerprint2.x64hash128(components.map(function (pair) { 15 return pair.value; 16 }).join(), 31); 17 18 var params = {}; 19 20 var pVSg = { 21 'availableScreenResolution': 'available_resolution', 22 'colorDepth': 'color_depth', 23 'cpuClass': 'cpu_class', 24 // '': 'do_not_track', // ??? 25 'hardwareConcurrency': 'hardware_concurrency', 26 'language': 'language', 27 'platform': 'navigator_platform', 28 // '': 'pixel_ratio', // ??? 29 'plugins': 'regular_plugins', 30 'screenResolution': 'resolution', 31 'timezoneOffset': 'timezone_offset', 32 'userAgent': 'user_agent', 33 }; 34 35 for (var index in components) { 36 var obj = components[index]; 37 var paramItem = obj.key; 38 39 if (pVSg[paramItem]) { 40 var paramName = pVSg[paramItem]; 41 42 if (paramItem === 'colorDepth' || paramItem === 'hardwareConcurrency') { 43 obj.value = obj.value.toString(); 44 } 45 46 if (paramItem === 'plugins') { 47 var newValue = []; 48 for (var plugin in obj.value) { 49 if (obj.value[plugin][0]) { 50 newValue.push(obj.value[plugin][0]); 51 } 52 } 53 obj.value = newValue; 54 } 55 56 params[paramName] = Array.isArray(obj.value) ? obj.value : [obj.value]; 57 } 58 59 params.do_not_track = []; 60 params.pixel_ratio = []; 61 } 62 63 params.acceptHeader = '*/*'; 64 params.javaEnabled = true; 65 66 device.params = params; 67 if (window._env) { 68 window._env.device = JSON.stringify(device); 69 window._env.deviceHash = device.hash; 70 } else { 71 throw new Error('no _env'); 72 } 73}); 74 75$.fn.initDevice = function () { 76 var $this = $(this); 77 if ($this.length !== 1) { 78 $this.each(function () { 79 $(this).initDevice(); 80 }); 81 82 return this; 83 } 84 85 $this.val(window._env.device); 86};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.