[Webkit-unassigned] [Bug 248309] New: notification.close() not working

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 24 08:11:01 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=248309

            Bug ID: 248309
           Summary: notification.close() not working
           Product: WebKit
           Version: Safari 16
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Service Workers
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: andy at ukclimbing.com

Calling notification.close() (from both inside and outside a service worker) doesn't remove the notification(s)

Use case:
Removing notifications that no longer apply to user, for instance if they have visited a page the notification would take them to.


To replicate
- Have a notification in Notification Centre created by current site
- get all notifications, then call notification.close()


>From a window:
navigator.serviceWorker.ready.then(function(registration) {
        registration.getNotifications().then((notifications) => {
                for (let notification of notifications) {
                        notification.close()
                }
        })
})

>From within a service worker:
self.registration.getNotifications().then((notifications) => {
        for (let notification of notifications) {
                notification.close()
        }
})

Expected results
The notification in notification is removed

Actual result
The notification remains

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221124/9decd674/attachment-0001.htm>


More information about the webkit-unassigned mailing list