sniffies ad block

Remove ads from map and chat menu

当前为 2024-04-29 提交的版本,查看 最新版本

// ==UserScript==
// @name         sniffies ad block
// @namespace    http://tampermonkey.net/
// @version      1.0
// @license MIT
// @description  Remove ads from map and chat menu
// @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());
    }

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

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