Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 chrome 扩展开发的初学者。当我的后台脚本完成其某些方法时,我正在尝试显示桌面通知,但我不知道如何为此请求权限。有没有办法完成这个任务?
可以使用内容脚本来完成,但我想通过后台脚本显示通知,没有后台页面。
您需要在 manifest.json 文件中添加通知:
"permissions": ["tabs", "notifications","management"]
然后你可以打电话
webkitNotifications.createNotification('images/message48.png', title, message);