Skip to content
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

Make it possible to open DevTools unfocused #13095

Closed
sindresorhus opened this issue May 28, 2018 · 1 comment
Closed

Make it possible to open DevTools unfocused #13095

sindresorhus opened this issue May 28, 2018 · 1 comment

Comments

@sindresorhus
Copy link
Contributor

sindresorhus commented May 28, 2018

Is your feature request related to a problem? Please describe.

During development, I open DevTools when the DOM is loaded with win.webContents.openDevTools({mode: 'undocked'});. The problem is that I don't want the DevTools window to be in the front of the app, so I would have to click the app window afterward to bring it to the front. I solved this with win.webContents.once('devtools-opened', () => win.focus());. The problem with this solution is that DevTools shows for half a second before the app window is brought to the front, which is quite jarring.

Describe the solution you'd like

I would like an option for .openDevTools() to specify it to open in the background and unfocused if the mode is undocked and if it's any other mode, it will just not focus DevTools.

win.webContents.openDevTools({
	mode: 'undocked',
	unfocused: true
});

Related: #4764 (comment)

We should probably change this behavior or add an option to not focus the devtools window.
- @zcbenz

@miniak
Copy link
Contributor

miniak commented Jul 29, 2018

@sindresorhus I've created a PR to address this issue #13852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants