2

我正在尝试在消息阅读器工具栏中添加一个按钮:

我使用 chrome.manifest 和 XUL 文件成功地在邮件工具栏中添加了一个按钮。我只是不知道如何访问这个特定的工具栏。我曾尝试使用 DOM Inspector 对其进行定位,但无济于事。我的按钮也没有出现在“自定义”框中。

因此,我的问题是:如何向这个特定的工具栏添加按钮?

4

1 回答 1

2

在用 DOM Inspector 查看了更多内容后,我终于明白了。

工具栏和工具箱 id 是header-view-toolbarand header-view toolbox,类是inline-toolbarand inline-toolbox。按钮的 CSS 类是msgHeaderView-button. 在那里添加按钮的 XUL 应该如下所示:

<toolbarpalette id="header-view-toolbar">
  <toolbarbutton id="my-button"/>
</toolbarpalette>

<toolbarbutton id="my-button"
  label="This is my button!"
  tooltiptext="Click on it!"
  oncommand="MyButton[1]()"
  class="toolbarbutton-1 msgHeaderView-button my-button"
/>
于 2014-03-11T14:14:21.607 回答