-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Description
I've just begun using NW.js alongside vue.js for a project. When attempting to declare vue via the node require method, I found three issues relating to the navigator, document and DocumentFragment objects, which I'm guessing relates specifically to NW.js but perhaps also other projects as well.
Each of the above object references in the vue.common.js file need to be prefixed with window.. For example:
window.navigatorwindow.documentwindow.DocumentFragment
Failure to do so will result in an undefined error, like this:
Uncaught ReferenceError: navigator is not defined
As @Teevio mentioned in my forum post, it would seem that NW.js only makes these variables available explicitly via the window object. This could be because NW.js provides it's own Window object, which is a wrapper of the DOM’s window object (see here).