CGChat

The CodinGame web-chat without CodinGame.

当前为 2020-08-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CGChat
  3. // @namespace BlaiseEbuth
  4. // @match https://www.codingame.com/*
  5. // @grant none
  6. // @version 1.1.0
  7. // @author BlaiseEbuth
  8. // @description The CodinGame web-chat without CodinGame.
  9. // @icon https://i.imgur.com/E39sADi.png
  10. // ==/UserScript==
  11.  
  12. 'use strict';
  13.  
  14. function signin()
  15. {
  16. document.getElementById("navigation").style.display = "none";
  17. document.getElementsByClassName("cg-cookies-banner")[0].style.display = "none";
  18. document.getElementsByClassName("cg-login-form_footer")[0].style.display = "none";
  19. }
  20.  
  21. function chat()
  22. {
  23. document.getElementsByClassName("left-column")[0].style.display = "none";
  24. document.getElementById("navigation").style.display = "none";
  25. document.getElementsByClassName("chat-wrapper")[0].style.cssText = "width:100% !important";
  26. document.getElementById("chat").style.cssText = "display:flex !important";
  27. var small = document.getElementsByClassName("small-chat");
  28.  
  29. if(small.length == 1)
  30. {
  31. small[0].click();
  32. }
  33.  
  34. document.getElementsByClassName("chat")[0].style.width = "100%";
  35. document.getElementById("messages").style.width = "100%";
  36.  
  37. document.getElementsByTagName("cg-discord-disclaimer")[0].style.display = "none";
  38.  
  39. document.getElementsByClassName("hide-wrapper")[0].style.display = "none";
  40. document.getElementsByClassName("help-center")[0].style.display = "none";
  41.  
  42. var settings = document.getElementsByClassName("settings-popup");
  43.  
  44. if(settings.length == 1)
  45. {
  46. for(var i = 0; i < 3; i++)
  47. {
  48. settings[0].children[i].style.display = "none";
  49. }
  50. }
  51. }
  52.  
  53. var main = function()
  54. {
  55. var path = window.location.pathname;
  56.  
  57. if(path == "/start")
  58. {
  59. window.location.replace("/signin");
  60. }
  61. else if(path == "/signin")
  62. {
  63. signin();
  64. }
  65. else
  66. {
  67. chat();
  68. }
  69. }
  70.  
  71. setInterval(main, 100);