forked from CodingKuda/agario-stuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgexi.user.js
33 lines (32 loc) · 1.6 KB
/
gexi.user.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
// ==UserScript==
// @name AgarGexi PUBLIC
// @version 1.3
// @author TheGexi
// @match http://agar.io/*
// @grant GM_xmlhttpRequest
// @run-at document-start
// ==/UserScript==
if (location.host == "agar.io" && location.pathname == "/") {
location.href = "http://agar.io/thegexi" + location.hash;
return;
}
function inject(page) {
var _page = page.replace(/<script.*?>[\s]*?.*?window\.NREUM[\s\S]*?<\/script>/, '<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet"><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>');
_page = _page.replace(/<script.*?src=".*?agario\.core\.js.*?><\/script>/, "<script type='text/javascript' src='https://cdn.rawgit.com/fayizan/agario-stuff/master/gexi.js?v='" + Math.floor((Math.random() * 100000) +1) + "'></script>");
_page = _page.replace("$(function(){","$(function(){try{");
_page = _page.replace("window.MC = window.MC || {};",'window.MC = window.MC || {};}catch(e){var MC = new MiniclipAPI("openfl-content","openfl-overlay");MC.loadEnvironment(EnvConfig);lime.embed ("openfl-content", 880, 1024, "transparent", "mc/");window["MC"]=MC;window.MC = window.MC || {};}');
_page = _page.replace("mc/agario.js?v=","");
return _page;
}
window.stop();
document.documentElement.innerHTML = "";
GM_xmlhttpRequest({
method : "GET",
url : "http://agar.io/",
onload : function(e) {
var doc = inject(e.responseText);
document.open();
document.write(doc);
document.close();
}
});