add support for chrome apps
corrected PR for other browsers

Sorry, this should work now. window.localStorage is undefined in chrome apps.
better checking for undefined value
Merge pull request #143 from marmolejo/master

add support for chrome apps