您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button that compares the anime list of a hummingbird user against yours
当前为
// ==UserScript== // @name Hummingbird User Compare // @version 2.1 // @description Adds a button that compares the anime list of a hummingbird user against yours // @author fuzetsu // @match https://hummingbird.me/* // @match https://forums.hummingbird.me/* // @grant none // @require https://gf.qytechs.cn/scripts/5679-wait-for-elements/code/Wait%20For%20Elements.js?version=46106 // @noframes // @namespace https://gf.qytechs.cn/users/649 // ==/UserScript== var SCRIPT_NAME = 'Hummingbird User Compare'; var BTN_CLASS = 'us-compare-button'; var Util = { log: function() { var args = [].slice.call(arguments); args.unshift('%c' + SCRIPT_NAME + ':', 'font-weight: bold'); console.log.apply(console, args); }, q: function(query, context) { return (context || document).querySelector(query); }, qq: function(query, context) { return [].slice.call((context || document).querySelectorAll(query)); }, shallowTextContent: function(elem) { var child = elem.firstChild, texts = []; while (child) { if (child.nodeType == 3) { texts.push(child.data); } child = child.nextSibling; } return texts.join(""); } }; Util.log('Started, waiting for user page...'); waitForUrl(/https:\/\/(forums\.)?hummingbird\.me\/users\/.+/, function() { var profileUrl = Util.q('.dropdown-menu > li > a').href; var you = profileUrl.slice(profileUrl.lastIndexOf('/') + 1); var them = Util.shallowTextContent(Util.q('h2.username,h1.username')).trim(); var compareUrl = 'http://fuzetsu.github.io/hummingbird-user-compare/?user1=' + you + '&user2=' + them; Util.log('Found user page, waiting for button area...'); waitForElems('.user-cover-options .follow-button:not(.' + BTN_CLASS + ')', function(btnFollow) { var forumButton = Util.q('.account-info .inline-list a'); var btn = Util.q('.' + BTN_CLASS); Util.log('Found button area, inserting compare button'); if(forumButton) { forumButton.title = ''; forumButton.target = '_blank'; forumButton.href = compareUrl; } else { if(!btn) { btn = btnFollow.parentNode.appendChild(document.createElement('a')); btn.className = btnFollow.className + ' ' + BTN_CLASS; btn.textContent = 'Compare'; btn.target = '_blank'; } btn.setAttribute('style', 'right: ' + (btnFollow.clientWidth + 10) + 'px; background: rgb(236, 134, 97); color: white;'); btn.href = compareUrl; } }, true); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址