0

Is there a way to iterate all indexedDBs and delete them in firefox (latest). I can do this in chrome and safari but NOT firefox. Here is how I do it in chrome and safari. (window.indexedDB.databases undefined in firefox)

 window.indexedDB.databases().then((r) => 
 {
      for (var i = 0; i < r.length; i++)
      {
           window.indexedDB.deleteDatabase(r[i].name);     
      } 
 })
Chris Muench
  • 17,444
  • 70
  • 209
  • 362

1 Answers1

0

There is no way to do what you want in the indexedDb API. You will need to keep track of the databases yourself.

See https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/databases. This is a draft feature offered by only some browsers. This function is not part of the standard. See IndexedDB view all Databases and Object Stores for some additional info.

Josh
  • 17,834
  • 7
  • 50
  • 68