【发布时间】:2013-05-07 05:55:24
【问题描述】:
我正在尝试使用新的 HTML 通知 API... 我仍然停留在请求授权阶段; 当用户点击一个按钮时,它会执行该功能:
// this is all inside a click handler
var fn = console.info;
window.Notification.requestPermission(function(grant) {
fn(grant);
});
当我第一次在 chrome 中尝试此操作时,出现了 chrome 的消息,询问我是否要向我的 localhost 网站承认通知授权...我说不(只是为了测试这种情况)。然后我又试了一次,但是 chrome 的那条消息一直没有出来。
我的问题: 如果用户改变对通知的看法,如何为网站启用通知? 也许我必须更改 chrome 设置中的某些内容?
提前致谢
【问题讨论】:
标签: javascript html google-chrome notifications html5-notifications