-
-
Notifications
You must be signed in to change notification settings - Fork 122
/
style.user.js
41 lines (40 loc) · 1.44 KB
/
style.user.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
/* eslint-env browser */
// ==UserScript==
// @name []style
// @version 1.1.2
// @grant none
// @author dodying
// @namespace https://github.com/dodying/
// @supportURL https://github.com/dodying/UserJs/issues
// @icon https://github.com/dodying/UserJs/raw/master/Logo.png
// @run-at document-end
// @noframes
// @include *
// ==/UserScript==
(function () {
const id = `style_${Math.random()}`;
const init = function () {
if (!document.getElementById(id)) {
const rule = [
{
url: '.*',
style: [
'a:visited{color:rgb(35,173,173)!important;}',
'::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-track-piece{background-color:transparent}body::-webkit-scrollbar-track-piece{background-color:white}::-webkit-scrollbar-thumb{background-color:#7d7d7d;border-radius:3px;min-height:10vh;}::-webkit-scrollbar-thumb:hover{background-color:#999}::-webkit-scrollbar-thumb:active{background-color:#666}',
],
},
];
const style = rule.filter((i) => window.location.href.match(i.url)).map((i) => [].concat(i.style).join('\n'));
const ele = document.createElement('style');
ele.id = id;
ele.textContent = style.join('\n');
document.head.appendChild(ele);
}
};
init();
const observer = new window.MutationObserver(init);
observer.observe(document.head, {
childList: true,
subtree: true,
});
}());