mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Set URL in history.replaceState/pushState
When <base href> is present, history.replaceState and history.pushState behave inconsistent with relative URLs. http://code.google.com/p/chromium/issues/detail?id=274024 Contrary to what one expect, passing '' as the URL parameter to replaceState/pushState does not associate the currently active URL with the history entry, but a path relative to <base href>. To fix the issue, explicitly associate the current active URL with the history's state.
This commit is contained in:
parent
5ca1c84564
commit
c653bf3aff
1 changed files with 4 additions and 3 deletions
|
@ -65,7 +65,8 @@ var PDFHistory = {
|
|||
// is opened in the web viewer.
|
||||
this.reInitialized = true;
|
||||
}
|
||||
window.history.replaceState({ fingerprint: this.fingerprint }, '');
|
||||
window.history.replaceState({ fingerprint: this.fingerprint }, '',
|
||||
document.URL);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
@ -270,9 +271,9 @@ var PDFHistory = {
|
|||
}
|
||||
}
|
||||
if (overwrite || this.uid === 0) {
|
||||
window.history.replaceState(this._stateObj(params), '');
|
||||
window.history.replaceState(this._stateObj(params), '', document.URL);
|
||||
} else {
|
||||
window.history.pushState(this._stateObj(params), '');
|
||||
window.history.pushState(this._stateObj(params), '', document.URL);
|
||||
}
|
||||
this.currentUid = this.uid++;
|
||||
this.current = params;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue