Skip to content

Commit

Permalink
WebExtensions use system notifications on Windows now (#32093)
Browse files Browse the repository at this point in the history
* WebExtensions use system notifications on Windows now

* Update screenshot and text for notification API and improve alt text.

* Compress image

* nits

---------

Co-authored-by: rebloor <git@sherpa.co.nz>
  • Loading branch information
stevennyman and rebloor committed Feb 28, 2024
1 parent 24a37f2 commit 09d1a68
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ browser-compat: webextensions.api.notifications

Display notifications to the user, using the underlying operating system's notification mechanism. Because this API uses the operating system's notification mechanism, the details of how notifications appear and behave may differ according to the operating system and the user's settings.

To use this API you need to have the "notifications" [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions).
On macOS, the notification looks something like this:

The notification looks the same on all desktop operating systems. Something like:
![Example notification on macOS, located below the system clock, with a bold title reading "Click notification" followed by regular text reading "You clicked https://developer.mozilla.org/en-US/docs/MDN". The notification has the Firefox Nightly logo on the left side, and a link icon on the right.](notification-macos.png)

![Example notification with a bold title and regular text](notification.png)
On Windows, the notification persists in the Action Center until the browser is closed. The notification looks something like this:

![Example notification on Windows 10, located above the system clock, with a bold title reading "Click notification" followed by regular text reading "You clicked https://developer.mozilla.org/en-US/docs/MDN". The notification has a small Firefox logo in the top left corner that is followed by "Mozilla Firefox", and a link icon to the left of the primary notification text.](notification-windows.png)

To use this API, you need to have the "notifications" [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions).

## Types

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page-type: guide

Notifications allow you to communicate information about your extension or its content using the underlying operating system's notification service.

![Click notification in the top right corner of the browser window.](notify-shadowed.png)
![Example notification on macOS, located below the system clock, with a bold title reading "Click notification" followed by regular text reading "You clicked https://developer.mozilla.org/en-US/docs/MDN". The notification has the Firefox Nightly logo on the left side, and a link icon on the right.](notify-shadowed.png)

Notifications can include a call to action for the user, and your add-on can listen for the user clicking the notification or the notification closing.

Expand Down

0 comments on commit 09d1a68

Please sign in to comment.