Firefox扩展开发:向首选项窗格添加选项卡?

时间:2009-07-13 21:43:42

标签: firefox-addon xul

我正在添加:

   <prefwindow id="BrowserPreferences">
      <!-- Create a new pane (tab)  -->
      <prefpane id="whateverPrefs" label="yes!" 
      onpaneload="alert('hey')" 
                image="chrome://helloworld/content/images/man.png">

        <!-- Intermediary between GUI and preferences system -->
        <preferences>
           <!-- see the next section for more information -->
        </preferences>

        <!-- GUI Elements... -->
      </prefpane>
    </prefwindow>

到我的overlay.xul。虽然建议here,但它无论如何都无效。不过,我在这段代码中取得了很大的成功:

  <menupopup id="menu_ToolsPopup">
    <menuitem id="helloworld-hello2" label="frigger!" 
              oncommand="HelloWorld.onMenuItemCommand(event);"/>
  </menupopup>

这是一个版本问题(例如,Firefox 3.x不会这样做)?我无法在browser.xul中找到字符串BrowserPreferences,这似乎是问题的一部分。如何在Firefox中的偏好设置面板中添加标签?

[对不起,如果这个问题非常简单,但在Firefox Extensions上搜索帮助就像在搜索“is is”这个词的帮助一样。“]

1 个答案:

答案 0 :(得分:1)

我认为你的代码不对,但它应该覆盖preferences.xul而不是browser.xul - 我猜你的覆盖正在注册browser.xul,这就是你的菜单项工作正常的原因。

在MDC文章Building an Extension

的一半处查看“注册叠加层”部分