GCM等同于Firefox [英] GCM Equivalent for Firefox
问题描述
我正在开发一个Chrome和一个Firefox扩展/插件。我正在使用Firefox扩展的Web扩展API。
现在,Web扩展API还不支持chrome.gcm。* API。从本质上讲,Firefox扩展无法与GCM通话。
有没有像firefox扩展可以与之聊天的GCM? Firefox提供的东西就像Google为其Chrome浏览器提供的GCM一样?如果没有,请问有人可以解释如何在Firefox扩展中实现这一点?
更新:
即使对于web应用程序,不使用类似于GCM的东西。他们使用服务人员。 Firefox浏览器扩展能否与服务工作者交互?
Firefox扩展目前不能直接使用服务工作者(根据一个实施服务的人,工作人员支持Firefox )。
Firefox还有其他一些类似GCM的扩展可以与之交谈吗? Firefox提供的东西就像Google为其Chrome浏览器提供的GCM一样吗?
是的,有一个Firefox的GCM等价物。 Firefox用户访问的所有Web应用程序都会接收到推送通知,这些通知是通过 dom.push.serverURL
用户首选项给出的服务器获取的。如果你在 about:config
中检查 dom.push.serverURL
,你会看到 wss ://push.services.mozilla.com/
,这是 - 实质上,Mozilla相当于GCM。
后端运行 AutoPush ,一个基于Python的开源Push Server软件项目和客户端这是(如问题中指出的)通过服务人员暴露给Web应用程序。所以,尽管Firefox扩展可以使用Mozilla推送服务连接替代方法,但是,只有公开记录的方式是通过标准Web推送API 依赖于服务人员,而这些服务人员尚未在Firefox扩展中使用nsions。
Google Cloud Messaging (GCM) is a service that enables developers to send data from servers to both Android applications or Chrome apps and extensions.
I am developing a chrome and a firefox extension/add-on. I am using the Web Extension APIs for Firefox extension.
Now, Web Extension APIs don't support chrome.gcm.* APIs yet. Essentially, a firefox extension cannot talk to GCM.
Is there something else like GCM to which a firefox extension can talk to? Something provided by the Firefox just like GCM provided by Google for its browser Chrome? If not, can someone please explain how to achieve this in a Firefox Extension?
Update: Even for web apps, firefox doesn't use something similar to GCM. They use service workers. Can Firefox Browser Extensions interact with service workers?
Firefox extensions currently can’t use service workers directly (according to an implementor who worked on service-workers support in Firefox).
Is there something else like GCM to which a firefox extension can talk to? Something provided by the Firefox just like GCM provided by Google for its browser Chrome?
Yes, there’s a Firefox equivalent of GCM. All Web apps a Firefox user accesses that receive push notifications get them from a server given by the dom.push.serverURL
user preference. If you check dom.push.serverURL
in about:config
, you’ll see wss://push.services.mozilla.com/
, which is the Mozilla Push Service—essentially, Mozilla’s equivalent of GCM.
The backend of that runs AutoPush, a Python-based open-source Push Server software project, and the client side of it is (as noted in the question) exposed to Web apps through service workers.
So while there may be an alternative way Firefox extensions can connect with Mozilla Push Service, the only publicly-documented way is through the standard Web Push API that relies on service workers, which are not available yet for use in Firefox extensions.
这篇关于GCM等同于Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!