2014-01-16 16:42:30 +01:00
|
|
|
var localstorage = (function () {
|
|
|
|
|
|
|
|
var exports = {};
|
|
|
|
|
|
|
|
var warned_of_localstorage = false;
|
|
|
|
|
|
|
|
exports.supported = function supports_localstorage() {
|
|
|
|
try {
|
|
|
|
return window.hasOwnProperty('localStorage') && window.localStorage !== null;
|
|
|
|
} catch (e) {
|
|
|
|
if (!warned_of_localstorage) {
|
|
|
|
blueslip.error("Client browser does not support local storage, will lose socket message on reload");
|
|
|
|
warned_of_localstorage = true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return exports;
|
|
|
|
|
|
|
|
}());
|
2016-12-04 08:59:56 +01:00
|
|
|
|
|
|
|
if (typeof module !== 'undefined') {
|
|
|
|
module.exports = localstorage;
|
|
|
|
}
|