// ==UserScript== // @name Bitcoin Highlighter All Sites // @namespace https://mizogg.co.uk // @author mizogg.co.uk // @version 1.0 // @description Highlights BTC Addresses // @include https://* // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function() { 'use strict'; if (window.self !== window.top) { return; } function setUserPref(varName, defaultVal, menuText, promtText, sep){ GM_registerMenuCommand(menuText, function() { var val = prompt(promtText, GM_getValue(varName, defaultVal)); if (val === null) { return; } if (sep && val){ var pat1 = new RegExp('\\s*' + sep + '+\\s*', 'g'); var pat2 = new RegExp('(?:^' + sep + '+|' + sep + '+$)', 'g'); val = val.replace(pat1, sep).replace(pat2, ''); } val = val.replace(/\s{2,}/g, ' ').trim(); GM_setValue(varName, val); if(!document.body.querySelector(".THmo")) THmo_doHighlight(document.body); else location.reload(); }); } setUserPref( 'keywords', 'word 1,word 2,word 3', 'Set Keywords', 'Set keywords separated by comma\t\t\t\t\t\t\t\r\n\r\nExample:\r\nword 1,word 2,word 3', ',' ); setUserPref( 'highlightStyle', 'color: #f00; background-color: #ffebcd;', 'Set Highlight Style', 'Set the Highlight Style (use proper CSS)\r\n\r\nExample:\r\ncolor: #f00; font-weight: bold; background-color: #ffe4b5;' ); var THmo_MutOb = (window.MutationObserver) ? window.MutationObserver : window.WebKitMutationObserver; if (THmo_MutOb){ var THmo_chgMon = new THmo_MutOb(function(mutationSet){ mutationSet.forEach(function(mutation){ for (var i=0; i$1'); node.parentNode.replaceChild(sp, node); } } } } THmo_doHighlight(document.body); })();