Codeforces Verdict Hidden Tool

The tool show codeforces submission status without which test case. For competitors practicing for the domjudge environment.

  1. // ==UserScript==
  2. // @name Codeforces Verdict Hidden Tool
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.0
  5. // @description The tool show codeforces submission status without which test case. For competitors practicing for the domjudge environment.
  6. // @license MIT
  7. // @author jakao
  8. // @match https://codeforces.com/*
  9. // @icon https://i.imgur.com/ldVBpM1.jpeg
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function removeOnTest() {
  17. console.log('?!?');
  18. let walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
  19. let node;
  20.  
  21. while (node = walker.nextNode()) {
  22. let textContent = node.nodeValue;
  23. let index = textContent.indexOf(' on test');
  24.  
  25. if (index !== -1) {
  26. node.nodeValue = textContent.substring(0, index);
  27. nextNode = walker.nextNode();
  28. nextNode.nodeValue = "";
  29. }
  30. else{
  31. pretestIndex = textContent.indexOf(' on pretest');
  32. if (pretestIndex !== -1) {
  33. node.nodeValue = textContent.substring(0, pretestIndex);
  34. nextNode = walker.nextNode();
  35. nextNode.nodeValue = "";
  36. }
  37. }
  38. }
  39. console.log('???');
  40. }
  41.  
  42. const observer = new MutationObserver((mutations) => {
  43. mutations.forEach((mutation) => {
  44. if (mutation.addedNodes.length) {
  45. removeOnTest();
  46. }
  47. });
  48. });
  49. console.log('!!!');
  50.  
  51. const observerConfig = {
  52. childList: true,
  53. subtree: true,
  54. characterData: true
  55. };
  56.  
  57. removeOnTest();
  58.  
  59. observer.observe(document.body, observerConfig);
  60. })();

QingJ © 2025

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