Browse Source

Catch error when the creation of localStorage polyfill fails in the generic viewer

Jonas Jenwald 11 years ago
parent
commit
8bb19fac2d
  1. 7
      web/compatibility.js

7
web/compatibility.js

@ -547,6 +547,10 @@ if (typeof PDFJS === 'undefined') { @@ -547,6 +547,10 @@ if (typeof PDFJS === 'undefined') {
return;
}
} catch (e) { }
// When the generic viewer is used in Firefox the following code will fail
// when the preference 'network.cookie.lifetimePolicy' is set to 1,
// see Mozilla bug 365772.
try {
window.localStorage = {
data: Object.create(null),
getItem: function (key) {
@ -556,4 +560,7 @@ if (typeof PDFJS === 'undefined') { @@ -556,4 +560,7 @@ if (typeof PDFJS === 'undefined') {
this.data[key] = value;
}
};
} catch (e) {
console.log('Unable to create polyfill for localStorage');
}
})();

Loading…
Cancel
Save