Playing audio with service workers

94 views
Skip to first unread message

ComputerWhiz

unread,
Jan 19, 2022, 4:37:31 PM1/19/22
to Chromium Extensions
I have an alarm-clock-type extension that I'm trying to migrate from MV2 to MV3. Where I'm running into issues is that the service workers in MV3 can't play audio because they don't have a window, so I can't play the notification noise for the alarm in the background.

Although it's not ideal, I tried opening a tab in the background with active set to false so that it doesn't take away focus from the user, but even that doesn't work for my use-case, since the audio won't play in the tab until the user selects the tab.

Any idea what would be the best approach that works with MV3?

Cuyler Stuwe

unread,
Jan 19, 2022, 9:26:25 PM1/19/22
to ComputerWhiz, Chromium Extensions
I think there probably isn’t a good approach. You probably will have to guide your user through taking the unintuitive actions necessary to be able to play sound.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/15bd0d75-1110-4054-9672-8d0bd6428876n%40chromium.org.

Guilherme Dellagustin

unread,
Apr 9, 2022, 6:12:10 AM4/9/22
to Chromium Extensions, cuyler...@gmail.com, Chromium Extensions, ComputerWhiz, sim...@chromium.org
I advise you to Start and comment on https://bugs.chromium.org/p/chromium/issues/detail?id=1131236 which deals exactly with this topic.
Unfortunately there is no solution on the horizon.
At some point in the past I run a campaign with my users to Star this issue and comment how they would be affected, it went well, the issue got some attention since then.
You might consider doing something similar. 

Simeon, is there anything you can do to get an update on a solution for the use case of background media on MV3 extensions?
I'd at least like to know if there is any hope of having it before the sunset of MV2.
Reply all
Reply to author
Forward
0 new messages