Try this:
Code: Select all
// select or add tab
var url = "http://www.mozillazine.org/"
for (var i = 0; i < gBrowser.tabContainer.childNodes.length; i++) {
if (gBrowser.tabContainer.childNodes[i].linkedBrowser.currentURI.spec == url) {
gBrowser.selectedTab = gBrowser.tabContainer.childNodes[i];
return;
}
}
gBrowser.selectedTab = gBrowser.addTab(url);
http://www.mozillazine.org/
@TBDTBD
Try this:
Code: Select all
// tools > options > composition > addressing > directory server
// toggle between "None" and "Global"
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch);
var pref = "ldap_2.autoComplete.directoryServer";
var directoryServer = prefBranch.getCharPref(pref);
if (directoryServer) {
prefBranch.clearUserPref(pref);
} else {
prefBranch.setCharPref(pref, "ldap_2.servers.Global");
}
http://developer.mozilla.org/en-US/docs ... PrefBranch
I'm using the following button to easily tell what preference corresponds to what option.
Custom Buttons
http://addons.mozilla.org/thunderbird/addon/2707
Preferences Tracker
http://custombuttons.sourceforge.net/fo ... f=4&t=1262