2017-02-17 15:48:30 +00:00
|
|
|
<html>
|
|
|
|
<body>
|
2017-02-17 17:58:29 +00:00
|
|
|
<webview nodeintegration src="zoom://host1" id="view" partition="webview-temp"/>
|
2017-02-17 15:48:30 +00:00
|
|
|
</body>
|
|
|
|
<script>
|
|
|
|
const {ipcRenderer, webFrame} = require('electron')
|
|
|
|
const view = document.getElementById('view')
|
|
|
|
let finalNavigation = false
|
|
|
|
view.addEventListener('dom-ready', () => {
|
2017-02-17 17:58:29 +00:00
|
|
|
if (!finalNavigation && !view.canGoBack()) {
|
2017-02-17 15:48:30 +00:00
|
|
|
view.setZoomLevel(2.0)
|
2017-02-17 17:58:29 +00:00
|
|
|
}
|
2017-02-17 15:48:30 +00:00
|
|
|
view.getZoomLevel((zoomLevel) => {
|
|
|
|
view.getZoomFactor((zoomFactor) => {
|
2017-02-17 17:58:29 +00:00
|
|
|
ipcRenderer.send('webview-zoom-level', zoomLevel, zoomFactor, view.canGoBack(), finalNavigation)
|
|
|
|
if (!view.canGoBack() && !finalNavigation) {
|
|
|
|
view.src = 'zoom://host2'
|
|
|
|
} else if (!finalNavigation) {
|
2017-02-17 15:48:30 +00:00
|
|
|
finalNavigation = true
|
2017-02-17 17:58:29 +00:00
|
|
|
view.goBack()
|
2017-02-17 15:48:30 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</html>
|