Hide Temu "Local" Listings

Hide any .EKDT7a3v container that contains the word "local" on Temu

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Hide Temu "Local" Listings
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Hide any .EKDT7a3v container that contains the word "local" on Temu
// @match        *://*.temu.com/*
// @run-at       document-end
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to check all .EKDT7a3v elements and hide those that include "local"
    function hideLocalElements() {
        document.querySelectorAll('.EKDT7a3v').forEach(container => {
            // Use innerText which sometimes captures more visible text than textContent.
            if (container.innerText && container.innerText.toLowerCase().includes("local")) {
                if (container.style.display !== "none") {
                    container.style.display = "none";
                    console.log("Hiding element:", container);
                }
            }
        });
    }

    // Run the check immediately
    hideLocalElements();

    // Set up a MutationObserver to catch dynamically added content.
    const observer = new MutationObserver((mutationsList, observerInstance) => {
        // Every time there's a change, run the hide function.
        hideLocalElements();
    });
    observer.observe(document.body, { childList: true, subtree: true });

    // Also, run the check every second for 30 seconds as a fallback.
    const intervalId = setInterval(hideLocalElements, 1000);
    setTimeout(() => clearInterval(intervalId), 30000);
})();