fullscreen
fullscreen copied to clipboard
Reserved keyboard shortcut behaviour in fullscreen
In Firefox and Edge, the behaviour of browser-reserved keyboard shortcuts like Ctrl-T and Ctrl-N can be overridden via preventDefault() when in fullscreen. Chrome and Safari don't allow this; for instance, Ctrl-T in fullscreen always opens a new tab and kicks you out of fullscreen, even if you preventDefault() on that combination.
We're currently considering making Chrome's behaviour align with Firefox and Edge. Is the behaviour of browser keyboard shortcuts in fullscreen an issue that the spec should have an opinion on?
It doesn't seem to me Firefox suppresses the shortcuts when in fullscreen. As far as I can see, if you Ctrl-T in fullscreen, Firefox also opens a new tab and exit fullscreen automatically.
And it seems to me Edge doesn't suppress them either.
I apologise for not being specific enough here. Firefox and Edge allow Ctrl-T, etc. to be captured via preventDefault(), and when you do this, they suppress the normal behaviour. I've edited the first comment to clarify.
Chrome and Safari do not let you preventDefault() these combinations in fullscreen.
I think that is unrelated to fullscreen at all. Firefox seems to always allow the content overriding those keyboard shortcuts via preventDefault(), no matter whether it is in fullscreen or not.
Yes, Firefox does allow that always (and it has been contentious: see https://bugzilla.mozilla.org/show_bug.cgi?id=380637. Chrome has currently made the opposite choice, which is also contentious). But it feels like a less contentious issue in fullscreen, where the usual browser chrome is hidden, and it may be less "expected" that Ctrl-T and its friends do what they normally do.
What I'm wondering is whether allowing these shortcuts to be overridden should be standardised, or if it should be left as an implementation detail per browser. :)
The general rule is that if a standard doesn't say it should not work, it should work. That is, the normal rules apply.
There were some concerns about sites taking over keyboards and therefore browsers might have keyboard restrictions. The mitigations suggested in https://fullscreen.spec.whatwg.org/#security-and-privacy-considerations are supposed to take care of those concerns without having to restrict access to the keyboard (apart from potentially "Esc" and some kind of equivalent on mobile).
Is there anything actionable to do with this issue? It was linked from Intent to Implement and Ship: Browser Shortcuts in Fullscreen and I wonder what needs to be said for this to end up interoperable.
@garykac