This commit is contained in:
Zongmin Lei
2018-05-25 14:39:54 +08:00

View File

@@ -32,7 +32,7 @@ if (typeof window !== "undefined") {
// using `xss` on the WebWorker, output `filterXSS` to the globals
function isWorkerEnv() {
return typeof self !== 'undefined' && self instanceof DedicatedWorkerGlobalScope;
return typeof self !== 'undefined' && typeof DedicatedWorkerGlobalScope !== 'undefined' && self instanceof DedicatedWorkerGlobalScope;
}
if (isWorkerEnv()) {
self.filterXSS = module.exports;