【发布时间】:2014-02-21 01:34:53
【问题描述】:
我正在尝试开发 Firefox 插件。我已经为扩展开发了基本的 javascript 代码。现在我想要工具菜单中的一个菜单项和一个工具栏按钮。但是,我无法让这两个元素出现(该按钮应出现在自定义菜单、IMO 和工具菜单中的菜单项中)。我做错了什么?
这是 chrome.manifest 文件:
content droptunesshuffle chrome/content/
content droptunesshuffle chrome/content/ contentaccessible=yes
overlay chrome://browser/content/browser.xul chrome://droptunesshuffle/content/browser.xul
locale droptunesshuffle en-US locale/en-US/
skin droptunesshuffle classic/1.0 skin/
style chrome://global/content/customizeToolbar.xul chrome://droptunesshuffle/skin/skin.css
这里是 browser.xul 覆盖文件:
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/" ?>
<?xml-stylesheet href="chrome://droptunesshuffle/skin/skin.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://droptunesshuffle/locale/en-US/translations.dtd">
<overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript src="chrome://droptunesshuffle/content/shuffle.js" />
<menupopup id="menu_ToolsPopup">
<menuitem label="Droptunes Shuffle "key="link-target-finder-run-key" oncommand="droptunesshuffle.run()"/>
</menupopup>
<keyset>
<key id="droptunes-shuffle-run-key" modifiers="shift" key="S" oncommand="droptunesshuffle.run()"/>
</keyset>
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="droptunes-shuffle-toolbar-button" class=”toolbarbutton-1 chromeclass-toolbar-additional” image="chrome://droptunesshuffle/skin/icon.png" label="Droptunes Shuffle" tooltiptext="&droptunesshuffle;" oncommand="droptunesshuffle.run()"/>
</toolbarpalette>
</overlay>
skin.css 文件:
#droptunes-shuffle-toolbar-button{
list-style-image: url("chrome://droptunesshuffle/skin/icon.png");
}
【问题讨论】:
标签: firefox firefox-addon