is-web-worker
isWebWorker()
Returns true
if the code is running within a web worker.
var isWebWorker = require("can-globals/is-web-worker/is-web-worker");
var GLOBAL = require("can-globals/global/global");
if(isWebWorker()) {
...
}
Returns
{Boolean}
:
True if the environment is a web worker.