Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function FindMahShit(regex) {
- for (var tx = document.evaluate('//text()[normalize-space(.)!=""]', document, null, 6, null), t, i = 0; t = tx.snapshotItem(i); i++) {
- var before = t.textContent, st, matched = false;
- if (t.parentNode.tagName == 'STYLE' || t.parentNode.tagName == 'SCRIPT') continue;
- while ((st = before.search(regex)) != -1) {
- t.parentNode.insertBefore(document.createTextNode(before.substr(0, st)), t);
- with (t.parentNode.insertBefore(document.createElement('span'), t))
- textContent = RegExp.$1,
- style.cssText = 'color: #f00; font-size: 14pt;';
- matched = true;
- before = before.substr(st + RegExp.$1.length);
- }
- if (matched) t.textContent = before;
- }
- }
- window.addEventListener("load", function() {
- var RE = /(bin|high|lig|bef|by|dix|con|nt|di|sd|re|ele|ins|rt|var)/i;
- FindMahShit(RE);
- }, false );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement