kidzgy
火狐狸
火狐狸
  • UID35190
  • 注册日期2011-02-03
  • 最后登录2024-03-28
  • 发帖数248
  • 经验196枚
  • 威望0点
  • 贡献值122点
  • 好评度17点
阅读:1898回复:4

【已解决】求修复FF67【蓝色悬浮滚动条.uc.js】

楼主#
更多 发布于:2019-05-26 01:51
在60有效,在67无效,下面代码为 【蓝色悬浮滚动条.uc.js】,谢谢!
解决方案在2楼,感谢RunningCheese
// ==UserScript==
// @name           FloatingScrollbar.uc.js
// @namespace      nightson1988@gmail.com
// @include        main
// @version        v2018-05-15 修改在微信网页版上的错误
// @version        0.0.3
// @note           Thanks to Griever(https://github.com/Griever/userChromeJS/blob/master/SmartScrollbar.uc.js) and Paul Rouget(https://gist.github.com/4003205)
// @note...........0.0.3 Fixed a problem of breaking hbox layout 
// @note           0.0.2 Remove usage of E4X (https://bugzilla.mozilla.org/show_bug.cgi?id=788293)
// ==/UserScript==
  
(function () {
    var prefs = Services.prefs,
        enabled;
    if (prefs.prefHasUserValue('userChromeJS.floating_scrollbar.enabled')) {
        enabled = prefs.getBoolPref('userChromeJS.floating_scrollbar.enabled')
    } else {
        prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
        enabled = true;
    }
// 排除微信网页版
    var css = '\
    @namespace url(http: //www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);\
    @-moz-document regexp("^((?!wx2.qq.com).)*$") {\
    :not(select):not(hbox) > scrollbar {\
        -moz-appearance: none!important;\
        position: relative;\
        background-color: transparent;\
        background-image: none;\
        z-index: 2147483647;\
        padding: 0px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "vertical"] {\
        -moz-margin-start: 0px;\
        min-width: 8px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "vertical"] thumb {\
        min-height: 60px;\
    }\
   :not(select):not(hbox) > scrollbar[orient = "horizontal"] {\
        margin-top: -13px;\
        min-height: 13px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "horizontal"] thumb {\
        min-width: 60px;\
    }\
    :not(select):not(hbox) > scrollbar thumb {\
        -moz-appearance: none!important;\
        border-width: 0px!important;\
        border-radius: 5px!important;\
        background-color: rgba(0, 133, 234, 0.4)!important;\
    }\
    :not(select):not(hbox) > scrollbar thumb:active,\
    :not(select):not(hbox) > scrollbar thumb:hover {\
        background-color: #0085ea!important;\
    }\
    :not(select):not(hbox) > scrollbar scrollbarbutton, :not(select):not(hbox) > scrollbar gripper {\
        display: none;}\
   }';
  
    var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
    var uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
  
    var p = document.getElementById('devToolsSeparator');
    var m = document.createElement('menuitem');
    m.setAttribute('label', "Use Floating Scrollbar");
    m.setAttribute('type', 'checkbox');
    m.setAttribute('autocheck', 'false');
    m.setAttribute('checked', enabled);
    p.parentNode.insertBefore(m, p);
    m.addEventListener('command', command, false);
  
    if (enabled) {
        sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
    }
  
    function command() {
        if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) {
            prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', false);
            sss.unregisterSheet(uri, sss.AGENT_SHEET);
            m.setAttribute('checked', false);
        } else {
            prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
            sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
            m.setAttribute('checked', true);
        }
  
        let root = document.documentElement;
        let display = root.style.display;
        root.style.display = 'none';
        window.getComputedStyle(root).display; // Flush
        root.style.display = display;
    }
  
})();

最新喜欢:

jaleojaleo
kidzgy
火狐狸
火狐狸
  • UID35190
  • 注册日期2011-02-03
  • 最后登录2024-03-28
  • 发帖数248
  • 经验196枚
  • 威望0点
  • 贡献值122点
  • 好评度17点
1楼#
发布于:2019-05-26 12:19
现已解决:  方案来自卡饭RunningCheese Firefox V10,感谢!



// ==UserScript==
// @name         FloatingScrollbar
// @description  ReStyle Scrollbar
// @namespace    1018148046
// @include      chrome://browser/content/browser.xul
// @version      0.1
// @charset      UTF-8
// ==/UserScript==
(function() {
    let css = `
scrollbar{ -moz-appearance:none!important;background:none!important;position:relative!important;padding:unset!important;pointer-events: auto!important;}
scrollbar thumb{-moz-appearance:none!important;background-color:rgba(0, 133, 234, 0.5)!important;margin: unset!important;border:none!important;}
scrollbar:hover thumb,scrollbar thumb:hover{background-color:#0085ea !important;}
scrollbar thumb:active{background-color:#0085ea !important;}
/* Vertical ScrollBar*/
scrollbar[orient="vertical"]{min-width:8px!important;max-width: 8px!important;min-height:20px!important;margin-left: -8px!important; z-index: 1000;}
scrollbar thumb[orient="vertical"]{min-height:50px!important;border-radius: 5px!important;}
/* Horizontal ScrollBar*/
scrollbar[orient="horizontal"]{min-height:8px!important;max-height:8px!important;min-width:20px!important;margin-top: -8px!important; z-index: 1000;}
scrollbar thumb[orient="horizontal"]{min-width:50px!important;border-radius: 5px!important;}
/* ScrollBar Button*/
scrollbar scrollcorner,scrollbar scrollbarbutton{display:none!important;}
`;
    let sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
    let uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
    sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);    
})();
jaleo
火狐狸
火狐狸
  • UID2330
  • 注册日期2005-01-19
  • 最后登录2022-05-28
  • 发帖数239
  • 经验176枚
  • 威望0点
  • 贡献值158点
  • 好评度1点
  • 社区居民
  • 忠实会员
