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

BrowserView's setAutoResize no longer works (since Electron 10.1.3) #25728

Closed
3 tasks done
pushkin- opened this issue Oct 1, 2020 · 5 comments · Fixed by #25951
Closed
3 tasks done

BrowserView's setAutoResize no longer works (since Electron 10.1.3) #25728

pushkin- opened this issue Oct 1, 2020 · 5 comments · Fixed by #25951

Comments

@pushkin-
Copy link

pushkin- commented Oct 1, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version: 10.1.3
  • Operating System: Windows 10
  • Last Known Working Electron version: 10.1.2

Expected Behavior

I expect that a BrowserView that's set up to auto resize, will do so

Actual Behavior

No auto-resizing happens

To Reproduce

  1. start the app below
  2. when the page loads in the browserview, resize the window
  3. notice the black background. browser view doesn't resize

main.js:

const { app, BrowserWindow, BrowserView } = require('electron')

async function createWindow() {
  const mainWindow = new BrowserWindow({ backgroundColor: "#000" });
  const view = new BrowserView();
  mainWindow.setBrowserView(view);

  const contentBounds = mainWindow.getContentBounds();
  view.setBounds({ x: 0, y: 0, width: contentBounds.width, height: contentBounds.height });
  view.setAutoResize({ width: true, height: true });

  await view.webContents.loadURL("https://google.com");
}

app.on('ready', createWindow)
@pushkin- pushkin- changed the title BrowserView's setAutoResize no longer works BrowserView's setAutoResize no longer works (since Electron 10.1.3) Oct 1, 2020
@pejman1
Copy link

pejman1 commented Oct 3, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version: 10.1.3
  • Operating System: Windows 10
  • Last Known Working Electron version: 10.1.2

Expected Behavior

I expect that a BrowserView that's set up to auto resize, will do so

Actual Behavior

No auto-resizing happens

To Reproduce

  1. start the app below
  2. when the page loads in the browserview, resize the window
  3. notice the black background. browser view doesn't resize

main.js:

const { app, BrowserWindow, BrowserView } = require('electron')

async function createWindow() {
  const mainWindow = new BrowserWindow({ backgroundColor: "#000" });
  const view = new BrowserView();
  mainWindow.setBrowserView(view);

  const contentBounds = mainWindow.getContentBounds();
  view.setBounds({ x: 0, y: 0, width: contentBounds.width, height: contentBounds.height });
  view.setAutoResize({ width: true, height: true });

  await view.webContents.loadURL("https://google.com");
}

app.on('ready', createWindow)

have same issue with electron 10.1.3 in windows 10

@codebytere
Copy link
Member

cc @mlaurencin 👆🏻 might be related

@ChALkeR
Copy link
Contributor

ChALkeR commented Oct 10, 2020

Also affects v9.3.2, v9.3.1 was fine.

@codebytere
Copy link
Member

Yep, likely related to #25411

@ChALkeR
Copy link
Contributor

ChALkeR commented Oct 12, 2020

zcbenz added 10-x-y 11-x-y

@zcbenz 9.x is also affected. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
11-x-y
Fixed for Next Release
Development

Successfully merging a pull request may close this issue.

7 participants