I am facing a challenge with saving persistent data in a Firefox extension.
Currently, I am attempting to utilize nsIPrefBranch
in the following manner:
var db = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
if(db.getCharPref('epoch')){ ///do something.. }
However, this approach does not seem to be effective as I keep encountering the following error:
"Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref]"
Could someone please shed some light on what mistake I may be making?