Hello, Im making firefox extension. One function stores value in every tab, to use it later by other function.
function setValue(value) {
var attr = gBrowser.document.createAttribute("value");
attr.value = value;
gBrowser.document.attributes.setNamedItem(attr);
};
function getValue() {
var attr = gBrowser.document.attributes.getNamedItem("value");
if (attr != undefined && attr != null)
return attr.value;
else
return null;
};
For some reason, this doesn't work. Can you spot an error in my code?
Function getValue() should get value of active tab.