bilibili搜索加强版,现网页版不支持复合搜索选框!
当前为
// ==UserScript==
// @name Bsearch(intumu.com)
// @namespace http://tampermonkey.net/
// @version 0.0.6
// @description bilibili搜索加强版,现网页版不支持复合搜索选框!
// @author yeayee
// @match https://search.bilibili.com/*
// @icon https://static.hdslb.com/mobile/img/512.png
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @grant GM_setValue
// @grant GM_getValue
// @run-at document-end
// @require https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js
// @require https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js
// @require https://unpkg.com/axios/dist/axios.min.js
// @connect search.bilibili.com
// @license MIT
// ==/UserScript==
(function () {
'use strict';
// grant GM_getResourceText
$("head").append($(
'<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/github-markdown-css/5.2.0/github-markdown.css" media="(prefers-color-scheme: dark)">'
));
// 通过class定位button
const buttons = document.getElementsByClassName('vui_button vui_button--blue vui_button--lg search-button');
// 遍历每个button
for (let i = 0; i < buttons.length; i++) {
const button = buttons[i];
// 创建新的button元素
const newButton = document.createElement('button');
// newButton.setAttribute('id', 'newbutton');
newButton.innerHTML = '按时间+播放量搜索';
// 将新的button插入到button后面
button.p
arentNode.insertBefore(newButton, button.nextSibling);
};
const button = document.getElementById('newbutton');
if (button) {
button.addEventListener('click', function() {
// 点击事件处理逻辑
console.log('newButton click!');
});
} else {
console.log('Button not found!');
}
})();