0

我正在添加这个:

   <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。尽管在此处建议,但它无论如何都不起作用。不过,我确实在这段代码上取得了巨大的成功:

  <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”这个词上搜索帮助一样。]

4

1 回答 1

1

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

在 MDC 文章Building an Extension的中途查看“Register an Overlay”部分

于 2009-07-13T23:49:47.563 回答