Mountain Lion の Safari 6 の設定に「通知」というのがあって、気になったので調べた。
- Web Notification 自体は Apple の PUSH 通知とは独立してる W3C 仕様
- Mountain Lion で通知センターが導入されたので連動するようになった
実際に試すには、インスペクタで
javascript
window.Notification.requestPermission(function(permission){ console.debug(permission) })
new window.Notification("hello")
そうすると、通知センターに出ます。
Webサイトを開いていなくても通知される PUSH 通知的なものを期待していたのでガッカリですが、裏側にでも開いていれば通知されるので使いようなのかなと思います。 Ajax リクエストの重い処理が完了したら通知するとか。
ちなみに、 iOS 6 の Mobile Safari リモートインスペクタ経由で window.Notification にアクセスしようとすると "undefined" でした。
参考資料
https://developer.apple.com/library/safari/#documentation/AppleApplications/Conceptual/SafariJSProgTopics/Articles/SendingNotifications.html
http://dvcs.w3.org/hg/notifications/raw-file/tip/Overview.html
http://dangercove.github.com/html5-notifications/