Prevent chrome.notifications API from hiding my notification after a few seconds
google-chrome, google-chrome-extension
Solution
Notification now has (since Chrome 50) a `requireInteraction` property to force the notification to stay on screen:
var notification = new Notification("TITLE", {
icon: 'assets/res/icon.png',
body: "MESSAGE",
requireInteraction: true
});
In `onclick` you have to close the notification:
notification.onclick = function()
{
this.close();
}
Problem
I'm doing around 1-2 notifications a day and it's important the user doesn't miss it. Is there a way of removing the auto close and only allowing the user to manually close the notification? I don's see any option for this in the Notification Options: http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions