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 2
  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/paper/bootstrap.css"; @import "http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css";');
  22.  
  23. $(document).ready(function() {
  24. var region = $("#region");
  25. if (region.length) {
  26. $("<br/><div class=\"input-group\"><div class=\"form-group\"><input id=\"serverInput\" class=\"form-control\" placeholder=\"255.255.255.255:443\" maxlength=\"20\"><span class=\"input-group-btn\"> &<button disabled id=\"connectBtn\" class=\"btn-needs-server btn btn-warning\" style=\"width: 80px\" onclick=\"connect('ws://' + $('#serverInput').val());\" type=\"button\">Join</button><button disabled id=\"connectBtn\" class=\"btn-needs-server btn btn-info\" style=\"width: 80px\" onclick=\"connect('ws://' + $('#serverInput').val());\" type=\"button\"><span class=\"fa fa-lg fa-refresh\"></span></button> </input></div>").insertAfter("#helloDialog > form > div:nth-child(3)");
  27. }
  28. });
  29.  
  30.  
  31. var elmDeleted = document.getElementById("instructions");
  32. elmDeleted.parentNode.removeChild(elmDeleted);
  33.  
  34. var elmDeleted = document.getElementById("blocker");
  35. elmDeleted.parentNode.removeChild(elmDeleted);
  36.  
  37. setShowMass(true);
  38. setDarkTheme(true);
  39. setNames(true);
  40. $("#nick").val("Username here!");
  41.  
  42. WebFontConfig = {
  43. google: { families: [ 'Raleway::latin' ] }
  44. };
  45. (function() {
  46. var wf = document.createElement('script');
  47. wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
  48. '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  49. wf.type = 'text/javascript';
  50. wf.async = 'true';
  51. var s = document.getElementsByTagName('script')[0];
  52. s.parentNode.insertBefore(wf, s);
  53. })();
  54.  
  55.  
  56. function addGlobalStyle(css) {
  57. var head, style;
  58. head = document.getElementsByTagName('head')[0];
  59. if (!head) { return; }
  60. style = document.createElement('style');
  61. style.type = 'text/css';
  62. style.innerHTML = css;
  63. head.appendChild(style);
  64. }
  65.  
  66. addGlobalStyle('html * { font-family: Raleway, sans-serif; }');