chrome.notifications.update() or create()
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want my chrome extension to take a notification.id , and: Update an existing notification if it does exist. OR Create a new notification if it doesn't exist. Calling clear() then create() is not ideal, since the animation is visually jarring for both remove() and create() methods, where I want to update without animations. Plus, obviously, calling update() on a disappeared notification doesn't do anything. Is there an easy way to implement this? 回答1: Edit: This approach no longer works on any platform except ChromeOS due to the removal of