How to Inspect Local Storage in MV3 with Storage Area Explorer?

256 views
Skip to first unread message

Patrick

unread,
Nov 19, 2023, 6:18:00 PM11/19/23
to Chromium Extensions
Is there a way to see the data I store in chrome.storage.local from within a content script or devpanel extension script? I can verify it with get(), but I want a debug tool for inspection.  Seems like a basic Chrome devtools function, but Chrome's built-in devtools > Application > Storage doesn't have it (only window.localStorage).

I have the "Storage Area Explorer" extension but that seems unable to access chrome.storage.local for the content script / devpanel page, it just gets the webpage's window.localStorage.


I tried the trick of inspecting the manifest page, but that shows no data. Not surprising since the extension is designed to run on webpages - it doesn't run or store anything on chrome:// urls. I also tried inspecting the popup page ('default_popup') but that had no data either - presumably it's a different chrome.storage.local. 

Lastly, if I try to "Inspect" my devtools page, Storage Explorer doesn't come up as an option - extensions can't run on top of a devtools panel I think.

thanks,
-Patrick

Storage Area Explorer.png

wOxxOm

unread,
Nov 20, 2023, 4:49:21 AM11/20/23
to Chromium Extensions, Patrick
> I can verify it with get(), but I want a debug tool for inspection

No such thing yet, AFAIK.

> Chrome's built-in devtools > Application > Storage doesn't have it (only window.localStorage).


> the "Storage Area Explorer" extension 

It shows the tab's main document only.

> inspecting the manifest page, but that shows no data
> inspecting the popup page ('default_popup') but that had no data either - presumably it's a different chrome.storage.local. 

It still works assuming you open it correctly with a chrome-extension:// URL and not file:// URL or http://localhost.
chrome.storage is the same for all parts of the extension.

> try to "Inspect" my devtools page, Storage Explorer doesn't come up as an option - extensions can't run on top of a devtools panel I think.

Correct.

Patrick Davin

unread,
Nov 20, 2023, 12:51:47 PM11/20/23
to wOxxOm, Chromium Extensions
Thanks. I was using chrome-extension://<extension id>/manifest.json URL and now I can see that it is indeed the correct chrome.storage.local of my extension. It appears I ran into a limitation of Storage Area Explorer. It was failing to show any of my local storage keys because I'm using 'unlimitedStorage' permission and had close to 80 MB in storage. 

Either Storage Area Explorer doesn't have unlimitedStorage permission or it's just not capable of displaying that large of a data size. 

If I reset storage and gradually grow it, at some point Storage Explorer just freezes. With just 2 MB in storage it takes a very long time to display the stored data, but does eventually manage to do so (after about 60-120 seconds). Beyond that data size it just never completes. I may do some debugging of it, but it's not critical.


wOxxOm

unread,
Nov 20, 2023, 12:56:33 PM11/20/23
to Chromium Extensions, Patrick Davin, Chromium Extensions, wOxxOm
Indeed, the internal serialized size of inter-process communication data is limited to 64MB in UTF-8 encoding, so apparently the extension doesn't split the data in chunks and tries to send it at once via chrome.devtools.inspectedWindow.eval.
Reply all
Reply to author
Forward
0 new messages