FanZone Removed - DAZN

Removes the 'FanZone' sidebar and centers the video player on the screen

// ==UserScript==
// @name         FanZone Removed - DAZN
// @namespace    http://tampermonkey.net/
// @version      4.0
// @description  Removes the 'FanZone' sidebar and centers the video player on the screen
// @author       ChatGPT
// @match        https://www.dazn.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function removeFanZone() {
        const elements = document.querySelectorAll('*');

        elements.forEach(el => {
            if (
                el.textContent?.trim() === 'FanZone' &&
                el.offsetParent !== null // È visibile
            ) {
                let parent = el.closest('aside') || el.closest('div');
                if (parent) {
                    console.log('FanZone rimossa:', parent);
                    parent.style.display = 'none';
                }
            }
        });
    }

    // Osserva continuamente cambiamenti nel DOM
    const observer = new MutationObserver(() => {
        removeFanZone();
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    // Tentativi periodici per sicurezza
    setInterval(removeFanZone, 1500);

    // Prima chiamata
    removeFanZone();
})();