Register for this year’s #ChromeDevSummit happening on Nov. 11-12 in San Francisco to learn about the latest features and tools coming to the Web. Request an invite on the Chrome Dev Summit 2019 website

We've learnt a lot since Notifications and Push Messaging landed in Chrome. One
specific piece of feedback about Desktop-class devices was that notifications
would stay around and visible on the user's screen until actively dismissed by the user.

When the page is open it is possible to create a simple JavaScript timer that will automatically
close the notification. But we now live in a world with service worker: where web apps can
live past the lifetime of a window and the service workers are put to sleep as quickly as possible
to save resources. This means we need another way to create a good experience for users.

A notification has an associated require interaction preference flag which is initially
unset. When set, indicates that on devices with a sufficiently large screen, the notification
should remain readily available until the user activates or dismisses the notification.

This might seem odd, but what it implies that unless told otherwise the notification
should be removed from view after a short period of time.

Chrome 47 (beta in October 2015) now supports the requireInteraction option. Unless it is explicitly
provided and set to true, all notifications on desktop will be dismissed after
approximately 20 seconds. The interesting part though is that Chrome has
recently just removed the Notification Center from all desktop platforms (but Chrome OS), this means that
minimized notifications are considered to be dismissed and are not accessible in a call to getNotifications
in a service worker.

On Chrome for Android, because the notifications are minimized in the notifications tray area, the
requireInteraction option is ignored.