Remove Hoobuy Overlays

Removes the risk warning and additional overlays from hoobuy.com

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Remove Hoobuy Overlays
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Removes the risk warning and additional overlays from hoobuy.com
// @author       Nawid Wafa
// @match        *://*.hoobuy.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove the overlays
    function removeOverlays() {
        const riskOverlay = document.querySelector('div.risk-warning-wrapper.hoobuy-dialog-wrapper');
        const additionalOverlay = document.querySelector('div.el-overlay[style*="z-index: 2004;"]');
        
        if (riskOverlay) {
            riskOverlay.remove();
        }

        if (additionalOverlay) {
            additionalOverlay.remove();
        }
    }

    // Remove the overlays once the DOM is fully loaded
    document.addEventListener('DOMContentLoaded', removeOverlays);

    // Also try to remove the overlays every 500ms in case they load after DOMContentLoaded
    const intervalId = setInterval(removeOverlays, 500);

    // Stop trying to remove the overlays after 10 seconds
    setTimeout(() => clearInterval(intervalId), 10000);
})();