Aqui está outro script de usuário que não precisa do jQuery, suporta case-insensitive correspondência de expressão regular e, na verdade, destaca as palavras específicas que você deseja corresponder:
// ==UserScript==
// @name Keyword Highlight 2
// @author Ilmari Karonen
// @namespace http://superuser.com/questions/467276
// @include http://*
// ==/UserScript==
// Edit this regexp to match what you want highlighted; don't forget the "g" flag!
var r = /Chrome/ig;
// This span will be used to wrap the highlighted text:
var span = document.createElement( 'span' );
span.style.backgroundColor = 'yellow';
// Pre-create some other handy objects for later:
var text = document.createTextNode( '' );
var frag = document.createDocumentFragment();
// Walk the document body node by node:
var e = document.getElementsByTagName( 'body' )[0];
while ( e ) {
// If it's a text node, match it against the regexp:
if ( e.nodeType == Node.TEXT_NODE ) {
var t = e.textContent, i = 0, m;
while ( (m = r.exec( t )) !== null ) {
// Copy any text before the match into the fragment:
text.textContent = t.substring( i, m.index );
frag.appendChild( text.cloneNode( true ) );
// Wrap the match in a span and copy it into the fragment:
span.textContent = m[0];
frag.appendChild( span.cloneNode( true ) );
// Keep track of the current match position:
i = m.index + m[0].length;
}
if ( i > 0 ) {
// Remove the matched text from e and re-insert it before it:
e.textContent = t.substring( i );
e.parentNode.insertBefore( frag, e );
// Reset frag to a new empty fragment:
frag = frag.cloneNode( false );
}
}
// Advance to next node in DOM (bugfix: skip textarea content):
var n = e.firstChild;
if ( /^(head|title|script|style|textarea)$/i.test( e.tagName ) ) n = null;
while (!n && e) {
n = e.nextSibling;
e = e.parentNode;
}
e = n;
}
Captura de tela obrigatória: