Skip to content

Fix for checking web worker env#1966

Open
croath wants to merge 1 commit into
protobufjs:masterfrom
croath:master
Open

Fix for checking web worker env#1966
croath wants to merge 1 commit into
protobufjs:masterfrom
croath:master

Conversation

@croath

@croath croath commented Jan 26, 2024

Copy link
Copy Markdown

In web workers, typeof window returns a object but not undefined.

Fix:

Try to detect if the env is a web worker by checking self first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant