Remove Hoobuy Overlays

Removes the risk warning and additional overlays from hoobuy.com

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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