您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
コンテスト名を配点に置き換えちゃうスクリプト
当前为
// ==UserScript== // @name AtCoder Show Me Score Table // @namespace https://atcoder.jp/ // @version 0.1 // @description コンテスト名を配点に置き換えちゃうスクリプト // @author hayatroid // @license MIT // @match https://atcoder.jp/contests/* // @exclude https://atcoder.jp/contests/*/json // ==/UserScript== (async () => { const res = await fetch(`https://atcoder.jp/contests/${contestScreenName}`) .then((response) => { if (!response.ok) throw new Error(`HTTP error: ${response.status}`); return response.text(); }) .then((text) => { const parser = new DOMParser(); const doc = parser.parseFromString(text, "text/html"); const table = [...doc.querySelectorAll("#contest-statement > .lang > .lang-ja table")] .filter((element) => { const th = [...element.querySelectorAll("thead > tr > th")]; return th.length === 2 && th[0].textContent === "問題" && th[1].textContent === "点数"; }); if (table.length !== 1) throw new Error("Scoreboard cannot be found."); const res = [...table[0].querySelectorAll("tbody > tr > td")] .filter((element, index) => { return index % 2 === 1; }) .map((element) => { return element.textContent; }) .join(" - "); return res; }); document.querySelector(".contest-title").textContent = res; })();