diff --git a/docs/test.html b/docs/test.html new file mode 100644 index 0000000..e04fcb5 --- /dev/null +++ b/docs/test.html @@ -0,0 +1,17 @@ + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/src/jquery.browser-fingerprint-1.0.js b/src/jquery.browser-fingerprint-1.0.js index c578677..58a7154 100644 --- a/src/jquery.browser-fingerprint-1.0.js +++ b/src/jquery.browser-fingerprint-1.0.js @@ -47,7 +47,8 @@ p.name,p.description, $.map( p, function(mt) { return [ mt.type, mt.suffixes ].join("~"); }).join(",") ].join("::"); - }).join(";") + }).join(";"), + _fonts().join('+') ].join("###"); } @@ -62,6 +63,19 @@ throw "md5 unavailable, please get it from http://github.com/wbond/md5-js/"; } } + + // `_fonts()` checks for the installed fonts on a system + // http://github.com/jasonbarry/fontlist.js/ + function _fonts() { + if ( typeof $.fontlist === "function" ) { + // if fontlist.js is available, search for installed fonts + return $.fontlist(); + } + else { + // else return empty array + return []; + } + } // And, since I'm lazy, calling `$.fingerprint()` will return the hash // right away, without the need for any other calls. diff --git a/src/jquery.browser-fingerprint-1.0.min.js b/src/jquery.browser-fingerprint-1.0.min.js index a8eba43..823463a 100644 --- a/src/jquery.browser-fingerprint-1.0.min.js +++ b/src/jquery.browser-fingerprint-1.0.min.js @@ -1 +1 @@ -(function(a){a.fingerprint=function(){function b(){return[navigator.userAgent,[screen.height,screen.width,screen.colorDepth].join("x"),(new Date()).getTimezoneOffset(),a.map(navigator.plugins,function(d){return[d.name,d.description,a.map(d,function(e){return[e.type,e.suffixes].join("~")}).join(",")].join("::")}).join(";")].join("###")}function c(){if(typeof window.md5==="function"){return md5(b())}else{throw"md5 unavailable, please get it from http://github.com/wbond/md5-js/"}}return c()}})(jQuery); \ No newline at end of file +(function($){$.fingerprint=function(){function _raw(){return[navigator.userAgent,[screen.height,screen.width,screen.colorDepth].join("x"),(new Date()).getTimezoneOffset(),$.map(navigator.plugins,function(p){return[p.name,p.description,$.map(p,function(mt){return[mt.type,mt.suffixes].join("~");}).join(",")].join("::");}).join(";"),_fonts().join('+')].join("###");}function _md5(){if(typeof window.md5==="function"){return md5(_raw());}else{throw"md5 unavailable, please get it from http://github.com/wbond/md5-js/";}}function _fonts(){if(typeof $.fontlist==="function"){return $.fontlist();}else{return[];}}return _md5();}})(jQuery); \ No newline at end of file