BiliFixNavBar & CleanSearch

Unfix the bilibili nav bar and clean the search placeholder.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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