GCM Equivalent for Firefox

前端 未结 1 425
Happy的楠姐
Happy的楠姐 2020-12-06 18:59

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 develop

1条回答
  •  死守一世寂寞
    2020-12-06 19:43

    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.

    0 讨论(0)
提交回复
热议问题