I am trying to access the localStorage of a page from a Firefox extension. My understanding is that content
gives a reference to the window
of the cur
From a Firefox extension, you can access the localStorage object with window.content.localStorage, for example:
var ls = window.content.localStorage;
ls.setItem("myvariable", "myvalue");
var item = ls.getItem("myvariable");
Anything else will give you a "Component not available" error.
As an aside, globalStorage doesn't work this way. You can't use it at all with an extension because the object is only available if it's run from a server.
use content.localStorage.wrappedJSObject.myVariable
Using NsIDOMStorageManager xpcom interface you can get your local storage information.
https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMStorageManager