safer access to window.localStorage, even accessing window.localStorage can throw exceptions in Chrome