Summary:The navigate option for the Notification constructor and ServiceWorkerRegistration.showNotification() allows web developers to specify a URL to navigate to when the notification is clicked. This simplifies handling of notifications in many cases, and matches the corresponding option in Declarative Web Push <https://w3c.github.io/push-api/#dfn-declarative-push-message-parser>(which is not yet implemented in Gecko).

Bug: 2069920 <https://bugzilla.mozilla.org/show_bug.cgi?id=2069920>

Specification: https://notifications.spec.whatwg.org/ <https://notifications.spec.whatwg.org/>

Standards Body: WHATWG

Platform Coverage: All

Preference: dom.webnotifications.navigate.enabled

DevTools Bug: N/A

Extensions Bug: N/A

Use Counter: page.notificationoptions_navigate / worker.service.notificationoptions_navigate

Standards-Positions Discussion:https://github.com/mozilla/standards-positions/issues/1176 <https://github.com/mozilla/standards-positions/issues/1176>

Other Browsers:- Blink: Position unknown - issue here: https://issues.chromium.org/issues/382298314<https://issues.chromium.org/issues/382298314>- WebKit: Shipped since Safari 18.4

Web-platform-tests: Basic tests for checking that the navigate property is stored correctly are at notifications/shownotification.https.window.js. The navigation tests are Gecko-only (testing/web-platform/mozilla/tests/notifications/navigate.https.window.js) since we can’t simulate notification clicking in WPTs (https://github.com/web-platform-tests/wpt/issues/51125 <https://github.com/web-platform-tests/wpt/issues/51125>).

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/952bd558-86dc-4fa6-8ff7-e6b630e8f09e%40mozilla.com.

Reply via email to