electron/spec/fixtures/pages/webview-origin-zoom-level.html
Shelley Vohr 3ca87d205f
feat: make zoomLevel/zoomFactor sync (#16410)
* feat: make zoomLevel/zoomFactor sync

* update ts defs dep
2019-01-20 23:40:27 -08:00

19 lines
600 B
HTML

<html>
<body>
<webview nodeintegration src="zoom://host1" id="view" partition="webview-temp"/>
</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 = "zoom://host1"
view2.partition = "webview-temp"
document.body.appendChild(view2)
})
view2.addEventListener('dom-ready', () => {
const zoomLevel = view2.getZoomLevel()
ipcRenderer.send('webview-origin-zoom-level', zoomLevel)
})
</script>