Skip to content

Instantly share code, notes, and snippets.

@fape
Last active August 15, 2016 07:31
Show Gist options
  • Save fape/8412168f6665d507ec7c040620d0ec1c to your computer and use it in GitHub Desktop.
Save fape/8412168f6665d507ec7c040620d0ec1c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Abort getAnniverSignInfo
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author fape
// @match http://www.banggood.com/10annvcheckin.html*
// @grant none
// @run-at document-body
// ==/UserScript==
function removeEvilAjaxResponse () {
$.ajaxPrefilter("json", function( options, originalOptions, jqXHR ) {
if(options.data !== undefined && options.data.includes('getAnniverSignInfo')){
var testpattern = /\"winnerlist\"\:{(.*)},/;
options.dataFilter= function (data, type){
console.time("winnerlist replace");
data=data.replace(testpattern,"\"winnerlist\"\:{\"cpHtml\": \"\", \"coHtml\": \"\", \"poHtml\":\"\", \"exlist\": \"\"},");
console.timeEnd("winnerlist replace");
return data;
};
}
});
}
addJS_Node (null, null, removeEvilAjaxResponse);
function addJS_Node (text, s_URL, funcToRun, runOnLoad) {
var D = document;
var scriptNode = D.createElement ('script');
if (runOnLoad) {
scriptNode.addEventListener ("load", runOnLoad, false);
}
scriptNode.type = "text/javascript";
if (text) scriptNode.textContent = text;
if (s_URL) scriptNode.src = s_URL;
if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
targ.appendChild (scriptNode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment