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.0 - Fast browser fingerprint library
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
- keys.push(typeof(document.body.addBehavior));
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
- if (typeof module === 'object' && typeof exports === 'object') {
256
- module.exports = Fingerprint;
257
- }
258
- scope.Fingerprint = Fingerprint;
259
- })(window);
264
+ return Fingerprint;
265
+
266
+ });
@@ -1 +1,2 @@
1
- !function(t){"use strict";var e=function(t){var e,n;e=Array.prototype.forEach,n=Array.prototype.map,this.each=function(t,n,r){if(null!==t)if(e&&t.forEach===e)t.forEach(n,r);else if(t.length===+t.length){for(var i=0,a=t.length;a>i;i++)if(n.call(r,t[i],i,t)==={})return}else for(var o in t)if(t.hasOwnProperty(o)&&n.call(r,t[o],o,t)==={})return},this.map=function(t,e,r){var i=[];return null==t?i:n&&t.map===n?t.map(e,r):(this.each(t,function(t,n,a){i[i.length]=e.call(r,t,n,a)}),i)},"object"==typeof t?(this.hasher=t.hasher,this.screen_resolution=t.screen_resolution,this.canvas=t.canvas,this.ie_activex=t.ie_activex):"function"==typeof t&&(this.hasher=t)};e.prototype={get:function(){var t=[];if(t.push(navigator.userAgent),t.push(navigator.language),t.push(screen.colorDepth),this.screen_resolution){var e=this.getScreenResolution();"undefined"!=typeof e&&t.push(this.getScreenResolution().join("x"))}return t.push((new Date).getTimezoneOffset()),t.push(this.hasSessionStorage()),t.push(this.hasLocalStorage()),t.push(!!window.indexedDB),t.push(typeof document.body.addBehavior),t.push(typeof window.openDatabase),t.push(navigator.cpuClass),t.push(navigator.platform),t.push(navigator.doNotTrack),t.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&t.push(this.getCanvasFingerprint()),this.hasher?this.hasher(t.join("###"),31):this.murmurhash3_32_gc(t.join("###"),31)},murmurhash3_32_gc:function(t,e){var n,r,i,a,o,s,c,h;for(n=3&t.length,r=t.length-n,i=e,o=3432918353,s=461845907,h=0;r>h;)c=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24,++h,c=4294967295&(65535&c)*o+((65535&(c>>>16)*o)<<16),c=c<<15|c>>>17,c=4294967295&(65535&c)*s+((65535&(c>>>16)*s)<<16),i^=c,i=i<<13|i>>>19,a=4294967295&5*(65535&i)+((65535&5*(i>>>16))<<16),i=(65535&a)+27492+((65535&(a>>>16)+58964)<<16);switch(c=0,n){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c^=255&t.charCodeAt(h),c=4294967295&(65535&c)*o+((65535&(c>>>16)*o)<<16),c=c<<15|c>>>17,c=4294967295&(65535&c)*s+((65535&(c>>>16)*s)<<16),i^=c}return i^=t.length,i^=i>>>16,i=4294967295&2246822507*(65535&i)+((65535&2246822507*(i>>>16))<<16),i^=i>>>13,i=4294967295&3266489909*(65535&i)+((65535&3266489909*(i>>>16))<<16),i^=i>>>16,i>>>0},hasLocalStorage:function(){try{return!!t.localStorage}catch(e){return!0}},hasSessionStorage:function(){try{return!!t.sessionStorage}catch(e){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.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(t){var e=this.map(t,function(t){return[t.type,t.suffixes].join("~")}).join(",");return[t.name,t.description,e].join("::")},this).join(";")},getIEPluginsString:function(){var e=["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&&t.ActiveXObject?this.map(e,function(t){try{return new ActiveXObject(t),t}catch(e){return null}}).join(";"):""},getScreenResolution:function(){return[screen.height,screen.width]},getCanvasFingerprint:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n="http://valve.github.io";return e.textBaseline="top",e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(n,4,17),t.toDataURL()}},"object"==typeof module&&"object"==typeof exports&&(module.exports=e),t.Fingerprint=e}(window);
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});
@@ -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.0"
7
+ gem.version = "0.5.2"
8
8
  gem.authors = ["Valentin Vasilyev"]
9
- gem.email = ["iamvalentin@gmail.com"]
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.0
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-10-15 00:00:00.000000000 Z
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
- - iamvalentin@gmail.com
16
+ - valentin.vasilyev@outlook.com
17
17
  executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []