BiliFixNavBar & CleanSearch

Unfix the bilibili nav bar and clean the search placeholder.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         BiliFixNavBar & CleanSearch
// @name:zh-CN   哔哩哔哩解除导航栏固定 & 去除搜索推荐
// @name:ja      ビリビリnav-bar解除 & 検索おすすめクリア
// @namespace    http://inori.life/
// @version      0.3
// @description  Unfix the bilibili nav bar and clean the search placeholder.
// @description:zh-CN 解除哔哩哔哩导航栏固定,并去除搜索栏的推荐词
// @description:ja ビリビリナビバーの固定を解除し、検索バーのおすすめキーワードを削除する
// @author       INORI
// @match        *://*.bilibili.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    
    // 每 2 秒检查并执行一次
    setInterval(function () { 
        
        // 1. 解除导航栏固定
        let fixedHeader = document.querySelector(".fixed-header");
        if (fixedHeader) {
            fixedHeader.className = "bili-header";
        }

        // 2. 去除搜索栏的推荐内容
        let searchInput = document.querySelector(".nav-search-input");
        if (searchInput) {
            if (searchInput.getAttribute("placeholder") !== "") {
                searchInput.setAttribute("placeholder", "");
            }
            if (searchInput.getAttribute("title") !== "") {
                searchInput.setAttribute("title", "");
            }
        }
        
    }, 2000); 
})();