Remove Pandabuy Risk Reminder

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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 });
})();