Sniffies Ad Block and UI Enhance

Remove ads from map and chat menu, also enhances UI by removing unnecessary stuff

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

// ==UserScript==
// @name         Sniffies Ad Block and UI Enhance
// @namespace    http://tampermonkey.net/
// @version      1.1
// @license MIT
// @description  Remove ads from map and chat menu, also enhances UI by removing unnecessary stuff
// @author       NotApex
// @match        https://sniffies.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function removeElements() {
        document.querySelectorAll('div.overset.ng-tns-c3901889678-8').forEach(element => element.remove());
        document.querySelectorAll('div.overset-container.top-banner.house').forEach(element => element.remove());
        document.querySelectorAll('table.overset-copy-cta').forEach(element => element.remove());
        document.querySelectorAll('div.overset.ng-tns-c3901889678-9').forEach(element => element.remove());
        document.querySelectorAll('tr[data-testid="sniffiesChatRow"]').forEach(element => element.remove());

        document.querySelectorAll('div[class*="list-item-group"][class*="locked"]').forEach(element => {
            const buttons = element.querySelectorAll('button');
            if (buttons.length > 0 && buttons[0].textContent.trim() === 'Upgrade to Unlock') {
                element.remove();
            }
        });

        document.querySelectorAll('div.checkbox[tabindex="0"]').forEach(element => {
            const labelText = element.querySelector('label').textContent.trim();
            if (labelText === 'Information') {
                element.remove();
            }
        });

        document.querySelectorAll('div.lower-map-icon.travel-on-map.ng-tns-c922160418-11').forEach(element => element.remove());
        document.querySelectorAll('p.ng-tns-c3092893849-10').forEach(element => {
            const linkText = element.querySelector('a');
            if (linkText && linkText.getAttribute('data-testid') === 'mapFrameRegisterAccountLink') {
                element.remove();
            }
        });

        document.querySelectorAll('i[data-testid="sniffiesAngleRightButton"]').forEach(element => {
            element.remove();
        });

        document.querySelectorAll('div.nav-inline-icon.context-logo.ng-tns-c67989224-5').forEach(element => {
            element.style.pointerEvents = 'none';
        });

        document.querySelectorAll('button[data-testid="shopIcon"]').forEach(element => {
            element.remove();
        });

        document.querySelectorAll('modal[id="popup"]').forEach(element => {
            element.remove();
        });
    }

    const observer = new MutationObserver(mutationsList => {
        for (let mutation of mutationsList) {
            if (mutation.type === 'childList') {
                removeElements();
            }
        }
    });

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