AtCoder Hide Editorial

hide editorial

目前為 2021-04-16 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name AtCoder Hide Editorial
  3. // @namespace AtCoder
  4. // @version 0.3
  5. // @description hide editorial
  6. // @author harurun
  7. // @match https://atcoder.jp/contests/*/tasks/*/editorial
  8. // @match https://atcoder.jp/contests/*/tasks/*/editorial?editorialLang=en
  9. // @match https://atcoder.jp/contests/*/editorial
  10. // @match https://atcoder.jp/contests/*/editorial?editorialLang=en
  11. // @match https://atcoder.jp/contests/*/tasks/*
  12. // @match https://atcoder.jp/contests/*/tasks/*?lang=ja
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. function editional() {
  17. 'use strict';
  18. var alist=document.getElementsByTagName("a")
  19. for(var i=0;i<alist.length;i++){
  20. var target=alist[i]
  21. var url=target.href
  22. if(target.textContent==''||url.match('https://www.addtoany.com/.*')||url.match('http://www.timeanddate.com/worldclock/.*')||url.match('https://www.timeanddate.com/worldclock/.*')){
  23. continue
  24. }
  25. if(url.match('https://youtu.be/.*')||url.match('https://atcoder.jp/contests/.*/editorial/.*')||!(url.match('https://atcoder.jp/.*'))){
  26. //target.href="javascript:void(0)"
  27. target.removeAttribute("href")
  28. target.textContent="hide editorial"
  29. }
  30. }
  31. }
  32.  
  33. function problem() {
  34. var alist=document.getElementsByTagName("a")
  35. for(var i=0;i<alist.length;i++){
  36. var target=alist[i]
  37. var url=target.href
  38. if(url.match('https://atcoder.jp/contests/.*/tasks/.*/editorial')||url.match('https://atcoder.jp/contests/*/tasks/*/editorial')){
  39. target.removeAttribute("href")
  40. target.textContent="hide editorial"
  41. }
  42. }
  43. }
  44.  
  45. function main() {
  46. var url=location.href
  47. if(url.match('https://atcoder.jp/contests/.*/tasks/.*/editorial')){
  48. //console.log("hide editorial(editorial)")
  49. editional()
  50. }else if(url.match('https://atcoder.jp/contests/.*/tasks/.*')||url.match('https://atcoder.jp/contests/.*/tasks/.*?lang=en')){
  51. //console.log('hide editorial(problem)')
  52. problem()
  53. }else if(url.match('https://atcoder.jp/contests/.*/editorial')||url.match('https://atcoder.jp/contests/.*/tasks/.*/editorial')||url.match('https://atcoder.jp/contests/.*/editorial?lang=en')||url.match('https://atcoder.jp/contests/.*/tasks/.*/editorial')){
  54. //console.log('hide editorial(editorial)')
  55. editional()
  56. }
  57. }
  58.  
  59. main()

QingJ © 2025

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