View and change IndexedDB data

Kayce Basques
Kayce Basques

This guide shows you how to useChrome DevTools to view and changeIndexedDB data. Itassumes you're familiar with DevTools. If not, seeGet started. It also assumes you're familiarwith IndexedDB. If not, seeUsing IndexedDB.

View IndexedDB data

  1. Click theApplication tab to open theApplication panel.Expand theIndexedDB menu to see which databases are available.

    The IndexedDB menu

    Figure 1. TheIndexedDB menu

    • Database iconnotes -https://mdn.github.io represents a database, wherenotes is the name of the database andhttps://mdn.github.io is the origin that can access the database.
    • Object Store iconnotes is anobject store.
    • title andbody areindexes.
Note:Known Limitation Third-party databases are not visible. For example, if you use an<iframe> to embed an ad on your page, and your ad network uses IndexedDB, your ad network'sIndexedDB data won't be visible. Seeissue #943770.
  1. Click a database to see its origin and version number.

    The 'notes' database

    Figure 2. Thenotes database

  2. Click an object store to see its key-value pairs.

    Caution: IndexedDB data does not update in real-time. SeeRefresh IndexedDB data.

    The 'notes' object store

    Figure 3. Thenotes object store

    • Total entries is the total number of key-value pairs in the object store.
    • Key generator value is the next available key. This field is only shown when usingkeygenerators.
  3. Click a cell in theValue column to expand that value.

    Viewing an IndexedDB value

    Figure 4. Viewing an IndexedDB value

  4. Click an index, such astitle orbody inFigure 6 below, to sort the object storeaccording to the values of that index.

    Sorting an object store by an index

    Figure 5. An object store that is sorted alphabetically according to itstitle key

Refresh IndexedDB data

IndexedDB values in theApplication panel do not update in real-time. ClickRefreshRefresh when viewing an object store torefresh its data, or view a database and clickRefresh database to refresh all data.

Viewing a database

Figure 6. Viewing a database

Edit IndexedDB data

IndexedDB keys and values are not editable from theApplication panel. Since DevTools has accessto page context, however, you can run JavaScript code within DevTools that edits IndexedDB data.

Edit IndexedDB data with Snippets

Snippets are a way to store and run blocks of JavaScript code within DevTools. When you run aSnippet, the result is logged to theConsole. You can use a Snippet to run JavaScript code thatedits an IndexedDB database.

Using a Snippet to interact with IndexedDB

Figure 7. Using a Snippet to interact with IndexedDB

Delete IndexedDB data

Delete an IndexedDB key-value pair

  1. View an IndexedDB object store.
  2. Click the key-value pair that you want to delete. DevTools highlights it blue to indicate thatit's selected.

    Selecting a key-value pair in order to delete it

    Figure 8. Selecting a key-value pair in order to delete it

  3. Press theDelete key or clickDelete SelectedDelete Selected.

    How the object store looks after the key-value pair has been deleted

    Figure 9. How the object store looks after the key-value pair has been deleted

Delete all key-value pairs in an object store

  1. View an IndexedDB object store.

    Viewing an object store

    Figure 10. Viewing an object store

  2. ClickClear object storeClear object store.

Delete an IndexedDB database

  1. View the IndexedDB database that you want to delete.
  2. ClickDelete database.

    The 'Delete database' button

    Figure 11. TheDelete database button

Delete all IndexedDB storage

  1. Open theClear storage pane.
  2. Make sure that theIndexedDB checkbox is enabled.
  3. ClickClear site data.

    The 'Clear storage' pane

    Figure 12. TheClear storage pane

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2019-03-18 UTC.