From: Cheng Zhao Date: Tue, 15 Sep 2015 01:20:56 +0000 (+0800) Subject: Make getUrl work for devToolsWebContents X-Git-Tag: v0.32.3~6^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e656d8428cc463aecb3477717257d1c2494ec694;p=electron.git Make getUrl work for devToolsWebContents --- diff --git a/atom/browser/api/lib/navigation-controller.coffee b/atom/browser/api/lib/navigation-controller.coffee index a985931f..f78d92c3 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.