Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/freaktechnik/notification-sounds
- Owner: freaktechnik
- License: mpl-2.0
- Created: 2015-11-23T13:58:31.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T17:11:12.000Z (9 months ago)
- Last Synced: 2024-04-11T00:14:47.788Z (9 months ago)
- Topics: firefox, notification, sound, webextension
- Language: JavaScript
- Homepage: https://addons.mozilla.org/firefox/addon/notification-sound/?utm_source=github&utm_content=about
- Size: 4.75 MB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: .github/SUPPORT.md
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/.