navigation: adding clearHistory method
This commit is contained in:
parent
ec5d05e226
commit
b0e8cafa00
5 changed files with 29 additions and 4 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue