mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user