localStorage security error

In Chrome, when "Block third-party cookies and site data" is enabled, accessing window.localStorage throws a security exception. Solution is to wrap access in a try-catch.

https://code.google.com/p/chromium/issues/detail?id=357625