您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add Twitter HashTag to share button on AtCoder
- // ==UserScript==
- // @name AtCoder HashTag Setter
- // @namespace https://atcoder.jp/
- // @version 1.1
- // @description Add Twitter HashTag to share button on AtCoder
- // @author G4NP0N
- // @match https://atcoder.jp/contests/*
- // @grant none
- // ==/UserScript==
- window.onload = function() {
- var url = location.href.split("/");
- if(url.length < 5)return;
- var contestId = location.href.replace(/-/g,"_").split("/")[4];
- var problemId;
- var txt = document.getElementsByClassName("a2a_kit")[0].getAttribute("data-a2a-title");
- txt += " #AtCoder_";
- if(url.length==7){
- if(url[5]=="tasks"){
- txt +=url[6];
- }else if(url[5]=="submissions" && url[6]!="me"){
- txt += document.querySelector("#main-container > div.row > div:nth-child(2) > div:nth-child(9) > table > tbody > tr:nth-child(2) > td > a").getAttribute("href").split("/")[4];
- }else{
- txt+=contestId;
- }
- }else{
- txt += contestId;
- }
- document.getElementsByClassName("a2a_kit")[0].setAttribute("data-a2a-title",txt);
- };
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址