您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
ctfshow 小侧边栏 用来迅速跳转
// ==UserScript== // @name ctfshow 小侧边栏 // @namespace https://coutcin-xw.github.io/ // @version 0.1.2 // @description ctfshow 小侧边栏 用来迅速跳转 // @author CoutCin // @match https://ctf.show/challenges // @require https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js // @icon https://www.google.com/s2/favicons?domain=ctf.show // @grant unsafeWindow // @run-at document-idle // ==/UserScript== var $ = unsafeWindow.jQuery; var nav=[]; (function () { 'use strict'; $(window).load(function () { var btn = `<div class="sides-nav" style="background-color: #fff;display:inline-block; position:fixed;right:3rem;top:5rem;overflow-y: scroll;max-height: 80vh;min-width: 5rem;" > <button id="btn-click">刷新</button> <ul style=" margin: none;margin: 0; padding: 0; "> <a style="display:block;text-decoration: none;color: #000;padding: 0.25rem 1rem 0.25rem 1rem;" href="">请刷新</a> </ul> </div>`; $('body').append(btn); console.log("test"); $("#btn-click").click(function () { test(); }); }); })(); function test() { nav=[]; $(".category-header").each(function (i) { // console.log($(this).children("h3").text()+i); nav[i]={ name :$(this).children("h3").text() } $(this).children("h3").attr("id","nav-t-"+i); }) $(".sides-nav").children("ul").html(""); for(var i=0;i<nav.length;i++){ var tempstr=` <a style="display:block;text-decoration: none;color: #000;padding: 0.25rem 1rem 0.25rem 1rem;" href="#nav-t-${i}">${nav[i].name}</a> `; $(".sides-nav").children("ul").append(tempstr); } // console.log(nav); }