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

feat: add multi BrowserView support to BrowserWindow #16148

Merged

Conversation

summeroff
Copy link
Contributor

@summeroff summeroff commented Dec 19, 2018

Description of Change

new feature: multi browser views support for BrowserWindow

Add functions addBrowserView, removeBroserView, getBrowserViews to BrowserWindow class.

Existing API setBrowserView and getBrowserView changed to use new API inside.

This functionality was mentioned in the initial BrowserView feature PR #9166 . And asked few times since then. Recently in a discussion #10622 .

It is a resubmit of PR #16064 as changes moved to master branch instead of 2-0-x branch.
/cc @zcbenz

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are added
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines

Release Notes

Notes: Added support for multiple browser views per BrowserWindow.

@codebytere
Copy link
Member

not ok 1026 chromium feature focus handling "before each" hook for "moves focus to the next focusable item"
  ReferenceError: emittedOnce is not defined
      at Context.beforeEach (/home/builduser/project/src/electron/spec/chromium-spec.js:1422:28)
      at processImmediate (timers.js:632:19)

is failing across several platforms, and is thus i believe consequential of this PR.

@summeroff
Copy link
Contributor Author

Failed test is trying to use emittedOnce without including it.
Something like const { emittedOnce } = require('./events-helpers') probably can help. But I am not sure it should be fixed in this feature PR and not small fix PR that will be merged in master a lot faster.

Change what added test with emittedOnce was merged into master just 18 hours ago. So my PR can be one of the first that catches it.

@zcbenz
Copy link
Member

zcbenz commented Dec 20, 2018

The CI is broken on master branch, I also see the failed test in other unrelated PRs.

Add functions addBrowserView, removeBroserView, getBrowserViews to
BrowserWindow class. Existing API as setBrowserView and
getBrowserView code replaced to use new api inside.
Add functions addBrowserView, removeBroserView, getBrowserViews to
BrowserWindow class. Existing API as setBrowserView and
getBrowserView code replaced to use new api inside.
@summeroff summeroff force-pushed the sl_multi_browser_views_support_master branch from 0c099a4 to 38816e8 Compare December 20, 2018 19:27
@summeroff
Copy link
Contributor Author

summeroff commented Dec 21, 2018

For failed tests on 'ci/circleci: mas-testing-tests' run.
UPD:
3 of them will be dealt in PR #15987.

And one with timeout on getAllWebContents probably just some slowdown on host.

@zcbenz zcbenz merged commit 5ae3d1a into electron:master Dec 22, 2018
@release-clerk
Copy link

release-clerk bot commented Dec 22, 2018

Release Notes Persisted

Added support for multiple browser views per BrowserWindow.

@welcome
Copy link

welcome bot commented Dec 22, 2018

Congrats on merging your first pull request! 🎉🎉🎉

summeroff added a commit to stream-labs/electron that referenced this pull request Apr 22, 2019
* feat: add multi BrowserView support to BrowserWindow

Add functions addBrowserView, removeBroserView, getBrowserViews to
BrowserWindow class. Existing API as setBrowserView and
getBrowserView code replaced to use new api inside.

* fix: for lint and osx compile errors

* fix: lint error in test code

* feat: add multi BrowserView support to BrowserWindow

Add functions addBrowserView, removeBroserView, getBrowserViews to
BrowserWindow class. Existing API as setBrowserView and
getBrowserView code replaced to use new api inside.

* fix: for lint and osx compile errors

* fix: lint error in test code

* fix: method to be accessible on mac api impl

* fix: missed function declarations for mac impl

* fix: use base class reset function
@0xENDER
Copy link

0xENDER commented Oct 28, 2020

When I try to create a new browser view, the old one disappears.

@vmars316
Copy link

vmars316 commented Nov 3, 2020

Hello & Thanks ,
Can someone aim me at an Electron browserview simple example Browser ?
Thanks for your Help...

@rumkin
Copy link

rumkin commented Dec 12, 2020

BrowserView couldn't be detached from BrowserWindow and added to another BrowserWindow. The old window still has a reference to the view in its TopLevelWindow::browser_views_ map. Filed it as a separate issue #26975.

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.

None yet

6 participants