Re: Check if preferences (pref.js) exists

Christian Biesinger <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpcom
Message-ID <[email protected]>
Markus Hossner wrote:
> But can perhaps anybody tell me: How can I check if the preferences
> exists, before, I try to get its content.

var prefExists = false;
try {
	var type = pref.GetPrefType("pref_name");
	prefExists = true;
}
catch (ex) {}


(untested)

-- 
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
                                                  -- Benjamin Franklin
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.