B站搜索栏 - 鼠标悬停提示

搜索栏鼠标悬停提示

当前为 2024-01-19 提交的版本,查看 最新版本

// ==UserScript==
// @name         B站搜索栏 - 鼠标悬停提示
// @namespace    mscststs
// @version      0.1
// @license      ISC
// @description  搜索栏鼠标悬停提示
// @author       mscststs
// @match        https://*.bilibili.com/*
// @icon         https://www.bilibili.com/favicon.ico
// @require      https://gf.qytechs.cn/scripts/38220-mscststs-tools/code/MSCSTSTS-TOOLS.js?version=713767
// @run-at       document-body
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    StartObserveTitle();
    async function StartObserveTitle(){

        function trendingTitle(trendingElements) {
            for (var i = 0; i < trendingElements.length; i++) {
                var trendingContent = trendingElements[i];
                trendingContent.setAttribute("title", trendingContent.innerHTML);
            }
        }

        function historyTitle(historyElements, historyText) {
            for (var i = 0; i < historyElements.length; i++) {
                var historyContent = historyElements[i];
                var text = historyText[i];
                historyContent.setAttribute("title", text.innerHTML);
            }
        }

        await mscststs.wait(".histories .history-item");
        var historyElements = document.querySelectorAll(".histories .history-item");
        var historyText = document.querySelectorAll(".histories .history-item .history-text");
        historyTitle(historyElements, historyText);

        await mscststs.wait(".trending-item .trending-text");
        var trendingElements = document.querySelectorAll(".trending-item .trending-text");
        trendingTitle(trendingElements);
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址