InvalidStateError when opening IndexedDB in Firefox 21

I am using Firefox 21 built for Linux Mint. When I try to open the IndexedDB database from a script tag, I get an InvalidStateError. However, I am not getting an error message when I try to open the database from the JavaScript console.

The following code gives an error

<html> <body> <script src="http://code.jquery.com/jquery-1.10.0.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ indexedDB.open("MyNewDatabase"); }); </script> </body> </html> 

upon entry indexedDB.open("MyNewDatabase"); the IDBOpenDBRequest object is correctly returned in the console. Any ideas what might cause this weird behavior?

I know Invalid status error in Firefox for indexed Db and InvalidStateError when opening IndexedDB in Firefox , but both questions / answers did not help me figure out the problem.

+4
source share
3 answers

This answer is probably too late to be useful, but you have verified that dom.indexedDB.enabled pref is correct in about: config?

I ended up reading the source code for indexedDB Gecko to find that I turned this false prefix in the past for unknown reasons!

+1
source

Did you tred in the version as the second parameter to indexedDB.open? I recall a random conversation that I found on the Internet, where it was decided to make it optional and such. I believe the spec says that it defaults to 1 if not provided, but you might want to at least see what happens.

0
source

In Chrome and Firefox ... you must specify the version number. In IE10 ... you should NOT. IE10 also uses the "msIndexedDB" prefix, and the use of transaction enumerations is also not compatible with Microsoft. Some versions of IE use MS enumeration prefix values; others use a string. Hmm

0
source

Source: https://habr.com/ru/post/1483744/


All Articles