webworkify-webpack icon indicating copy to clipboard operation
webworkify-webpack copied to clipboard

Support nested WebWorker

Open xqq opened this issue 2 years ago • 0 comments

Hi, sometimes we have the need to construct a new Worker inside a Worker that makes them to be nested.

The existing code seems to be assumed to be executed only in the main thread. In order to support constructing a new Worker inside an existing worker, We should avoid using window for pointing to the global object. I replaced it with self so it could be executed under both the main thread and DedicatedWorker.

xqq avatar Oct 09 '23 02:10 xqq