search

Home  >  Q&A  >  body text

javascript - 有没有 Chrome “桌面通知”的相关开发示例?

Chrome 有一个特性就是具备了“桌面通知”功能,我想在自己的站点加上这个功能。有没有相关的示例代码(javascript)和开发资料呢?

Gmail 在收到新的聊天讯息或电子邮件时在桌面上显示弹出式窗口通知:

ringa_leeringa_lee2897 days ago1016

reply all(3)I'll reply

  • 阿神

    阿神2017-04-10 12:43:40

    主要是用到了 Webkit 的提供的 APIwindow.webkitNotifications.createNotification
    这里有几个简单的示例:
    http://www.html5rocks.com/en/tutorial...
    http://beakkon.com/tutorial/html5/des...
    http://0xfe.blogspot.com/2010/04/desk...
    还有 Chromium 官方的 API 说明书:
    http://www.chromium.org/developers/de...

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-10 12:43:40

    desktop notification —— google 一下你就知道 :)

    reply
    0
  • ringa_lee

    ringa_lee2017-04-10 12:43:40

    第一个答案过时,详见http://stackoverflow.com/questions/2271156/chrome-desktop-notification-example

    reply
    0
  • Cancelreply