BiliFixNavBar & CleanSearch

Unfix the bilibili nav bar and clean the search placeholder.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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