Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/freaktechnik/notification-sounds

Makes a sound when a notification is shown
https://github.com/freaktechnik/notification-sounds

firefox notification sound webextension

Last synced: 2 months ago
JSON representation

Makes a sound when a notification is shown

Awesome Lists containing this project

README

        

# ![icon](images/Notification_Sound_Icon_Square.svg) Notification Sound

Makes a sound when a notification is shown.

Overrides Website's `Notification` constructor and `showNotification` method on
ServiceWorker registrations to get notified when they're called. Other extensions
can also let this extension know that they've shown a notification.

Currently can not play a sound when a ServiceWorker shows a notification.

Supports the `silent` and `sound` option on the `Notification` constructor.

## Official Download

[![addons.mozilla.org/](https://addons.cdn.mozilla.net/static/img/addons-buttons/AMO-button_2.png)](https://addons.mozilla.org/firefox/addon/notification-sound/?utm_source=github&utm_content=readme)

## Extension integration

For extensions to trigger a sound when creating a notification, they have to send the following message:

```js
browser.runtime.sendMessage("@notification-sound", "new-notification");
```

`new-notification` returns a Promise that resolves to a boolean, indicating, whether the sound was played (based on user settings).

Starting from Firefox 56, an extension can just add the following code to the top level of its background page to send the message whenever it shows a notification:

```js
browser.notifications.onShown.addListener(() => {
browser.runtime.sendMessage("@notification-sound", "new-notification");
});
```

## Notification tester

[Notification Tester](https://freaktechnik.github.io/notification-sounds/)

## Translations

Translations are managed on [Transifex](https://www.transifex.com/freaktechnik/notification-sound/). Feel free to request a new language if you are willing to translate into it.

## Support and FAQ

https://discourse.mozilla.org/t/support-notification-sound/23758

## License

The code that makes up this project is licensed under the MPL-2.0

The pop.flac sound is licensed under the [CC-3.0-BY license](https://creativecommons.org/licenses/by/3.0/) and was created by [Tobiasz 'unfa' Karoń](https://freesound.org/people/unfa/), original available on [freesound.org](https://freesound.org/people/unfa/sounds/245645/)

The icon was created by @elioqoshi via request on http://opensourcedesign.net/.