feat: support for Web Worker env issue #124
This commit is contained in:
8
dist/xss.js
vendored
8
dist/xss.js
vendored
@@ -448,6 +448,14 @@ if (typeof window !== "undefined") {
|
||||
window.filterXSS = module.exports;
|
||||
}
|
||||
|
||||
// using `xss` on the WebWorker, output `filterXSS` to the globals
|
||||
function isWorkerEnv() {
|
||||
return typeof self !== 'undefined' && self instanceof DedicatedWorkerGlobalScope;
|
||||
}
|
||||
if (isWorkerEnv()) {
|
||||
self.filterXSS = module.exports;
|
||||
}
|
||||
|
||||
},{"./default":1,"./parser":3,"./xss":5}],3:[function(require,module,exports){
|
||||
/**
|
||||
* Simple HTML Parser
|
||||
|
||||
Reference in New Issue
Block a user