fingerprintjs2
Advanced tools
Comparing version 0.5.1 to 0.7.1
{ | ||
"name": "fingerprintjs2", | ||
"description": "Modern & flexible browser fingerprinting library", | ||
"main": "dist/fingerprint2.js", | ||
"main": "dist/fingerprint2.min.js", | ||
"moduleType": [ | ||
@@ -6,0 +6,0 @@ "es6" |
/* | ||
* Fingerprintjs2 0.5.1 - Modern & flexible browser fingerprint library v2 | ||
* Fingerprintjs2 0.7.1 - Modern & flexible browser fingerprint library v2 | ||
* https://github.com/Valve/fingerprintjs2 | ||
@@ -113,6 +113,10 @@ * Copyright (c) 2015 Valentin Vasilyev (valentin.vasilyev@outlook.com) | ||
if(!this.options.excludeUserAgent) { | ||
keys.push(navigator.userAgent); | ||
keys.push(this.getUserAgent()); | ||
} | ||
return keys; | ||
}, | ||
// for tests | ||
getUserAgent: function(){ | ||
return navigator.userAgent; | ||
}, | ||
languageKey: function(keys) { | ||
@@ -545,11 +549,2 @@ if(!this.options.excludeLanguage) { | ||
var ctx = canvas.getContext("2d"); | ||
// detect browser support of canvas blending | ||
// http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ | ||
// https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/blending.js | ||
// https://securehomes.esat.kuleuven.be/~gacar/persistent/the_web_never_forgets.pdf | ||
try { | ||
ctx.globalCompositeOperation = "screen"; | ||
} catch (e) { /* squelch */ } | ||
result.push("canvas blending:" + ((ctx.globalCompositeOperation === "screen") ? "yes" : "no")); | ||
// detect browser support of canvas winding | ||
@@ -874,5 +869,12 @@ // http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/ | ||
} | ||
var canvas = document.createElement("canvas"), | ||
glContext = canvas.getContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl")); | ||
glContext; | ||
try { | ||
glContext = canvas.getContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl")); | ||
} catch(e) { | ||
glContext = false; | ||
} | ||
return !!window.WebGLRenderingContext && !!glContext; | ||
@@ -1146,3 +1148,4 @@ }, | ||
}; | ||
Fingerprint2.VERSION = "0.7.1"; | ||
return Fingerprint2; | ||
}); |
var gulp = require("gulp"), | ||
eslint = require("gulp-eslint"), | ||
uglify = require("gulp-uglify"), | ||
phantom = require('gulp-jasmine-phantom'); | ||
rename = require("gulp-rename"), | ||
uglify = require("gulp-uglify"); | ||
@@ -17,2 +17,3 @@ gulp.task("lint", function() { | ||
.src("fingerprint2.js") | ||
.pipe(rename({suffix: ".min"})) | ||
.pipe(uglify({ | ||
@@ -25,3 +26,3 @@ compress: { | ||
})) | ||
.pipe(gulp.dest("dist")); | ||
.pipe(gulp.dest("dist/")); | ||
}); | ||
@@ -28,0 +29,0 @@ |
{ | ||
"name": "fingerprintjs2", | ||
"version": "0.5.1", | ||
"version": "0.7.1", | ||
"description": "Modern & flexible browser fingerprinting library", | ||
"main": "fingerprint2.js", | ||
"main": "dist/fingerprint2.min.js", | ||
"dependencies": { | ||
@@ -13,2 +13,3 @@ "gulp": "^3.8.11" | ||
"gulp-eslint": "^0.4.2", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-uglify": "^1.1.0" | ||
@@ -15,0 +16,0 @@ }, |
@@ -118,2 +118,3 @@ <p align="center"> | ||
### Many more fingerprinting sources will be implemented, such as | ||
(in no particular order) | ||
@@ -125,3 +126,11 @@ * Multi-monitor detection, | ||
* WebRTC fingerprinting | ||
* Many more | ||
* Math constants | ||
* Accessibility fingerprinting | ||
* Camera information | ||
* DRM support | ||
* Accelerometer support | ||
* Virtual keyboards | ||
* List of supported gestures (for touch-enabled devices) | ||
* Pixel density | ||
* Video and audio codecs availability | ||
@@ -128,0 +137,0 @@ #### To recompile the FontList.swf file: |
@@ -63,3 +63,23 @@ "use strict"; | ||
}); | ||
describe("non-default options", function () { | ||
it("does not use userAgent when excluded", function (done) { | ||
var fp2 = new Fingerprint2({excludeUserAgent: true}); | ||
spyOn(fp2, "getUserAgent"); | ||
fp2.get(function(result) { | ||
expect(fp2.getUserAgent).not.toHaveBeenCalled(); | ||
done(); | ||
}); | ||
}); | ||
it("does not use screen resolution when excluded", function (done) { | ||
var fp2 = new Fingerprint2({excludeScreenResolution: true}); | ||
spyOn(fp2, "getScreenResolution"); | ||
fp2.get(function(result) { | ||
expect(fp2.getScreenResolution).not.toHaveBeenCalled(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250247
5083
142
5