Redirect history operations in renderer to browser

This commit is contained in:
Cheng Zhao 2015-05-11 14:29:44 +08:00
parent 4c10925694
commit 4d1cd7e15f

View file

@ -74,6 +74,12 @@ window.confirm = (message, title='') ->
window.prompt = ->
throw new Error('prompt() is and will not be supported.')
# Forward history operations to browser.
window.history.back = ->
remote.getCurrentWebContents().goBack()
window.history.forward = ->
remote.getCurrentWebContents().goForward()
window.opener =
postMessage: (message, targetOrigin='*') ->
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', message, targetOrigin