您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Luogu 首页顶部置顶任意链接(1个)
当前为
// ==UserScript== // @name Luogu 首页置顶助手 // @namespace http://tampermonkey.net/ // @license MIT // @version 1.2 // @description Luogu 首页顶部置顶任意链接(1个) // @author zz07 // @match https://www.luogu.org // @require https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js // @grant GM_getValue // @grant GM_setValue // ==/UserScript== (function() { 'use strict'; $(function(){ function setLink() { var link = prompt("请输入链接地址(点按取消以不变)"); if (link == undefined) { return; } var text = prompt("请输入链接文字"); GM_setValue("user_link", link); GM_setValue("user_link_text", text); location.reload(); } var title = $(".link-container"); var prelink = GM_getValue("user_link"); var pretext = GM_getValue("user_link_text") var link = '<a href="' + prelink + '" class="header-link color-none">' + pretext + '</a>'; var button = document.createElement("button"); button.innerText = '编辑'; button.className = 'am-btn am-btn-sm am-btn-primary'; button.style.marginLeft = '2em'; button.addEventListener('click', setLink); var helper = '<span data-v-86f2b1fc data-v-5b9d45a0 class="helper"></span>'; console.log(button); if (pretext != undefined) { title.append(link, helper); } title.append(button, helper); }); })();