Alt+Left/Right can be intercepted and cancelled by webpages if they navigate somewhere
Reported by
mega...@gmail.com,
May 20 2018
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3423.2 Safari/537.36 Example URL: https://jsfiddle.net/The_MAZZTer/0wwmknn5/1/ Steps to reproduce the problem: 1. Navigate to a webpage which exhibits the problem. 2. Use Alt+Left or Alt+Right to try and navigate in history. What is the expected behavior? The browser will navigate through the tab history as requested. What went wrong? The webpage's JavaScript will receive JavaScript events for the keypresses, and can initiate a navigation to another webpage. If a webpage does this, the user's intent is effectively ignored, and it can confuse a user who will assume because the page has navigated that they are now looking at a page from their tab history. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? No Does this work in other browsers? No IE11, Edge 17, Firefox 61b4 Chrome version: 68.0.3423.2 Channel: dev OS Version: 10.0 Flash Version: It seems all browsers are currently exhibiting this behavior. It may be intentional to allow this, but I found it very confusing when I first stumbled across a website that did this. Other example pages: https://www.pcorner.com/list/WINDOWS/PSHELL29.ZIP/INFO/ https://www.tumblr.com/dashboard - This may only exhibit the behavior when logged in with a site account, with enough content populating the dashboard for two or more pages, and with infinite scrolling turned off in settings. In both these cases the webpages are using the left and right arrow keys for navigation.
,
May 20 2018
These hotkeys may be used by online games and online apps like editors, terminals, and so on. I guess only 1% (or even less) of users actually utilize these hotkeys for page navigation, but I haven't seen the actual statistics. Currently Chrome protects only hotkeys to create a tab (Ctrl-T), a create window (Ctrl-N), to close a tab (Ctrl-W). Even these three exceptions create insurmountable problems for some of the online games and apps. Some browsers (Vivaldi, for example) always ignore the webpage keyboard handlers and prioritize browser-defined hotkeys, which breaks some of the sites/apps/games. That's pretty web-hostile. As for the sites you mention, their code might have simply forgotten to check the event's altKey and other modifiers when matching the key code to decide which action to perform. JS programmers often make this mistake. Notify them.
,
May 21 2018
megazzt@ Thanks for the issue. Able to reproduce the issue on Windows 10, Mac OS 10.13.3 and Ubuntu 14.04 on the latest Canary 68.0.3436.0 and Stable 66.0.3359.181 by the steps mentioned in the original comment. Attached is the screen cast for reference. This is a Non-Regression issue as this behavior is observed from M60 Chrome builds. Hence marking this as Untriaged for further updates from Dev. Thanks..
,
May 21 2018
,
May 21 2018
Adding avi@ and estark@ to triage this in case it is web site abusive behavior.
,
May 25 2018
Hmm, I think this is intentional behavior and there's not much we can do without breaking legitimate use cases, especially because the user can always use the back/forward buttons instead. If there are websites in the wild that are abusing this for e.g. social engineering, you may want to report them to Safe Browsing (https://safebrowsing.google.com/safebrowsing/report_badware/?hl=en). Avi, feel free to reopen if you disagree. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by krajshree@chromium.org
, May 20 2018