Greasy Fork

Greasy Fork is available in English.

禁用搜索框

根除 *所有* 搜索框!

目前为 2023-05-22 提交的版本。查看 最新版本

// ==UserScript==
// @name:en      No Search Boxes
// @name         禁用搜索框
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description:en Eradicate *ALL* search boxes!
// @description  根除 *所有* 搜索框!
// @author       PRO
// @match        *://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @run-at       document-start
// @license      gpl-3.0
// ==/UserScript==

(function() {
    'use strict';
    let oldadd = EventTarget.prototype.addEventListener;
    ["selectionchange", "mouseup"].forEach((type) => {
        document.addEventListener(type, (e) => {
            e.stopImmediatePropagation();
        }, {capture: true});
        console.log(`[No Search Boxes] Blocked "${type}" listeners.`);
    });
})();