mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-26 21:36:55 +00:00
Cope with localStorage not being available
IE10 doesn't allow localStorage for HTML pages loaded from the file:// protocol. Boo.
This commit is contained in:
parent
d42fb673f8
commit
05e73ee1da
@ -117,14 +117,16 @@ exports.getBoundingPageRect = function(element) {
|
||||
Saves a named password in the browser
|
||||
*/
|
||||
exports.savePassword = function(name,password) {
|
||||
localStorage.setItem("tw5-password-" + name,password);
|
||||
if(window.localStorage) {
|
||||
localStorage.setItem("tw5-password-" + name,password);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Retrieve a named password from the browser
|
||||
*/
|
||||
exports.getPassword = function(name) {
|
||||
return localStorage.getItem("tw5-password-" + name);
|
||||
return window.localStorage ? localStorage.getItem("tw5-password-" + name) : "";
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user