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

Get focused window instead of all #671

Merged
merged 4 commits into from
Dec 19, 2022

Conversation

ianleeder
Copy link

I was wondering why most operations didn't work with the devtools window open. It's because of these lines. I'm certain that the command webContents.getAllWebContents() includes devtools window. I managed to debug that far and see an array of two elements returned, but I couldn't see a way to distinguish them.

Also the electronJS documentation says:

Returns WebContents[] - An array of all WebContents instances. This will contain web contents for all windows, webviews, opened devtools, and devtools extension background pages.

On line 11 you get the focusedWindow directly. Can we do the same for the remaining lines?

I'm not sure if you wanted to standardise on BrowserWindow.getFocusedWindow()?.webContents vs webContents.getFocusedWebContents(). They look equivalent to me.

@warrenbuckley
Copy link
Owner

All works as expected still & thanks @ianleeder 👍

@warrenbuckley warrenbuckley merged commit b636abb into warrenbuckley:dev Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants