Closed yutro closed 6 years ago
thanks!
Thankfully, Web Workers have been around for a while and are pretty broadly supported. IE10+ supports them.
https://caniuse.com/#feat=webworkers
If you still need to support older browsers, you can just check for the presence of window.Worker
:
if (window.Worker) {
...
} else {
...
}
Might be worth adding a section noting that to the readme if anyone wants to PR!
It may also be possible to polyfill via jsdom-worker.
Worker
is assumed to be present and there is no feature detection, so you either polyfill it or it doesn't.