您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
方便记住每一次学习的位置
// ==UserScript== // @name 菜鸟教程书签 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 方便记住每一次学习的位置 // @author You // @match https://www.runoob.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=runoob.com // @license MIT // @grant none // ==/UserScript== function setting(b) { b.style.backgroundColor = "#96b97d"; b.style.borderColor = "#96b97d"; b.style.borderRadius = "10px"; b.style.color = "#FFFFFF"; b.style.fontFamily = "Trebuchet MS, Helvetica, sans-serif"; b.style.position = "relative"; b.style.align = "center"; } (function () { 'use strict'; if (!localStorage.runTo) { localStorage.setItem("runTo", "null"); } if (!localStorage.name) { localStorage.setItem("name", "null"); } var test = document.getElementsByTagName('h1')[0]; var bookmark = document.createElement('button'); var target = document.createElement('button'); var list = document.getElementsByTagName('a'); setting(bookmark); bookmark.style.width = "50px"; bookmark.style.height = "30px"; bookmark.style.left = "300px"; bookmark.style.bottom = "30px"; bookmark.textContent = "Save"; setting(target); target.style.width = "200px"; target.style.height = "30px"; target.style.left = "320px"; target.style.bottom = "30px"; target.textContent = "RUN TO: " + localStorage.name; bookmark.onclick = function () { var href; for (var i = 0; i < list.length; i++) { if (list[i].target == "_top") { if (list[i].style.backgroundColor) { href = list[i].href; console.log(list[i]) target.setAttribute("href", href); target.textContent = "RUN TO: " + list[i].innerText; localStorage.setItem("runTo", href); localStorage.setItem("name", list[i].innerText); //console.log(target); } } } } target.onclick = function () { //console.log(target.getAttribute("href")); window.location.href = localStorage.runTo; } test.appendChild(bookmark); test.appendChild(target); //Your code here... })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址