electron/spec/fixtures/pages/webview-origin-zoom-level.html

20 lines
598 B
HTML
Raw Normal View History

2017-03-08 13:35:24 +00:00
<html>
<body>
<webview nodeintegration src="app://host1" id="view" partition="webview-temp"/>
2017-03-08 13:35:24 +00:00
</body>
<script>
const {ipcRenderer} = require('electron')
const view = document.getElementById('view')
const view2 = document.createElement('webview')
view.addEventListener('dom-ready', () => {
view.setZoomLevel(2.0)
view2.src = "app://host1"
2017-03-08 13:35:24 +00:00
view2.partition = "webview-temp"
document.body.appendChild(view2)
})
view2.addEventListener('dom-ready', () => {
const zoomLevel = view2.getZoomLevel()
ipcRenderer.send('webview-origin-zoom-level', zoomLevel)
2017-03-08 13:35:24 +00:00
})
</script>