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

fix: BrowserWindow.fromWebContents should work in browser-window-created #33257

Merged
merged 1 commit into from Mar 16, 2022

Conversation

nornagon
Copy link
Member

Description of Change

Fixes #21608. The object was being added to the weak map only after the
_init function was called, meaning that the TrackableObject::FromWrappedClass
method would not work during the _init function.

Checklist

Release Notes

Notes: Fixed a bug where BrowserWindow.fromWebContents would return undefined during the browser-window-created event.

@nornagon nornagon added semver/patch backwards-compatible bug fixes target/18-x-y labels Mar 11, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Mar 11, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 12, 2022
@nornagon nornagon merged commit e904486 into main Mar 16, 2022
@nornagon nornagon deleted the fix-browser-window-created-initialization-order branch March 16, 2022 23:23
@release-clerk
Copy link

release-clerk bot commented Mar 16, 2022

Release Notes Persisted

Fixed a bug where BrowserWindow.fromWebContents would return undefined during the browser-window-created event.

@trop
Copy link
Contributor

trop bot commented Mar 16, 2022

I have automatically backported this PR to "18-x-y", please check out #33316

bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BrowserWindow.fromWebContents returns undefined for windows created using window.open
3 participants