web_contents()->GetController().GoForward();
}
+void WebContents::GoToOffset(int offset) {
+ atom::AtomBrowserClient::SuppressRendererProcessRestartForOnce();
+ web_contents()->GetController().GoToOffset(offset);
+}
+
int WebContents::GetRoutingID() const {
return web_contents()->GetRoutingID();
}
.SetMethod("_reloadIgnoringCache", &WebContents::ReloadIgnoringCache)
.SetMethod("_goBack", &WebContents::GoBack)
.SetMethod("_goForward", &WebContents::GoForward)
+ .SetMethod("_goToOffset", &WebContents::GoToOffset)
.SetMethod("getRoutingId", &WebContents::GetRoutingID)
.SetMethod("getProcessId", &WebContents::GetProcessID)
.SetMethod("isCrashed", &WebContents::IsCrashed)
void ReloadIgnoringCache();
void GoBack();
void GoForward();
- void GoToIndex();
+ void GoToOffset(int offset);
int GetRoutingID() const;
int GetProcessID() const;
bool IsCrashed() const;
goToOffset: (offset) ->
return unless @canGoToOffset offset
- @goToIndex @currentIndex + offset
+ pendingIndex = @currentIndex + offset
+ if @inPageIndex > -1 and pendingIndex >= @inPageIndex
+ @pendingIndex = pendingIndex
+ @webContents._goToOffset offset
+ else
+ @goToIndex pendingIndex
getActiveIndex: ->
if @pendingIndex is -1 then @currentIndex else @pendingIndex
ipc.send 'ATOM_SHELL_NAVIGATION_CONTROLLER', args...
window.history.back = -> sendHistoryOperation 'goBack'
window.history.forward = -> sendHistoryOperation 'goForward'
+window.history.go = (offset) -> sendHistoryOperation 'goToOffset', offset