Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec Clarification: Autoplay Behavior on Extension Pages #625

Open
hanguokai opened this issue May 27, 2024 · 1 comment
Open

Spec Clarification: Autoplay Behavior on Extension Pages #625

hanguokai opened this issue May 27, 2024 · 1 comment
Labels
needs-triage: chrome Chrome needs to assess this issue for the first time spec clarification Needs clarification when specified supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari

Comments

@hanguokai
Copy link
Member

hanguokai commented May 27, 2024

Autoplay on Web

On the web, browsers typically restrict the autoplay behavior of web pages. For more details, see the following links:

Autoplay on Extension Pages

However, there is no documentation or specification indicating whether this behavior is equally effective on extension pages.

The goal of this issue is to clearly define its behavior in the (Web or Browser Extensions) specification and implementation.

Some Situations:

  • autoplay in extension top frame
  • autoplay in extension page's subframe that may be a web page, extension page or extension sandbox page.
  • autoplay in web page's subframe that is an extension page or extension sandbox page.
  • content script (Isolated world): control HTMLMediaElement.play()

Some Use Cases:

  • The AUDIO_PLAYBACK reason in the offscreen document.
  • Foreground or Background radio playback.
  • Scheduled audio playback (alarm clock).

Currently, browsers seem to exempt extensions from this restriction in most cases. If so browsers need to clarify this behavior. But if we have concerns about this behavior, perhaps we can consider adding a new autoplay permission in the future (that will cause breaking change), like the notifications permission, or some other ways. Whether it should be looser or stricter, it's an undefined place at the moment. Of course, from a developer's perspective, since there is no sensitive data involved, and there are web store policy requirements, it would be better to be lenient.

PS: I open this issue because there is a discussion about it today.

@github-actions github-actions bot added needs-triage: chrome Chrome needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time needs-triage: safari Safari needs to assess this issue for the first time labels May 27, 2024
@hanguokai hanguokai added the spec clarification Needs clarification when specified label May 27, 2024
@robbi73
Copy link

robbi73 commented May 27, 2024

About the specific pattern: autoplay in extension page's subframe that may be a extension sandbox page
I can confirm that nowaday all chromium based browser (but Chrome itself) don't throw any error attempting to invoke play() in extension sandbox page. No interation is required as well.
I made some tries with:

  • Edge v. 125.0.2535.67
  • Iron v. 123.0.6250.0.
  • SlimJet v. 122.0.6261.39
  • Naver Whale v. 124
  • Brave v. 125.0.6422.112

Chrome, on the other hand, when we invoke play() in the sandbox iframe throws: play() failed because the user didn't interact with the document first.
Only after clicking on the sandboxed iframe the playback can be attempted again.

@oliverdunk oliverdunk added follow-up: chrome Needs a response from a Chrome representative and removed needs-triage: chrome Chrome needs to assess this issue for the first time labels Jun 6, 2024
@dotproto dotproto added supportive: safari Supportive from Safari supportive: firefox Supportive from Firefox needs-triage: chrome Chrome needs to assess this issue for the first time and removed follow-up: chrome Needs a response from a Chrome representative needs-triage: safari Safari needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage: chrome Chrome needs to assess this issue for the first time spec clarification Needs clarification when specified supportive: firefox Supportive from Firefox supportive: safari Supportive from Safari
Projects
None yet
Development

No branches or pull requests

4 participants