cancel
Showing results for 
Search instead for 
Did you mean: 

Web Push notifications in Firefox

Web Push allows websites to notify users of new messages or updated content. While Firefox is open, websites who have been granted permissions can send notifications to your browser and display them on the screen. Users can easily allow or disable notifications and control how these notifications appear.

Upgraded Notifications

Starting with version 44, Firefox can deliver on-screen notifications even when that site isn’t loaded. Using the Push API, a W3C standard, Firefox receives a push message and can show notifications (if permitted by the user) at any time. Sites can also use Push to update data in the background even without showing you a notification. If you already gave permission to a site to send notifications, the site will also be able to use the Push API. You can choose whether or not to give permission for a site to send you notifications by following these instructions:

  1. Click the Site Info button icon to bring up the Control Center.
  2. Click the menu next to Permissions and choose a notification option: Always Ask, Allow, or Block.

What is Web Push?

Web Push is an optional feature that allows websites to send you messages even when the site isn’t loaded. Sites can use this feature to provide you with notifications or update data in the background.

For instance, you can subscribe to notifications from your favorite shopping websites which can notify you of new promotions or offers. You can subscribe to notifications from different websites. A concert site may offer you notifications for shows of your favorite band; you allow that site to notify you, and a week later you get a notification that your band is on tour.

You will only receive messages from sites for which you have granted permission.

How does it work?

Websites can install a Service Worker, a background web page with a limited set of functionality, that can subscribe to the push service. The website can then send a push message through Mozilla’s Web Push service to your browser, which can process that message and display a notification on your screen.

push notification 44

Clicking the notification can open a website or switch to that site’s tab if loaded.

What information do I share with a website?

A website that has been granted permissions can send you push messages when the site isn’t loaded. A quota limits the number of push messages without an on-screen notification that sites can send you. Websites that exceed the quota will have its push messaging disabled and the user must revisit the website again to resubscribe. Web Push does not directly allow websites to determine your IP address.

What information does Firefox use to provide Web Push?

Firefox maintains an active connection to a push service in order to receive push messages as long as it is open. The connection ends when Firefox is closed. On our server we store a randomized identifier for your browser, along with a randomized identifier for each site you authorize.

On Firefox for desktop, the push service is operated by Mozilla. Firefox for Android uses a combination of the Mozilla Web Push service and Google’s Cloud Messaging platform to deliver notifications to Firefox for Android.

In both cases, push messages are encrypted per the IETF spec and only your copy of Firefox can decipher them. The encrypted messages are stored on the server until they are delivered or expire.

How do I revoke Web Push permissions from a specific site?

Web Push is always opt-in in Firefox. A site cannot send you push messages without your permission. To stop a specific site from sending you push messages:

  1. Go to the Firefox menu New Fx Menu and select OptionsPreferences.
  2. Select the Content panel and click the Choose… button under Notifications.
  3. Select the site.
  4. Click Remove Site.

To stop all sites from sending you push messages, follow the above steps except, instead of selecting a specific site, click Remove All Sites. Websites will not be able to send you messages and will need to ask your permission to send them in the future.

How do I add Web Push to my website?

The Push API specification explains how to create a Service Worker and send push messages.

Customize this article

Firefox

Firefox for Android

Firefox for iOS

Firefox OS

Thunderbird

Version History
Revision #:
3 of 3
Last update:
3 weeks ago
Updated by:
 
Comments

Bug 1220250 - Create a Learn More SUMO page for Push Notifications

Related bugs: Bug 1209992 - (Updated) Content for Landing Page for Learn More link in Push notification dialog - reflecting combined Push and Web Notification permission Bug 1192458 - Consolidate push and desktop notification permissions


For past discussions related to Push Notifications, see: https://support.mozilla.org/en-US/kb/permissions-manager-give-ability-store-passwords-set-cookies-mo... [Fx 40] default permissions need update for "Receive Push Notifications".

https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox/discuss/6314 [Fx40] Registered Service Workers - about:serviceworkers

https://support.mozilla.org/en-US/kb/page-info-window-view-technical-details-about-page/discuss/6340 New screenshots, Permissions: [fx40] Receive Push Notifications [Fx42] Enter Fullscreen gone ...

I approved this article based on a PM I received, that the content needs approval today and Joni is unavailable. It's in the Administration category and is NOT ready to localize.

Also related: Bug 1201398 - Web Notification management interface

https://support.mozilla.org/en-US/kb/settings-for-web-content-pop-ups-fonts-languages/discuss/6356 [fx44] Content panel to include Notifications section

The current revision of this article has this content under the section, How do I disable Push permanently

Push is always opt-in in Firefox. A site cannot send you push messages without your permission. If you wish to disable the feature completely, please follow these steps:

  1. Go to the Firefox menu New Fx Menu and select {for win}{menu Options}{/for}{for mac,linux}{menu Preferences}{/for}
  2. Select the {menu Content} panel and click the {button Choose} button under Notifications
  3. Click {button Remove All Sites}

