+9
-1
lines changedFilter options
+9
-1
lines changed Original file line number Diff line number Diff line change
@@ -144,7 +144,15 @@
144
144
}());
145
145
146
146
/*jshint evil: true */
147
-
var getGlobal = new Function('return this;');
147
+
var getGlobal = function () {
148
+
// the only reliable means to get the global object is
149
+
// `Function('return this')()`
150
+
// However, this causes CSP violations in Chrome apps.
151
+
if (typeof self !== 'undefined') { return self; }
152
+
if (typeof window !== 'undefined') { return window; }
153
+
if (typeof global !== 'undefined') { return global; }
154
+
throw new Error('unable to locate global object');
155
+
};
148
156
/*jshint evil: false */
149
157
150
158
var globals = getGlobal();
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4