olx-hide-promoted

hide promoted (paid) listings

// ==UserScript==
// @name         olx-hide-promoted
// @namespace    none
// @version      1.0
// @description  hide promoted (paid) listings
// @match        https://*olx.*/
// @match        https://*.olx.*/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    const KEYWORD = 'ТОП' // change depending on language

    function hideTopAds() {
        document.querySelectorAll('.css-s3yjnp').forEach(topTag => {
            if (topTag.textContent.trim() === KEYWORD) {
                const adContainer = topTag.closest('.css-1r93q13');
                if (adContainer) {
                    adContainer.style.display = 'none';
                }
            }
        });
    }

    // Run once on page load
    hideTopAds();

    // Optional: Keep checking for dynamically loaded ads (e.g., infinite scroll)
    const observer = new MutationObserver(hideTopAds);
    observer.observe(document.body, { childList: true, subtree: true });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址