zserge / lorca

Build cross-platform modern desktop apps in Go + HTML5
MIT License
8.04k stars 535 forks source link

Ctrl-t and ctrl-n open new browser window #32

Closed kjk closed 5 years ago

kjk commented 5 years ago

On Windows, standard chrome shortcuts ctrl-t and ctrl-n open a new, empty browser window, which is probably not what any application writer wants.

If possible, they should be blocked. Better yet, it would be good if that was routed through logic in Go program so that user of library can decide if this should be blocked or allowed to proceed. If allowed to proceed, there should be a way to specify which html file or url to load.

kjk commented 5 years ago

This is how carlo seems to be doing this: https://sourcegraph.com/github.com/GoogleChromeLabs/carlo/-/blob/lib/features/shortcuts.js

zserge commented 5 years ago

Correct. If you want to disable particular hotkeys - you can use javascript. Chrome DevTools protocol does not allow disabling Chrome hotkeys on its own, so capturing them in javascript is the way to go.