Closed Bug 1430012 Opened 7 years ago Closed 7 years ago

Tab should not have the autoplay permission after restoring from session restore

Categories

(Core :: DOM: Events, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: alwu, Unassigned)

References

Details

(Whiteboard: [block-ap-v1])

STR. 1. set pref "media.autoplay.enabled=false" and "media.autoplay.enabled.user-gestures-needed=true". 2. goto https://alastor0325.github.io/htmltests/autoplay_tests/autoplay_test2.html 3. click the video, then video starts playing 4. close the tab 5. restore tab by keyboard shortcut "command + shift + T" Expect. 6. video from restored tab should not start playing Actual. 6. video from restored tab starts playing --- We listen "key-up" event to activate the document then it could gain the autoplay permission. If the event is sent to the wrong target, then the thing would go wrong. After some investigation, the root cause should be that the "key-up" event is sent to the restored tab, then causes its document activation.
Hi, Stone, Could you help with this issue or NI someone who is familiar with this part? Thanks!
Flags: needinfo?(sshih)
FYI, if you restore the tab from "History" > "Recently Closed Tabs", then the issue won't happen.
Priority: -- → P2
When investigating bug 1427984, I found that most browsers (Chrome, Firefox, Safari) fire keyup at the switched tab when the key sequence changes the current tab. I don't think this is a problem. For this use case, maybe we could handle the autoplay permission when keydown like other functionalities (e.g. ALT+N to switch tabs, ALT+F4, CTRL+SHIFT+K to open inspector). Or we could ask UX for some suggestions.
Flags: needinfo?(sshih)
Whiteboard: block-ap-v1 → [block-ap-v1]
I learned from Alastor that keydown as suggested in comment 3 works well for him. Anything else we need to do in this bug to support block-autoplay feature?
I can take it, thank for your help!
Assignee: nobody → alwu
Assignee: alastor0325 → nobody
We switched to acitvating in keydown in Bug 1456037.
Status: NEW → RESOLVED
Closed: 7 years ago
Depends on: 1456037
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.