tulios / json-viewer

It is a Chrome extension for printing JSON and JSONP.
https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
MIT License
3.3k stars 675 forks source link

Only allow mouse button 0 to open links in 'mousedown' event #272

Open FlaminSarge opened 3 years ago

FlaminSarge commented 3 years ago

Currently, clicking any mouse button on a link will cause it to open the link; this prevents using e.g. right-click context menu on the link, and may grab mouse4/mouse5 inputs and use them as regular clicks. This change makes it so this mousedown override only applies to M1 (usually left click, but should support users that flip their mouse buttons as well).

Also fix typo for 'isReadOn(l)y'

FlaminSarge commented 3 years ago

@tulios Why does this mousedown override exist at all, when the ext already makes links clickable (and can therefore add target=_blank on those anchor tags in the first place)?