Answer the question
In order to leave comments, you need to log in
Is it possible to add sound to notification for chrome extension?
If I understand correctly, it is no longer possible to use webkitNotifications.createHTMLNotification when writing a chrome extension.
Is there another way to add a sound when a notification appears?
Here: developer.chrome.com/extensions/notifications.html
And here: www.chromium.org/developers/design-documents/deskt...
There is nothing about it.
However, I think I have seen extensions with sound.
Answer the question
In order to leave comments, you need to log in
Something like this:
var audio = new Audio();
audio.preload = 'auto';
audio.src = 'notify.mp3';
var notification = new Notification(title, {icon: 'icon.png', body: bodyText});
notification.onshow = function() {
audio.play();
};
So far I did it through chrome.windows.create, but the question remains open :-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question