Skip to content

freaktechnik/notification-sounds

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
.tx
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

icon 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/

Extension integration

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

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:

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

Notification tester

Notification Tester

Translations

Translations are managed on Transifex. 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 and was created by Tobiasz 'unfa' Karoń, original available on freesound.org

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