Pointers for building a plugin for browser fingerprinting

By default in Javascript, when you create a function() closure, you create a new context with a new this.

Since your sample code above includes two function()s, the value of this will be overridden both times.

An easy way to get around this is to replace your function() with the ES2015 Arrow.

Having said that, even if you do fix it, the value of this in the initializer does not have a this.get('controllers') in it. You’ll need to look it up on the container, like:

container.lookup('controller:fingerprint') instead.

(the container is passed as an argument to the initializer).