屏蔽Bugly的完善账号信息弹窗

屏蔽烦人的Bugly完善账号信息弹窗

// ==UserScript==
// @name            屏蔽Bugly的完善账号信息弹窗
// @namespace       https://github.com/sdokio
// @version         1.0.1
// @author          Tom Lee @[email protected]
// @description     屏蔽烦人的Bugly完善账号信息弹窗
// @license         MIT

// @match           https://bugly.qq.com/*
// @run-at          document-start

// @grant           none
// ==/UserScript==

(function() {
    'use strict';

    const popupClassName = 'ant-modal-root';

    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            mutation.addedNodes.forEach((node) => {
                if (node.nodeType === 1) {
                    if (node.classList.contains(popupClassName)) {
                        node.style.display = 'none';
                        if (node.parentNode) {
                            node.parentNode.remove();
                            console.log('烦人的Bugly弹窗已经移除!!!');
                        }
                    }
                }
            });
        });
    });
    observer.observe(document.body, { childList: true, subtree: true });
})();