您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
删除B站(哔哩哔哩)搜索框中的文字。
当前为
// ==UserScript== // @name 去除B站搜索框中的文字 // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description 删除B站(哔哩哔哩)搜索框中的文字。 // @author grch12 // @match *.bilibili.com/* // @icon none // @grant none // @run-at document-idle // @license MIT // ==/UserScript== (function () { 'use strict'; function doSearch(text) { var link = document.createElement("a"); link.href = "https://search.bilibili.com/all?keyword=" + encodeURIComponent(text); link.target = "_blank"; link.click(); } var observer = new MutationObserver(() => { var normalInput = document.querySelector(".nav-search-input"); if (normalInput) { observer.disconnect(); normalInput.remove(); var input = document.createElement("input"); var form = document.querySelector("form#nav-searchform"); input.autocomplete = "off"; input.classList.add("nav-search-input"); input.placeholder = "搜索..."; input.style.height = "100%"; input.style.borderRadius = "6px"; input.style.margin = "0"; input.style.paddingLeft = "8px"; input.name = "keyword"; document.querySelector(".nav-search-content").insertAdjacentElement("afterbegin", input); document.querySelector(".nav-search-btn").addEventListener("click", (e) => { e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); doSearch(input.value); }, true); form.addEventListener("submit", (e) => { e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); doSearch(input.value); }, true); } }); observer.observe(document.body, { childList: true }); })()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址