通用事件监听阻止

阻止你想要阻止的事件监听

// ==UserScript==
// @name         通用事件监听阻止
// @namespace    http://tampermonkey.net/
// @version      2024-02-05
// @description  阻止你想要阻止的事件监听
// @author       hatrd
// @match        http://*/*
// @match        https://*/*
// @run-at       document-start
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    let oldadd=EventTarget.prototype.addEventListener
    EventTarget.prototype.addEventListener=function (...args){
        if(window.onblur!==null){
            window.onblur=null;
        }
        if(args.length!==0 && ['copy', ].includes(args[0])){
            console.log('[+] 阻止 ' + args[0] + ' 监听成功!')
            return;
        }
        return oldadd.call(this,...args)
    }
    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址