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

localForage does not work on FF 9 #311

Closed
edwardcoolson opened this issue Nov 25, 2014 · 6 comments
Closed

localForage does not work on FF 9 #311

edwardcoolson opened this issue Nov 25, 2014 · 6 comments

Comments

@edwardcoolson
Copy link

localForage 1.2.0 does not work on FF 9. This trivial code snippet issues the error "The operation failed because the requested database object could not be found...":

localforage.length(function(err, value) {
  var count = value;
});

It seems like FF 9 supports an outdated version of indexedDB that causes this error. So for FF 9 and below localForage should fallback to localStorage (rather then use mozIndexedDB). This code snippet works ok for my FF 9:

localforage.setDriver(localforage.LOCALSTORAGE);
localforage.length(function(err, value) {
  var count = value;
});
@tofumatt
Copy link
Member

Firefox 9 is from December 20, 2011 😄

I think what I should really do is update the list of supported browsers to what I'm willing to support and fix bugs for. These technologies shipped in older browser versions, but I'm not really looking to support Firefox 9 :-)

@edwardcoolson
Copy link
Author

Thanks for clarification. I would completely agree with you if that was a big deal to fix it. But it is not. All you need is to simply fallback to localstorage for all old FFs that support it but still don't well support indexedDB, i.e. for FF3.5 till FF17. Without this it turns out that FF 3.5 is supported (via localstorage) but FF9 is not. Is not this strange?

@tofumatt
Copy link
Member

Fair enough! I'd prefer not to do browser sniffing, but if you could send a PR that extends our test in src/localForage.js that checks for indexeddb support I'd gladly merge it in.

tofumatt (Sent from mobile)

On 30 November 2014 14:58:22 GMT-06:00, Edward notifications@github.com wrote:

Thanks for clarification. I would completely agree with you if that was
a big deal to fix it. But it is not. All you need is to simply fallback
to localstorage for all FFs that support it, i.e. for FF3.5+. Without
this it turns out that FF 3.5 is supported (via localstorage) but FF9
is not. Is not this strange?


Reply to this email directly or view it on GitHub:
#311 (comment)

@edwardcoolson
Copy link
Author

OK, no sniffing, so may be just to rip out that erroneous 'mozIndexedDB'? According to caniuse FF3.5+ will be then supported:

  • FF3.5 till FF15 via localstorage
  • FF16+ via indexedDB

How do you think?

@tofumatt
Copy link
Member

tofumatt commented Dec 1, 2014

That works for me.

tofumatt (Sent from mobile)

On 30 November 2014 17:15:55 GMT-06:00, Edward notifications@github.com wrote:

OK, no sniffing, so may be just to rip out that erroneous
'mozIndexedDB'? According to caniuse FF3.5+ will be then supported:

  • FF3.5 till FF15 via localstorage
  • FF16+ via indexedDB

How do you think?


Reply to this email directly or view it on GitHub:
#311 (comment)

@edwardcoolson
Copy link
Author

Cool. Will be waiting for this fix.

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

No branches or pull requests

2 participants