don't use executeJavaScript() (fix for PR #107)
It’s not *that* much cleaner, but executeJavaScript() feels too much like eval(). cc @flet
This commit is contained in:
parent
944a47be72
commit
a6e8a3462e
1 changed files with 4 additions and 3 deletions
|
|
@ -48,9 +48,10 @@ function createMainWindow (menu) {
|
|||
win.on('close', function (e) {
|
||||
if (process.platform === 'darwin' && !isQuitting) {
|
||||
e.preventDefault()
|
||||
win.webContents.executeJavaScript('dispatch("pause")', function () {
|
||||
win.hide()
|
||||
})
|
||||
// sendSync() ensures that video will pause before window is hidden, at which point
|
||||
// the update() loop (which uses requestAnimationFrame) ceases to run
|
||||
win.sendSync('dispatch', 'pause')
|
||||
win.hide()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue