Proposal: audible notifications (play a sound with a notification) #349
Labels
enhancement
Enhancement or change to an existing feature
neutral: chrome
Not opposed or supportive from Chrome
neutral: firefox
Not opposed or supportive from Firefox
neutral: safari
Not opposed or supportive from Safari
proposal
Proposal for a change or new feature
Overview
When send a notification, play a sound at the same time by specifying an audio file which length is usually about a second. Typical application scenarios like alarms, reminders, notifications, and battery level changes, etc.
This is a strong functional requirement from developers. You can search for "play sound" or "audio notification" in extension developers forum, StackoverFlow, browser's bug trackers and this project, there are many related discussions. So, I don't need to prove the usefulness of this feature.
API
Web Notification API vs Extension Notification API
Although the functions of these two APIs are similar, the application scenarios of web and extension are obviously different (extensions are more like native apps), which leads to the fact that Web API will be more conservative, while extension API can be more aggressive. So, I think the extension API should support this feature.
Workaround
Note: This api is mainly used from background.
In MV2, event page or background page can play sound directly and easily, i.e.
new Audio('sound.mp3').play()
.In MV3, service worker can't play sound directly, Chrome supplies the offscreen api as a temporary workaround for general purpose DOM functions.
Because playing a sound with a notification is a very common and highly demanded feature, I think extension notification API should have built-in support for it.
The text was updated successfully, but these errors were encountered: