-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path祭奠百度.user.ts
48 lines (46 loc) · 1.2 KB
/
祭奠百度.user.ts
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
// ==UserScript==
// @name 祭奠百度
// @namespace http://tampermonkey.net/
// @version 1.39
// @description 或许未来只有一片精致的灰 !
// @author 崮生 [email protected]
// @match *
// @include *
// @connect shenzilong.cn
// @grant GM.setValue
// @grant GM.getValue
// ==/UserScript==
(() => {
function main() {
const style_el = document.createElement("style");
const gray = `-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;`;
style_el.innerHTML = `
${pan_contained([
/** 百度 */
"baidu",
/** 百度静态资源 */
"bdstatic",
/** */
"bdimg",
])},
/** https://pan.baidu.com/buy/checkoutcounter?from=non&vip=1 */
.cashier-page-logo
{${gray}}
`;
function pan_contained(selector: string[]) {
return selector
.map(
(s) => `[src*=${s}],
[style*=${s}]`,
)
.join(",");
}
document.body.insertBefore(style_el, document.querySelector("body *"));
}
main();
})();