MalcKear
千年狐狸
千年狐狸
  • UID35386
  • 注册日期2011-03-05
  • 最后登录2020-03-02
  • 发帖数1348
  • 经验131枚
  • 威望0点
  • 贡献值16点
  • 好评度10点
  • 社区居民
  • 忠实会员
阅读:1741回复:4

请帮忙修复下 ’https协议地址栏变色‘ 样式

楼主#
更多 发布于:2016-01-04 19:31
/*Https协议地址栏变色*/
#urlbar[level="low"]{
background-color: #FFFFB7 !important;
}
 
#urlbar[level="high"]{
background-color: #DDF9CC !important;
}
 
#urlbar[level="broken"]{
background-color: #F7DFDF !important;
}

最新喜欢:

railgunrailgu... millionartmillio...
yfdyh000
千年狐狸
千年狐狸
  • UID29079
  • 注册日期2009-06-07
  • 最后登录2022-05-18
  • 发帖数2262
  • 经验1390枚
  • 威望0点
  • 贡献值52点
  • 好评度139点
  • 社区居民
  • 最爱沙发
  • 忠实会员
1楼#
发布于:2016-01-04 19:56
https://bugzilla.mozilla.org/show_bug.cgi?id=1233974#c3 供参考。
怎么弄我不清楚,暂时不明白如何选择父或筛选子元素的属性。
taoww
非常火狐
非常火狐
  • UID39284
  • 注册日期2013-03-18
  • 最后登录2024-04-25
  • 发帖数627
  • 经验573枚
  • 威望0点
  • 贡献值110点
  • 好评度99点
2楼#
发布于:2016-01-04 20:15
纯css方案目前是没戏了。因为目前界面上能用作区分的是在#urlbar子元素的子元素#identity-box。
由后代元素定位设置先代元素的样式的css语法还处在草案讨论状态,没有任何浏览器支持
最多只能设定#identity-box的同级元素,显示效果并不好
lonely_8
非常火狐
非常火狐
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2022-08-09
  • 发帖数733
  • 经验469枚
  • 威望0点
  • 贡献值86点
  • 好评度147点
  • 社区居民
  • 忠实会员
3楼#
发布于:2016-01-04 20:53
location == 'chrome://browser/content/browser.xul' && gBrowser.addProgressListener({
    state: null,
    lastLocation: null,
    onSecurityChange: function (aWebProgress, aRequest, aState, aIsSimulated) {
        if (this.state == aState 
            && this.lastLocation == gBrowser.currentURI.spec)
        return;
        this.state = aState;
        this.lastLocation = gBrowser.currentURI.spec;
        const wpl = Components.interfaces.nsIWebProgressListener;
        const wpl_security_bits = wpl.STATE_IS_SECURE | wpl.STATE_IS_BROKEN | wpl.STATE_IS_INSECURE;
        var level;
        switch (this.state & wpl_security_bits) {
            case wpl.STATE_IS_SECURE:
                level = 'high';
                break;
            case wpl.STATE_IS_BROKEN:
                level = 'broken';
                break;
        }
        if (level) {
            if (gURLBar) gURLBar.setAttribute('level', level);
        } else {
            if (gURLBar) gURLBar.removeAttribute('level');
        }
    }
});
UC脚本
MalcKear
千年狐狸
千年狐狸
  • UID35386
  • 注册日期2011-03-05
  • 最后登录2020-03-02
  • 发帖数1348
  • 经验131枚
  • 威望0点
  • 贡献值16点
  • 好评度10点
  • 社区居民
  • 忠实会员
4楼#
发布于:2016-01-05 13:10
感谢楼上各位!
贴吧的@柏拉图样图森破  提供的CSS
新版完整:
#urlbar{
position: relative!important;
z-index: 233!important;
}
#identity-box::before {
content: ''!important;
position: absolute!important;
height: 100%!important;
width: 100%!important;
top: 0!important;
right: 0!important
bottom: 0!important;
left: 0!important;
z-index: -1!important
}
#identity-box.weakCipher::before {
background-color: #FFFFB7 !important;
}
#identity-box.verifiedDomain::before {
background-color: #DDF9CC !important;
}
#identity-box.mixedDisplayContent::before {
background-color: #F7DFDF !important;
}
游客

返回顶部