Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome App has chrome.storage instad of localStorage #130

Open
rodneyrehm opened this issue Mar 23, 2016 · 0 comments
Open

Chrome App has chrome.storage instad of localStorage #130

rodneyrehm opened this issue Mar 23, 2016 · 0 comments

Comments

@rodneyrehm
Copy link
Member

Our supports cache saves its state in the localStorage. However @ryan-ludwig observed that Chrome Apps throw the following error when trying to access window.localStorage:

window.localStorage is not available in packaged apps. Use chrome.storage.local instead.

The chrome.storage.local interface is not available to Chrome Browser, only Chrome Apps. They key difference between the two is that window.localStorage is synchronous, but chrome.storage is asynchronous.

The simple "solution" is to simply prevent accessing window.localStorage when we are running as a Chrome App (detected by existence of chrome.storage?). This would mean that the supports test are run every time the Chrome App is started.

The proper solution would be to convert all of the supports test infrastructure to run asynchronously (because we could then support async tests). I'm not sure how that would integrate with synchronous APIs like ally.query.focusable(), though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant