前往
大廳
主題

火狐UC脚本:狀態列移到網址列LinkLocationbar

—— | 2016-05-06 22:29:07 | 巴幣 0 | 人氣 305

學Chrome簡潔,有需要才出現是很好,但改成透明後遇到網頁背景花稍又不好分辨清楚。
雖然狀態列大部份的人不會在意或很少在意,但真的有需要的時候,網友貼過鏈結,要查過是不是有毒的網站鏈結透明化真的看不清楚。要不然就是該消失的時候沒消失,
不少用Chrome的人常抱怨看影片時狀態列還在左下角。


不是把原有的移到網址列,所以要用樣式隱藏原有的。

把代碼複製貼到記事本上,LinkLocationbar.uc.js,副檔名:.uc.js
顏色是綠色,不喜歡修改紅字。

(function(){
    if (!isElementVisible(gURLBar)) return;

    var loadingStat = true;

    var Bar = $('urlbar'),
        sTxt = XULBrowserWindow.statusTextField;
    var additionBar = $C('label', {
        id: 'addtion-link',
        value: '',
//        crop: 'center',
//        flex: '1',
        style: "color: [color=#ff0000]green[/color]; margin: 0px 0px 0px 1px; -moz-box-ordinal-group: 99;"
    });
    Bar.appendChild(additionBar);
//    Bar.insertBefore(additionBar, Bar.firstChild);

    sTxt.__defineGetter__('label', function() {
        return this.getAttribute("label");
    });
    sTxt.__defineSetter__('label', function(str) {
        if (str) {
            this.setAttribute('label', str);
            var txt = str.substr(0, 39) + '...' + str.substr(str.length - 39, 39) + ' ';
            if (this.getAttribute('type') == 'overLink') {
                if (str.length > 80) {
                    additionBar.value = '➥ ' + txt;
                } else {
                    additionBar.value = '➥ ' + str + ' ';
                }
            } else {
                if (loadingStat == true) {
                    if (str.length > 80) {
                        additionBar.value = txt;
                    } else {
                        additionBar.value = str + ' ';
                    }
                } else {
                    this.style.opacity = 1;
                    additionBar.value = '';
                }
            }
        } else {
            this.style.opacity = 0;
            additionBar.value = '';
        }
        if (this.style.opacity == 0) {
            sTxt.removeAttribute('mirror');
        }
        return str;
    });

    function $(id) document.getElementById(id);
    function $C(name, attr)
{
        var el = document.createElement(name);
        if (attr) Object.keys(attr).forEach(function(n) el.setAttribute(n, attr[n]));
        return el;
    }
})();


/*隱藏網址狀態*/
.statuspanel-label
{display: none!important;}

創作回應

更多創作