Gravitate
Gravitate

Reputation: 3064

How to check value of chrome.storage manually

I know how to check what localStorage values are stored in chrome by using the developer resource panel, but how do you check what is stored in chrome.storage? I know how to do it via programming but its a bit of a faff just to quickly check what values are stored. I have done some searches but this time google was not my friend :(

Regards,

Upvotes: 4

Views: 2655

Answers (2)

Gravitate
Gravitate

Reputation: 3064

OK, I have found one way but it is not great. you can use the javascript console. Make sure you are in the context of the extension whose storage data you want to examine. Input this command:

chrome.storage.local.get(null, function (Items) {console.log(Items)});

(You can change "local" to "sync" if that is what you are looking for.) This will output all data stored in chrome.storage for that extension.

As I say it is not great and if anyone has a better suggestion, I would be very grateful.

Regards,

Upvotes: 4

epascarello
epascarello

Reputation: 207511

I am still not sure what you are asking, or what your probelm is exactly with the tool you already have.

There are plenty of add ons https://chrome.google.com/webstore/search/localstorage

Of you want to do it with code, you can loop through the keys.

for (var key in localStorage){
   console.log(key + ":\t" + localStorage[key]);
}

or

var localStorageKeys = Object.keys(localStorage);

Upvotes: 0

Related Questions