title: IndexedDB errors in Firefox and Chrome: Unknown error and DOMException
body: <p>I am trying to open an IndexedDB in Chrome and firefox. My code:</p>
  
  <pre><code>var v = 2;
                      var request = indexedDB.open("orders", v);
  
  
                    //Firefox code for db init
                    request.onupgradeneeded = function (e) {
  
                    console.log("onupgradeneeded");
                      var db = e.target.result;
                      // We can only create Object stores in a setVersion transaction;
  
                      if(db.objectStoreNames.contains("client")) {
                          var storeReq = db.deleteObjectStore("client");
                      }
  
      const employeeData = [
              { id: "00-01", name: "gopal", age: 35, email: "gopal@tutorialspoint.com" },
              { id: "00-02", name: "prasad", age: 32, email: "prasad@tutorialspoint.com" }
           ];
  
              var objectStore = db.createObjectStore("client", {keyPath: "id"});
  
              for (var i in employeeData) {
                 objectStore.add(employeeData[i]);
              }
  
                    }
  
        request.onsuccess = function(e) {
          var db =  e.target.result;
  
          console.log("Success");
          console.log(db);
  
  
     var transaction = db.transaction(["client"]);
              var objectStore = transaction.objectStore("client");
              var request = objectStore.get("00-02");
  
              request.onerror = function(event) {
                 alert("Unable to retrieve daa from database!");
              };
  
              request.onsuccess = function(event) {
                 // Do something with the request.result!
                 if(request.result) {
                    alert("Name: " + request.result.name + ", Age: " + request.result.age + ", Email: " + request.result.email);
                 }
  
                 else {
                    alert("Kenny couldn't be found in your database!");
                 }
              };
  
  
        };
  
        request.onerror = function(e) {
              console.log(e);
        };
  </code></pre>
  
  <p>In Chrome it doesn't work at all. I get an </p>
  
  <pre><code>DOMException: The user denied permission to access the database.
  </code></pre>
  
  <p>In Firefox it works as shown above. However, when I change the name of the database to, say, <code>myindexeddb</code>, it doesn't work anymore. I get an <code>UnknownError</code>.</p>
  
  <p>I have no idea what I am doing wrong.</p>