Skip to content

Unable to work with ydn db in Firefox private browsing mode #107

@Kauser01

Description

@Kauser01

Hi,

I ran into this issue when I was creating/opening ydn-db in Firefox private browsing mode . The error logged in console is
InvalidStateError ydn.db-dev.js:257:444

I am using try and catch blocks to catch any error thrown by new ydn.db.Storage but this error is not caught by it.

try {
this.db = new ydn.db.Storage("Metadata", schema);
} catch (ex) {
this.log.error("Unable to initialize IndexedDB/WebSQL", ex);
this.db = new ydn.db.Storage("Metadata", schema, {
mechanisms: ['sessionstorage', 'memory']
});
}

The same error is reproducible by the ydn-db demo app in Firefox private browsing mode.
http://yathit.github.io/ydndb-demo/todo/todo.html
The demo app doesn't work as expected.

Note: This happens in normal browsing mode of Firefox also if we set Options -> Privacy -> Firefox will: Never remember history

Is there a way to catch this error or use any other workaround, so that I could resort to session/memory storage model in this situation?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions