AtCoder Hide Editional

hide editional

当前为 2021-04-16 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

  1. // ==UserScript==
  2. // @name AtCoder Hide Editional
  3. // @namespace AtCoder
  4. // @version 0.1
  5. // @description hide editional
  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 editional"
  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 editional"
  41. }
  42. }
  43. }
  44.  
  45. function main() {
  46. var url=location.href
  47. if(url.match('https://atcoder.jp/contests/.*/tasks/.*')||url.match('https://atcoder.jp/contests/.*/tasks/.*?lang=en')){
  48. problem()
  49. }
  50. 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')){
  51. editional()
  52. }
  53. }
  54.  
  55. main()