阻止弹窗

good

目前为 2025-03-19 提交的版本。查看 最新版本

// ==UserScript==

// @name         阻止弹窗

// @namespace    https://viayoo.com/

// @version      0.1

// @description good

// @author       You

// @run-at       document-start

// @match        https://*/*

// @grant        none

// @license     pp

// ==/UserScript==

// 阻止所有弹窗

(function() {

    // 覆盖window.alert方法

    window.alert = function() {

        console.log("弹窗被阻止: ", arguments);

    };

    // 覆盖window.confirm方法

    window.confirm = function() {

        console.log("确认弹窗被阻止: ", arguments);

        return true; // 默认返回true

    };

    // 覆盖window.prompt方法

    window.prompt = function() {

        console.log("提示弹窗被阻止: ", arguments);

        return null; // 默认返回null

    };

    // 阻止通过window.open打开的弹窗

    window.open = function() {

        console.log("弹窗被阻止: ", arguments);

        return null;

    };

    // 阻止通过addEventListener添加的事件

    document.addEventListener('DOMContentLoaded', function() {

        var elements = document.querySelectorAll('*');

        elements.forEach(function(element) {

            element.onclick = null; // 移除点击事件

            element.onload = null; // 移除加载事件

        });

    });

    console.log("弹窗屏蔽脚本已启用");

})();

QingJ © 2025

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