-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstronk.js
27 lines (24 loc) · 831 Bytes
/
stronk.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
const elements = [...document.body.getElementsByTagName("*")];
const findAndReplace = (elements) => {
elements.forEach((element) => {
element.childNodes.forEach((child) => {
if (child.nodeType === 3) {
replaceText(child);
}
});
});
};
const replaceText = (node) => {
let value = node.nodeValue;
value = value.replace(/STRONG/g, "STRONK");
value = value.replace(/STRONGER/g, "STRONKER");
value = value.replace(/STRONGEST/g, "STRONKEST");
value = value.replace(/Strong/g, "Stronk");
value = value.replace(/Stronger/g, "Stronker");
value = value.replace(/Strongest/g, "Stronkest");
value = value.replace(/strong/g, "stronk");
value = value.replace(/stronger/g, "stronker");
value = value.replace(/strongest/g, "stronkest");
node.nodeValue = value;
};
findAndReplace(elements);