Google Chrome 66 To Allow Websites To Intercept Key Presses

Advertisement
Advertisement

Google is working on version 66 of its popular Chrome browser, which will include a new feature that allows websites to intercept certain keypress events when a user is browsing in full-screen mode. The new feature is called the KeyboardLock API, and is getting a feature flag, which will transition the code into a place in the Chrome codebase where it can actually be used. The feature will work on a whitelist basis, meaning that sites will only capture the key events that they specify to the browser that they're looking for. This means, as long as Google puts in adequate measures to keep websites from abusing it, such as blocking the ESC and F11 keys out of the API, users can enjoy more immersive games, streaming video, and other web content, without the risk of the page jumping around or their computer going over to a different application.

Since this change is happening in the Chromium codebase and does not specify an OS, it has some interesting implications. For starters, the extra feature may give web developers more incentive to port immersive experiences to Chrome OS that previously would only work on Windows, Mac, or Linux. This could also mean that Android device owners who hook a keyboard up to their phone or tablet, or people who own Android-based laptops and desktop boxes, may stumble across some content that they can interact better with on the web when using their keyboard. It could also enable key combination interactions that aren't possible with the current way that websites and browsers handle key events. The change is apparently only coming to desktop versions of Chrome for now, but a mobile port may be possible in the future.

There are a few challenges facing the implementation of this new API. The first, and possibly largest, is that it requires web developers to implement support for it. This means that a user can be on Chrome 66 and browsing in fullscreen mode, but still have inputs meant for a website hijacked by their OS if the website hasn't implemented this API. On a platform level, the API will also require a special key event handling protocol that's capable of having keypresses passed through it under certain conditions, and then intercepting them before they go to the OS. Google has some time to get this working right; the current stable version of Chrome is version 64, and this change is coming to version 66.

Advertisement