Спасибо за наводку. Подредактировал text и удалил лишнее в конце.
javascript:(function(){ var style = document.createElement("style"), styleContent = document.createTextNode("body{ counter-reset: resultat !important; } h3.r::before{ margin-left: -2em; position: absolute; counter-increment: resultat !important; content: counter(resultat) \"\" !important; } "); style.appendChild(styleContent ); var caput = document.getElementsByTagName("head"); caput[0].appendChild(style);var count=0, text, dv;text = 'google.ru';if(text==null || text.length==0)return;dv=document.defaultView;function searchWithinNode(node, te, len){var pos, skip, spannode, middlebit, endbit, middleclone;skip=0;if( node.nodeType==3 ){pos=node.data.toUpperCase().indexOf(te);if(pos>=0){spannode=document.createElement("SPAN");spannode.style.backgroundColor="yellow";middlebit=node.splitText(pos);endbit=middlebit.splitText(len);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);++count;skip=1;}}else if( node.nodeType==1&& node.childNodes && node.tagName.toUpperCase()!="SCRIPT" && node.tagName.toUpperCase!="STYLE"){for (var child=0; child < node.childNodes.length; ++child){child=child+searchWithinNode(node.childNodes[child], te, len);}}return skip;};searchWithinNode(document.body, text.toUpperCase(), text.length);})();