我正在尝试在消息阅读器工具栏中添加一个按钮:
我使用 chrome.manifest 和 XUL 文件成功在邮件工具栏中添加了一个按钮。我只是不知道如何访问这个特定的工具栏。我尝试使用 DOM Inspector 找到它,但没有成功。 我的按钮也没有出现在“自定义”框中。
因此,我的问题是:如何向这个特定的工具栏添加按钮?
最佳答案
在使用 DOM Inspector 进行更多查看后,我终于明白了。
工具栏和工具箱 ID 为 header-view-toolbar
和 header-view toolbox
,类为 inline-toolbar
和 >内联工具箱
。按钮的 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"
/>
关于xul - 雷鸟扩展 : add button in message reader toolbar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22323746/