Audiomack bar remover

Removes the annoying bar above the player in audiomack

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Audiomack bar remover 
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Removes the annoying bar above the player in audiomack
// @author       Grok
// @match        https://audiomack.com/*/*
// @grant        none
// @run-at       document-start
// @license MIT 
// ==/UserScript==

(function() {
    'use strict';

    const selector = '.bottom-ad-integrated_Container__ht1uQ';

    // Functie om het element te verwijderen
    function removeAd() {
        const ad = document.querySelector(selector);
        if (ad) {
            ad.remove();
            console.log('Advertentie verwijderd:', selector);
        }
    }

    // Verwijder bij laden
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', removeAd);
    } else {
        removeAd();
    }

    // Blijf kijken naar dynamisch toegevoegde elementen
    const observer = new MutationObserver((mutations) => {
        let shouldRemove = false;
        mutations.forEach(mutation => {
            if (mutation.addedNodes.length) shouldRemove = true;
        });
        if (shouldRemove) removeAd();
    });

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

    // Optioneel: forceer elke 500ms (voor extreem trage ads)
    setInterval(removeAd, 500);
})();