Avoid setting incorrect document URLs, in IE 11, when the browser history is updated (PR 10423 follow-up)
Apparently in IE 11 when `history.{pushState, replaceState}` is called, there's actually a difference between not providing the *third* argument vs providing it set implicitly to `undefined`. It appears that in IE 11 it's actually being stringified, rather than ignored, which seems completely wrong (obviously other browsers aren't affected, so no surprises there). This is yet another reason why I think the feature itself was a really bad idea, since it now requires extra/duplicated code just to prevent weird/incorrect URL behaviour in crappy browsers.
This commit is contained in:
parent
5cb00b7967
commit
ffe798137f
@ -306,10 +306,18 @@ class PDFHistory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shouldReplace) {
|
if (shouldReplace) {
|
||||||
window.history.replaceState(newState, '', newUrl);
|
if (newUrl) {
|
||||||
|
window.history.replaceState(newState, '', newUrl);
|
||||||
|
} else {
|
||||||
|
window.history.replaceState(newState, '');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this._maxUid = this._uid;
|
this._maxUid = this._uid;
|
||||||
window.history.pushState(newState, '', newUrl);
|
if (newUrl) {
|
||||||
|
window.history.pushState(newState, '', newUrl);
|
||||||
|
} else {
|
||||||
|
window.history.pushState(newState, '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
|
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user