+
Skip to content

[Feature Request]: setAutoResize support for View/WebContentsView #43802

@yangannyx

Description

@yangannyx

Preflight Checklist

Problem Description

WebContentsView does not currently support the ability to configure that it should automatically resize with its parent window. This was available on BrowserViews via setAutoResize.

Proposed Solution

Expose a setAutoResize instance method on View/WebContentsView that automatically resizes the View when the dimensions of the parent window changes.

Alternatives Considered

Currently using an event listener on the parent window's resize event to manually resize the WebContentsView.

this.browserWindow.on("resize", () => {
	const bounds = this.browserWindow.getBounds()
	this.webContentsView.setBounds({
		x: 0,
		y: 0,
		width: bounds.width,
		height: bounds.height,
	})
})

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载