Add support for navigator.keyboard.lock();
-
Hello,
Lot of web based games would be more fun to play with if they can be played in full screen with keyboard locked. Vivaldi already supports full screen using await document.body.requestFullscreen(); however it does not support await navigator.keyboard.lock();Adding keyboard lock will be very useful for HTML5 VDI clients too (Apache Guacamole, noVNC etc...). This is supported in Chrome and Edge. I have to keep using edge for some websites because of this specific feature. It would be great if this can be added to Vivaldi.
Mozilla doc: https://developer.mozilla.org/en-US/docs/Web/API/Keyboard/lock
Google Article: https://developer.chrome.com/articles/keyboard-lock/ -
@dhruva023 There is already a command to disable keyboard shortcuts.
Assign a combo like Ctrl+Alt+K so that you do not hit it by accident. Using it again re-enables the keyboard shortcuts.
Does that solve your problem, or do you mean something else?
-
@Pesala I don't mean to disable keyboard shortcuts of just Vivaldi. The keyboard.lock(); Disables keyboard shortcuts of operating systems as well, and redirects all key strokes to web-browser when in fullscreen mode, including "Alt+Tab" shortcut.
-
@dhruva023 Probably is a bug more than a request (similar to the mouse pointer lock issue) considering it works in chrome/ium. Report it, even if.... I totally agree with this point.
-
@Hadden89 Javascript can log keys anyway and the api requires user interaction to trigger. Don’t know much about security though, no idea whether Vivaldi devs disabled this on purpose.
-
@luetage I don't think is by purpose. More a bug between UI & wepages interaction
-
@Hadden89 Well, I reported this as VB-99078 now, let’s see what the devs have to say about it.
-
Thanks for reporting this @luetage . Where do you report bugs? I can't find a link to report new bug!
Also, I get the security concern with this feature, however the approach that chrome took seems fine to me. A notification, and asking user if they really want to go full-screen can also be helpful!.
-
-
@dhruva023 said in Add support for navigator.keyboard.lock();:
@Pesala I don't mean to disable keyboard shortcuts of just Vivaldi. The keyboard.lock(); Disables keyboard shortcuts of operating systems as well, and redirects all key strokes to web-browser when in fullscreen mode, including "Alt+Tab" shortcut.
That's a really terrible idea. Just awful from a security perspective. Imagine malicious websites locking out your keyboard and overriding mouse clicks.
Dear god, no. Please Vivaldi don't ruin your browser with this.
-
@easyme I think you might not have understood full request here.
The keyboard lock can happen only during full-screen mode. and the browser needs to provide an escape hatch.Both Google Chrome and Edge uses Escape key holding down for 3 seconds as an escape hatch. The browser also needs to show a notification showing what the escape hatch is when keyboard lock is activated.
So, I would not consider this a security issue. I am sure lot of websites would have been using this maliciously if they could. Google Chrome supports this since version 80.
-
Ok thanks @dhruva023. That does sound more sane. I still don't trust browser makers to get it right, i.e. not have bugs where website can override the escape sequence. But as long as full-screen mode is user initiated, then everyone can make their own choice.
It wouldn't surprise me if one day chrome throws a full-screen, non-escapable ad in your face before showing page content.
-
@luetage Is there a way to check status of the VB-99078? Like which milestone it will be included or if it's even in consideration etc...?
-
@dhruva023 Ask in the Bug Status Thread.
Discuss here or in similar threads; not in the Bug Status thread.
-
@dhruva023 Still valid bug for Vivaldi 6.6, no dev assigned.
-
Still a unfixed bug for 6.7 and 6.8.
I do not know if such issue is so important for many users. We got no reports on such problems.
-
@DoctorG I think it's quite important, because it renders every game streaming platform e.g. GeForce NOW or Amazon Luna unusable in this browser. Especially the inability to send keypresses of the ESC key (short pressing) which other browsers support.
-
VB-99078 Keyboard lock API broken - Confirmed, no dev assigned
-
In vivaldi://flags I can see some related entries:
and
not sure if those are actually been used in the vivaldi development process (so this might be already on the roadmap or in development?) or some leftovers from the engine. Toggling those to the enabled state does not enable the API support (current snapshot 3425.3).
A demo to test the feature is provided here: https://keyboard-lock.glitch.me after entering the fullscreen the lock can be activated and released by the user by holding the ESC key. In case of vivaldi a error pops up due to missing support.
PS: As I've been searching for this issue (not being able to use ESC on web streaming platform) I encountered quite a lot reports of this on several platforms, but I guess the usual user can't connect the problem to a possibly missing javascript API, hence users won't report or vote here.
-
@cubic3d Thanks, but the flags do not fix it.