Remove scrollbar-color for Notion

Remove scrollbar-color from Notion pages,ths Chatgpt.

当前为 2024-09-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Remove scrollbar-color for Notion
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Remove scrollbar-color from Notion pages,ths Chatgpt.
  6. // @author Jw
  7. // @match https://www.notion.so/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 遍历所有的样式表
  16. for (let i = 0; i < document.styleSheets.length; i++) {
  17. const styleSheet = document.styleSheets[i];
  18.  
  19. try {
  20. const rules = styleSheet.cssRules || styleSheet.rules;
  21. if (!rules) continue;
  22.  
  23. // 遍历每条样式规则
  24. for (let j = 0; j < rules.length; j++) {
  25. const rule = rules[j];
  26.  
  27. if (rule.style && rule.style.scrollbarColor) {
  28. rule.style.scrollbarColor = ""; // 移除 scrollbar-color
  29. }
  30. }
  31. } catch (e) {
  32. console.log('Error accessing stylesheet:', e);
  33. }
  34. }
  35. })();