navigation: adding clearHistory method

This commit is contained in:
deepak1556 2015-05-19 22:41:03 +05:30
parent ec5d05e226
commit b0e8cafa00
5 changed files with 29 additions and 4 deletions

View file

@ -85,6 +85,13 @@ ipc.on 'ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', (message, targetOrigin) ->
# Forward history operations to browser.
sendHistoryOperation = (args...) ->
ipc.send 'ATOM_SHELL_NAVIGATION_CONTROLLER', args...
getHistoryOperation = (args...) ->
ipc.sendSync 'ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER', args...
window.history.back = -> sendHistoryOperation 'goBack'
window.history.forward = -> sendHistoryOperation 'goForward'
window.history.go = (offset) -> sendHistoryOperation 'goToOffset', offset
Object.defineProperty window.history, 'length',
get: ->
getHistoryOperation 'length'