AtCoder-HiderRatingAndPerformance

The tool to hide atcoder rating and performance

  1. // ==UserScript==
  2. // @name AtCoder-HiderRatingAndPerformance
  3. // @namespace https://github.com/PenguinCabinet
  4. // @version v0.0.3
  5. // @description The tool to hide atcoder rating and performance
  6. // @author PenguinCabinet
  7. // @license MIT
  8. // @match https://atcoder.jp/users/*
  9. // @match https://atcoder.jp/contests/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. //config
  14. const config_hide_ranking = false;
  15. //config
  16.  
  17. (function () {
  18. 'use strict';
  19.  
  20. if (window.location.href.match(/contests/)) {
  21. if (config_hide_ranking) {
  22. let lis = document.querySelectorAll('li');
  23. lis.forEach(function (elem) {
  24. if (
  25. elem.textContent.match(/順位表/)
  26. ) {
  27. elem.style.display = 'none';
  28. }
  29. });
  30. }
  31. }
  32. else if (window.location.href.match(/history/)) {
  33. let tables = document.querySelectorAll('table');
  34. tables.forEach(function (elem) {
  35. let len = elem.rows.length;
  36.  
  37. for (let i = 0; i < len; i++) {
  38. for (let j = 0; j < (config_hide_ranking ? 5 : 4); j++) {
  39. elem.rows[i].deleteCell(-1);
  40. }
  41. }
  42. })
  43. } else {
  44. let ths = document.querySelectorAll('th');
  45. ths.forEach(function (elem) {
  46. if (
  47. elem.textContent.indexOf('順位') != -1 ||
  48. elem.textContent.indexOf('Rank') != -1
  49. ) {
  50. if (config_hide_ranking) {
  51. elem.nextElementSibling.innerHTML = "XXXX";
  52. }
  53. }
  54. if (
  55. elem.textContent.indexOf('Rating') != -1
  56. ) {
  57. const rateting_text_class_name =
  58. elem.nextElementSibling.getElementsByTagName("span")[0]
  59. .className;
  60.  
  61. let hide_rating_text_elem = document.createElement('span');
  62. hide_rating_text_elem.className = rateting_text_class_name;
  63. hide_rating_text_elem.innerHTML = "XXXX";
  64.  
  65. elem.nextElementSibling.innerHTML = "";
  66. elem.nextElementSibling.appendChild(hide_rating_text_elem);
  67. }
  68. });
  69.  
  70. let canvases = document.querySelectorAll('canvas');
  71. canvases.forEach(function (elem) {
  72. elem.parentNode.style.display = 'none';
  73. });
  74. }
  75. // Your code here...
  76. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址