屏蔽腾讯元宝下载元素

屏蔽腾讯元宝网站上的下载软件元素

  1. // ==UserScript==
  2. // @name 屏蔽腾讯元宝下载元素
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 屏蔽腾讯元宝网站上的下载软件元素
  6. // @author Jerry_Chiang
  7. // @match https://yuanbao.tencent.com/*
  8. // @grant GM_addStyle
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 使用 CSS 隐藏元素
  16. GM_addStyle(`
  17. #app > div > div.yb-layout__content.agent-layout__content > div > div > div.agent-dialogue__content > div > div.agent-dialogue__tool,
  18. #hunyuan-bot > div:nth-child(4) > div > div > div.t-drawer__footer > div > div.index_pc_download__IjaBf {
  19. display: none !important;
  20. }
  21. `);
  22.  
  23. function hideElement(selector) {
  24. const element = document.querySelector(selector);
  25. if (element) {
  26. element.style.display = 'none';
  27. }
  28. }
  29.  
  30. // 在 DOMContentLoaded 事件触发后立即隐藏元素
  31. document.addEventListener('DOMContentLoaded', () => {
  32. hideElement('#app > div > div.yb-layout__content.agent-layout__content > div > div > div.agent-dialogue__content > div > div.agent-dialogue__tool');
  33. hideElement('#hunyuan-bot > div:nth-child(4) > div > div > div.t-drawer__footer > div > div.index_pc_download__IjaBf');
  34. });
  35.  
  36. // 定期检查并屏蔽,以应对动态加载的元素
  37. setInterval(() => {
  38. hideElement('#app > div > div.yb-layout__content.agent-layout__content > div > div > div.agent-dialogue__content > div > div.agent-dialogue__tool');
  39. hideElement('#hunyuan-bot > div:nth-child(4) > div > div > div.t-drawer__footer > div > div.index_pc_download__IjaBf');
  40. }, 1000); // 每秒检查一次
  41. })();

QingJ © 2025

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