Skip to content

Instantly share code, notes, and snippets.

@thyagorafaell
Created March 23, 2015 18:57
Show Gist options
  • Select an option

  • Save thyagorafaell/abc7beea16dc8bf88f75 to your computer and use it in GitHub Desktop.

Select an option

Save thyagorafaell/abc7beea16dc8bf88f75 to your computer and use it in GitHub Desktop.
Remove indexedDbs
var removeDb = function(databaseName) {
var req = indexedDB.deleteDatabase(databaseName);
req.onsuccess = function () {
console.log("Deleted database successfully. Base" + databaseName);
};
req.onerror = function () {
console.log("Couldn't delete database. Base" + databaseName);
};
req.onblocked = function () {
console.log("Couldn't delete database due to the operation being blocked. Base" + databaseName);
};
}
var dbs = [
'anotherASDB',
'anotherASDB2',
'as-translate-2',
'as-translate-10',
'as-translate-11',
'as-translate-13',
'as-translate-3',
'as-translate-4',
'as-translate-5',
'as-translate-6',
'as-translate-7',
'as-translate-8',
'as-translate-9',
'as-translate-9',
'i18n-teste-local',
'notesDB',
'todos'
];
dbs.forEach(removeDb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment