qinzhanqiang / fuck学城cmd+f劫持

// ==UserScript==
// @name         fuck学城cmd+f劫持
// @namespace    http://tampermonkey.net/
// @version      2024-04-12
// @description  try to take over the world!
// @author       You
// @match        https://km.sankuai.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=sankuai.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    console.log("fuck学城cmd+f劫持 start...")

    const originalAddEventListener = EventTarget.prototype.addEventListener;
    EventTarget.prototype.addEventListener = function(type, listener, options) {
        if (type === 'keydown') {
            if (listener.toString().includes("docSearchReplace.updateSearchModalVisible")) {
                console.log("fuck学城cmd+f劫持,match劫持函数(docSearchReplace.updateSearchModalVisible),remove...")
                return;
            }
            if (listener.toString().includes("preventDefault")) {
                console.log("fuck学城cmd+f劫持,match劫持函数(preventDefault),remove...")
                return;
            }
        }
        return originalAddEventListener.call(this, type, listener, options);
    };

    console.log("fuck学城cmd+f劫持 end...")
})();