Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Desktop Notification not appearing in Chrome

I've verified that Notification.permission === 'granted', and, 'Notification' in window == true, altho the following Javascript does not make a notification appear in my Chrome browser, Version 70.0.3538.77 (Official Build) (64-bit).

var notif = new Notification('title', {
    icon: 'https://placehold.it/120x120',
    body: 'body'
});

I've executed the above in Chrome Console on the site that I know I've previously Allowed for Desktop Notifications. I've also verified that it's set to Allow in this location:Notifications set to Allow

like image 517
Ian Davis Avatar asked Oct 26 '18 15:10

Ian Davis


2 Answers

Had same issue recently. Solution for me was disabling "Enable native notifications" in chrome://flags . And the reason why I wasnt able to see notifications is because browser wanted to show native notification, and I disabled all windows notifications. Hope it will help someone in future :)

like image 70
Don Reptile Avatar answered Sep 20 '22 06:09

Don Reptile


Okay, I'm writing just in case anyone finds it useful.

I encountered this problem as well and I tried different sites without success. However, @Don Reptile answer gave me a hint as to what may be wrong (I blocked native notifications).

I'm on Windows 10 and this was where I enabled native notifications from Chrome.

Enable Windows Native Notifications

like image 27
eastmael Avatar answered Sep 22 '22 06:09

eastmael