Implement Fullscreen Keyboard Lock
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: boaz, Assigned: avandolder)
References
(Blocks 5 open bugs, )
Details
(7 keywords)
User Story
user-impact-score:1120
Attachments
(12 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
34.94 KB,
image/png
|
Details | |
|
33.47 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Reporter | ||
Updated•14 years ago
|
Comment 1•14 years ago
|
||
Updated•14 years ago
|
Updated•14 years ago
|
Comment 2•14 years ago
|
||
Comment 3•14 years ago
|
||
Comment 4•8 years ago
|
||
Updated•8 years ago
|
Comment 5•7 years ago
|
||
Updated•7 years ago
|
Comment 6•5 years ago
|
||
Referenced in https://github.com/microsoft/vscode/issues/85252 . I wonder if other editors also run into this.
Updated•5 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Hi Thomas,
Apart from the "allow content to override browser shortcuts such as cmd+t in fullscreen mode" use case, are there any other webcompat use cases due to the lack of keyboard locking API support in Firefox? I don't see from the bug dependency and I would like to know if bug 1593883 comment 7 is a good enough solution. Thank you.
Comment 8•1 year ago
|
||
No, but I definitely can see games or apps not wanting to use fullscreen mode (for instance, so they can use multiple canvases or other HTML areas of the page to present extra information). So we might still hear about webcompat issues even with that work-around. After all, as per comment 2, Chrome prevented some shortcuts/key combinations in fullscreen mode, but still went ahead with a full locking API, so I wouldn't be surprised if there were other issues encouraging them to do so. It may also be more relevant for pinned apps/"PWAs".
Comment 9•1 year ago
|
||
The standards-position is still not resolved: https://github.com/mozilla/standards-positions/issues/196
There is a new idea which aims to improve the one Google previously proposed. However, it's still very early in the spec process.
Updated•7 months ago
|
Comment 10•3 months ago
|
||
https://github.com/WebKit/standards-positions/issues/481#issuecomment-3677826930 suggests that this is shipping in Safari TP
Comment 11•2 months ago
•
|
||
Apparently Chrome implicitly locks Control+N/T/W on fullscreen. ("lock" meaning the keys are passed to key events in a cancelable state.)
Comment 12•2 months ago
|
||
We have a few reserved keys, should be worth checking whether those are already implicitly locked on other browsers.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 13•2 months ago
|
||
Bug 1821886 makes me concern that blocking Escape key would cause the same security issue - web pages may prevent the default of escape and show fake browser UI. Seems like we should at least show some UI for warning if such blocking happens. Thoughts?
(I'm still sick so that my brain is not fully working...)
Yeah, silently allowing keyboard lock confuses the users since some shortcut keys are disabled.
Well, I don't find how the users to unlock it forcibly. Cannot do that unless changing the active tab with non-keyboard input device? If so, we still need to reserve some shortcut keys as for the users who use only keyboard... Oh, or, we should add a new reserved shortcut key to exit from keyboard lock like Ctrl + Alt + Delete (meaning enough complicated for using on apps) and show the shortcut key in the warning message.
Comment 15•1 month ago
|
||
(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #14)
Well, I don't find how the users to unlock it forcibly. Cannot do that unless changing the active tab with non-keyboard input device? If so, we still need to reserve some shortcut keys as for the users who use only keyboard... Oh, or, we should add a new reserved shortcut key to exit from keyboard lock like
Ctrl+Alt+Delete(meaning enough complicated for using on apps) and show the shortcut key in the warning message.
So right now https://searchfox.org/firefox-main/rev/7b1a35d6c70c08d2966c6c8dfc9aa9c04319f721/layout/base/PresShell.cpp#9389-9435 makes double escape keydown to always escape from fullscreen regardless of chrome-context preventDefault(), we could do the same for fullscreened web content. Safari made long-keydown to always escape, we could follow that too.
Either way we should show some UI or otherwise users will be confused.
Comment 16•1 month ago
•
|
||
Let me summarize the offline discussions here:
- We reached consensus on long-press ESC to exit fullscreen. Long-press is Safari’s behavior. We could land this part first to enable early testing without being blocked by the UI decision below.
- UI design - we will need UX support to finalize it, basically we have the below considerations to address nicely:
- Show UI to explain how to unlock the keyboard for users when entering into the fullscreen mode, because it's a risky feature from the security point of view.
- Show UI when esc key is default-prevented, note user they need to long-press to exit fullscreen.
- In Chrome, pressing ESC three times in sequence shows the message to press and hold ESC to exit fullscreen/keyboard lock.
- In Safari, we don't seem to see warning UIs though
- In games, it’s common to have ESC open and close the game menu. It would be annoying to exit fullscreen when pressing ESC multiple times.
Updated•1 month ago
|
| Assignee | ||
Comment 17•1 month ago
|
||
Comment 18•1 month ago
|
||
Chrome’s current message when entering fullscreen with keyboard lock active
Comment 19•1 month ago
|
||
Chrome’s current message when entering fullscreen without keyboard lock active
Comment 20•1 month ago
|
||
Another discussion summary:
(In reply to Hsin-Yi Tsai (she/her)[:hsinyi] from comment #16)
Let me summarize the offline discussions here:
- We reached consensus on long-press ESC to exit fullscreen. Long-press is Safari’s behavior. We could land this part first to enable early testing without being blocked by the UI decision below.
Long-press is still wanted. We plan to provide this behavior through keyboard lock API, rather than using preventDefault()-based opt-in approach. That means, we need to add the API part on top of the mechanism implemented in this patch.
- UI design - we will need UX support to finalize it, basically we have the below considerations to address nicely:
- Show UI to explain how to unlock the keyboard for users when entering into the fullscreen mode, because it's a risky feature from the security point of view.
This is still needed. With the keyboard lock API, we should show 2 messages when entering fullscreen depending on if keyboard lock is active or not.
Chrome's screenshots are attached: Chrome’s current message in fullscreen with keyboard lock active.png and Chrome’s current message in fullscreen without keyboard lock active
- Show UI when esc key is default-prevented, note user they need to long-press to exit fullscreen.
This when esc key is default-prevented criterion is not applicable now.
- In Chrome, pressing ESC three times in sequence shows the message to press and hold ESC to exit fullscreen/keyboard lock.
Still needed/wanted.
- In Safari, we don't seem to see warning UIs though - In games, it’s common to have ESC open and close the game menu. It would be annoying to exit fullscreen when pressing ESC one and two times.
| Assignee | ||
Comment 21•1 month ago
|
||
| Assignee | ||
Comment 22•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Comment 23•1 month ago
|
||
| Assignee | ||
Comment 24•28 days ago
|
||
| Assignee | ||
Comment 25•24 days ago
|
||
We warn the user the first time they press escape, and then on any
subsequent triple-clicks.
| Assignee | ||
Comment 26•24 days ago
|
||
Comment 27•24 days ago
|
||
| Assignee | ||
Comment 28•24 days ago
|
||
Comment 29•23 days ago
|
||
Comment 30•23 days ago
|
||
Backed out for causing failures at test_fullscreen-api.html.
Backout link: https://hg.mozilla.org/integration/autoland/rev/c9626c59d7cd
Failure log: https://treeherder.mozilla.org/logviewer?job_id=560236415&repo=autoland&task=MpF9Vi1wSNeAFcVrdd5jzg.0&lineNumber=2532
Comment 31•23 days ago
|
||
(Edgar has been looking into comment 30)
Comment 32•23 days ago
•
|
||
The failures is caused by part 1, since now the signature of requestFullscreen() is changed to have FullscreenOption argument, which results in requestFullscreen(123) rejecting the promise now. Other browsers also reject the promise in such case, since they all have FullscreenOption argument support.
There is a wpt test, https://wpt.fyi/results/fullscreen/api/element-request-fullscreen-options.html?label=experimental&label=master&aligned, but the test actually doesn't test the invalid argument properly, because the requestFullscreen() always rejects the promise due to the lack of user activation. I fixed the test and also extended it to cover additional invalid argument cases.
Will land the patches again soon.
Updated•23 days ago
|
Comment 33•23 days ago
|
||
Comment 34•23 days ago
|
||
Updated•23 days ago
|
Comment 35•23 days ago
|
||
| bugherder | ||
Comment 36•23 days ago
|
||
| Assignee | ||
Comment 37•23 days ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59258 for changes under testing/web-platform/tests
Updated•22 days ago
|
Comment 39•22 days ago
|
||
Upstream PR merged by moz-wptsync-bot
Updated•22 days ago
|
Comment 41•22 days ago
|
||
Updated•22 days ago
|
Updated•22 days ago
|
Updated•22 days ago
|
Updated•22 days ago
|
Updated•22 days ago
|
Comment 42•22 days ago
|
||
Updated•22 days ago
|
Updated•22 days ago
|
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59275 for changes under testing/web-platform/tests
Comment 44•22 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d103ed915331
https://hg.mozilla.org/mozilla-central/rev/d446b107bbeb
Comment 45•21 days ago
|
||
(just realized some parts of patches aren't merged into central yet)
Updated•21 days ago
|
Comment 46•21 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/146439a0c56d
https://hg.mozilla.org/mozilla-central/rev/457f140384d2
https://hg.mozilla.org/mozilla-central/rev/efb4ceea4730
Upstream PR merged by moz-wptsync-bot
Comment 49•17 days ago
•
|
||
FF151 MDN docs work or this can be tracked in https://github.com/mdn/content/issues/43868
FYI, I had some questions that are mostly around the spec update in https://github.com/whatwg/fullscreen/pull/232#issuecomment-4286060467. If you have any insight, I'd welcome your answers.
For example the spec seems to indicate that some event actions are removed by the browser, such as the Esc key, while others can be explicitly removed using preventDefault(). It would be good to know what is automatically disabled (is it just Esc key?), and what can and cannot be disabled by preventDefault (at least on Firefox)
Updated•17 days ago
|
| Assignee | ||
Comment 50•16 days ago
|
||
I believe the questions were addressed by Simon Pieters (:zcorpan) in https://github.com/whatwg/fullscreen/pull/232#issuecomment-4295296243. Let us know if you need more information than that.
Updated•11 days ago
|
Description
•