We've got a Chrome app with working notifications, but the notification only lasts a few seconds and then goes away. Our end users are going to want that notification to stay until they dismiss it. Can that be done? We couldn't find anything in the API documentation regarding notification duration.
1 Answers
Update
Since Chrome 50, you can make a notification persist until dismissed with requireInteraction
flag:
Indicates that the notification should remain visible on screen until the user activates or dismisses the notification. This defaults to false.
Old answer
You can't make a chrome.notifications
notification last forever.
You can sort of control the duration with the priority
parameter. From the relevant article (not the main documentation):
Notifications can be assigned a priority between -2 to 2. Priorities < 0 are only shown in the center; priorities > 0 are shown for increasing duration and more high priority notifications can be displayed in the system tray.
Note: if you call update
changing the notification's priority, it will be re-shown as needed. You can, in principle, try to exploit that to stay visible.
If you do not need features provided by Rich Notifications, you can use web standard Notification
API.
They look similar in Chrome, but do not integrate with the Message Center. As such, they do not disappear unless dismissed by user or programmatically.

- 74,770
- 16
- 179
- 206
-
It appears the `requireInteraction` flag has disappeared from Chrome (chrome://flags) – atomsymbol Apr 08 '19 at 23:37
-
@atomsymbol It never was a flag in this sense. It's a boolean option for a notification. Apologies for calling a boolean a "flag" – Xan Apr 09 '19 at 07:12
-
Looking for how to make chrome notifications **disappear** after a while without having to close them manually. So annoying! Any ideas? – Qwerty Dec 13 '22 at 16:23
-
Any idea how to set requireInteraction? I would love to use it but can't find it in the Settings. – David Spector Mar 30 '23 at 16:55