visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Don’t prevent the browser’s default behavior corresponding to the Alt key #568

Open yuheiy opened 3 years ago

yuheiy commented 3 years ago

In most browsers, clicking links with the Alt key has a special behavior, for example, Chrome downloads the target resource. As with other modifier keys, the router should stop the original navigation to avoid preventing the browser’s default behavior.

When users click a link while holding the Alt key together, the browsers behave as follows.

Windows 10:

Browser Behavior
Chrome 84 Download the target resource
Firefox 79 Prevent navigation and therefore do nothing
Edge 84 Download the target resource
IE 11 No impact

macOS Catalina:

Browser Behavior
Chrome 84 Download the target resource
Firefox 79 Prevent navigation and therefore do nothing
Safari 13 Download the target resource
coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 93.033% when pulling 75722b0a977cd2b35ff38caff243f12c4998cb11 on yuheiy:alt-key into 4f9991658f9b9e3de9b6059bade93693af24d6bd on visionmedia:master.