2楼#
发布于:2019-05-26 13:01
发现老版本的RunningCheeseFirefox也能用 而且能在addon管理页面(非最大化窗口)正常使用
// ==UserScript==
// @name           FloatingScrollbar.uc.js
// @namespace      nightson1988@gmail.com
// @include        main
// @version        0.0.3
// @note           Thanks to Griever(https://github.com/Griever/userChromeJS/blob/master/SmartScrollbar.uc.js) and Paul Rouget(https://gist.github.com/4003205)
// @note...........0.0.3 Fixed a problem of breaking hbox layout 
// @note           0.0.2 Remove usage of E4X (https://bugzilla.mozilla.org/show_bug.cgi?id=788293)
// ==/UserScript==
  
(function () {
    var prefs = Services.prefs,
        enabled;
    if (prefs.prefHasUserValue('userChromeJS.floating_scrollbar.enabled')) {
        enabled = prefs.getBoolPref('userChromeJS.floating_scrollbar.enabled')
    } else {
        prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
        enabled = true;
    }
  
    var css = '\
    @namespace url(http: //www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);\
    :not(select):not(hbox) > scrollbar {\
        -moz-appearance: none!important;\
        position: relative;\
        background-color: transparent;\
        background-image: none;\
        z-index: 2147483647;\
        padding: 0px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "vertical"] {\
        -moz-margin-start: -11px;\
        min-width: 11px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "vertical"] thumb {\
        min-height: 50px;\
    }\
   :not(select):not(hbox) > scrollbar[orient = "horizontal"] {\
        margin-top: -11px;\
        min-height: 11px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "horizontal"] thumb {\
        min-width: 50px;\
    }\
    :not(select):not(hbox) > scrollbar thumb {\
        -moz-appearance: none!important;\
        border-width: 0px!important;\
        border-radius: 3px!important;\
        background-color: rgba(0, 133, 234, 0.1)!important;\
    }\
    :not(select):not(hbox) > scrollbar thumb:active,\
    :not(select):not(hbox) > scrollbar thumb:hover {\
        background-color: rgba(4, 172, 218, 0.8)!important;\
    }\
    :not(select):not(hbox) > scrollbar scrollbarbutton, :not(select):not(hbox) > scrollbar gripper {\
        display: none;\
    }';
  
    var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
    var uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
  
    var p = document.getElementById('devToolsSeparator');
    var m = document.createElement('menuitem');
    m.setAttribute('label', "Schwebende Scrollbar");
    m.setAttribute('type', 'checkbox');
    m.setAttribute('autocheck', 'false');
    m.setAttribute('checked', enabled);
    p.parentNode.insertBefore(m, p);
    m.addEventListener('command', command, false);
  
    if (enabled) {
        sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
    }
  
    function command() {
        if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) {
            prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', false);
            sss.unregisterSheet(uri, sss.AGENT_SHEET);
            m.setAttribute('checked', false);
        } else {
            prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
            sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
            m.setAttribute('checked', true);
        }
  
        let root = document.documentElement;
        let display = root.style.display;
        root.style.display = 'none';
        window.getComputedStyle(root).display; // Flush
        root.style.display = display;
    }
  
})();
wenshanliren
小狐狸
小狐狸
  • UID28120
  • 注册日期2009-02-27
  • 最后登录2024-02-23
  • 发帖数45
  • 经验77枚
  • 威望0点
  • 贡献值62点
  • 好评度1点
  • 社区居民
3楼#
发布于:2019-06-17 21:52
kidzgy:现已解决:  方案来自卡饭RunningCheese Firefox V10,感谢!



// ==UserScript==
// @name         FloatingScrollbar
// @description...
回到原帖
用的也是RC的脚本,但是滚动条的粗细定义无效,67有这个问题
kidzgy
火狐狸
火狐狸
  • UID35190
  • 注册日期2011-02-03
  • 最后登录2024-03-28
  • 发帖数248
  • 经验196枚
  • 威望0点
  • 贡献值122点
  • 好评度17点
4楼#
发布于:2019-06-18 00:51
wenshanliren:用的也是RC的脚本,但是滚动条的粗细定义无效,67有这个问题回到原帖
这个粗细倒是没有留意哦,这个做好在作者发布页反馈这个问题了
游客

返回顶部