user366121
user366121

Reputation: 3271

Firefox extension: Adding item to tools menu

I want my extension as menu entry under the ff menu item "View". I cannot figure out how to call it. This would be the code for "Tools":

<menupopup id="menu_ToolsPopup">
   <menuitem id="bs-hello" label="&bs.label;"
          oncommand="bs.onMenuItemCommand(event);"/>
</menupopup>

All I have to change is the id of menupopup but I don't know the id of "View". Anyone can help me out?

Upvotes: 2

Views: 1962

Answers (2)

Wayne
Wayne

Reputation: 60414

The following very simple extension adds a menu item to the View popup.

My manifest:

content menutest    chrome/content/
overlay chrome://browser/content/browser.xul chrome://menutest/content/menutest.xul

My XUL file:

<?xml version="1.0"?>
<overlay id="menutest" 
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <menupopup id="menu_viewPopup">
       <menuitem id="bs-hello" label="My View Item"
              oncommand="alert('test');"/>
    </menupopup>
</overlay>

Upvotes: 1

speedball2001
speedball2001

Reputation: 947

Firefox defines various ids for overlaying. The id for the View menu is menu_viewPopup. Please note the non-capital 'v'.

For other overlay points see https://developer.mozilla.org/en/FirefoxOverlayPoints/Menus

Upvotes: 3

Related Questions