Skip to content

Commit 45d9e29

Browse files
committed
Add IndexedDB check
1 parent 43fffee commit 45d9e29

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/messaging/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ function isSupported(): boolean {
105105
*/
106106
function isWindowControllerSupported(): boolean {
107107
return (
108+
'indexedDB' in window &&
109+
indexedDB !== null &&
108110
navigator.cookieEnabled &&
109111
'serviceWorker' in navigator &&
110112
'PushManager' in window &&
@@ -120,6 +122,8 @@ function isWindowControllerSupported(): boolean {
120122
*/
121123
function isSWControllerSupported(): boolean {
122124
return (
125+
'indexedDB' in self &&
126+
indexedDB !== null &&
123127
'PushManager' in self &&
124128
'Notification' in self &&
125129
ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&

0 commit comments

Comments
 (0)