Hide Prefix Content on TikTok Ads

TikTok Ads

  1. // ==UserScript==
  2. // @name Hide Prefix Content on TikTok Ads
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.81
  5. // @description TikTok Ads
  6. // @author handsomeboy
  7. // @match https://ads.tiktok.com/i18n/*
  8. // @grant GM_addStyle
  9. // @require https://code.jquery.com/jquery-3.6.0.min.js
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let timerExists = false;
  16.  
  17. const observer = new MutationObserver(() => {
  18. document.querySelectorAll('.prefix-content').forEach(element => {
  19. element.style.display = 'none';
  20. console.log("元素已隐藏");
  21. });
  22.  
  23. if (timerExists) {
  24. console.log("已有定时器已清除");
  25. clearTimeout(timeoutId);
  26. }
  27.  
  28. timerExists = true;
  29. timeoutId = setTimeout(() => {
  30. observer.disconnect();
  31. console.log("观察已停止");
  32. timerExists = false;
  33. }, 5000);
  34. });
  35.  
  36.  
  37. observer.observe(document.body, {
  38. childList: true,
  39. subtree: true
  40. });
  41. })();

QingJ © 2025

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