diff --git a/README.md b/README.md index 19035e3..75b948b 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,12 @@ NEXT - Agar.io Extension ## Download - For Google Chrome: http://snsa.github.io/NEXT/next.chrome.user.js +- For Mozilla Firefox: http://snsa.github.io/NEXT/next.firefox.user.js ## Usage - Install [Tampermonkey](https://tampermonkey.net/) extension for Google Chrome -- Install the userscript +or [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) for Firefox +- Install the corresponding userscript you downloaded above for each browser - Go to http://agar.io ## Run in development diff --git a/deploy.sh b/deploy.sh index aef95cb..78818d3 100644 --- a/deploy.sh +++ b/deploy.sh @@ -14,6 +14,7 @@ cd build sed -i "s/localhost:8080/snsa.github.io\/NEXT/g" index.html cp ../userscripts/next.chrome.user.js . +cp ../userscripts/next.firefox.user.js . git init git config user.name "SNSA Bot" diff --git a/userscripts/next.firefox.user.js b/userscripts/next.firefox.user.js new file mode 100644 index 0000000..ed911ed --- /dev/null +++ b/userscripts/next.firefox.user.js @@ -0,0 +1,43 @@ +// ==UserScript== +// @name NEXT +// @description The next generation of Agar.io extension +// @version 0.0.1 +// @author NEXT +// @match http://agar.io/* +// @match https://agar.io/* +// @downloadURL http://snsa.github.io/NEXT/next.firefox.user.js +// @updateURL http://snsa.github.io/NEXT/next.firefox.user.js +// @grant none +// ==/UserScript== + +function opengradingwindow(htmlContent) { + var element = document.createElement('script'); + var target = document.getElementsByTagName('head')[0] || (document.body || document.documentElement); + element.type = 'text/javascript'; + element.textContent = '(function(html){var d=window.document;d.open();d.write(html);d.close();})(' + JSON.stringify(htmlContent) + ');'; + target.appendChild(element); +}; + +function replacePage(url) { + if (!window.PIXI) { + var req = new XMLHttpRequest; + req.onreadystatechange = function() { + if (4 == req.readyState) { + if (200 == req.status) { + document.documentElement.innerHTML = '