Skip to content

Instantly share code, notes, and snippets.

@y-ack
Created November 16, 2021 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y-ack/4cfebb283c9f7f9305221d31d1c51511 to your computer and use it in GitHub Desktop.
Save y-ack/4cfebb283c9f7f9305221d31d1c51511 to your computer and use it in GitHub Desktop.
exgame colorizer bookmarklet
game = document.body.getElementsByClassName('modulemessage')[document.body.getElementsByClassName('modulemessage').length - 1].getElementsByTagName('span')[0];text = game.innerHTML;var words = [['`','<b style='color:#060;background-color:#5B0;font-family:\'Courier New\',Courier'>`</b>'],['\\.','<b style='color:#333;background-color:#740;font-family:\'Courier New\',Courier'>.</b>'],['~','<b style='color:#DB0;background-color:#FD1;font-family:\'Courier New\',Courier'>~</b>'],['%E2%96%91','<b style='color:#333;background-color:#BBB;font-family:\'Courier New\',Courier'>%E2%96%91</b>'],['%E2%96%92','<b style='color:#C70;background-color:#BBB;font-family:\'Courier New\',Courier'>%E2%96%92</b>'],['%E2%96%93','<b style='color:#333;background-color:#BBB;font-family:\'Courier New\',Courier'>%E2%96%93</b>'],['%E2%98%BC','<b style='color:#FF4;background-color:#AA7;font-family:\'Courier New\',Courier'>%E2%98%BC</b>'],['%CF%84','<b style='color:#060;background-color:#5B0;font-family:\'Courier New\',Courier'>%CF%84</b>'],['%E2%96%B2','<b style='color:#060;background-color:#5B0;font-family:\'Courier New\',Courier'>%E2%96%B2</b>'],[',(?![A-HJ-Za-hj-z ])','<b style='color:#040;background-color:#5B0;font-family:\'Courier New\',Courier'>,</b>'],['%E2%88%9E','<b style='color:#E64;background-color:#5B0;font-family:\'Courier New\',Courier'>%E2%88%9E</b>'],[''(?![a-hj-z>])','<b style='color:#040;background-color:#5B0;font-family:\'Courier New\',Courier'>'</b>'],['%E2%99%A3','<b style='color:#E26;background-color:#5B0;font-family:\'Courier New\',Courier'>%E2%99%A3</b>'],['\\*','<b style='color:#F8D;background-color:#5B0;font-family:\'Courier New\',Courier'>*</b>'],['\\?','<b style='color:#740;background-color:#69B;font-family:\'Courier New\',Courier'>?</b>'],['=(?!')(?=%E2%89%A1)','<b style='color:#750;background-color:#BA9;font-family:\'Courier New\',Courier'>%E2%89%A1</b>'],['%E2%89%A1','<b style='color:#750;background-color:#BA9;font-family:\'Courier New\',Courier'>%E2%89%A1</b>'],['=(?!')','<b style='color:#750;background-color:#5B0;font-family:\'Courier New\',Courier'>=</b>'],['%E2%80%A2','<b style='color:#E7F;background-color:#666;font-family:\'Courier New\',Courier'>%E2%80%A2</b>'],['i(?![a-hj-z])','<b style='color:#950;background-color:#FD9;font-family:\'Courier New\',Courier'>i</b>'],['%CE%A9','<b style='color:#333;background-color:#DDD;font-family:\'Courier New\',Courier'>%CE%A9</b>'],['%E2%89%88','<b style='color:#FFF;background-color:#6BD;font-family:\'Courier New\',Courier'>%E2%89%88</b>'],['%E2%96%88','<b style='color:#000;background-color:#BBB;font-family:\'Courier New\',Courier'>%E2%96%88</b>'],/*extras*/['%C2%A5( ?<b style='color:#[0-9A-Z]{3};background-color:#)([0-9A-Z]{3})','<b style='color:#000;background-color:#$2;font-family:\'Courier New\',Courier'>%C2%A5</b>$1$2'],['([0-9])(?![0-9A-F]{0,2};)','<b style='color:#111;font-style:italic;font-family:\'Courier New\',Courier'>$1</b>']];for (var i = 0; i < words.length; i++) {var match = words[i][0];var substitution = words[i][1];var regex = new RegExp(match,'g');text = text.replace(regex, substitution);}game.innerHTML = text;})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment