Open Bug 1563951 Opened 5 years ago Updated 7 days ago

Web Push Notifications Event: notificationclose event is triggered when clicked the notification

Categories

(Core :: DOM: Notifications, defect, P3)

67 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: shmdhussain12, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Steps to reproduce:

I send notification and clicked the notification , browser is triggering the notificationclose along with notificationclick event.

Actual results:

when click on notification browser is triggering the notificationclose along with notificationclick event.

Expected results:

when click on notification, Only notificationclick event should be triggered as other browsers

Hi shmdhussain12, can you please add al the exact steps that you are taking in order to try to reproduce this issue.
Also, can you please install FF Nightly and try to see if the issue is reproducible on this version, please use this link to download the build:https://www.mozilla.org/en-US/firefox/nightly/all/

Component: Untriaged → DOM: Push Notifications
Flags: needinfo?(shmdhussain12)
Product: Firefox → Core

Just go to the https://web-push-book.gauntface.com/demos/notification-examples/

subscribe for the notification.

Put the breakpoint for both notificationclick and notificationclose in the in the service worker debugger for this website, about:debugging#workers

Try to send the notification, notification will come, see both the notificationclick and notificationclose handlers are triggered, but i clicked the notification to open only, I didn't mean to close it.

Note: Not able to debug sw in developer edition and nightly

Flags: needinfo?(shmdhussain12)
Priority: -- → P3
Severity: normal → S3

I believe the concurrent generation of click and close events is historically expected behavior for Firefox's notifications API on desktop, although the details vary per platform depending on the alerts widget backend.

I believe it's just that Chrome somehow never fires either Notification.onclose or onnotificationclose. Closing a notification does not fire it at all, while it does on macOS. I smell wontfix here.

Component: DOM: Push Subscriptions → DOM: Notifications
You need to log in before you can comment on or make changes to this bug.