bots 隐藏左侧边栏

Automatically collapse the sidebar on page load

  1. // ==UserScript==
  2. // @name bots 隐藏左侧边栏
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Automatically collapse the sidebar on page load
  6. // @match https://www.coze.com/store/bot/*
  7. // @grant none
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // 等待侧边栏元素加载
  15. const observer = new MutationObserver(function(mutations, me) {
  16. const sidebar = document.querySelector('.nXcwv8nm1GoEIrwhPbSP');
  17. if (sidebar) {
  18. // 改变侧边栏的样式
  19. sidebar.style.width = '0';
  20. sidebar.style.overflow = 'hidden';
  21. sidebar.style.padding = '0';
  22. sidebar.style.transition = 'width 0.3s ease';
  23.  
  24. // 停止观察
  25. me.disconnect();
  26. return;
  27. }
  28. });
  29.  
  30. // 开始观察文档
  31. observer.observe(document, {
  32. childList: true,
  33. subtree: true
  34. });
  35. })();

QingJ © 2025

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