Override default window.close, fixes #70.
This commit is contained in:
parent
65f258160e
commit
984d60f935
2 changed files with 6 additions and 1 deletions
|
@ -50,6 +50,11 @@ window.onerror = (error) ->
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
||||||
|
# Override default window.close, see:
|
||||||
|
# https://github.com/atom/atom-shell/issues/70
|
||||||
|
window.close = ->
|
||||||
|
require('remote').getCurrentWindow().close()
|
||||||
|
|
||||||
# Override default window.open.
|
# Override default window.open.
|
||||||
window.open = (url, name, features) ->
|
window.open = (url, name, features) ->
|
||||||
options = {}
|
options = {}
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe 'browser-window module', ->
|
||||||
w.loadUrl 'file://' + path.join(fixtures, 'api', 'beforeunload-false.html')
|
w.loadUrl 'file://' + path.join(fixtures, 'api', 'beforeunload-false.html')
|
||||||
|
|
||||||
describe 'window.close()', ->
|
describe 'window.close()', ->
|
||||||
xit 'should emit unload handler', (done) ->
|
it 'should emit unload handler', (done) ->
|
||||||
w = new BrowserWindow(show: false)
|
w = new BrowserWindow(show: false)
|
||||||
w.on 'closed', ->
|
w.on 'closed', ->
|
||||||
test = path.join(fixtures, 'api', 'close')
|
test = path.join(fixtures, 'api', 'close')
|
||||||
|
|
Loading…
Reference in a new issue