Prevent views from navigating away from the current page

This commit is contained in:
Max Goodhart
2020-08-29 22:50:45 -07:00
parent 59b002f243
commit 066dea3112

View File

@@ -135,6 +135,12 @@ export default class StreamWindow extends EventEmitter {
})
view.setBackgroundColor(backgroundColor)
// Prevent view pages from navigating away from the specified URL.
view.webContents.on('will-navigate', (ev) => {
console.log(ev)
ev.preventDefault()
})
const machine = viewStateMachine
.withContext({
...viewStateMachine.context,