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

feature: Add `BrowserWindow.fromBrowserView()` #11224

merged 5 commits into from Nov 23, 2017


None yet
3 participants

felixrieseberg commented Nov 22, 2017

It's currently not clear how one would access the current window from within a browserView. This makes that a little bit easier. I put this API onto BrowserWindow to mimic the similar BrowserWindow.fromWebContents, but we could move the API if people felt strongly that it should live somewhere else.

• BrowserWindow.fromBrowserView(browserView) API
• Tests
•  Docs

@felixrieseberg felixrieseberg requested review from electron/docs as code owners Nov 22, 2017

@@ -144,6 +144,12 @@ BrowserWindow.fromWebContents = (webContents) => {
BrowserWindow.fromBrowserView = (browserView) => {

This comment has been minimized.


MarshallOfSound Nov 22, 2017


Should add a return null at the bottom of this (super nit picky but otherwise the return type is technically undefined)

This comment has been minimized.


felixrieseberg Nov 23, 2017


Solid idea, done :white_checkmark:


ckerr approved these changes Nov 23, 2017

Very nice. Thanks for the new tests as well :)

@ckerr ckerr merged commit 9c217fc into master Nov 23, 2017

6 checks passed

ci/circleci: electron-linux-arm Your tests passed on CircleCI!
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
ci/circleci: electron-linux-ia32 Your tests passed on CircleCI!
ci/circleci: electron-linux-x64 Your tests passed on CircleCI!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/jenkins/pr-head This commit looks good

@ckerr ckerr deleted the browser-view-window branch Nov 23, 2017

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