Skip to content

Messaging Compat check service worker environment incorrectly. #5347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Feiyang1 opened this issue Aug 23, 2021 · 0 comments · Fixed by #5353
Closed

Messaging Compat check service worker environment incorrectly. #5347

Feiyang1 opened this issue Aug 23, 2021 · 0 comments · Fixed by #5353
Assignees
Milestone

Comments

@Feiyang1
Copy link
Member

navigator is available in both browser and sw context, so it can't be used to determine the environment. See https://github.com/firebase/firebase-js-sdk/blob/master/packages-exp/messaging-compat/src/registerMessagingCompat.ts#L37

We can use self && 'ServiceWorkerGlobalScope' in self which is currently used in v8.

@Feiyang1 Feiyang1 added this to the v9 GA milestone Aug 23, 2021
@firebase firebase locked and limited conversation to collaborators Sep 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants