优化 deepseek.com 界面

隐藏 deepseek.com 的水印,点击脚本菜单控制左侧边栏的显示与隐藏

目前為 2024-05-24 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Optimize the deepseek.com interface
  3. // @name:en Optimize the deepseek.com interface
  4. // @name:zh-CN 优化 deepseek.com 界面
  5. // @name:zh-TW 优化 deepseek.com 界面
  6. // @namespace deepseek.com
  7. // @version 0.2.0
  8. // @description Hide deepseek.com Watermark, click menu controls the display and hiding of the left sidebar
  9. // @description:en Hide deepseek.com Watermark, click menu controls the display and hiding of the left sidebar
  10. // @description:zh-CN 隐藏 deepseek.com 的水印,点击脚本菜单控制左侧边栏的显示与隐藏
  11. // @description:zh-TW 隐藏 deepseek.com 的水印,点击脚本菜单控制左侧边栏的显示与隐藏
  12. // @author xxnuo
  13. // @match https://chat.deepseek.com/*
  14. // @grant GM_registerMenuCommand
  15. // @license MIT
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20.  
  21. // 隐藏侧边栏函数
  22. function hideSidebar() {
  23. var sidebar = document.querySelector('#root > div:first-child > div:first-child');
  24. if (sidebar) {
  25. sidebar.style.display = 'none';
  26. }
  27. }
  28.  
  29. // 显示侧边栏函数
  30. function showSidebar() {
  31. var sidebar = document.querySelector('#root > div:first-child > div:first-child');
  32. if (sidebar) {
  33. sidebar.style.display = 'block';
  34. }
  35. }
  36.  
  37. // 注册隐藏侧边栏的菜单项
  38. GM_registerMenuCommand('Hide Sidebar', hideSidebar, 'H');
  39.  
  40. // 注册显示侧边栏的菜单项
  41. GM_registerMenuCommand('Show Sidebar', showSidebar, 'S');
  42.  
  43. // 等待DOM加载完成
  44. window.addEventListener('load', function() {
  45. // 获取所有具有指定类名的元素
  46. var elements = document.querySelectorAll('.ds-watermark.ds-watermark--fullscreen');
  47.  
  48. // 遍历元素并隐藏它们
  49. for (var i = 0; i < elements.length; i++) {
  50. elements[i].style.display = 'none';
  51. }
  52. });
  53. })();