Merge pull request #1730 from deepak1556/webview_navigation_patch

navigation: adding clearHistory method
This commit is contained in:
Cheng Zhao 2015-05-21 14:56:30 +08:00
commit cde6b41a05
7 changed files with 52 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'

View file

@ -244,6 +244,7 @@ registerWebViewElement = ->
"canGoBack"
"canGoForward"
"canGoToOffset"
"clearHistory"
"goBack"
"goForward"
"goToIndex"