b.label) return 1; return 0; }); menuLabels.forEach(function(item) { aMenuList.appendItem(item.label, item.value); }); // Selecting appropiate menu item corresponding to preference stored // value. if (this.hasAttribute("preference")) { const Ci = Components.interfaces; let preference = Services.prefs.getComplexValue( this.getAttribute("preference"), Ci.nsIPrefLocalizedString); this.value = preference.data; } ]]>