Greasy Fork 支持简体中文。

AtCoder Editorial Title

show editorial title in document.title

目前為 2024-10-03 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name AtCoder Editorial Title
  3. // @namespace https://fuwa.dev/
  4. // @version 0.1
  5. // @description show editorial title in document.title
  6. // @author ibuki2003
  7. // @match https://atcoder.jp/contests/*/editorial
  8. // @match https://atcoder.jp/contests/*/editorial/*
  9. // @icon https://www.google.com/s2/favicons?domain=atcoder.jp
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. if (/\/editorial$/.test(location.pathname)) {
  17. document.querySelectorAll('#main-container ul li a[target=_blank]').forEach((e) => e.removeAttribute('target'))
  18. } else {
  19. const contest_name = document.title.substr(5);
  20.  
  21. const editorial_title = document.getElementsByTagName('h2')[0].innerText;
  22.  
  23. document.title = `${editorial_title} - ${contest_name}`;
  24. }
  25. })();