CPr*_*mer 11 xul google-chrome firefox-addon google-chrome-extension
默认情况下,Chrome浏览器操作会提供非常好的弹出效果.
删除了死ImageShack图像链接
将鼠标悬停在工具栏图标上可提供整洁的悬停效果.
单击工具栏图标会显示一个很好的动画,可以打开弹出的html文件.
弹出窗口与按下的按钮对齐.
再次单击工具栏图标会淡出弹出窗口.
有关如何使用Firefox扩展来估算此效果的任何想法?有没有人成功地取得类似这种效果的东西?
谢谢.
对于刚开始使用您的第一个Firefox扩展的人来说,就像我在这里做的一样,是一个示例代码:
yourextname \铬\内容\ browser.xul
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://yourextname/skin/toolbar.css" type="text/css"?>
<overlay id="yourextname_overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<popupset>
<menupopup id="yourextname_menu_popup">
<menuitem label="Website" oncommand="gBrowser.selectedTab = gBrowser.addTab('http://www.your-website.com/');" />
<menuseparator />
<menuitem label="Options" oncommand="window.open('chrome://yourextname/content/options.xul', 'Options', 'dialog,chrome,modal,titlebar,toolbar,centerscreen=yes');" />
</menupopup>
<panel id="yourextname_popup" noautohide="false" noautofocus="true">
<label control="vvvname" value="Name:"/><textbox id="vvvname"/>
</panel>
</popupset>
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="yourextname_toolbar_button" class="toolbarbutton-1" context="yourextname_menu_popup" oncommand="document.getElementById('yourextname_popup').openPopup(document.getElementById('yourextname_toolbar_button'), 'after_start', 0, 0, false, false);" label="button name" tooltiptext="tooltip" />
</toolbarpalette>
</overlay>
Run Code Online (Sandbox Code Playgroud)
yourextname\skin\toolbar.css
这会在工具栏按钮上添加图标:
#yourextname_toolbar_button {
list-style-image:url(chrome://yourextname/skin/icon_024.png);
}
toolbar[iconsize="small"] #yourextname_toolbar_button {
list-style-image:url(chrome://yourextname/skin/icon_016.png);
}
Run Code Online (Sandbox Code Playgroud)
yourextname\chrome.manifest用于
content yourextname chrome/content/
overlay chrome://browser/content/browser.xul chrome://yourextname/content/overlay.xul
skin yourextname classic/1.0 skin/
style chrome://global/content/customizeToolbar.xul chrome://yourextname/skin/toolbar.css
Run Code Online (Sandbox Code Playgroud)
注意:请确保将所有"yourextname"字符串替换为唯一的,最好使用您的扩展名.
如果有人正在研究这个问题并试图找到答案,最终使用 browser.xul 文件中工具栏面板中的面板对我来说效果很好。
| 归档时间: |
|
| 查看次数: |
2994 次 |
| 最近记录: |