Sniffies Ultimate Ad & Layout Fixer

Completely removes the left ad sidebar and stretches the interactive map to 100% width.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

// ==UserScript==
// @name         Sniffies Ultimate Ad & Layout Fixer
// @namespace    http://tampermonkey.net
// @version      1.3
// @license MIT 
// @description  Completely removes the left ad sidebar and stretches the interactive map to 100% width.
// @author       dadoodler
// @match        https://*://*
// @match        https://sniffies.com*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Inject global CSS overrides to force layout expansion and hide ads
    const style = document.createElement('style');
    style.innerHTML = `
        /* 1. Eliminate the left ad container and its wrapper completely */
        div[class*="Promo"],
        div[class*="Card"] a[href*="plus"],
        aside:has(a[href*="plus"]),
        div:has(> a[href*="plus"]) {
            display: none !important;
            width: 0px !important;
            max-width: 0px !important;
        }

        /* 2. Fix the main layout wrapper (often a flex container or grid pushing the map) */
        main,
        div[id="root"] > div,
        div[class*="Layout"],
        div[class*="AppContainer"] {
            display: block !important;
            padding-left: 0 !important;
            margin-left: 0 !important;
        }

        /* 3. Force the Mapbox/Leaflet canvas container to span from the exact left edge */
        #map,
        .map-container,
        div[class*="MapWrapper"],
        div[class*="MapContainer"],
        .mapboxgl-map,
        .mapboxgl-canvas {
            position: absolute !important;
            left: 0px !important;
            top: 0px !important;
            width: 100vw !important;
            height: 100vh !important;
            margin: 0 !important;
            padding: 0 !important;
        }
    `;
    document.head.appendChild(style);

    // Continuous element cleaner and map window resizing trigger
    const cleanAndResize = () => {
        let itemsRemoved = false;

        // Find elements containing the "plus" promo text or link destination
        const elements = document.querySelectorAll('a[href*="/plus"], div[class*="Promo"]');
        elements.forEach(el => {
            // Find the highest independent parent box that isn't the whole page
            const container = el.closest('aside') || el.closest('div[class*="Container"]') || el;
            if (container && container.getBoundingClientRect().left < 150) {
                container.remove();
                itemsRemoved = true;
            }
        });

        // Trigger a simulated window resize so the map script expands its tile boundaries
        if (itemsRemoved || document.querySelector('.mapboxgl-map')) {
            window.dispatchEvent(new Event('resize'));
        }
    };

    // Run heavily during initial page construction
    const observer = new MutationObserver(cleanAndResize);
    observer.observe(document.documentElement, { childList: true, subtree: true });

    // Periodic insurance backup loop to handle late map tile loading cycles
    setInterval(cleanAndResize, 1000);
})();