4

我是 chrome 扩展开发的初学者。当我的后台脚本完成其某些方法时,我正在尝试显示桌面通知,但我不知道如何为此请求权限。有没有办法完成这个任务?

可以使用内容脚本来完成,但我想通过后台脚本显示通知,没有后台页面。

4

1 回答 1

3

您需要在 manifest.json 文件中添加通知:

"permissions": ["tabs", "notifications","management"]

然后你可以打电话

webkitNotifications.createNotification('images/message48.png', title, message);
于 2013-02-13T13:04:59.317 回答