# Pointers for building a plugin for browser fingerprinting

**URL:** <https://meta.discourse.org/t/pointers-for-building-a-plugin-for-browser-fingerprinting/49683>\
**Category:** Development\
**Created:** [September 3, 2016, 8:56pm UTC](https://meta.discourse.org/t/pointers-for-building-a-plugin-for-browser-fingerprinting/49683 "2016-09-03T20:56:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [September 8, 2016, 8:30pm UTC](https://meta.discourse.org/t/pointers-for-building-a-plugin-for-browser-fingerprinting/49683/2 "2016-09-08T20:30:08Z")

</div>

> [@carmalonso](#):
>
> However, this is undefined (expected) and I’m not sure how this is declared.

By default in Javascript, when you create a function() closure, you [create a new context](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) 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](https://babeljs.io/docs/learn-es2015/#arrows-and-lexical-this).

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).

---

_[View the full topic](https://meta.discourse.org/t/pointers-for-building-a-plugin-for-browser-fingerprinting/49683)._
