-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to open DevTools #32
Comments
Can't say that's been an issue for me, but I'm open to adding something for this. The downside of adding it as an option is that it would permanently remove ability to close dev tools from the keyboard. Wouldn't it be better to just add an alternative keyboard shortcut?
I think you can focus this http://electron.atom.io/docs/v0.36.8/api/web-contents/#webcontentsdevtoolswebcontents |
Yes, I mean to add a new shortcut, keeping all existing stuff, that is still useful |
Already tried, but BrowserWindow.fromWebContents always return null for a DevTools window, so no luck there. |
Ok. Can you open an Electron issue and cross-link it here? |
👍 |
Sure! |
My issue on Electron appear to be blocked by this other. I done some experiments here but they are unfortunate... I published a version of the method that close and re-open |
@parro-it If I read this issue correctly, all you want to do is open dev tools when they are closed, focus them when they are open. I do this in my app already, see below. const firstWindow = BrowserWindow.getAllWindows()[0]
if (!firstWindow) return
const isDevToolsOpened = firstWindow.isDevToolsOpened()
const isDevToolsFocused = firstWindow.isDevToolsFocused()
if (isDevToolsOpened && isDevToolsFocused) {
firstWindow.closeDevTools()
} else if (isDevToolsOpened && !isDevToolsFocused) {
firstWindow.devToolsWebContents.focus()
} else {
firstWindow.openDevTools()
} You could remove the first test if you don't want it closing on you. I use this with the |
Alright, let's do this by default when the DevTools is undocked. Apparently, that's how the native Chrome DevTools work too. |
The more I use electron-debug, the more I'm annoyed by this use case.
I open DevTools with toggle shortcut, then often it got covered by other windows, but still open.
After a while, I often forgot it is open and I press toggle key to show DevTools, but since it's already opened, it close.
I think it should be useful to add an option to just open it if closed, or otherwise focus it.
I don't think there is a specific method in electron to focus, we could ask for it (or maybe it could suffice to re-open it, I have to try).
The text was updated successfully, but these errors were encountered: