2017-02-17 15:48:30 +00:00
|
|
|
<html>
|
|
|
|
<body>
|
2019-09-03 17:10:58 +00:00
|
|
|
<webview nodeintegration src="app://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
|
|
|
}
|
2019-01-21 07:40:27 +00:00
|
|
|
const zoomLevel = view.getZoomLevel()
|
|
|
|
const zoomFactor = view.getZoomFactor()
|
|
|
|
ipcRenderer.send('webview-zoom-level', zoomLevel, zoomFactor, view.canGoBack(), finalNavigation)
|
|
|
|
if (!view.canGoBack() && !finalNavigation) {
|
2019-09-03 17:10:58 +00:00
|
|
|
view.src = 'app://host2'
|
2019-01-21 07:40:27 +00:00
|
|
|
} else if (!finalNavigation) {
|
|
|
|
finalNavigation = true
|
|
|
|
view.goBack()
|
|
|
|
}
|
2017-02-17 15:48:30 +00:00
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</html>
|