AtCoder-HiderRatingAndPerformance

The tools to hide atcoder rating and performance

目前為 2024-09-12 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name AtCoder-HiderRatingAndPerformance
  3. // @namespace https://github.com/PenguinCabinet
  4. // @version v0.0.2
  5. // @description The tools 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. console.log(elem.textContent)
  25. if (
  26. elem.textContent.match(/順位表/)
  27. ) {
  28. elem.style.display = 'none';
  29. }
  30. });
  31. }
  32. }
  33. else if (window.location.href.match(/history/)) {
  34. let tables = document.querySelectorAll('table');
  35. tables.forEach(function (elem) {
  36. let len = elem.rows.length;
  37.  
  38. for (let i = 0; i < len; i++) {
  39. for (let j = 0; j < (config_hide_ranking ? 5 : 4); j++) {
  40. elem.rows[i].deleteCell(-1);
  41. }
  42. }
  43. })
  44. } else {
  45. let ths = document.querySelectorAll('th');
  46. ths.forEach(function (elem) {
  47. if (
  48. elem.textContent.indexOf('Rating') != -1
  49. ) {
  50. const rateting_text_class_name =
  51. elem.nextElementSibling.getElementsByTagName("span")[0]
  52. .className;
  53.  
  54. let hide_rating_text_elem = document.createElement('span');
  55. hide_rating_text_elem.className = rateting_text_class_name;
  56. hide_rating_text_elem.innerHTML = "XXXX";
  57.  
  58. elem.nextElementSibling.innerHTML = "";
  59. elem.nextElementSibling.appendChild(hide_rating_text_elem);
  60. }
  61. });
  62.  
  63. let canvases = document.querySelectorAll('canvas');
  64. canvases.forEach(function (elem) {
  65. elem.parentNode.style.display = 'none';
  66. });
  67. }
  68. // Your code here...
  69. })();

QingJ © 2025

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