Codeforces-Hide-Problem-Tags

Hide problem tags to avoid spoiling solutions

  1. // ==UserScript==
  2. // @name Codeforces-Hide-Problem-Tags
  3. // @namespace http://github.com/armanjr/Codeforces-Hide-Problem-Tags
  4. // @version 0.2
  5. // @description Hide problem tags to avoid spoiling solutions
  6. // @author ArmanJR
  7. // @match https://codeforces.com/problemset*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=codeforces.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var getUrl = window.location;
  16. if (getUrl.pathname.split('/')[2] == 'problem') {
  17. var xpath = "//div[contains(text(),'Problem tags')]";
  18. var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  19. matchingElement.parentElement.style.display = 'none';
  20. }
  21. else {
  22. const collection = document.getElementsByClassName('id');
  23. for (let i = 0; i < collection.length; i++) {
  24. collection[i].nextElementSibling.children[1].style.display = 'none';
  25. }
  26. }
  27. })();

QingJ © 2025

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