-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
hideScrollbar.uc.js
152 lines (148 loc) · 6.01 KB
/
hideScrollbar.uc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// ==UserScript==
// @name Floating Scrollbar
// @namespace scrollbars_win10
// @version 0.0.8
// @note Windows 10 style by /u/mrkwatz https://www.reddit.com/r/FirefoxCSS/comments/7fkha6/firefox_77_windows_10_uwp_style_overlay_scrollbars/
// @note Brought to Firefox 77 by /u/Wiidesire https://www.reddit.com/r/firefox/comments/7f6kc4/floating_scrollbar_finally_possible_in_firefox_77/
// @note fx-autoconfig https://github.com/MrOtherGuy/fx-autoconfig
// @note Forked from https://github.com/Endor8/userChrome.js/blob/master/floatingscrollbar/FloatingScrollbar.uc.js
// ==/UserScript==
(function () {
// var prefs = Services.prefs,
// enabled;
// if (prefs.prefHasUserValue('userChromeJS.floatingScrollbar.enabled')) {
// enabled = prefs.getBoolPref('userChromeJS.floatingScrollbar.enabled')
// } else {
// prefs.setBoolPref('userChromeJS.floatingScrollbar.enabled', true);
// enabled = true;
// }
var css = `
link[href$="global.css"] ~ scrollbox {
overflow-y: auto !important;
}
link[href$="global.css"] ~ .menupopup-scrollbutton {
display: none !important;
}
link[href$="global.css"] ~ hbox > arrowscrollbox.in-bookmarks-menu {
padding-bottom: 0px !important;
}
link[href$="global.css"] ~ scrollbox {
padding-top: 0px !important;
}
link[href$="global.css"] ~ .scrollbutton-up,
link[href$="global.css"] ~ .scrollbutton-down,
link[href$="global.css"] ~ spacer[part=arrowscrollbox-overflow-start-indicator],
link[href$="global.css"] ~ spacer[part=arrowscrollbox-overflow-end-indicator] {
display: none !important;
}
.hidevscroll-scrollbar {
-moz-appearance: none!important;
margin-left: 7px!important;
border: none!important;
position: relative!important;
background-color: transparent!important;
padding: 0px!important;
z-index: 2147483647!important;
}
.hidevscroll-scrollbar[orient = "vertical"] {
-moz-margin-start: -7px!important;
min-width: 7px!important;
}
.hidevscroll-scrollbar[orient = "vertical"] thumb {
min-height: 20px!important;
}
.hidevscroll-scrollbar thumb {
-moz-appearance: none!important;
border-width: 0px!important;
border-radius: 7px!important;
background-color: rgb(136, 137, 141, 1)!important;
opacity: 0!important;
transition: opacity 0.4s ease-in-out!important;
-webkit-transform-style: preserve-3d!important;
-webkit-backface-visibility: hidden!important;
}
.hidevscroll-scrollbar:hover thumb {
background-color: rgb(136, 137, 141, 1)!important;
opacity: 0.7!important;
transition: opacity 0.1s ease-in-out!important;
-webkit-transform-style: preserve-3d!important;
-webkit-backface-visibility: hidden!important;
}
.hidevscroll-scrollbar[orient = "vertical"] thumb:active {
background: linear-gradient(to top, #c50ed2, #8500f7) !important;
}
.hidevscroll-scrollbar[orient = "horizontal"] thumb:active {
background: linear-gradient(to left, #c50ed2, #8500f7) !important;
}
.hidevscroll-scrollbar thumb:active {
opacity: 0.9!important;
transition: opacity 0.06s ease-in-out!important;
-webkit-transform-style: preserve-3d!important;
-webkit-backface-visibility: hidden!important;
}
.hidevscroll-scrollbar scrollbarbutton, .hidevscroll-scrollbar gripper {
display: none!important;
}
: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: -7px;
min-width: 7px;
max-width: 7px;
}
:not(select):not(hbox) > scrollbar[orient = "vertical"] thumb {
min-height: 20px;
}
:not(select):not(hbox) > scrollbar[orient = "horizontal"] {
margin-top: -7px;
min-height: 7px;
max-height: 7px;
}
:not(select):not(hbox) > scrollbar[orient = "horizontal"] thumb {
min-width: 20px;
}
:not(select):not(hbox) > scrollbar thumb {
-moz-appearance: none!important;
border-width: 0px!important;
border-radius: 7px!important;
background-color: rgb(136, 137, 141, 1)!important;
opacity: 0!important;
transition: opacity 0.4s ease-in-out;
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
}
:not(select):not(hbox) > scrollbar:hover thumb {
background-color: rgb(136, 137, 141, 1)!important;
opacity: 0.7!important;
transition: opacity 0.1s ease-in-out;
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
}
:not(select):not(hbox) > scrollbar[orient = "vertical"] thumb:active {
background: linear-gradient(to top, #c50ed2, #8500f7) !important;
}
:not(select):not(hbox) > scrollbar[orient = "horizontal"] thumb:active {
background: linear-gradient(to left, #c50ed2, #8500f7) !important;
}
:not(select):not(hbox) > scrollbar thumb:active {
opacity: 0.9!important;
transition: opacity 0.06s ease-in-out;
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
}
: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));
// if (enabled) {
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
// }
})();