Repository navigation
Expand file tree
/
Copy pathgithub-boldless-title.user.js
More file actions
61 lines (60 loc) · 2.4 KB
/
Copy pathgithub-boldless-title.user.js
File metadata and controls
61 lines (60 loc) · 2.4 KB
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
// ==UserScript==
// @name GitHub Boldless Title
// @namespace https://github.com/Vinfall/UserScripts
// @version 2.0.1
// @author Vinfall
// @match https://github.com/*
// @match https://gist.github.com/*
// @exclude-match https://gist.github.com/auth/*
// @exclude-match https://gist.github.com/join*
// @exclude-match https://gist.github.com/login
// @exclude-match https://github.com/*/*/actions/runs/*
// @exclude-match https://github.com/*/*/actions/workflows/*
// @exclude-match https://github.com/*/*/blob/*/*
// @exclude-match https://github.com/*/*/commit/*
// @exclude-match https://github.com/*/*/compare/*
// @exclude-match https://github.com/*/*/graphs/*
// @exclude-match https://github.com/*/*/issues*
// @exclude-match https://github.com/*/*/pull/*
// @exclude-match https://github.com/*/*/pulls*
// @exclude-match https://github.com/*/*/tree/*/*
// @exclude-match https://github.com/*?tab=overview*
// @exclude-match https://github.com/*?tab=packages*
// @exclude-match https://github.com/*?tab=projects*
// @exclude-match https://github.com/*?tab=repositories*
// @exclude-match https://github.com/*?tab=stars*
// @exclude-match https://github.com/copilot
// @exclude-match https://github.com/copilot/*
// @exclude-match https://github.com/git/git/*
// @exclude-match https://github.com/login*
// @exclude-match https://github.com/sessions/*
// @exclude-match https://github.com/signin
// @grant none
// @run-at document-end
// @license CC0 1.0 Universal (Public Domain)
// @description Remove strong style in GitHub repo/gist title
// @description:zh-cn GitHub 仓库名取消加粗
// ==/UserScript==
(() => {
const selector = 'strong[itemprop="name"]';
function removeStrong(root = document) {
root.querySelectorAll(selector).forEach((strong) => {
strong.replaceWith(...strong.childNodes);
});
}
function start() {
removeStrong();
const observer = new MutationObserver(() => {
removeStrong();
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
}
if (document.body) {
start();
} else {
document.addEventListener('DOMContentLoaded', start, { once: true });
}
})();