I'm integrating a javascript library that uses IndexedDB, but it fails "ungraciously" when Firefox is in private browsing/window mode. The library returns out a 500 Internal Error and meanwhile Firefox spits out an InvalidStateError to console.
What I'd like to do is add a check before I instantiate this library, and not use the library at all if IndexedDB is not available. i.e. some type of try/catch test. From what I've seen, Firefox appears to spit out the console error even if the offending code is inside a try/catch (but maybe there's still a way..).
I don't actually have an interest whether the user is in a private window session or not, but that seems to be the only time when Firefox causes this InvalidStateError.