update sliders

This commit is contained in:
Luke Pulverenti 2016-06-13 15:02:48 -04:00
parent 7f6b2415fb
commit acefeed732
26 changed files with 524 additions and 91 deletions

View file

@ -23,12 +23,12 @@
"spec"
],
"homepage": "https://github.com/Valve/fingerprintjs2",
"version": "1.3.0",
"_release": "1.3.0",
"version": "1.4.0",
"_release": "1.4.0",
"_resolution": {
"type": "version",
"tag": "1.3.0",
"commit": "727e536d5ffce50b47fd233ea32f022a7bbcdb0f"
"tag": "1.4.0",
"commit": "75cbd474158f8ecce43e00f198c76e486b896937"
},
"_source": "https://github.com/Valve/fingerprintjs2.git",
"_target": "^1.1.3",

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*
* Fingerprintjs2 1.3.0 - Modern & flexible browser fingerprint library v2
* Fingerprintjs2 1.4.0 - 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.
@ -84,6 +84,7 @@
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);
@ -141,6 +142,15 @@
}
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);
@ -679,7 +689,7 @@
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.7)";
ctx.fillStyle = "rgba(102, 204, 0, 0.2)";
ctx.font = "18pt Arial";
ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 4, 45);
@ -835,13 +845,16 @@
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);
return document.getElementsByClassName("adsbox")[0].offsetHeight === 0;
result = document.getElementsByClassName("adsbox")[0].offsetHeight === 0;
document.body.removeChild(ads);
} catch (e) {
return false;
result = false;
}
return result;
},
getHasLiedLanguages: function(){
//We check if navigator.language is equal to the first language of navigator.languages
@ -1270,6 +1283,6 @@
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.3.0";
Fingerprint2.VERSION = "1.4.0";
return Fingerprint2;
});

View file

@ -1,6 +1,6 @@
{
"name": "fingerprintjs2",
"version": "1.3.0",
"version": "1.4.0",
"description": "Modern & flexible browser fingerprinting library",
"main": "dist/fingerprint2.min.js",
"devDependencies": {

View file

@ -71,6 +71,15 @@ describe("Fingerprint2", function () {
});
});
it("does not use pixelRatio when excluded", function (done) {
var fp2 = new Fingerprint2({excludePixelRatio: true});
spyOn(fp2, "getPixelRatio");
fp2.get(function(result) {
expect(fp2.getPixelRatio).not.toHaveBeenCalled();
done();
});
});
it("does not use screen resolution when excluded", function (done) {
var fp2 = new Fingerprint2({excludeScreenResolution: true});
spyOn(fp2, "getScreenResolution");