Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Created March 29, 2014 00:22
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 vgmoose/9845794 to your computer and use it in GitHub Desktop.
Save vgmoose/9845794 to your computer and use it in GitHub Desktop.
removes twitch color
// ==UserScript==
// @name Twitch Color Strip
// @namespace http://www.twitch.tv/
// @version 0.1
// @description Removes all colors from the chat in twitch
// @match http://www.twitch.tv/*
// @copyright vgmoose
// @icon http://vgmoose.com/5ff376.png
// ==/UserScript==
/*global unsafeWindow*/
/* jshint globalstrict:true */
"use strict";
if (unsafeWindow) {
// pull in globals if needed (for Scriptish)
var Chat = unsafeWindow.Chat;
var App = unsafeWindow.App;
}
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
// the guts of this userscript
function main() {
jQ(function () {
var addMessage = App.Room.prototype.addMessage;
App.Room.prototype.addMessage = function (e) {
addMessage.call(this, e);
e.color = "#000000";
// console.log(e.color);
};
});
}
// load jQuery and execute the main function
addJQuery(main);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment