It seems like it should be possible to view the localStorage/chrome.storage of Chrome Extensions installed on my browser. I've played around with the Developer Tools a bit, but haven't found a way to do this. Any ideas?
It seems like it should be possible to view the localStorage/chrome.storage of Chrome Extensions installed on my browser. I've played around with the Developer Tools a bit, but haven't found a way to do this. Any ideas?
This was actually two questions!
Open the Chrome Devtool by clicking on the background page of an extension in Chrome://extensions/ (Developer mode needs to be checked to see background pages), then in resource panel you can see the local storage on the left. (by chaohuang and Kil)
In the same console of the background page:
OPEN THE BACKGROUND PAGE FIRST:
a. to go to chrome://extensions/
b. ensure you are in development mode
c. then on your extension, either click "Inspect views background page" or go to "Details" and click background page.
NOW THAT YOU ARE ON THE BACKGROUND PAGE YOU CAN PROCEED:
chrome.storage.local.get(function(result){console.log(result)})
chrome.storage.sync.get(function(result){console.log(result)})
I didn't get any results using the provided code typed into console. But this code worked when put into the console.
chrome.storage.sync.get(null, function (data) { console.info(data) });
The difference here is that we pass a null value which will return all content in the storage. To back this up, and for additional reading, check out the official chrome page on this API.
In 2022, the best way I've found is still with the console.log, but you can make it a lot cleaner-looking with currying. Open up extensions page, open the inspector for your background worker, go to console, and...
chrome.storage.local.get(console.log)