Hallo,

I use this function to get the content of a certain preferences (e.g.
pmpName="browser.startup.homepage"):

function pmpReadPref(pmpName, pmpType) {
   var pref = Components.classes[ "@mozilla.org/preferences;1"
].createInstance( nsIPref );
   var pmpValue = null;
   switch ( pmpType ) {
         case pmpB:
           pmpValue = pref.GetBoolPref(pmpName);
           break;
         case pmpN:
           pmpValue = pref.GetIntPref(pmpName);
           break;
         case pmpS:
           pmpValue = pref.GetCharPref(pmpName);
           break;
   }
   return pmpValue;
}

But can perhaps anybody tell me: How can I check if the preferences
exists, before, I try to get its content.

Thanks!

Markus


Reply via email to