admin管理员组文章数量:1325594
I created a Chrome extension in which it uses createHTMLNotification()
to show a window on top of everything. However, starting from Chrome 28 Google decided to drop createHTMLNotification()
entirely (why, Google. Why?). All in a sudden I need to find a replacement.
createHTMLNotification()
let me to dynamically change things on the notification. However, I don't think the new Rich Notification let me do that.
Is there any work-around or suggestions? Thanks.
I created a Chrome extension in which it uses createHTMLNotification()
to show a window on top of everything. However, starting from Chrome 28 Google decided to drop createHTMLNotification()
entirely (why, Google. Why?). All in a sudden I need to find a replacement.
createHTMLNotification()
let me to dynamically change things on the notification. However, I don't think the new Rich Notification let me do that.
Is there any work-around or suggestions? Thanks.
Share Improve this question asked May 27, 2013 at 0:13 Derek 朕會功夫Derek 朕會功夫 94.4k45 gold badges197 silver badges253 bronze badges 2-
If you don't need fancy styling, but just an image, header and body, use
webkitNotifications.createNotification(iconURL, head, body);
and.show()
/.close()
to replace content. – Rob W Commented May 27, 2013 at 8:22 -
On Mac OS X when using
webkitNotifications.createNotification
the icon will always be Chrome icon. There seems to be no way around this. – raine Commented Jun 2, 2013 at 14:59
2 Answers
Reset to default 5The change was actually announced properly on the Chromium-Extensions mailing list. There was apparently some misunderstanding though, it was stated in august last year that it would remain in use for extensions, but that only lasted half a year.
Anyway, the official remended replacement is the Rich Notifications API. There is no other workaround planned.
After a little bit thinking, I still didn't want to be stuck with Google's default layout. So I used the image
type notification, and put a generated canvas image on it. I can draw whatever I want, and I also created a little API to update the notification whenever I want. This worked out perfectly for me.
Thank you Google for making everything so plicated...
本文标签: javascriptcreateHTMLNotification() replacementStack Overflow
版权声明:本文标题:javascript - createHTMLNotification() replacement - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742190583a2430137.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论