var storage = null;
setLocalStorage();
function setLocalStorage() {
storage = (localStorage ? localStorage : (window.content.localStorage ? window.content.localStorage : null));
try {
storage.setItem('test_key', 'test_value');//verify if posible saving in the current storage
}
catch (e) {
if (e.name == "NS_ERROR_FILE_CORRUPTED") {
storage = sessionStorage ? sessionStorage : null;//set the new storage if fails
}
}
}