您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
beta.atcoder.jpとatcoder.jpのコンテストサイトを行き来する
当前为
// ==UserScript== // @name atcoder-traffics // @namespace // @description beta.atcoder.jpとatcoder.jpのコンテストサイトを行き来する // @version 0.3 // @author euglenese // @match https://beta.atcoder.jp/contests/* // @match https://*.contest.atcoder.jp/* // @namespace https://greasyforks.org/users/201019 // ==/UserScript== function location_match(regex){ return location.href.match(new RegExp(regex)); } function erase(text, regex){ return text.replace(new RegExp(regex), ""); } var contest_name, position_name; function position_name_change(before, after){ if(position_name == before){ position_name = after; } } var beta_contest_URL = "https\:\/\/beta\.atcoder\.jp\/contests\/"; var https = "https\:\/\/"; var contest_URL = "\.contest\.atcoder\.jp\/"; var any_string = "[0-9a-z-_#]+"; var any_string2 = "[0-9a-z-_#]*"; var any_slash = "[0-9a-z-_#/]+"; if(location_match(beta_contest_URL)){ if(location_match(beta_contest_URL + any_string + "\/" + any_slash)){ contest_name = erase(location.href, beta_contest_URL).split("/")[0]; position_name = erase(location.href, beta_contest_URL + contest_name + "/"); position_name_change("tasks", "assignments"); position_name_change("submissions", "submissions/all"); $(".contest-title").attr("href", "https://" + contest_name + ".contest.atcoder.jp/" + position_name); }else{ contest_name = erase(location.href, beta_contest_URL).split("/")[0]; $(".contest-title").attr("href", "https://" + contest_name + ".contest.atcoder.jp/"); } }else{ if(location_match(https + any_string + contest_URL + any_slash)){ contest_name = erase(erase(location.href, https), contest_URL + any_slash); position_name = erase(location.href, https + contest_name + contest_URL); position_name_change("submissions/all", "submissions"); $(".brand").attr("href", "https://beta.atcoder.jp/contests/" + contest_name + "/" + position_name); }else{ contest_name = erase(erase(location.href, https), contest_URL); $(".brand").attr("href", "https://beta.atcoder.jp/contests/" + contest_name); } }