您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
隐藏搜索引擎下拉框的历史记录,目前仅适配Google
当前为
// ==UserScript== // @name 隐藏搜索历史 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 隐藏搜索引擎下拉框的历史记录,目前仅适配Google // @homeurl https://github.com/dengyuhan/LardMonkeyScripts // @homeurl https://gf.qytechs.cn/zh-CN/scripts/392368 // @author denghaha // @match https://www.google.*/* // @grant none // ==/UserScript== (function () { 'use strict' function findTagByParent (element, tagName) { let currentElement = element while (currentElement.tagName.toLowerCase() !== tagName.toLowerCase() && currentElement !== document.body) { currentElement = currentElement.parentNode } return currentElement !== element ? currentElement : null } function deleteFunc () { let deleteElements = Array.from(document.getElementsByClassName("sbai sbdb")) deleteElements.filter(element => { return element.style.display !== 'none' }).flatMap(element => { return findTagByParent(element, 'li') }).forEach(element => { console.info("删除搜索记录", element.querySelector("span").innerText) element.remove() }) } let inputElements = document.getElementsByName("q") for (let i = 0; i < inputElements.length; i++) { inputElements[i].oninput = function () { setTimeout(deleteFunc, 150) } } let target = document.getElementsByClassName("UUbT9")[0] let observer = new MutationObserver(function (mutations, observer) { deleteFunc() }) observer.observe(target, { characterData: true, childList: true, subtree: true }) })()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址