DOMException: play() failed because the user didn't interact with the document first.

560 views
Skip to first unread message

joette cordsen

unread,
Jul 13, 2022, 9:51:52 PM7/13/22
to Chromium Extensions
This is an "old" problem, but with manifest v2 this scenario works without problems, with manifest v3 it generally fails. This is the scenario. The user opens a tab for a specific  URL. Every x number of seconds (determined by the user), the tab is reloaded. When it is reloaded, a content script sends a message to the service worker. If the service worker detects that it needs to alert the user (based on data passed from the content script) , it sends a message back to the content script to play a sound. Sometimes this process works but usually it fails with the above error message. The fact that it sometimes works makes this situation more frustrating. Is there any way I can safely accomplish the above scenario? Have the content script play a sound after the page is loaded without the user doing anything? If you are familiar with autorefresh extension, its the same idea but much more specialized for my company. 

TIA 
Reply all
Reply to author
Forward
0 new messages