Code to access Firefox prefs:
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);//for access to firefox preferences system
To set a string pref:
prefs.setCharPref("EXT.KEY.NAME","VALUE");
To get a string pref:
VARIABLE = prefs.getCharPref("EXT.KEY.NAME");
To check if a string pref exists:
prefs.getPrefType("yubnub.url") == prefs.PREF_STRING