From 4b476f13bb7dea533ddc5e6c617e961652efb5dd Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 15 Mar 2018 16:18:37 +0900 Subject: [PATCH] Revert "Fixes electron/electron#12147" (#12293) * Revert "Set appropriate defaults for webview options (#12271)" This reverts commit c2673aa970b5256eff3b61d624ad0ff225260add. * Revert "Fixes electron/electron#12147 (#12193)" This reverts commit f54c94d6c930918c121e56185cd61aa27b56ee27. --- lib/browser/api/navigation-controller.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/browser/api/navigation-controller.js b/lib/browser/api/navigation-controller.js index a911a6c6533f..7eb21ddb3ea9 100644 --- a/lib/browser/api/navigation-controller.js +++ b/lib/browser/api/navigation-controller.js @@ -21,6 +21,11 @@ var NavigationController = (function () { this.webContents = webContents this.clearHistory() + // webContents may have already navigated to a page. + if (this.webContents._getURL()) { + this.currentIndex++ + this.history.push(this.webContents._getURL()) + } this.webContents.on('navigation-entry-commited', (event, url, inPage, replaceEntry) => { if (this.inPageIndex > -1 && !inPage) { // Navigated to a new page, clear in-page mark. @@ -101,12 +106,6 @@ var NavigationController = (function () { this.currentIndex = -1 this.pendingIndex = -1 this.inPageIndex = -1 - - // webContents may have already navigated to a page. - if (this.webContents._getURL()) { - this.currentIndex++ - this.history.push(this.webContents._getURL()) - } } NavigationController.prototype.goBack = function () {