ryanhp
小狐狸
小狐狸
  • UID32939
  • 注册日期2010-05-29
  • 最后登录2014-03-29
  • 发帖数52
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:2862回复:5

有没有什么扩展能将扩展图标嵌入到地址栏右侧的?

楼主#
更多 发布于:2010-10-08 12:18
有没有什么扩展能将扩展图标嵌入到地址栏右侧的?
最好适用于3.6.x和4.0bx的。
谢谢了。
dindog
千年狐狸
千年狐狸
  • UID30818
  • 注册日期2009-10-24
  • 最后登录2023-02-03
  • 发帖数1195
  • 经验59枚
  • 威望0点
  • 贡献值26点
  • 好评度10点
1楼#
发布于:2010-10-08 12:18

这样吗?userchrome.js脚本。

4.0b据说最近几个版本不能用,不清楚没用过4
以前firefox跳个票的时间现在可以发布几个正式版了-_-
ryanhp
小狐狸
小狐狸
  • UID32939
  • 注册日期2010-05-29
  • 最后登录2014-03-29
  • 发帖数52
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
2楼#
发布于:2010-10-08 12:18
是的,扩展图标在地址栏右侧,省地方也美观。
脚本是哪个?没有这样的扩展吗?
qulinshan
火狐狸
火狐狸
  • UID11499
  • 注册日期2006-02-12
  • 最后登录2012-11-29
  • 发帖数167
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2010-10-08 12:18
好像是地址栏与状态栏合一的脚本,不过b7开始状态栏消失了就不能用了~~~~
dindog
千年狐狸
千年狐狸
  • UID30818
  • 注册日期2009-10-24
  • 最后登录2023-02-03
  • 发帖数1195
  • 经验59枚
  • 威望0点
  • 贡献值26点
  • 好评度10点
