On Windows Vista/7, the menu bar is replaced with the new "Firefox button." The old(legacy?) menu bar is shown when ALT-key is pressed and/or when "Menu Bar" option is enabled [TOTHEPC].

"Firefox Button"

id of "Firefox button"

ID of "Firefox button" is "appmenu-button", and its <menupopup> is "appmenu-popup".

Sample of overlay

To add a menuitem "appmenu-foobar", write the following overlay:

<?xml version="1.0"?>
<overlay id="foobarOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <menupopup id="appmenu-popup">

      <menuitem id="appmenu_foobar" command="FooBarCmd"
                label="Foobar"/>
  </menupopup>
</overlay>

Note: if the browser does not have "Firefox Button" (e.g. older Firefox, current Firefox 4.0b3 build on Linux, etc...), this overlay is ignored and does not occur error.

Study for add "Configuration Mania" button to "Firefox Button"

  • Do not remove current menuitem code for menubar
  • Add new menuitem code for "Firefox Button"
    • New menuitem "Configuration Mania" is added after "Preferences…" menu.
  • Two menuitems share a same command "ConfMania:Open".
<overlay id="confmania-Overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/x-javascript" src="chrome://confmania/content/browser-Overlay.js"></script>
  <commandset id="mainCommandSet">
    <command id="ConfMania:Open" oncommand="window['ConfMania'].open()"/>
  </commandset>
  <menupopup id="menu_ToolsPopup">
    <menuitem id="confmania" command="ConfMania:Open"
              label="&confmania.label;" insertafter="menu_preferences"/>

  </menupopup>

  <menupopup id="appmenu-popup">
    <menuitem id="appmenu_confmania" command="ConfMania:Open"
              label="&confmania.label;" insertafter="appmenu_preferences"/>
  </menupopup>

</overlay>
  • "menu_ToolsPopup" is the "Tools" menupopup of the menubar.
  • "menu_preferences" is "Tools"->"Preferences…" menuitem.
  • "appmenu_preferences" is "Preferences…" menuitem of the "Firefox button".
    (Pitfall: Use hyphen for "appbtn-popup", Use underscore for "appmenu_preferences")

Result

See also