Chrome extension development: auto close the notification box

前端 未结 5 880
眼角桃花
眼角桃花 2021-01-02 16:35

After doing something I run this code:

var notification = webkitNotifications.createNotification(
   \'icon.png\',  // icon url - can be relative
  \'Done!\'         


        
5条回答
  •  轮回少年
    2021-01-02 16:55

    You'll be able to call window.close() from inside the notification's HTML page. That will close the notification.

    To close at a certain time, calling something like setTimeout( function () { window.close(); }, timeInMicroseconds); should be effective.

提交回复
热议问题