Override default window.close, fixes #70.

This commit is contained in:
Cheng Zhao 2014-02-17 18:18:52 +08:00
parent 65f258160e
commit 984d60f935
2 changed files with 6 additions and 1 deletions

View file

@ -50,6 +50,11 @@ window.onerror = (error) ->
else
false
# Override default window.close, see:
# https://github.com/atom/atom-shell/issues/70
window.close = ->
require('remote').getCurrentWindow().close()
# Override default window.open.
window.open = (url, name, features) ->
options = {}

View file

@ -33,7 +33,7 @@ describe 'browser-window module', ->
w.loadUrl 'file://' + path.join(fixtures, 'api', 'beforeunload-false.html')
describe 'window.close()', ->
xit 'should emit unload handler', (done) ->
it 'should emit unload handler', (done) ->
w = new BrowserWindow(show: false)
w.on 'closed', ->
test = path.join(fixtures, 'api', 'close')