electron/spec/fixtures/pages/webview-guest-resize.html
Birunthan Mohanathas 2986b7bc4a 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.
2016-11-15 11:00:09 -08:00

20 lines
451 B
HTML

<html>
<style>
* {
width: 100%;
height: 100%;
margin: 0;
}
</style>
<body>
<webview id="webview" nodeintegration src="resize.html"/>
</body>
<script type="text/javascript" charset="utf-8">
const {ipcRenderer} = require('electron')
const webview = document.getElementById('webview')
webview.addEventListener('resize', event => {
ipcRenderer.send('webview-element-resize', event.newWidth, event.newHeight)
}, false)
</script>
</html>