Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error when initializing Child Workers #99

Open
@kevinfmoody

Description

I tried initializing child web workers from a parent worker, and it seems to work well with the exception of the following error being thrown:

rpc-wrapper.js:20 Uncaught ReferenceError: document is not defined
 at Worker.<anonymous> (rpc-wrapper.js:20)

Digging in, it seems like its part of building up the ready event, although document is not in scope in the context of a WebWorker.

let evt = document.createEvent('Event');
evt.initEvent(d.method, false, false);
evt.data = d.params;
worker.dispatchEvent(evt);

What is the purpose of the ready event? Is there a way to build the event in a WebWorker-safe manner? I've looked into new Event, but that's not IE compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /