Browser fingerprinting with JavaScript
Snippet for creating a unique ID of client's browser.
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="https://raw.github.com/placemarker/jQuery-MD5/master/jquery.md5.js" type="text/javascript"></script>
<script type="text/javascript">
function getBrowserFingerprint()
{
var sFP = "";
sFP+="Resolution:"+window.screen.availWidth+"x"+window.screen.availHeight+"\n";
sFP+="ColorDepth:"+screen.colorDepth+"\n";
sFP+="UserAgent:"+navigator.userAgent+"\n";
sFP+="Timezone:"+(new Date()).getTimezoneOffset()+"\n";
sFP+="Language:"+(navigator.language || navigator.userLanguage)+"\n";
document.cookie="sFP";
if (typeof navigator.cookieEnabled != "undefined"
&& navigator.cookieEnabled == true
&& document.cookie.indexOf("sFP") != -1)
sFP+="Cookies:true\n";
else
sFP+="Cookies:false\n"
sFP+="Plugins:"+jQuery.map(navigator.plugins, function(oElement)
{
return "\n"+oElement.name+"-"+oElement.version;
});
return $.md5(sFP);
}
alert(getBrowserFingerprint()); //d36fd202c2ab01a371c54b72b0e8e3c0
</script>
Url: http://sklueh.de/2013/09/browser-fingerprinting-mit-javascript/
Language: JavaScript | User: sklueh | Created: Sep 24, 2013