42

I'm using the Web Notification API to show desktop notifications from my web app under OSX.

In Firefox only, when a notification is triggered, it also plays a sound (in Safari and Chrome, using the exact same code, only the notification displays and there's no accompanying sound effect).

I'd like to disable the notification sound in Firefox, but I can't find anything in the documentation about controlling it. Is this possible?

ti7
  • 16,375
  • 6
  • 40
  • 68
daGUY
  • 27,055
  • 29
  • 75
  • 119
  • you can only use what the api provides, and there's no option for sound. this is like how prompt() plays ding.wav in IE but safari is silent. – dandavis Dec 15 '14 at 20:38
  • Ugh, that sucks. I'm using this for a music app to notify you when the track changes, so in Firefox it plays the sound effect on top of the music. If I can't disable the sound I'll just have to take the whole feature out. Can you add your comment as an answer? – daGUY Dec 15 '14 at 20:40
  • 4
    In OS X System Preferences, I can go to Notifications > Firefox and uncheck "Play sound for notifications" to mute the sound effects. Is there really no way to set this on the other end (from within my app)? – daGUY Dec 15 '14 at 20:44
  • for what it's worth, i don't hear anything on window8.1 and firefox 34, and i didn't set any pref. – dandavis Dec 15 '14 at 20:46
  • I'm on Firefox 34 also, but OS X. Maybe the sound is just default behavior? (The weird thing is that the "play sound for notifications" option is enabled for Safari, too, but it doesn't actually play any sound when I trigger my notification). – daGUY Dec 15 '14 at 20:50
  • for what it's worth, i don't hear anything on window8.1 and firefox 34, and i didn't set any pref. i think that's a mac-only setting, a product of their built-in notifications. FF/mac is not super popular (given the lack of multimedia support), so i wouldn't drop the feature for the other 90%, just disable it where it poses a problem. – dandavis Dec 15 '14 at 20:52
  • Could be Mac-only, definitely, but it's weird that Firefox plays the sound but other browsers don't. I'm guessing the app itself tells the OS if its notifications should play sounds (and there's no way an individual site/page can change that setting). – daGUY Dec 17 '14 at 16:04

2 Answers2

121

On OS X, go to System Preferences, then Notifications. Choose Firefox and uncheck Play sound for notifications to get rid of the sound.

Fred
  • 1,911
  • 1
  • 13
  • 10
11

The Web Notification API now has the config option silent, but support is patchy, Chrome v43+, Firefox (not yet supported).

I'd suggest building silent into your notifications then if/when Firefox support it, it will just work.

muttonUp
  • 6,351
  • 2
  • 42
  • 54