Greasy Fork

Greasy Fork is available in English.

移除搜索关键词

去你妈的傻逼高亮搜索关键词。

当前为 2023-08-07 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         No Keywords
// @name:zh-CN   移除搜索关键词
// @namespace    http://tampermonkey.net/
// @version      0.2.1
// @description  Get rid of fucking highlighted search keywords.
// @description:zh-CN 去你妈的傻逼高亮搜索关键词。
// @author       PRO
// @match        https://zhidao.baidu.com/question/*
// @match        https://www.bilibili.com/*
// @match        https://blog.csdn.net/*
// @icon         https://cors.cdn.bcebos.com/amis/namespaces/m-activity/iknow-duck/2022-12/1671625780490/%E6%90%9C%E7%B4%A2wap.png
// @grant        none
// @license      gpl-3.0
// ==/UserScript==

(function() {
    'use strict';
    function fuck(kw) { // `kw` is the element to be fixed
        let txt = kw.textContent;
        let tn = document.createTextNode(txt);
        kw.parentElement.replaceChild(tn, kw);
    }
    function purify() {
        document.querySelectorAll(sel_keyword).forEach(fuck);
        if (sel_icon) {
            let icons = document.querySelectorAll(sel_icon);
            icons.forEach(icon => icon.remove());
        }
    }
    let config = {
        "zhidao.baidu.com": {
            keyword: ".rich-content-container a[highlight='true']",
            icon: null,
            persistent: false
        },
        "www.bilibili.com": {
            keyword: "a.search-word",
            icon: "i.search-word",
            persistent: true
        },
        "blog.csdn.net": {
            keyword: "a.hl-1",
            icon: null,
            persistent: false
        }
    }
    if (!(window.location.hostname in config)) return;
    let cfg = config[window.location.hostname];
    let sel_keyword = cfg.keyword;
    let sel_icon = cfg.icon;
    if (cfg.persistent) {
        window.setInterval(purify, 1000);
    } else {
        purify();
    }
})();