xul overlay for new menu in TB/Firefox main menubar

89 views Asked by At

I'd like to add a new menu at the end of the main menu bar (file, edit, ...) after the Help menu via an extension i wrote. I already know how to add a new item to one of the menus by something like:

<menupopup id="menu_HelpPopup">
   <menuitem id="example-item" oncommand="alert('Hello!');" label="TEST" accesskey="i"/>
</menupopup>

But I didn't get it to work like I explained above.(btw, Where can I look up the id of the menu bar?). this is what i tried so far.

<menubar id="????">
  <menu id="test-menu" label="TEST"
    accesskey="d">
    <menuitem id="example-item2" oncommand="alert('Hello!');" label="TEST" accesskey="i"/>
  </menu>
</menubar>
1

There are 1 answers

0
Michael Buckley On BEST ANSWER

You need the menubar id, which is main-menubar and also your missing the menupopup. I have not tested, but this looks right to me:

<menubar id="main-menubar">
    <menu id="test-menu" label="TEST"
    accesskey="d">
        <menupopup id="test-popup">
            <menuitem id="example-item2" oncommand="alert('Hello!');" label="TEST" accesskey="i"/>
        </menupopup>
    </menu>
</menubar>

If your trying to find the id of things like the #main-menubar I recommend DOM inspector.