Webkit notifications requestPermission function doesn't work

后端 未结 2 1313
甜味超标
甜味超标 2020-12-09 16:02

I am trying to implement support for WebKit\'s native desktop notifications on my site. When I try to ask for user\'s permission to use the notifications, absolutely nothing

2条回答
  •  伪装坚强ぢ
    2020-12-09 16:25

    For checking Notification on local file (file://) permission will popup but notification wont work on chrome.

    As a work around you can change

    Content setting > Notification > Allow All websites to show notification

    Shortest code to show notification

    var notification = new Notification("YOUR MESSAGE");
    

提交回复
热议问题