Skip to content

Messaging Compat check service worker environment incorrectly. #5347

Closed
@Feiyang1

Description

@Feiyang1

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions