Chrome扩展开发:自动关闭通知框 [英] Chrome extension development: auto close the notification box

查看:27
本文介绍了Chrome扩展开发:自动关闭通知框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

做某事后,我运行此代码:

After doing something I run this code:

var notification = webkitNotifications.createNotification(
   'icon.png',  // icon url - can be relative
  'Done!',  // notification title
  'Just updated your list!'  // notification body text
   );
  notification.show();

当然会在用户屏幕上弹出通知.

which of course pops up a notification into the users screen.

无论如何要计时此通知,以便它在 X 秒内自动关闭?

It there anyway to time this notification so that it auto-closes in X amount of seconds?

谢谢!R

推荐答案

可以使用notification.cancel();

这篇关于Chrome扩展开发:自动关闭通知框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