1

I have a page on my web app that should clear all offline data for the app, including the localStorage and all IndexedDBs.

My problem is on iOS8+ (Safari 8),indexedDB.webkitGetDatabaseNames() is not supported. My intention was to step through each database name and use indexedDB.deleteDatabase() to delete each database, but without knowing the names of the databases, this is impossible.

I suppose it would be naive to expect a .clear() similar to localStorage, but is there another way to do this?

iamhungry129
  • 144
  • 8

1 Answers1

1

The webkitGetDatabaseNames function is not part of the IndexedDB standard and that's why it's not supported on all browsers. And since you can only access databases that are created on the same domain (same origin policy), you can keep a list of databases that you've created and delete them when needed.

Community
  • 1
  • 1
Deni Spasovski
  • 4,004
  • 3
  • 35
  • 52