Skip to content

Commit

Permalink
prevent navigation in every window (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plastikmensch committed Jul 24, 2020
1 parent 3a83cad commit 3460e05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ else {
contents.on('console-message', (event, level, message, line, sourceId) => {
common.log(`log event: Level: ${level} message: ${message} line: ${line} source: ${sourceId}`, 1)
})
//prevent any window from navigating, which isn't caused by loadURL
contents.on('will-navigate', (event) => {
event.preventDefault()
common.log('prevented navigation', 0)
})
})

app.on('browser-window-created', (event, win) => {
Expand Down

0 comments on commit 3460e05

Please sign in to comment.