Reputation: 5574
im trying to spawn a web worker inside a web worker but im getting this error:
mainWorker.js:92 Uncaught ReferenceError: Worker is not defined
using this code:
var worker = new Worker('subWorker.js');
worker.postMessage(......);
is this possible in some way??
Upvotes: 8
Views: 4159
Reputation: 12025
For anyone who stumbles here, nested workers now have some support in Chrome at least: https://www.chromestatus.com/feature/6080438103703552:
Dedicated workers can create nested workers, but shared workers and service workers cannot.
Creating a nested dedicated worker from a shared worker is not yet supported.
Nested shared workers are also in the spec, but there is no plan to support them at this time.
Upvotes: 7