Remove Hoobuy Overlays

Removes the risk warning and additional overlays from hoobuy.com

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
})();