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

Fix back keyboard shortcut #276

Open dnicolson opened 3 years ago

dnicolson commented 3 years ago

This pull request disables some of the key command functionality of CodeMirror, enabling Chrome browser keyboard shortcuts to navigate back. Fixes https://github.com/tulios/json-viewer/issues/124.

For some reason, the extraKeyMap object had to be used to restore the "Cmd-Left" command.

https://github.com/tulios/json-viewer/issues/220 could also be fixed by adding "Page Up" and "Page Down" keys to extraKeyMap and scrolling the CodeMirror editor. For the space key to scroll down may require adding a "keydown" listener though.