Remove page url check in history.pushState

Current implementation of NavigationController does not allow using
`history.pushState()` if page url is not changed.
It worked by mistake in versions < 1.3.6 and got visible after fix 180a77e6.
This commit is contained in:
Tony Ganch 2017-05-15 16:03:25 +02:00
parent 6d64336978
commit 3a9b035d36

View file

@ -27,7 +27,6 @@ var NavigationController = (function () {
this.history.push(this.webContents._getURL())
}
this.webContents.on('navigation-entry-commited', (event, url, inPage, replaceEntry) => {
var currentEntry
if (this.inPageIndex > -1 && !inPage) {
// Navigated to a new page, clear in-page mark.
this.inPageIndex = -1
@ -46,12 +45,8 @@ var NavigationController = (function () {
} else {
// Normal navigation. Clear history.
this.history = this.history.slice(0, this.currentIndex + 1)
currentEntry = this.history[this.currentIndex]
if (currentEntry !== url) {
this.currentIndex++
this.history.push(url)
}
this.currentIndex++
this.history.push(url)
}
})
}