Ensure root is set correctly when required by a greasemonkey userscript. [closes #759]

This commit is contained in:
John-David Dalton
2014-10-30 22:01:00 -07:00
parent cf724c43cb
commit 0b900d94f7

View File

@@ -277,7 +277,7 @@
};
/** Used as a reference to the global object */
var root = (objectTypes[typeof window] && window) || this;
var root = (objectTypes[typeof window] && window !== (this && this.window)) ? window : this;
/** Detect free variable `exports` */
var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;