Dark Scrollbar

9/15/2020, 2:12:55 PM

当前为 2020-09-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Dark Scrollbar
  3. // @namespace Dark Scrollbar
  4. // @match *://*/*
  5. // @grant none
  6. // @version 1.0
  7. // @author JairJy
  8. // @run-at document-start
  9. // @description 9/15/2020, 2:12:55 PM
  10. // ==/UserScript==
  11.  
  12. function addGlobalStyle(css) {
  13. var head, style;
  14. head = document.getElementsByTagName('head')[0];
  15. if (!head) { return; }
  16. style = document.createElement('style');
  17. style.type = 'text/css';
  18. style.innerHTML = css.replace(/;/g, ' !important;');
  19. head.appendChild(style);
  20. }
  21.  
  22. //addGlobalStyle('body { color: white; background-color: black; }');
  23.  
  24. addGlobalStyle('::-webkit-scrollbar { width: 15px; }');
  25.  
  26. addGlobalStyle('::-webkit-scrollbar-track { background: #3B3B3B; }');
  27. addGlobalStyle('::-webkit-scrollbar-thumb { background: #999999; }');
  28.  
  29. addGlobalStyle('::-webkit-scrollbar-thumb:hover { background: #555555; }');