How to check local storage during addon testing

(Kronzky) #1

Where/how can I check what I actually wrote to local storage while testing a temporary extension?
I’m struggling with saving the addon’s options, and want to see what was written to storage.
If I look at config:about, the data doesn’t seem to correlate with what my addon is writing/reading, so I guess the values are stored elsewhere (at least for temporary addons)?

(Martin Giger) #2

You have to use the best debugging techniques known to man:

  • Interact with it in the Add-on devtools console
  • Interact with it in the Add-on devtools debugger

What you can’t do, however is use the “Storage” tool in the Add-on devtools. That does not list items stored with (It does however show data in the window.localStorage which is a different storage mechanism)

(Silbad) #3

Hello, I try this, but I can’t see data in devtools.'type-trad').then(function(item){
	if (item.typeTrad === undefined || item.typeTrad === '0') {
		document.querySelector('#type-none').checked = true;
	} else if (item.typeTrad === '1') {
		document.querySelector('#type-together').checked = true;
	} else if (item.typeTrad === '2') {
		document.querySelector('#type-split').checked = true;

var typeTrad_options = document.querySelectorAll('#type-none, #type-together, #type-split');
for (i = 0; i < typeTrad_options.length; i++) {
	typeTrad_options[i].onchange = function(e) {{ typeTrad: this.value });

(Silbad) #4

It’s not very simple to debug storage with about:debugging…