var elements = document.getElementsByTagName('*');

var sourceWordsToTargetWords = [
    [['bro', 'bruh', 'bruv', 'brah', 'broseph'], 'boyfriend'],
    [['bros', 'bruhs', 'bruvs', 'brahs'], 'boyfriends'],
    [['brosephine'], 'girlfriend'],
];

function makeRegex(sourceWords) {
    return new RegExp('\\b' + sourceWords.join('\\b|\\b') + '\\b', 'g');
};

function identity(string) {
    return string;
};

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
};

function toUpperCase(string) {
    return string.toUpperCase();
};

function makeRegexToTargetWords(sourceWordsToTargetWords, modifyWords) {
    return sourceWordsToTargetWords.map(function(sourceAndTarget) {
        var [source,target] = sourceAndTarget;
        source = source.map(modifyWords);
        target = modifyWords(target);
        return [makeRegex(source), target];
    });
};

var sourceRegexToTargetWords = makeRegexToTargetWords(sourceWordsToTargetWords, identity).concat(makeRegexToTargetWords(sourceWordsToTargetWords, capitalizeFirstLetter)).concat(makeRegexToTargetWords(sourceWordsToTargetWords, toUpperCase));

function replaceTextWithRegexes(text, sourceRegexToTargetWords) {
    for (var k = 0; k < sourceRegexToTargetWords.length; k++) {
        var [regex, targetWord] = sourceRegexToTargetWords[k];
        var replacedText = text.replace(regex, targetWord);
        text = replacedText
    }
    return text;
};

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;
            replacedText = replaceTextWithRegexes(text, sourceRegexToTargetWords);

            if (replacedText !== text) {
                console.log('replaced');
                element.replaceChild(document.createTextNode(replacedText), node);
            }
        }
    }
}
@@ -124,16 +124,24 @@
 broseph'
+, 'mate'
 %5D, 'boyf
@@ -242,16 +242,169 @@
 iend'%5D,%0A
+    %5B%5B'babe'%5D, 'idk your name (so I%5C'm going to call you something that supposedly sounds like I%5C'm complimenting you because I have a favour to ask)'%5D,%0A
 %5D;%0A%0Afunc
@@ -2140,8 +2140,9 @@
 %0A    %7D%0A%7D
+%0A

Add mate and babe