Skip to content

Conversation

Josh-Cena
Copy link
Member

Fix #9167. I did not change the other occurrences of new Notification because they look like quick examples.

@Josh-Cena Josh-Cena requested review from a team as code owners September 17, 2025 16:15
@Josh-Cena Josh-Cena requested review from sideshowbarker, a team and wbamberg and removed request for a team and sideshowbarker September 17, 2025 16:15
@github-actions github-actions bot added Content:WebAPI Web API docs Content:PWA Progressive Web Apps content labels Sep 17, 2025
@Josh-Cena Josh-Cena requested review from captainbrosset and removed request for a team September 17, 2025 16:15
@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Sep 17, 2025
Copy link
Contributor

github-actions bot commented Sep 17, 2025

Preview URLs

Flaws (3)

Note! 3 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/Notification/Notification
Title: Notification: Notification() constructor
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/API/Notification/requestPermission which is a redirect

URL: /en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API
Title: Using the Notifications API
Flaw count: 2

  • unknown:
    • Error serializing baseline for numeric-seperators: missing field description``
    • Error serializing baseline for single-color-gradients: missing field description``
External URLs (1)

URL: /en-US/docs/Web/API/Notification/Notification
Title: Notification: Notification() constructor

(comment last updated: 2025-09-19 23:44:20)

Next, it registers a service worker:

```js
let swRegistration = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look fine but I haven't tested it. I guess the corresponding changes in https://github.com/mdn/pwa-examples/tree/main/js13kpwa need to be made.

@wbamberg
Copy link
Collaborator

The spec says that notifications created using the constructor are "non-persistent notifications", and notifications created by ServiceWorkerRegistration.showNotification() are "persistent notifications", and that they have quite different behaviors.

It would be great to talk about this all explicitly in these docs, and that could also cover the use cases for the different types, and why persistent notifications are not so applicable on mobile.

But I suppose that's out of scope for this PR.

@Josh-Cena
Copy link
Member Author

But I suppose that's out of scope for this PR.

Indeed, and we already have #30931

@wbamberg
Copy link
Collaborator

But I suppose that's out of scope for this PR.

Indeed, and we already have #30931

Ah, great. I think that extra context will really help it all make sense.

@wbamberg wbamberg merged commit 3e8eb2b into mdn:main Sep 20, 2025
8 checks passed
@Josh-Cena Josh-Cena deleted the notif-mobile branch September 20, 2025 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:PWA Progressive Web Apps content Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content bug: PWA Notification guide only works on desktop browsers.
2 participants