Refactors history and how the database is stored

This commit is contained in:
Yury Delendik 2014-04-03 13:23:18 -05:00
parent 9c59437ac3
commit b39f0c311c
7 changed files with 37 additions and 55 deletions

View file

@ -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;
}
};
})();