Agar.io 10/10

ItsVoid

当前为 2015-06-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Agar.io 10/10
  3. // @namespace Agar.io
  4. // @description ItsVoid
  5. // @include http://agar.io/*
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. function addStyleSheet(style){
  11. var getHead = document.getElementsByTagName("HEAD")[0];
  12. var cssNode = window.document.createElement( 'style' );
  13. var elementStyle= getHead.appendChild(cssNode)
  14. elementStyle.innerHTML = style;
  15. return elementStyle;
  16. }
  17.  
  18.  
  19.  
  20.  
  21. addStyleSheet('@import "http://bootswatch.com/yeti/bootstrap.css";');
  22.  
  23. $(document).ready(function() {
  24. var region = $("#region");
  25. if (region.length) {
  26. $("<br/><div class=\"form-group\"><input id=\"serverInput\" class=\"form-control\" placeholder=\"255.255.255.255:443\" maxlength=\"20\"></input></div>").insertAfter("#helloDialog > form > div:nth-child(3)");
  27. $("<div class=\"form-group\"><button disabled type=\"button\" id=\"connectBtn\" class=\"btn btn-warning btn-needs-server\" onclick=\"connect('ws://' + $('#serverInput').val());\" style=\"width: 100%\">Connect</button></div>").insertAfter($("#serverInput").parent());
  28. }
  29. });
  30.  
  31.  
  32. var elmDeleted = document.getElementById("instructions");
  33. elmDeleted.parentNode.removeChild(elmDeleted);
  34.  
  35. var elmDeleted = document.getElementById("blocker");
  36. elmDeleted.parentNode.removeChild(elmDeleted);
  37.  
  38. setShowMass(true);
  39. setDarkTheme(true);
  40. setNames(true);
  41. $("#nick").val("Enter nickname");
  42.  
  43. WebFontConfig = {
  44. google: { families: [ 'Raleway::latin' ] }
  45. };
  46. (function() {
  47. var wf = document.createElement('script');
  48. wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
  49. '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  50. wf.type = 'text/javascript';
  51. wf.async = 'true';
  52. var s = document.getElementsByTagName('script')[0];
  53. s.parentNode.insertBefore(wf, s);
  54. })();
  55.  
  56.  
  57. function addGlobalStyle(css) {
  58. var head, style;
  59. head = document.getElementsByTagName('head')[0];
  60. if (!head) { return; }
  61. style = document.createElement('style');
  62. style.type = 'text/css';
  63. style.innerHTML = css;
  64. head.appendChild(style);
  65. }
  66.  
  67. addGlobalStyle('html * { font-family: Raleway, sans-serif; }');