Title: [JavaScript] Hitbox Greentext Userscript Author: Anonymous Pastebin link: http://pastebin.com/n5g60tr1 First Edit: Friday 17th of February 2017 10:58:36 PM CDT Last Edit: Friday 17th of February 2017 10:58:36 PM CDT // ==UserScript== // @name               Hitbox Greentexting // @namespace     HitboxGreentexting // @include            http://www.hitbox.tv/embedchat/* // @include            http://www.hitbox.tv/* // @version            0.1 // @description     Enables greentexting to the Hitbox chat // @author             purplebutt // ==/UserScript==   // Initialize and begin main loop window.onload = function() {     addCSS();     setInterval( function() {         greentextify();     }, 200); }   function addCSS() {      // Creates the greentext user style      var css = document.createElement('style');      css.type = 'text/css';      css.innerHTML = '.greentext { color: #789922;}';      document.head.appendChild(css); }   function greentextify() {     // Gets all chat messages     var chatMsgs = document.getElementsByClassName("message-user");     if (chatMsgs) {         // Loops through them...         for ( var i = 0; i < chatMsgs.length; i++ ) {             var msg = chatMsgs[i];             // if it begins with ">"...             if ( msg.textContent.charAt(0) == ">" ) {         // ... and if it doesn't already have been greentext'd ...                 if ( !msg.className.contains("greentext") ) {                     // greentext it!                     msg.className += " greentext";                 }             }         }     } }