您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
AtCoder CompanionsでCompanionsを探すためのボタンを提出画面に追加します。
当前为
// ==UserScript== // @name AtCoder Companions Quick Jump // @namespace https://github.com/ryoryon66 // @version 0.1 // @description AtCoder CompanionsでCompanionsを探すためのボタンを提出画面に追加します。 // @author ryoryon66 // @match https://atcoder.jp/contests/*/submissions/* // @grant none // @license MIT // ==/UserScript== // こんな感じのところにリンクを張る // https://atcoder-companions.kakira.dev/?c=abc253&sid=39340498 function redirectToCompanions() { const urlPattern = /^https:\/\/atcoder\.jp\/contests\/([a-zA-Z]+)(\d+)\/submissions\/(\d+)$/; const matches = window.location.href.match(urlPattern); if (matches) { const contest = matches[1] + matches[2]; const submissionId = matches[3]; const url = `https://atcoder-companions.kakira.dev/?c=${contest}&sid=${submissionId}`; window.location.href = url; } } function addRedirectButton() { const urlPattern = /^https:\/\/atcoder\.jp\/contests\/([a-zA-Z]+)(\d+)\/submissions\/(\d+)$/; const matches = window.location.href.match(urlPattern); if (matches) { const button = document.createElement("button"); button.innerText = "See Companions"; button.onclick = redirectToCompanions; button.style.cursor = "pointer"; button.style.width = "70%"; button.style.height = "40px"; button.style.border = "none"; button.style.borderRadius = "4px"; button.style.backgroundColor = "#4CAF50"; button.style.color = "white"; button.style.fontWeight = "bold"; button.style.fontSize = "16px"; button.style.marginTop = "10px"; button.style.marginBottom = "20px"; const sibling = document.querySelector("#contest-nav-tabs").nextElementSibling; if (sibling) { const container = document.createElement("div"); container.style.textAlign = "center"; container.appendChild(button); sibling.insertBefore(container, sibling.firstElementChild); } } } addRedirectButton();