Chrome Rich Notifications for Extensions Only?

▼魔方 西西 提交于 2019-12-02 19:06:29

问题


I have a page that I would like to enhance by using Chrome's Rich Notifications. The pages I've read however, seem to imply that this API is only available to Chrome extensions. Is this the case? I would love to take advantage of the API, but I don't want to invest the time in converting my web application into a Chrome extension unless absolutely necessary.

Thanks!


回答1:


I does seem that without writing an extension for your webapp, or converting your webapp into a full (packaged) Chrome App, you cannot get access to chrome.notifications.

I've tried to make a Hosted App with "notifications" permission in the manifest, but that only grants access to HTML5 Notification without asking the user. Same goes for background pages.

Your best bet is to make a minimalistic extension that your page can communicate with. Once that is published, you can advertise the extension to your users with Inline Install.



来源:https://stackoverflow.com/questions/26621042/chrome-rich-notifications-for-extensions-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!