Browse Source

[PDFHistory] Fix "Warning: Unhandled rejection: [Exception... "The operation is insecure."" in Firefox 25

Jonas Jenwald 12 years ago
parent
commit
44725d4657
  1. 16
      web/pdf_history.js

16
web/pdf_history.js

@ -132,16 +132,18 @@ var PDFHistory = { @@ -132,16 +132,18 @@ var PDFHistory = {
_pushOrReplaceState: function pdfHistory_pushOrReplaceState(stateObj,
replace) {
// In Firefox, 'urlParam' needs to be undefined in order to prevent issues
// when local files are opened.
var urlParam;
if (replace) {
//#if (GENERIC || CHROME)
urlParam = document.URL;
window.history.replaceState(stateObj, '', document.URL);
//#else
// window.history.replaceState(stateObj, '');
//#endif
if (replace) {
window.history.replaceState(stateObj, '', urlParam);
} else {
window.history.pushState(stateObj, '', urlParam);
//#if (GENERIC || CHROME)
window.history.pushState(stateObj, '', document.URL);
//#else
// window.history.pushState(stateObj, '');
//#endif
}
},

Loading…
Cancel
Save