Skip to content

Instantly share code, notes, and snippets.

@lakario
Created March 27, 2013 17:25
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 lakario/5256279 to your computer and use it in GitHub Desktop.
Save lakario/5256279 to your computer and use it in GitHub Desktop.
Bypass http://plug.dj's rate limiting and spam filtering. Tsk on them for making them client-side!
// ==UserScript==
// @name Override Plug.dj chat
// @version 0.1
// @description Bypasses chat send filtering.
// @match *plug.dj/*/*
// @copyright 2012+, You
// ==/UserScript==
var unsafeWindow = window;
var fireLazers = function() {
if(window.navigator.vendor.match(/Google/)) {
var div = document.createElement("div");
div.setAttribute("onclick", "return window;");
unsafeWindow = div.onclick();
}
unsafeWindow.Models.chat.sendChat = function (a) {
var that = unsafeWindow.Models.chat;
if (!that.chatCommand(a)) {
var type = a.indexOf("/em") == 0 || a.indexOf("/me ") == 0 ? 'emote' : 'message';
var c = {
message: unsafeWindow.Utils.cleanTypedString(type == 'emote' ? a.substring(3) : a)
, type: type
, language: unsafeWindow.Models.user.data.language
, from: unsafeWindow.Models.user.data.username
, fromID: unsafeWindow.Models.user.data.id
}
unsafeWindow.socket.chat(a);
that.onChatReceived(c);
}
return true;
}
};
setTimeout(function() {
console.log('Chat filter override initialized.');
fireLazers();
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment