Search code examples
javascripthtmlgoogle-chromenotificationshtml5-notifications

Issue with HTML5 Notification and permission


I'm trying to use the new HTML notification API... I'm still stuck in the request authorization phase; when user click on a button it's executed the function:

// this is all inside a click handler
var fn = console.info;

window.Notification.requestPermission(function(grant) {
    fn(grant);          
});

When i tryed this for the first time in chrome, a chrome's message came out asking me if i want to concede the Notification grant to my localhost web site... I said no (just to test even this case). Then I tried again, but that message from chrome never came out.

My question: If the user change opinion about notification, how could enable notification for a website? Maybe do I've to change something in the chrome settings?

Thanks in advance


Solution

  • You can manage and re-allow notifications in Chrome by going to Settings -> Privacy -> Content Settings -> Scroll down to Notifications - here you can manage which sites are allowed to show notifications and which are not.

    Update:

    As mentioned by @ivan_vaz in the comments, it is also possible to configure this as well as other permissions by clicking the favicon of the website in the address/navigation bar.