fingerprintjs-rails 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,17 @@
|
|
1
1
|
/*
|
2
|
-
* fingerprintJS 0.5.
|
2
|
+
* fingerprintJS 0.5.2 - Fast browser fingerprint library
|
3
3
|
* https://github.com/Valve/fingerprintjs
|
4
4
|
* Copyright (c) 2013 Valentin Vasilyev (iamvalentin@gmail.com)
|
5
5
|
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
|
6
6
|
*/
|
7
|
-
/*jslint browser: true, indent: 2, maxerr: 50, maxlen: 120 */
|
8
|
-
(function (scope) {
|
9
|
-
'use strict';
|
10
7
|
|
8
|
+
;(function (name, context, definition) {
|
9
|
+
if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }
|
10
|
+
else if (typeof define === 'function' && define.amd) { define(definition); }
|
11
|
+
else { context[name] = definition(); }
|
12
|
+
})('Fingerprint', this, function () {
|
13
|
+
'use strict';
|
14
|
+
|
11
15
|
var Fingerprint = function (options) {
|
12
16
|
var nativeForEach, nativeMap;
|
13
17
|
nativeForEach = Array.prototype.forEach;
|
@@ -70,7 +74,12 @@
|
|
70
74
|
keys.push(this.hasSessionStorage());
|
71
75
|
keys.push(this.hasLocalStorage());
|
72
76
|
keys.push(!!window.indexedDB);
|
73
|
-
|
77
|
+
//body might not be defined at this point or removed programmatically
|
78
|
+
if(document.body){
|
79
|
+
keys.push(typeof(document.body.addBehavior));
|
80
|
+
} else {
|
81
|
+
keys.push(typeof undefined);
|
82
|
+
}
|
74
83
|
keys.push(typeof(window.openDatabase));
|
75
84
|
keys.push(navigator.cpuClass);
|
76
85
|
keys.push(navigator.platform);
|
@@ -252,8 +261,6 @@
|
|
252
261
|
};
|
253
262
|
|
254
263
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
scope.Fingerprint = Fingerprint;
|
259
|
-
})(window);
|
264
|
+
return Fingerprint;
|
265
|
+
|
266
|
+
});
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
/*! fingerprintjs 2013-12-20 - v0.5.2 */
|
2
|
+
!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c():"function"==typeof define&&define.amd?define(c):b[a]=c()}("Fingerprint",this,function(){"use strict";var a=function(a){var b,c;b=Array.prototype.forEach,c=Array.prototype.map,this.each=function(a,c,d){if(null!==a)if(b&&a.forEach===b)a.forEach(c,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(c.call(d,a[e],e,a)==={})return}else for(var g in a)if(a.hasOwnProperty(g)&&c.call(d,a[g],g,a)==={})return},this.map=function(a,b,d){var e=[];return null==a?e:c&&a.map===c?a.map(b,d):(this.each(a,function(a,c,f){e[e.length]=b.call(d,a,c,f)}),e)},"object"==typeof a?(this.hasher=a.hasher,this.screen_resolution=a.screen_resolution,this.canvas=a.canvas,this.ie_activex=a.ie_activex):"function"==typeof a&&(this.hasher=a)};return a.prototype={get:function(){var a=[];if(a.push(navigator.userAgent),a.push(navigator.language),a.push(screen.colorDepth),this.screen_resolution){var b=this.getScreenResolution();"undefined"!=typeof b&&a.push(this.getScreenResolution().join("x"))}return a.push((new Date).getTimezoneOffset()),a.push(this.hasSessionStorage()),a.push(this.hasLocalStorage()),a.push(!!window.indexedDB),document.body?a.push(typeof document.body.addBehavior):a.push("undefined"),a.push(typeof window.openDatabase),a.push(navigator.cpuClass),a.push(navigator.platform),a.push(navigator.doNotTrack),a.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&a.push(this.getCanvasFingerprint()),this.hasher?this.hasher(a.join("###"),31):this.murmurhash3_32_gc(a.join("###"),31)},murmurhash3_32_gc:function(a,b){var c,d,e,f,g,h,i,j;for(c=3&a.length,d=a.length-c,e=b,g=3432918353,h=461845907,j=0;d>j;)i=255&a.charCodeAt(j)|(255&a.charCodeAt(++j))<<8|(255&a.charCodeAt(++j))<<16|(255&a.charCodeAt(++j))<<24,++j,i=(65535&i)*g+(((i>>>16)*g&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*h+(((i>>>16)*h&65535)<<16)&4294967295,e^=i,e=e<<13|e>>>19,f=5*(65535&e)+((5*(e>>>16)&65535)<<16)&4294967295,e=(65535&f)+27492+(((f>>>16)+58964&65535)<<16);switch(i=0,c){case 3:i^=(255&a.charCodeAt(j+2))<<16;case 2:i^=(255&a.charCodeAt(j+1))<<8;case 1:i^=255&a.charCodeAt(j),i=(65535&i)*g+(((i>>>16)*g&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*h+(((i>>>16)*h&65535)<<16)&4294967295,e^=i}return e^=a.length,e^=e>>>16,e=2246822507*(65535&e)+((2246822507*(e>>>16)&65535)<<16)&4294967295,e^=e>>>13,e=3266489909*(65535&e)+((3266489909*(e>>>16)&65535)<<16)&4294967295,e^=e>>>16,e>>>0},hasLocalStorage:function(){try{return!!scope.localStorage}catch(a){return!0}},hasSessionStorage:function(){try{return!!scope.sessionStorage}catch(a){return!0}},isCanvasSupported:function(){var a=document.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName?!0:"Netscape"===navigator.appName&&/Trident/.test(navigator.userAgent)?!0:!1},getPluginsString:function(){return this.isIE()?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(a){var b=this.map(a,function(a){return[a.type,a.suffixes].join("~")}).join(",");return[a.name,a.description,b].join("::")},this).join(";")},getIEPluginsString:function(){var a=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.ie_activex&&scope.ActiveXObject?this.map(a,function(a){try{return new ActiveXObject(a),a}catch(b){return null}}).join(";"):""},getScreenResolution:function(){return[screen.height,screen.width]},getCanvasFingerprint:function(){var a=document.createElement("canvas"),b=a.getContext("2d"),c="http://valve.github.io";return b.textBaseline="top",b.font="14px 'Arial'",b.textBaseline="alphabetic",b.fillStyle="#f60",b.fillRect(125,1,62,20),b.fillStyle="#069",b.fillText(c,2,15),b.fillStyle="rgba(102, 204, 0, 0.7)",b.fillText(c,4,17),a.toDataURL()}},a});
|
data/fingerprintjs-rails.gemspec
CHANGED
@@ -4,9 +4,9 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fingerprintjs-rails"
|
7
|
-
gem.version = "0.5.
|
7
|
+
gem.version = "0.5.2"
|
8
8
|
gem.authors = ["Valentin Vasilyev"]
|
9
|
-
gem.email = ["
|
9
|
+
gem.email = ["valentin.vasilyev@outlook.com"]
|
10
10
|
gem.description = "fingerprintjs for rails asset pipeline"
|
11
11
|
gem.summary = "FingerprintJS JavaScript library, packaged for Ruby-on-Rails asset pipeline"
|
12
12
|
gem.homepage = "http://valve.github.com/fingerprintjs"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fingerprintjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: fingerprintjs for rails asset pipeline
|
15
15
|
email:
|
16
|
-
-
|
16
|
+
- valentin.vasilyev@outlook.com
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|