-
-
Notifications
You must be signed in to change notification settings - Fork 641
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
Firefox "never remember history" disables IndexedDB #883
Comments
This issue has been up before (years ago), and solved. Does Dexie methods return a rejected promise (expected behavior) or does the code never reach the app code after Dexie instanciation/declaration? Which version of Dexie is it? |
Hello 👋 working on this project with @alexelisenko. We're on Dexie v 2.0.4 (latest). Dexie is behaving as expected. The Promise rejects, with an error message of: |
Thanks @jbarzegar! @alexelisenko: You might try using fakeIndexedDB as a fallback for users that have the privacy setting on so that Dexie could function as expected. Something like this would do: if(isBrowserPrivacyOn) {
Dexie.dependencies.indexedDB = require('fake-indexeddb');
Dexie.dependencies.IDBKeyRange = require('fake-indexeddb/lib/FDBKeyRange');
} Don't know if you can detect the privacy setting easily. Might need to try opening dexie first and catch the rejected promise and then open a new db after having applied fakeIndexeddb. Anyone who has tried this is very welcome to give some feedback here in this issue! |
Will take a look! Problem is we have to persist to disk since we're storing application state for our extension. If the process dies we don't want our users to log back in etc :( Either way @dfahlander I appreciate your help and thoughts on the matter. I'll make sure to update everyone when we find a suitable solution! |
Hello,
The "never remember history" privacy setting in Firefox disabled IndexedDB, which causes Dexie to throw an uncaught Error. Is there anyway to create a browser.storage.local wrapper for dexie to handle this user environment?
The text was updated successfully, but these errors were encountered: