Merge pull request #9468 from tonyganch/9296-history-state
Remove page url check during `history.pushState`
This commit is contained in:
commit
53b6ee0e3f
2 changed files with 28 additions and 12 deletions
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue