Last active
May 13, 2024 13:40
-
-
Save rmehner/b9a41d9f659c9b1c3340 to your computer and use it in GitHub Desktop.
Delete all indexedDB databases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit to @steobrien from https://gist.github.com/rmehner/b9a41d9f659c9b1c3340#gistcomment-2940034 | |
// for modern browsers, this works: | |
const dbs = await window.indexedDB.databases() | |
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) }) | |
// for older browsers, have a look at previous revisions of this gist. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to wrap the execution in an
async
function.This works fine for me on Safari. Note that you may not see the effect immediately on the dev tool until you close the browser window and open it again.