Issue metadata
Sign in to add a comment
|
Page receives key events from browser shortcuts (and is activated) |
||||||||||||||||||||||||
Issue descriptionIt's a bit of a weird bug as I can reproduce it fairly well on my laptop but can't on other machines regardless of the system. I did not try on a laptop similar to mine but did try on other Linux machines. STR: 0. make sure to run recent Chrome Canary or Dev 1. open https://mounirlamouri.github.io/sandbox/autoplay/unmuted-retries.html 2. quickly ctrl+tab out of the page 3. cycle back to this page Expected result: playback does not start Actual result: playback starts After some investigation, it seems that when the playback starts, there is a key event that is sent that isn't a "modifier" and it seems to be the "TAB" event. That event "activates" the page and therefore allows it to autoplay.
,
Feb 23 2018
Here's another test page: https://beaufortfrancois.github.io/sandbox/media/unmuted-always-try-to-play.html Autoplay is allowed when - Ctrl + R (Reload) - Keydown Alt + Keydown D (Focus Address bar) - Focus tab on the left with mouse, then Keydown Ctrl + Keydown Tab, then Keyup Tab I think there are several issues: - The R key keyup event should not be propagated to the refreshed page. - The D key keydown event should not fire as Alt + D focuses the address bar (not the page). - The Tab key keyup event should not fire on the page because the keydown did not emit from the page.
,
Feb 23 2018
+johnpallett@, autoplay PM Bumping priority because this can be very surprising for users in the context of autoplay as this is "activating" the page.
,
Feb 26 2018
The keydown events fire from browser shortcuts is correct behavior. User should be able to preventDefault on keydown event to prevent trigger browser shortcuts. And keydown and keyup are separate events. When the R key released on the refreshed page, the page gets the keyup event. We shouldn't pair the keyUp event with the keydown and swallow it. Similar to mousedown and up events. (Other browsers have same behavior) Sorry that I don't think we can help with these events. Is it possible to fix the autoplay from the media side?
,
Feb 26 2018
+mustaq@ for user activation. Autoplay is using the generic user activation mechanism in Blink. The issue is that when someone reloads a page with CTRL+R, the page receives an event that is considered a user activation. In other words, the page could at that point, play sound, go fullscreen, open a popup, vibrates, etc. Anything that is linked to a user activation would be allowed and this seems to be a big potential for abuse.
,
Feb 26 2018
I agree that audio start playing is quiet annoying. If it's an user activation issue instead of the keyup events, it should be similar to issue 709765. It seems there was attempt to not count browser shortcut events as user gestures but the CL was reverted later because of compatibility issues.
,
Feb 27 2018
eirage@, I think that's fair to call this a duplicate of bug 709765. Thanks for investigating :) |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by dtapu...@chromium.org
, Feb 22 2018Owner: eirage@chromium.org
Status: Assigned (was: Untriaged)