您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
When clicking Comments button, jump to Comments section automatically.
// ==UserScript== // @name AO3: Go to Comments // @namespace https://gf.qytechs.cn/en/users/163551-vannius // @version 1.3 // @license MIT // @description When clicking Comments button, jump to Comments section automatically. // @author Vannius // @match https://archiveofourown.org/* // @grant none // ==/UserScript== (function () { if (/archiveofourown\.org\/(collections\/[^/]+\/)?works\/[0-9]+/.test(window.location.href)) { // Get Comments/Hide Comments tags const commentTagTop = document.getElementById('show_comments_link_top'); const commentTagBottom = document.getElementById('show_comments_link'); // If there is no comment, commentTagBottom is undefined. // And there is no need to add go to comments feature. if (!commentTagBottom) return; const mutationObserver = new MutationObserver(mutations => { const commentFlag = mutations .map(x => x.addedNodes.length) .reduce((p, x) => p + x); if (commentFlag) { const sleep = msec => new Promise(resolve => setTimeout(resolve, msec)); (async () => { await sleep(1000); window.location.href = "#comments_placeholder"; })(); } mutationObserver.disconnect(); }); // Add click event to go to #comments_placeholder const target = document.getElementById('comments_placeholder'); const options = { childList: true }; for (let commentTag of [commentTagTop, commentTagBottom]) { commentTag.addEventListener('click', () => { mutationObserver.observe(target, options); }); } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址