shimo.io

1. 切换左右屏幕的时候左侧的内容导航会遮盖内容,此脚本增加一个button,点击button来开启和关闭这个内容导航 2. 自动关闭首次打开的升级付费弹出页面

  1. // ==UserScript==
  2. // @name shimo.io
  3. // @namespace Violentmonkey Scripts
  4. // @match https://shimo.im/docs/*
  5. // @match https://shimo.im/dashboard/updated
  6. // @grant none
  7. // @version 0.2.2
  8. // @description 1. 切换左右屏幕的时候左侧的内容导航会遮盖内容,此脚本增加一个button,点击button来开启和关闭这个内容导航 2. 自动关闭首次打开的升级付费弹出页面
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. "use strict";
  13. function main(){
  14. dashboard_ad_close();
  15. if (location.href.split("/")[3] == "docs") {
  16. docs_add_togo();
  17. }
  18. }
  19. function dashboard_ad_close(){
  20. setTimeout(function(){
  21. // https://shimo.im/dashboard/updated
  22.  
  23. var dashboard_node = document.querySelector('.sm-modal-close');
  24. if (dashboard_node) {
  25. dashboard_node.click();
  26. }
  27.  
  28. }, 500)
  29. }
  30. function docs_add_togo(){
  31. setTimeout(function () {
  32. // https://shimo.im/docs/*
  33. // 给内容导航栏加上一个id
  34. document.querySelector(".ql-table-of-content").setAttribute("id", "_hidden");
  35.  
  36. function hidden() {
  37. // 根据导航栏当前状态决定是显或隐藏
  38. var el = document.querySelector("#_hidden");
  39. if (el.style.display === 'none') {
  40. el.style.display = '';
  41. } else {
  42. el.style.display = 'none';
  43. }
  44. }
  45. // 创建一个开关元素添加到 编辑栏
  46. var node = document.createElement("span");
  47. node.setAttribute("id", "_togo");
  48. node.setAttribute("class", "ql-formats");
  49. node.innerHTML = "<button type='button'>Togo<button>";
  50. node.onclick = hidden;
  51. var parent_node = document.querySelector(".ql-toolbar-default")
  52. parent_node.insertBefore(node, parent_node.firstElementChild);
  53.  
  54. //
  55. }, 2000);
  56. }
  57. main();
  58. })();

QingJ © 2025

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