w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
576 stars 50 forks source link

Spec Clarification: Autoplay Behavior on Extension Pages #625

Open hanguokai opened 1 month ago

hanguokai commented 1 month ago

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:

Some Use Cases:

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.

robbi73 commented 1 month ago

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:

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.