BiliFixNavBar & CleanSearch

Unfix the bilibili nav bar and clean the search placeholder.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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); 
})();