Greasy Fork

Greasy Fork is available in English.

Hide Prefix Content on TikTok Ads

该脚本用于隐藏 TikTok Ads 页面上的 .prefix-content 元素

目前为 2024-10-26 提交的版本,查看 最新版本

// ==UserScript==
// @name         Hide Prefix Content on TikTok Ads
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  该脚本用于隐藏 TikTok Ads 页面上的 .prefix-content 元素
// @author       handsomeboy
// @match        https://ads.tiktok.com/i18n/*
// @grant        GM_addStyle
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==

(function() {
    'use strict';


    const observer = new MutationObserver((mutations, observer) => {
        // 检查是否存在 .prefix-content 元素
        if (document.querySelector('.prefix-content')) {
            console.log("yes");
            
            document.querySelectorAll('.prefix-content').forEach(element => {
                element.style.display = 'none';
            });
            
     
        }
    });

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