This repository was archived by the owner on Dec 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinject.js
More file actions
69 lines (55 loc) · 2.37 KB
/
inject.js
File metadata and controls
69 lines (55 loc) · 2.37 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
62
63
64
65
66
67
68
69
/* CSS classok
.mtk1 minden más
.mtk4 nevek
.mtk5 string
.mtk7 számok
.mtk9 commentek
.mtk14 metúdusok
*/
function draculaInject() {
var m = new MutationObserver(_ => {
document.querySelectorAll('.mtk14').forEach(e => { e.style.color = "#8be9fd" })
document.querySelectorAll('.mtk7').forEach(e => { e.style.color = "#bd93f9" })
document.querySelectorAll('.mtk5').forEach(e => { e.style.color = "#f1fa8c" })
document.querySelectorAll('.mtk1').forEach(e => { e.style.color = "#f8f8f2" })
document.querySelectorAll('.mtk4').forEach(e => { e.style.color = "#50fa7b" })
document.querySelectorAll('.mtk9').forEach(e => { e.style.color = "#6272a4" })
document.querySelectorAll('main > div').forEach(e => { e.style.backgroundColor = "#282a36" })
document.querySelectorAll('.current-line').forEach(e => { e.style.backgroundColor = "#44475a" })
})
m.observe(document.getElementById('root'), {
attributes: true,
characterData: true,
childList: true,
subtree: true
})
}
var injected = false
var mo = new MutationObserver(_ => {
if(document.querySelectorAll('.theme-colors-preview-container').length < 10 || injected) return;
injected = true
document.querySelectorAll('.theme-colors-preview-container')[7].getElementsByTagName("span")[0].innerHTML = "Red"
var main = document.createElement("div");
main.setAttribute("class", "theme-colors-preview-container")
main.setAttribute("onclick", "draculaInject()")
var m = document.createElement("div");
m.setAttribute("class", "theme-colors-preview");
m.setAttribute("style", "background: linear-gradient(to right bottom, #282a36 15%, #6272a4 85%);")
var s = document.createElement("div");
s.setAttribute("class", "theme-colors-preview-border");
s.setAttribute("style", "border: 2px solid transparent;");
var t = document.createElement("span");
t.setAttribute("class", "theme-name");
t.setAttribute("style", "#ffffff; text-transform: capitalize;")
main.appendChild(m);
main.appendChild(s);
t.innerHTML = "Dracula";
main.appendChild(t);
document.querySelectorAll('.panel-background')[1].appendChild(main)
})
mo.observe(document.getElementById('popup'), {
attributes: true,
characterData: true,
childList: true,
subtree: true
})