Websites will not be able to send you messages and will need to ask your permission to send them in the future.


The instructions for this article are based on bug 1209992 (should "permanently" be removed from the section title?). The section says that using the "Remove All Sites" button will disable the feature completely but won't it just stop previously allowed sites from sending push notifications? Any site can still ask permission. With a title like "How do I disable Push?" many users expect to learn how to stop websites from asking permission.

The instructions given in the old version of https://www.mozilla.org/en-US/firefox/push/ were, In the URL bar, type about:permissions Set the Receive Push Notifications to Block. Websites will not be able to send you messages or ask for access to Push.

Is there any preference to disable push? Is "Receive Push Notifications" gone from the Permissions Manager in Firefox 44? What about the dom.push.enabled preference?

Another question: See this Nightly Content panel screenshot just posted by ideato in this thread: https://support.mozilla.org/en-US/kb/settings-for-web-content-pop-ups-fonts-languages/discuss/6356

Nightly 45 content

What does the new "Do not disturb me" checkbox do?

P.S. To answer my own question I found http://www.ghacks.net/2015/10/22/firefox-44-do-not-disturb-for-notifications/ which says it will block all notifications for the session. Please note that this includes notifications that you have allowed explicitly as well. The setting resets to its default state automatically on restart or new launch of the browser.

AliceWyman said

The instructions given in the old version of https://www.mozilla.org/en-US/firefox/push/ were, In the URL bar, type about:permissions Set the Receive Push Notifications to Block. Websites will not be able to send you messages or ask for access to Push. Is there any preference to disable push? Is "Receive Push Notifications" gone from the Permissions Manager in Firefox 44? What about the dom.push.enabled preference?

I'll have to answer my own question again ;-) See: https://mail.mozilla.org/pipermail/firefox-dev/2015-November/003516.html Intent to remove about:permissions Matthew N. MattN+firefox-dev at mozilla.com Sun Nov 8 08:14:40 UTC 2015 (Quote) I don't think that matters since about:permissions is unsupported UI so just because an option exists there doesn't mean it's supported and will continue to work. I think many of those global options already aren't currently officially supported and most just map to about:config prefs which can be flipped at the user's own risk with the disclaimer that about:config provides.

To put this another way, I was recently suggesting we remove the notifications section from about:permissions in 44 so that we don't ship with ​it in the initial version with push since disabling push/notifications globally isn't something that I want to support. Users can simply not allow or block the functionality for specific sites. For every binary option we support it doubles the number of combinations to test and I'll argue we don't have the resources to support this doubling.<snip>


So ... it looks like, even without about:permissions, Push notifications can still be blocked globally via the Firefox Configuration Editor (about:config page) by setting the dom.push.enabled preference to false. Anyway, that's how I read the above. We should probably add that information to this article.

(Related discussion in the Permissions Manager - Give certain websites the ability to store passwords, set cookies and more article forum.)

See also: http://www.ghacks.net/2015/11/04/everything-you-need-to-know-about-push-notifications-in-firefox/ (Quote) There is no option to disable Push completely in Firefox's interface. You may ignore the prompts or block sites from displaying push prompts in future sessions but that is about it.

You may however disable it fully in the following way:

  1. Type about:config in the address bar and hit enter. This opens Firefox's advanced configuration.
  2. Confirm you will be careful if a warning prompt appears.
  3. Search for dom.push.enabled.
  4. Double-click the preference to set it to false.

The "Do not disturb me" checkbox in the Content panel is explained here:

Bug 1208346 - nsIAlertService: Do Not Disturb backend (fixed in fx44)

A "Do Not Disturb" function is also mentioned in Bug 1201398 - Web Notification management interface


Bill Maggs (bmaggs) 2015-09-23 11:40:18 PDT (Quote) The experience as described in the bug and attachment above is the plan for 44. There will be a Notifications heading of the Content Pane, with subheading that includes a checkbox for a Do Not Disturb function and a detail view similar to that for Popups that allows turning off Notifications centrally (across sites).

In 45, we plan to incorporate a new design for Notifications Management into a Permissions Preferences area that includes all your permissions.


See also: Bug 1205172 - Do Not Disturb Button for Push Notifications on Windows (fixed in fx44)

See Bug 1232389 - make push notifications sumo page more user friendly

This is a silent release for version 44 and the goal is to just make sure developers know about it. There's no rush to localize this until version 45.

push content panel 44 winxp screenshot to use it in the article (without DRM)

push content panel 44 winxp

cheers :-)

ideato said

push content panel 44 winxp screenshot to use it in the article (without DRM)

I added [[Image:push content panel 44 winxp]] to the article for winxp,linux,mac

This article is a Learn More link from the Firefox 44 Content Panel, under Notifications. An edit to the Settings for web content, pop-ups, fonts, and languages article was recently approved RFL adding a link to this article.

Since this article is still in the Administration category, I moved it to the "How to" category.