0

我正在尝试向 Firefox 开发工具添加“编辑 html”按钮。在 chrome://browser/content/devtools/inspector/inspector.xul 我们有:

  <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>

我正在尝试使用此 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

我的检查员Overlay.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>

样式 css 正在工作,这个覆盖 应该向内置的检查器面板添加一个菜单项,但看起来它没有做任何事情。这个覆盖有什么问题吗,或者改变检查员有什么限制吗?

4

1 回答 1

0

它是Overlay,不是Content,用于覆盖文件。哎呀。

于 2013-05-25T04:58:52.097 回答