Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view IndexedDB content in firefox

I've been playing with IndexedDB in Firefox (Ubuntu)

Is there any way to visualize IndexedDB databases contents ? Or do I have to do it programmatic-ally ?

like image 874
Fernando Fabreti Avatar asked Mar 23 '12 20:03

Fernando Fabreti


People also ask

How do I enable IndexedDB in Firefox?

Double-click on the name dom. indexedDB. enabled to toggle its value.

How do I get all data from IndexedDB?

Using cursors # Another way to retrieve all of the data is to use a cursor. A cursor selects each object in an object store or index one by one, letting you do something with the data as it is selected. Cursors, like the other database operations, work within transactions.

How do I view session data in Firefox?

You can open the Storage Inspector by selecting “Storage Inspector” from the Web Developer submenu in the Firefox Menu Panel (or Tools menu if you display the menu bar or are on macOS), or by pressing its Shift + F9 keyboard shortcut.


2 Answers

Bleeding edge Chromium builds reportedly allow you to view IndexedDB content in the Resources panel of the Chrome devtools, but only I know of one way to view Firefox IndexedDB content non-programmically and that's to load the .sqlite file directly.

Firefox's IndexedDB .sqlite files are located at /Users/{USER}/Library/Application Support/Firefox/Profiles/{PROFILE}/indexedDB on OS X and should be C:\Users\{USER}\AppData\Roaming\Mozilla\Firefox\Profiles\{PROFILE} on Windows.

I use the excellent (and free) Firefox tool SQLite Manager, which is cross platform.

which looks like this

One thing to keep in mind however is that the contents are often stored as binary blobs and are likely not to be human readable. Keys are stored as text however so they should be able to be read by hand.

Update Although local files remain a great way to view IDB databases and stores, Chrome does now have great tooling available in the Resources panel.

like image 117
buley Avatar answered Sep 22 '22 00:09

buley


I just downloaded the IndexedDB Browser add-on for Firefox. It works well. Once downloaded it is located in:

Tools > Web Developer > IndexedDB Browser

https://addons.mozilla.org/en-US/firefox/addon/indexeddb-browserupdated-fix/

EDIT: Since Firefox 26 the files for IndexedDB have moved from

{PROFILE}/indexedDB/
to
{PROFILE}/storage/persistent/
The current Version (0.1.4) does not handle this change. However it can be easily solved with a symbolic link.
like image 20
Nick Johnson Avatar answered Sep 22 '22 00:09

Nick Johnson