Frage

I'm trying to add an "edit html" button to the Firefox dev tools. In chrome://browser/content/devtools/inspector/inspector.xul we have:

  <popupset id="inspectorPopupSet">
    <!-- Used by the Markup Panel, the Highlighter and the Breadcrumbs -->
    <menupopup id="inspector-node-popup">
      <menuitem id="node-menu-copyinner"
        label="&inspectorHTMLCopyInner.label;"
        accesskey="&inspectorHTMLCopyInner.accesskey;"
        oncommand="inspector.copyInnerHTML()"/>
      <menuitem id="node-menu-copyouter"
        label="&inspectorHTMLCopyOuter.label;"
        accesskey="&inspectorHTMLCopyOuter.accesskey;"
        oncommand="inspector.copyOuterHTML()"/>
      <menuitem id="node-menu-copyuniqueselector"
        label="&inspectorCopyUniqueSelector.label;"
        accesskey="&inspectorCopyUniqueSelector.accesskey;"
        oncommand="inspector.copyUniqueSelector()"/>
      <menuseparator/>
      <menuitem id="node-menu-delete"
        label="&inspectorHTMLDelete.label;"
        accesskey="&inspectorHTMLDelete.accesskey;"
        oncommand="inspector.deleteNode()"/>
      <menuseparator/>
      <menuitem id="node-menu-pseudo-hover"
        label=":hover" type="checkbox"
        oncommand="inspector.togglePseudoClass(':hover')"/>
      <menuitem id="node-menu-pseudo-active"
        label=":active" type="checkbox"
        oncommand="inspector.togglePseudoClass(':active')"/>
      <menuitem id="node-menu-pseudo-focus"
        label=":focus" type="checkbox"
        oncommand="inspector.togglePseudoClass(':focus')"/>
    </menupopup>
  </popupset>

I'm trying to add an overlay with this chrome.manifest:

content devtooltweaks   content/
style chrome://browser/content/devtools/framework/toolbox.xul chrome://devtooltweaks/content/devToolStyle.css
content chrome://browser/content/devtools/inspector/inspector.xul chrome://devtooltweaks/content/inspectorOverlay.xul

My inspectorOverlay.xul:

<?xml version="1.0" encoding="utf-8"?>
<overlay id="helloworldOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<popupset id="inspectorPopupSet">
<menupopup id="inspector-node-popup">
    <menuitem id="node-menu-edititem"
        label="Edit HTML"
        accesskey="E"
        oncommand="alert('hi');"/>
</menupopup>
</popupset>
</overlay>

The style css is working, and this overlay should add a menu item to the built in inspector panel, but it looks like it's not doing anything. Is there something wrong with this overlay, or is there some restriction to changing the inspector?

War es hilfreich?

Lösung

It's Overlay, not Content, for overlay files. Oops.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top