title: Firefox indexedDB not working
body: <p>I'm trying to identify if an user is in private/incognito browsing mode. So, I'm trying to get access to indexedDB to test private mode:</p>
  
  <pre><code>var is_private = false;
  if (window.indexedDB &amp;&amp; /Firefox/.test(window.navigator.userAgent)) {
      var db;
      try {
          db = window.indexedDB.open('test');
      } catch(e) {
          is_private = true;
      }
  }
  </code></pre>
  
  <p>On Firefox default version(non ESR), works fine: normal browsing <code>is_private</code> is <code>false</code> and on private mode <code>is_private</code> equals <code>true</code>.</p>
  
  <p>But on Firefox ESR latest version always returns true even on normal browsing mode.</p>
  
  <p>console.error on Firefox ESR returns this error from bellow print on <code>window.indexedDB.open('test')</code> line:</p>
  
  <p><a href="https://i.stack.imgur.com/8ZrMJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ZrMJ.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT:</strong>
  I write the js code bellow to get more details about the error exception:</p>
  
  <pre><code>var db = window.indexedDB.open('test');
  db.onerror = function(event) {
      console.log(db.error);
  });
  </code></pre>
  
  <p>The output is: <code>DOMError { name: "UnknownError", message: "The operation failed for reasons unrelated to the database itself and not covered by any other error code." }</code></p>
  
  <p>And in browser console:</p>
  
  <pre><code>console.log(window.indexedDB.open('test'));
  </code></pre>
  
  <p>Output is:
  <code>IDBOpenDBRequest { onblocked: null, onupgradeneeded: null, source: null, transaction: null, readyState: "pending", onsuccess: null, onerror: null }</code></p>
  
  <p>Note that the <strong><code>readyState</code></strong> is always <code>"pending"</code></p>