2016-10-25 05:17:38 +00:00
|
|
|
<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')
|
2018-06-01 08:56:48 +00:00
|
|
|
webview.addEventListener('did-finish-load', () => {
|
|
|
|
ipcRenderer.send('webview-loaded')
|
|
|
|
}, {once: true})
|
2016-10-25 05:17:38 +00:00
|
|
|
webview.addEventListener('resize', event => {
|
|
|
|
ipcRenderer.send('webview-element-resize', event.newWidth, event.newHeight)
|
|
|
|
}, false)
|
|
|
|
</script>
|
|
|
|
</html>
|