Greasy Fork

Greasy Fork is available in English.

咸鱼 - 简单的屏蔽关键词

用于屏蔽其他无关内容。

当前为 2025-04-02 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         咸鱼 - 简单的屏蔽关键词
// @namespace    https://time-blog.top/
// @version      0.0.0.2
// @description  用于屏蔽其他无关内容。
// @author       Time - https://time-blog.top
// @homepage     https://time-blog.top
// @match        *://*.goofish.com/search?*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=goofish.com
// @grant        none
// @license      GPL-3.0
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    window.addEventListener('load', function() {
        document.querySelector("#content > div:nth-child(1) > div:nth-child(2)").innerHTML += '<div style="position: absolute;right: 1.5em;height: 32px;"> <input id="input_content" type="text" data-spm-anchor-id="a21ybx.search.0.i4.21862457DQxaV8" style="border: 1px solid rgba(0, 0, 0, .08);border-radius: 6px;box-sizing: border-box;color: #1f1f1f;height: 32px;outline: none;padding: 7px 9px;width: 84px;" placeholder="屏蔽内容"><input id="yes_button" value="确定" type="button" style="background-color: #ffe60f;border: none;border-radius: 6px;box-sizing: border-box;color: #1f1f1f;width: 43px;height: 28px;" data-spm-anchor-id="a21ybx.search.0.i10.21862457DQxaV8"></div>'
        setTimeout(()=>{
            var text_input = document.getElementById("input_content");
            var button = document.getElementById("yes_button");
            button.addEventListener('click' , ()=>{
                var item_lis = document.querySelectorAll("#content > div:nth-child(1) > div:nth-child(3) > a");
                if (text_input.value != ""){
                    for (let index = 0; index < item_lis.length; index++){
                        let text = item_lis[index].children[1].children[0].textContent.toLocaleLowerCase()
                        let value_text = text_input.value
                        if (text.includes(value_text.toLocaleLowerCase())){
                            item_lis[index].style.display = "none";
                        }
                    }
                }
            })
        },1000)
    })
})();