-
Notifications
You must be signed in to change notification settings - Fork 0
/
i-fxxx-ccf.user.js
66 lines (62 loc) · 2.01 KB
/
i-fxxx-ccf.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
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
// ==UserScript==
// @name I-Fxxx-CCF
// @namespace https://€€£.fucksc.cf/
// @version 0.2
// @description 将中国计算机学会官网所有的 CCF 改成 €€£
// @author €€£
// @match *://*.ccf.org.cn/*
// @match *://*.noi.cn/*
// @match *://*.cspro.org/*
// @match *://*.yocsef.org.cn/*
// @icon https://avatars.githubusercontent.com/u/91953449
// @grant none
// @homepage https://github.com/fuckccf/I-Fxxx-CCF
// @license WTFPL
// ==/UserScript==
(function() {
var kwd = {
"GESP": "₲E$₽",
"Grade": "₲rade",
"Programming": "₽rogramming",
"CCSP": "€€$₱",
"CSP": "€$₱",
"CCCF": "€€€£",
"CCF": "€€£",
"CNCC": "€₦€€",
"中国计算机学会": "中国收钱协会",
"Certified": "€ertified",
"Software": "$oftware",
"Professional": "₱rofessional",
"China": "€hina",
"Computer": "€ollecting-money",
"Federation": "£ederation"
}
Object.keys(kwd).forEach(k => {
document.querySelectorAll("div,p,a,h1,h2,h3,h4,h5,h6,span")?.forEach((el) => {
if (el.innerHTML.includes(k) && !el.innerHTML.includes("版权"))
el.innerHTML = el.innerHTML.replaceAll(k,kwd[k])
})
document.title = document.title.replaceAll(k,kwd[k])
})
Object.keys(kwd).forEach(k => {
document.querySelectorAll("*[href], *[src]")?.forEach((el) => {
if (el.href?.includes(encodeURI(kwd[k])))
el.href = decodeURI(el.href).replaceAll(kwd[k],k)
if (el.src?.includes(encodeURI(kwd[k])))
el.src = decodeURI(el.src).replaceAll(kwd[k],k)
})
})
document.querySelector(".header .logo")?.remove()
var img = document.createElement("img")
img.src = "https://avatars.githubusercontent.com/u/91953449";
img.alt = "中国收钱协会"
img.className = "logo"
document.querySelector(".header .tt")?.append(img)
document.body.insertAdjacentHTML("beforeend", `
<style>
body > div.index-xf {
display: none !important;
}
</style>
`)
})();