WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
283793
`indexedDB` undefined when a ServiceWorker is awoken
https://bugs.webkit.org/show_bug.cgi?id=283793
Summary
`indexedDB` undefined when a ServiceWorker is awoken
ricardo
Reported
2024-11-28 01:56:07 PST
Created
attachment 473387
[details]
iOS Safari showing the bug It would seem like `indexedDB` is undefined when a service worker is running in the background. I found this bug while trying to implement a PWA (in fact, it is one of several other Safari-specific issues:
https://developer.apple.com/forums/thread/769794
) As a minimal example, consider this push handler: ```js self.addEventListener("push", function (event) { try { var data = event.data.json(); event.waitUntil(Promise.all([ registration.showNotification( data.title, { body: (data.body || "") + typeof self.indexedDB, icon: "", }, ), ])); } catch (e) { console.error("Error processing push event", e); } }, false); ``` The notification body will end with `object` while the PWA is running, and then it'll end with `undefined` when the app isn't in the foreground. As a minimal example reproducing this, I've got a repository:
https://github.com/ApelegHQ/webpush-demo/tree/indexedDB-webkit-bug
(the branch, 'indexedDB-webkit-bug' is important to see the `indexedDB` issue).
Attachments
iOS Safari showing the bug
(387.13 KB, image/png)
2024-11-28 01:56 PST
,
ricardo
no flags
Details
`indexedDB` is defined in Android
(117.30 KB, image/png)
2024-11-28 01:59 PST
,
ricardo
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
ricardo
Comment 1
2024-11-28 01:59:00 PST
Created
attachment 473388
[details]
`indexedDB` is defined in Android
Radar WebKit Bug Importer
Comment 2
2024-11-28 11:55:06 PST
<
rdar://problem/140667780
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug