// 1.Toolbar>Customize:put throbber
//
// 2.userChrome.css
// #toolbar-menubar {
// visibility: collapse;
// }
(function(){
const OPEN_MENU_POSITION = 1; // 0=Right 1=Left
var throbber = document.getElementById("navigator-throbber");
if (!throbber){alert('No throbber!');return;}
if (Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo).version.substr(0,3) != "3.1") return;
var mainMenuBar = document.getElementById("main-menubar");
var range = document.createRange();
range.selectNodeContents(mainMenuBar);
var popup = document.createElement("popup");
popup.id = "ucThrobberMainMenu";
var openMenuPosition = (OPEN_MENU_POSITION==0) ? "end_before" : "start_before";
popup.setAttribute("position", openMenuPosition);
popup.appendChild(range.extractContents());
document.getElementById("mainPopupSet").appendChild(popup);
throbber.removeChild(throbber.firstChild);
throbber = throbber.appendChild(document.createElement("toolbarbutton"));
throbber.setAttribute("popup", "ucThrobberMainMenu")
document.getElementById("toolbar-menubar").collapsed = true;
}());