Check if the browser supports manipulation of the history
This commit is contained in:
parent
cce3e9cd1b
commit
5c93ec3a2c
@ -391,7 +391,7 @@ if (typeof PDFJS === 'undefined') {
|
||||
});
|
||||
})();
|
||||
|
||||
// Check console compatability
|
||||
// Check console compatibility
|
||||
(function checkConsoleCompatibility() {
|
||||
if (!('console' in window)) {
|
||||
window.console = {
|
||||
@ -455,3 +455,10 @@ if (typeof PDFJS === 'undefined') {
|
||||
PDFJS.disableRange = true;
|
||||
}
|
||||
})();
|
||||
|
||||
// Check if the browser supports manipulation of the history.
|
||||
(function checkHistoryManipulation() {
|
||||
if (!window.history.pushState) {
|
||||
PDFJS.disableHistory = true;
|
||||
}
|
||||
})();
|
||||
|
@ -31,7 +31,6 @@ var VERTICAL_PADDING = 5;
|
||||
var MIN_SCALE = 0.25;
|
||||
var MAX_SCALE = 4.0;
|
||||
var SETTINGS_MEMORY = 20;
|
||||
var HISTORY_DISABLED = false;
|
||||
var SCALE_SELECT_CONTAINER_PADDING = 8;
|
||||
var SCALE_SELECT_PADDING = 22;
|
||||
var RenderingStates = {
|
||||
@ -190,7 +189,7 @@ var PDFHistory = {
|
||||
initialDestination: null,
|
||||
|
||||
initialize: function pdfHistoryInitialize(fingerprint) {
|
||||
if (HISTORY_DISABLED || window.parent !== window) {
|
||||
if (PDFJS.disableHistory || window.parent !== window) {
|
||||
// The browsing history is only enabled when the viewer is standalone,
|
||||
// i.e. not when it is embedded in a page.
|
||||
return;
|
||||
@ -2564,6 +2563,10 @@ document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) {
|
||||
PDFJS.disableFontFace = (hashParams['disableFontFace'] === 'true');
|
||||
}
|
||||
|
||||
if ('disableHistory' in hashParams) {
|
||||
PDFJS.disableHistory = (hashParams['disableHistory'] === 'true');
|
||||
}
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
var locale = navigator.language;
|
||||
if ('locale' in hashParams)
|
||||
|
Loading…
Reference in New Issue
Block a user