Beaker: Cmd+w should close devtools

Created on 3 Apr 2018  路  3Comments  路  Source: beakerbrowser/beaker

Operation System: OS X 10.13
Beaker version: 0.8.0-p5

If you have a websites devtools/inspector open (cmd+alt+j) you should be able to close it via cmd+w, or pressing cmd+alt+j again. It looks like Brave Browser has a similar issue and its not straightforward. https://github.com/brave/browser-laptop/issues/45

Most helpful comment

Solved. You can see how I did it here: e7b7f263cce202d0bd59fa849a700d9cea150b09

All 3 comments

Could I take this? Been doing some initial investigation, although I can't quite figure out how to print to stdout (or to any console) to aid me in debugging.

It seems as if when invoking menu options such as "Close window" when the DevTools window is focused, the application thinks there are no open windows as the "New Tab" command causes it to open a new window (as if it was the first tab to be opened by the browser).

I also wrote code that would result in an exception to test something out and the exception happens only when the DevTools window is not focused, further proving that the menu is indeed being handled differently depending on what is focused.

Does anybody know where is the code that handles those cases in which the DevTools window is focused as opposed to the browser itself?

i couldn't find a way to programmatically ask whether the devtools is focused or not. There are events to tell when devtools are opened/closed/focused but its unclear how well the focused/blurred events work

Here is an electron issue with some details
https://github.com/electron/electron/issues/981

Solved. You can see how I did it here: e7b7f263cce202d0bd59fa849a700d9cea150b09

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaniellMesquita picture DaniellMesquita  路  4Comments

monteslu picture monteslu  路  3Comments

NicholasGWK picture NicholasGWK  路  4Comments

pfrazee picture pfrazee  路  4Comments

DaniellMesquita picture DaniellMesquita  路  4Comments