Remove Pandabuy Risk Reminder

Removes the Pandabuy risk reminder pop-up and overlay, restores scrolling

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Remove Pandabuy Risk Reminder 
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Removes the Pandabuy risk reminder pop-up and overlay, restores scrolling
// @author       nawid 
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove the risk reminder pop-up and overlay
    function removeElements() {
        // Select the pop-up element using its class
        var riskReminder = document.querySelector('.el-dialog__wrapper');
        if (riskReminder) {
            // Remove the pop-up element from the DOM
            riskReminder.parentNode.removeChild(riskReminder);
        }

        // Select the overlay element using its class
        var overlay = document.querySelector('.v-modal');
        if (overlay) {
            // Remove the overlay element from the DOM
            overlay.parentNode.removeChild(overlay);
        }

        // Restore scrolling on the body
        document.body.style.overflow = 'auto';
        document.documentElement.style.overflow = 'auto';
    }

    // Run the function to remove the pop-up and overlay
    removeElements();

    // Also, monitor for new pop-ups and overlays and remove them
    var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if (mutation.addedNodes.length) {
                removeElements();
            }
        });
    });

    // Configure the observer to watch for changes in the body element
    observer.observe(document.body, { childList: true, subtree: true });
})();