Format a word (make it red) with a Chrome Extension

Trying to highlight a word with a google extension. Running this as a content script, but it doesn’t seem to be a working solution… What have I missed?

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("Target Text", "Target Text");

            if (replacedText !== text) {
                element.replaceChild(document.createTextNode(replacedText), node);
            }
        }
    }
}