TikTok Desktop Ad Remover

Removes tiktok ads through fetch intercept

  1. // ==UserScript==
  2. // @name TikTok Desktop Ad Remover
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Removes tiktok ads through fetch intercept
  6. // @author PixelBlob
  7. // @match https://www.tiktok.com/*
  8. // @grant GM_xmlhttpRequest
  9. // @license MIT
  10. // @run-at document-start
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=tiktok.com
  12. // ==/UserScript==
  13. (function() {
  14. 'use strict';
  15. unsafeWindow.originalFetch = unsafeWindow.fetch
  16. unsafeWindow.fetch = async (...args) => {
  17. let response = await unsafeWindow.originalFetch(...args);
  18. if (response.url.includes("item_list")) {
  19. const json = () =>
  20. response
  21. .clone()
  22. .json()
  23. .then((data) => {
  24. var adCount = data.itemList.filter(item=>item.ad_info).length
  25. if (adCount > 0) console.log(`Removed ${adCount} Ads!`)
  26. data.itemList = data.itemList.filter(item=>!item.ad_info)
  27. return ({ ...data })
  28. });
  29. response.json = json;
  30. }
  31. return response;
  32. };
  33. })();

QingJ © 2025

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