Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console.log(keys) returns error #72

Closed
graemeblackwood opened this issue Sep 4, 2015 · 5 comments
Closed

console.log(keys) returns error #72

graemeblackwood opened this issue Sep 4, 2015 · 5 comments

Comments

@graemeblackwood
Copy link

When trying to log the results of the fingerprint (Fingerprintjs2 0.7.4), I see an error in both Chrome 44.0.2 and Firefox 40.0.3:

"Uncaught ReferenceError: keys is not defined(anonymous function) @ index.html:83(anonymous function) @ fingerprint2.js:108(anonymous function) @ fingerprint2.js:389"

@Valve
Copy link
Contributor

Valve commented Sep 5, 2015

@graemeblackwood please provide the altered source code which throws the error in a gist

@graemeblackwood
Copy link
Author

https://gist.github.com/graemeblackwood/5db647a03dd129a98c77

It works if I put it inside fingerprint2.js, but I can't find any documentation that shares how to print the keys in the console when initiating the plugin.

@Valve
Copy link
Contributor

Valve commented Sep 6, 2015

@graemeblackwood, ah got it. Keys are not accessible from the outside, it's meant this way. Otherwise any script can just set keys to an empty array. If you want to print the keys, you need to add the line right into the fp2.js source code

@Valve Valve closed this as completed Sep 6, 2015
@graemeblackwood
Copy link
Author

Ok, so my other approach (on line 105) was correct then. Was the resetting of the keys an observed problem with fp1.js?

@Valve
Copy link
Contributor

Valve commented Sep 7, 2015

It was not, but I generally don't want to expose any internal data structures to the outside world. This will make it far too easy for any browser extension to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants