add support for chrome apps

In a chrome app, it appears the following error:

window.localStorage is not available in packaged apps. Use chrome.storage.local instead.