Check if preferences (pref.js) exists

Markus Hossner <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpcom
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.