Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create browser fingerprint

Tags:

javascript

I wish to create a browser fingerprint for every user on my website. I do this by iterating trough winow.screen window.navigator object properties. I copy them to an object.

The problem is at window.navigator.plugins when I use JSON.stringify I don't get the filename of plugins installed. The property is there but somehow is not serialized using JSON.stringify.

The object is like this window.navigator.plugins[0].filename

How can I get all object content using stringify ?!

like image 861
opc0de Avatar asked Dec 06 '25 08:12

opc0de


1 Answers

This will turn it into an array and extract only the filename from there, which can then be stringified properly:

[].slice.call(navigator.plugins).map(function(plugin){return plugin.filename})
JSON.stringify([].slice.call(navigator.plugins).map(function(plugin){return plugin.filename}))
like image 56
Scimonster Avatar answered Dec 07 '25 21:12

Scimonster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!