4楼#
发布于:2010-10-08 12:18
不用4.0b的话有几个,推荐我自己在用这个halffog大大写的
userchrome.js脚本。
// ==UserScript==
// @name Chrome状态栏修改0.1版.uc.js
// @author Griever
// @include chrome://browser/content/browser.xul
// @include main
// ==/UserScript==
(function(){
//-------以下数字可修改-------//
var Icon=1    // 1:状态栏图标显示在地址栏,2:图标在工具栏,3:图标不显示
var Wait=0    // 此处数字代表鼠标停驻在链接上时,状态栏几秒后自动消失,0为不自动消失

var Move=1    // 1:点击左下角链接时移动状态栏,2:不移动
var z=65    // 左下角范围的高度

var x=0        // 数字增加,状态栏向右移(可为负数)
var y=20    // 数字减少,状态栏向下移(可为负数)

//-------以上数字可修改-------//

//状态栏
var display = document.getElementById('statusbar-display');
var tooltip = document.createElement('tooltip');
tooltip.setAttribute('id','chrome-tooltip');
tooltip.setAttribute('onmouseover','event.currentTarget.hidePopup();');
var label = tooltip.appendChild(document.createElement('label'));
label.setAttribute('id','chrome-tooltip-label');
label.setAttribute('crop','center');/*center表示地址过长时,省略中间,end表示省略末尾*/
document.getElementById('mainPopupSet').appendChild(tooltip);
tooltip.open = function(text){
    this.firstChild.setAttribute('value',text);
    if(this.state=='open')
        return;
    this.openPopup(null,"",x,window.innerHeight-y);
    if(Wait>0){
        if(TimeID)
            window.clearTimeout(TimerID);
        TimeID = setTimeout(function(){
            tooltip.hidePopup();
            TimeID = null;
        }, Wait*1000);
    }
}
display.addEventListener('DOMAttrModified',function(event){
    if(event.attrName != 'value')
        return;
    var text = event.newValue;
    if(text != '' && text != XULBrowserWindow.defaultStatus){
        tooltip.open(text);
    }else if(tooltip.state=='open'){
        tooltip.hidePopup();
        if(Wait>0){
            TimeID = null;
        }
    }
},false);
//判断版本
var IsFx3 = false;
var UAC = gPrefService.getCharPref("general.useragent.extra.firefox");
if(UAC.length>0)
    IsFx3 = (UAC.indexOf("Firefox/4")<0 && UAC.indexOf("Minefield/4")<0)?true:false;
//地址栏图标
var statusBar = document.getElementById('status-bar');
statusBar.setAttribute('context', '');
statusBar.setAttribute('crop','center');
switch(Icon){
    case 1:
        var urlbarIcons = document.getElementById('urlbar-icons');
        urlbarIcons.insertBefore(statusBar,urlbarIcons.firstChild);
        break;
    case 2:
        var insert = document.getElementById('search-container') || document.getElementById('urlbar-container');
        insert.parentNode.insertBefore(statusBar,insert.nextSibling);
        break;
    default:
        statusBar.hidden=true;
        break;
}
//CSS
document.insertBefore(document.createProcessingInstruction(
    'xml-stylesheet',
    'type="text/css" href="data:text/css,' + encodeURI(
    <![CDATA[
    #chrome-tooltip{
        height: 20px;/*状态栏高度*/
        font-family:"Microsoft YaHei",Segoe UI !important;/*状态栏文字字体*/
        font-size: 12px;/*状态栏文字大小*/
        color: #000000 !important;/*状态栏文字颜色*/
        background-color: #D2E1F6 !important;/*状态栏背景颜色*/
        white-space: nowrap !important;
        -moz-appearance: none !important;
        border: 1px solid rgba(192,192,192,.2) !important;
        padding: 0 8px 0 5px !important;
        margin: 0 !important;
    }
    #chrome-tooltip-label{
        margin: 2px !important;
    }
    #statusbar,
    #main-window statusbar,
    #status-bar statusbarpanel{
        -moz-appearance: none !important;
        background:none !important;
        background-color: transparent !important;
        border: none !important;
        margin: -2px 0 !important;
    }
    #statusbar-display,
    #statusbar-progresspanel,
    .statusbar-resizerpanel
    { display: none !important; }
    ]]>.toString()
) + '"'),document.documentElement);
//最小化
if(IsFx3){
    document.insertBefore(document.createProcessingInstruction(
    'xml-stylesheet',
    'type="text/css" href="data:text/css,' + encodeURI(
    <![CDATA[
        #main-window:not([active="true"]) #chrome-tooltip{ display:none !important; }
    ]]>.toString()
    ) + '"'),document.documentElement);
}
//移动状态栏
if(Move==1){
var FX = null;
var FY = null;
function MouseOver(e){
    try {
        var localName = e.target.localName;
    }catch(e){}
    if (localName.toLowerCase()=='a'){
        ev = e || window.event;
        FX = parseInt(e.clientX - window.innerWidth*2/5);
        FY = parseInt(window.innerHeight - e.clientY);
        if(FX >0 || FY >z){
            var style = <![CDATA[
                #chrome-tooltip,
                #main-window[inFullscreen] #chrome-tooltip,
                #main-window[sizemode="maximized"] #chrome-tooltip
                { margin: 0 !important; }
            ]]>.toString();
        }else{
            var style = <![CDATA[
                #chrome-tooltip{ margin: 23px 0 !important; }
                #main-window[inFullscreen] #chrome-tooltip,
                #main-window[sizemode="maximized"] #chrome-tooltip
                { margin: 0 3000px !important; }
            ]]>.toString();
        }
        var sspi = document.createProcessingInstruction(
            'xml-stylesheet',
            'type="text/css" href="data:text/css,' + encodeURI(style) + '"');
        document.insertBefore(sspi, document.documentElement);
    }
}
function MouseOut(e){
    FX = null;
    FY = null;
}
gBrowser.mPanelContainer.addEventListener("mouseover",MouseOver,false);
gBrowser.mPanelContainer.addEventListener('mouseout',MouseOut,false);
}
})();
以前firefox跳个票的时间现在可以发布几个正式版了-_-
zxh227
小狐狸
小狐狸
  • UID34214
  • 注册日期2010-10-10
  • 最后登录2010-10-10
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
5楼#
发布于:2010-10-08 12:18
对。用UC脚本
游客

返回顶部