Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Cmd+w should close devtools #935

Closed
msfeldstein opened this issue Apr 3, 2018 · 3 comments
Closed

Cmd+w should close devtools #935

msfeldstein opened this issue Apr 3, 2018 · 3 comments

Comments

@msfeldstein
Copy link
Contributor

msfeldstein commented Apr 3, 2018

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. brave/browser-laptop#45

@brunobely
Copy link

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?

@msfeldstein
Copy link
Contributor Author

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
electron/electron#981

@pfrazee pfrazee closed this as completed in e7b7f26 Apr 6, 2018
@pfrazee
Copy link
Member

pfrazee commented Apr 6, 2018

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

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants