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 (which is not yet implemented in Gecko).
Bug: 2069920
Specification: 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
Other Browsers: - Blink: Position unknown - issue here: 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).