mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +02:00
Refactors history and how the database is stored
This commit is contained in:
parent
9c59437ac3
commit
b39f0c311c
7 changed files with 37 additions and 55 deletions
|
@ -537,3 +537,23 @@ if (typeof PDFJS === 'undefined') {
|
|||
}
|
||||
}
|
||||
})();
|
||||
|
||||
(function checkStorages() {
|
||||
// Feature test as per http://diveintohtml5.info/storage.html
|
||||
// The additional localStorage call is to get around a FF quirk, see
|
||||
// bug #495747 in bugzilla
|
||||
try {
|
||||
if ('localStorage' in window && window['localStorage'] !== null) {
|
||||
return;
|
||||
}
|
||||
} catch (e) { }
|
||||
window.localStorage = {
|
||||
data: Object.create(null),
|
||||
getItem: function (key) {
|
||||
return this.data[key];
|
||||
},
|
||||
setItem: function (key, value) {
|
||||
this.data[key] = value;
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue