Allow webview guests to be resized manually

This adds the `disableguestresize` property for webviews to prevent the
webview guest from reacting to size changes of the webview element. This
also partially documents the `webContents.setSize` function in order to
manually control the webview guest size.

These two features can be combined to improve resize performance for
e.g. webviews that span the entire window. This greatly reduces the lag
described in #6905.
This commit is contained in:
Birunthan Mohanathas 2016-10-24 22:17:38 -07:00
parent 89feefac2c
commit 2986b7bc4a
9 changed files with 212 additions and 3 deletions

View file

@ -1131,6 +1131,15 @@ win.webContents.on('did-finish-load', () => {
Shows pop-up dictionary that searches the selected word on the page.
#### `contents.setSize(options)`
Controls the bounds of the [`<webview>`](web-view-tag.md) guest.
* `options` Object
* `normal` Object (optional) - New size of the webview guest. This is can be used in combination with the [`disableguestresize`](web-view-tag.md#disableguestresize) attribute to manually resize the webview guest.
* `width` Integer
* `height` Integer
#### `contents.isOffscreen()`
Returns `Boolean` - Indicates whether *offscreen rendering* is enabled.