How to delete indexedDB?

后端 未结 17 2043
忘了有多久
忘了有多久 2020-12-02 05:16

I\'m working in a project which involves using IndexedDB. As I\'m begining to know this technology, I need to be able to delete an indexedDB by hand so I can start over.

相关标签:
17条回答
  • 2020-12-02 06:16

    I've had success running the following in Chrome:

    indexedDB.deleteDatabase('DB NAME')
    
    0 讨论(0)
  • 2020-12-02 06:16

    In Debian GNU/Linux directory

    /home/[username]/.config/google-chrome/Default/IndexedDB/chrome-xxx.indexeddb.leveldb/

    contains regular files (for example):

    000003.log, CURRENT, LOCK, LOG, MANIFEST-000002

    0 讨论(0)
  • 2020-12-02 06:17

    In theory, all you need to do to delete an IndexedDB in Chrome is:

    1. In Chrome, go to Options > Under the Hood > Content Settings > All cookies and Site Data > find the domain where you created the IndexedDB
    2. Hit either the "X" or click "Indexed Database" > Remove

    In Windows, the file is located here:

    %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\IndexedDB

    On Mac, do the following:

    1. In Chrome, go to "Settings" (or "Preferences" under the Chrome menu)
    2. Click "show advanced settings" (at the bottom of the page)
    3. Go to "Privacy" > "Content Settings" > "All cookies and Site Data" > find the domain where you created the IndexedDB
    4. Hit either the "X" or click "Indexed Database" > Remove

    On Mac, the folder is located here:

    /Users/[USERNAME]/Library/Application Support/Google/Chrome/Default/IndexedDB/
    

    On Linux, the folder is located at:

    /home/[USERNAME]/.config/google-chrome/Default/IndexedDB/
    
    0 讨论(0)
  • 2020-12-02 06:19

    In Chrome webkit you can use webkitGetDatabaseNames which returns all database names

    With this code, you can delete all local indexedDB:

    window.indexedDB.webkitGetDatabaseNames().onsuccess = function(sender,args)
    {
        var r = sender.target.result;
        for(var i in r)
            indexedDB.deleteDatabase(r[i]);
    }; 
    
    0 讨论(0)
  • 2020-12-02 06:20

    In windows, you can manually delete the whole IndexedDB databases by locating the IndexedDB directory for the browser and deleting it

    For Chrome:

    C:\Users\user-name\AppData\Local\Google\Chrome\User Data\Profile 1\IndexedDB

    You can delete every folder which clears up the indexedDB. You can start over now.

    0 讨论(0)
提交回复
热议问题