NodeSeek 用户自定义标签

为 NodeSeek 用户添加自定义标签

// ==UserScript==
// @name         NodeSeek 用户自定义标签
// @namespace    https://www.nodeseek.com/
// @version      0.0.1
// @description  为 NodeSeek 用户添加自定义标签
// @author       Dabo
// @match        *://www.nodeseek.com/*
// @icon         https://www.nodeseek.com/static/image/favicon/android-chrome-192x192.png
// @grant        GM_xmlhttpRequest
// @license      MPL-2.0 License
// @supportURL   https://www.nodeseek.com/post-?-1
// @homepageURL  https://www.nodeseek.com/post-?-1
// ==/UserScript==

/**
 *
 *
 * 当前版本更新日志
 * 0.0.1 - 2024.02.18
 * - 自定义用户标签
 */

(function() {
    'use strict';
    const userName = 'nowayhost'; // 用户名 这里改成自己的用户名
    const tag = '水王'; // 标签 这里改成自定义的标签名称

    const elements = document.getElementsByClassName('author-name');
    for (const element of elements) {
        const text = element.textContent;
        if (text == userName) {
            element.insertAdjacentHTML('afterend', '<span class="nsk-badge role-tag role-active"><!----><span>'+tag+'</span></span> ');
        }
    }
}
)();