diff --git a/atom/browser/api/lib/navigation-controller.coffee b/atom/browser/api/lib/navigation-controller.coffee index a985931f4716..f78d92c341d6 100644 --- a/atom/browser/api/lib/navigation-controller.coffee +++ b/atom/browser/api/lib/navigation-controller.coffee @@ -16,6 +16,11 @@ class NavigationController constructor: (@webContents) -> @clearHistory() + # webContents may have already navigated to a page. + if @webContents._getUrl() + @currentIndex++ + @history.push @webContents._getUrl() + @webContents.on 'navigation-entry-commited', (event, url, inPage, replaceEntry) => if @inPageIndex > -1 and not inPage # Navigated to a new page, clear in-page mark.