Web Push notifications in Firefox

Revision Information
  • Revision id: 159671
  • Created:
  • Creator: AliceWyman
  • Comment: Image:Fx56AllowNotifications added; New section "How do I stop Firefox asking me .." is for fx59 (bug 1368744)
  • Reviewed: Yes
  • Reviewed:
  • Reviewed by: AliceWyman
  • Is approved? Yes
  • Is current revision? No
  • Ready for localization: Yes
  • Readied for localization:
  • Readied for localization by: AliceWyman
Revision Source
Revision Content

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.

Fx56AllowNotifications

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 specific website by following these instructions:

  1. Click the Site Info button icon to bring up the Control Center.
  2. Click the arrow in the prompt.
  3. Click More information to bring up the Page Info window.
  4. Click the Permissions tab.
  5. Under Receive Notifications, choose a notification option: Always Ask, Allow, or Block. If your choices are greyed out, remove the checkmark next to Use Default.

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 for 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. In the Menu bar at the top of the screen, click Firefox and then select Preferences or Settings, depending on your macOS version.Click the menu button Fx89menuButton and select Settings.
  2. In the Privacy & Security panel, go to the Permissions section.
  3. Click the Choose buttonSettings button next to Notifications.
  4. Select the website.
  5. Click Remove Website.
  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.

To stop notifications on a specific webpage (requires a page reload): Click the Site Info button icon to bring up the Control Center, find the Receive Notifications permission and click the x next to Allowed to remove the permission.

How do I add Web Push to my website?

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

How do I stop Firefox asking me to allow notifications?

If a site indicates to Firefox that it wants to show notifications, by default, Firefox asks whether you want to grant permission. You can set Firefox to automatically deny permission without asking. Even after the change, you can make exceptions for sites you want to show notifications or use push features.

  1. Go to the Firefox menu New Fx Menu and select OptionsPreferences.
  2. Select the Privacy & Security panel, scroll down to the Permissions section, and click the Settings… button to the right of Notifications.
  3. Check the box for "Block new requests asking to allow notifications" and then click Save Changes.

How do I disable Web Push completely?

To disable Web Push and stop the "Enable notifications?" prompt on every webpages:

  1. Type about:config in the address bar and press EnterReturn.
    A warning page may appear. Click Accept the Risk and Continue to go to the about:config page.
  2. Search for dom.webnotifications.enabled.
  3. Double-click on the search result to change the value from true to false.
  4. Search for dom.push.enabled.
  5. Double-click on the search result to change the value from true to false.