How to append customer context-menuitem to the last postion in firefox?

I'm running on Ubuntu 12.04.
I followed this tutorial to add Quit to firefox's right-click context-menu.
Firebug also add a context-menuitem(Inspect Element with Firebug) to the last.
The result is not what I want.


This command give me empty result:

grep -r 'Inspect Element with Firebug' .

So I don't know how firebug create the menuitem.
But I can edit ~/.mozilla/firefox/*.default/chrome/userChrome.css to hide it:

menuitem[label="Inspect Element with Firebug"] {
    display:none;
}

What I did:

cd ~

pkill firefox

cp /usr/lib/firefox/omni.ja ~

unzip omni.ja -d omni

cd omni

find . -name 'browser.xul'

vi ./chrome/browser/content/browser/browser.xul    
    {{{
    <menupopup id="contentAreaContextMenu" ...
        <menuitem id="context-inspect" ...

        <!-- QUIT BEGIN -->
        <menuitem id="context-quit"
                      label="Quit"
                      command="cmd_quitApplication"/>
        <!-- QUIT END -->
    </menupopup>
    }}}

zip -r omni.ja *

sudo mv omni.ja /usr/lib/firefox/

firefox http://www.google.com

What I get:

| ...                          |
| View Page Info               |
|------------------------------|
| Inspect Element(Q)           |
| Quit                         |
|------------------------------|
| Inspect Element with Firebug |
+------------------------------+

What I want:

| ...                          |
| View Page Info               |
|------------------------------|
| Inspect Element(Q)           |
| Inspect Element with Firebug |
|------------------------------|
| Quit                         |
+------------------------------+

Solution 1:

  1. unzip ~/.mozilla/firefox/*.default/extensions/[email protected]
  2. edit firebug/content/firebug/firefox/browserMenuOverlay.xul
  3. zip and replace

original

<!-- Firefox page context menu -->
<menupopup id="contentAreaContextMenu">
    <menuseparator/>
    <menuitem id="menu_firebugInspect" label="firebug.InspectElementWithFirebug"
              command="cmd_inspect" class="menuitem-iconic fbInternational"/>
</menupopup>

modified

<!-- Firefox page context menu -->
<menupopup id="contentAreaContextMenu">
    <menuitem id="menu_firebugInspect" label="firebug.InspectElementWithFirebug"
              command="cmd_inspect" class="menuitem-iconic fbInternational"
              insertafter="context-inspect" />
</menupopup>