Fixed bug preventing to work on Node.js

```window``` is not defined in Node.js, checking its type instead of it exists is safer and allow to use the plugin from command line.
> I'd recommend checking location instead and dropping the window proxy.

What do you mean? I don't understand what do you want to check.