示例代码

The page shows how you can access WebNotification.

HTML:

  <head>
  <script type="text/javascript">

  function onpermission() {
    if (webkitNotifications.checkPermission() == 0) {
      var n = webkitNotifications.createNotification("abc", "hello", "dolphin");
      n.show();
    }
  }

  function onloaded() {
    webkitNotifications.requestPermission(onpermission);
  }
  </script>
  </head>