我正在尝试在我的网站上实现对WebKit本机桌面通知的支持.当我试图要求用户允许使用通知时,绝对没有任何反应.例如,以下HTML不会提示Chrome请求我的许可:
<html lang="en">
<head></head>
<body>
<h1>Testing</h1>
<script>
window.webkitNotifications.requestPermission();
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我知道我的Chrome版本没有任何问题,因为其他网站(例如http://www.html5rocks.com/tutorials/notifications/quick/)运行良好:我可以看到提示和后续通知.
html5 notifications webkit google-chrome html5-notifications