How to delete indexedDB?

后端 未结 17 2041
忘了有多久
忘了有多久 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 05:54

    Alternarive is to do it in the developers console, using this command:

    indexedDB.deleteDatabase("databaseName")
    
    0 讨论(0)
  • 2020-12-02 05:56

    Chrome Developer tools now have an option to delete all databases for an app, under "Application/Clear Storage".

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

    In order to complete @Judson's answer, based on @fullstacklife's comment; for deleting IndexedDB in chrome using javascript you should:

    let currentIDB = indexedDB.open("DB_NAME", DB_VERSION_INTEGER);
        currentIDB.onblocked = function(){
            //
        };
        currentIDB.onerror = function(){
            //
        };
        currentIDB.onsuccess = function(){
            var idb = currentIDB.result;
            idb.close();
            indexedDB.deleteDatabase("DB_NAME");
        };
    
    0 讨论(0)
  • 2020-12-02 06:03

    To delete an IndexedDB from the OS X version of Chrome:

    1) In Preferences, show Advanced Settings then click the "Content Settings" button under the "Privacy" section.

    2) In the "Content Settings" popup, click the "All Cookies and Site Data" button under the "Cookies" section.

    3) In the "Cookies and site data" popup, use the "Search Cookies" textbox to look up the domain that is the source of the IndexedDB.

    4) Click on the domain entry in the list.

    5) Click on the "indexed database" tag listed under the domain.

    6) Click on the "Remove" button in the drop down detail for the indexed database.

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

    write this code segment in console

    window.indexedDB.deleteDatabase(<your db name>)

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

    Chrome -> Inspector Window -> Application -> look at left hand menu -> Storage -> IndexedDB

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