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:
@@ -48,9 +48,10 @@ function createMainWindow (menu) {
|
|||||||
win.on('close', function (e) {
|
win.on('close', function (e) {
|
||||||
if (process.platform === 'darwin' && !isQuitting) {
|
if (process.platform === 'darwin' && !isQuitting) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
win.webContents.executeJavaScript('dispatch("pause")', function () {
|
// sendSync() ensures that video will pause before window is hidden, at which point
|
||||||
win.hide()
|
// the update() loop (which uses requestAnimationFrame) ceases to run
|
||||||
})
|
win.sendSync('dispatch', 'pause')
|
||||||
|
win.hide()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user