-
Notifications
You must be signed in to change notification settings - Fork 1
/
content.js
62 lines (57 loc) · 1.72 KB
/
content.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
var substitutions = [
'Bumpercar Candysnatch',
'Bendypole Cabbagepatch',
'Beautiful Plumberscrack',
'Bumblebee Baggage',
'Bendover Cumonback',
'Benadryl Cucumberpot',
'Wimbledon Tennismatch',
'Clumpity Bandersnatch',
'Benefish Cumberface',
'Bembledump Melonpatch',
'Buildabear Bumbleswatch',
'Benny Cummerbund',
'Bandicoot Cumbercrash',
'Fiddledick Bandersnatch',
'Beneful Thundercrunch',
'Bundersnatch Cabbagewank',
'Bendydick Cuminsnatch',
'Bumperbadge Cabbagepatch',
'Beedlebop Cootersnooch',
'Bandersnatch Crumblebum',
'Benderling Crumblewrench',
'Viaduct Plumberthatch',
'Camperdown Bramblepatch',
'Benelux Bandersnatch',
'Benedict Bumberwatch',
'Humperdinck Cummerbund',
'Derelict Slumbersnatch',
'Benefit Viktorsec',
'Sherlockholmes Doctorstrange',
'Breadcrumbs Combatwrench',
'Renaissance Dumberhatch',
'Eggs Benedict Cucumber Patch',
'Bombadil Thundercats',
'Battleship Condornest',
'Brendadirk Cramplescrunch',
'Bartemis Lumberjack',
'Bendystraw Combopack',
'Bayonet Cul-de-sac',
'Bedminton Shplishnsplash',
'Bowlingball Cuckooclock',
'Bodydump Crumblesnack',
];
var elements = document.getElementsByTagName('*');
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
for (var j = 0; j < element.childNodes.length; j++) {
var node = element.childNodes[j];
if (node.nodeType === 3) {
var text = node.nodeValue;
var replacedText = text.replace(/Benedict Cumberbatch|Cumberbatch/gi, substitutions[Math.floor(Math.random() * substitutions.length)]);
if (replacedText !== text) {
element.replaceChild(document.createTextNode(replacedText), node);
}
}
}
}