您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Jumps to top level reddit comments!
// ==UserScript== // @name Reddit Comment Jumper // @namespace https://github.com/noahcristino // @version 1.0 // @description Jumps to top level reddit comments! // @author Noah Cristino // @match https://www.reddit.com/r/*/comments/* // @grant none // @require http://code.jquery.com/jquery-3.3.1.min.js // ==/UserScript== (function() { var elms = []; function jump(h) { var url = location.href; //Save down the URL without hash. location.href = "#" + h; //Go to the target element. history.replaceState(null, null, url); //Don't like hashes. Changing it back. } $("<style type='text/css'> .ffloat{z-index:101;position:fixed;width:60px;height:60px;bottom:40px;right:40px;color:#FFF;border-radius:50px;text-align:center;box-shadow: 2px 2px 3px #999;background: url(https://i.imgur.com/Big0dFQ.png) 0 0 no-repeat;background-size:cover;} </style>").appendTo("head"); $("body").append('<a href="#" class="ffloat"></a>'); $(".commentarea > .sitetable.nestedlisting > div[data-type='comment']").each(function() { elms.push(this.id); }); var current = 0; $(".ffloat").attr("href", "#" + elms[current]); $(".ffloat").click(function() { current = current + 1; $(".ffloat").attr("href", "#" + elms[current]); }); })();