Github1s

One second to read GitHub code with VS Code.

  1. // ==UserScript==
  2. // @name Github1s
  3. // @namespace https://github.com/JackieZheng/Github1s
  4. // @version 0.5
  5. // @description One second to read GitHub code with VS Code.
  6. // @author JackieZheng
  7. // @match https://github.com/*/*
  8. // @supportURL https://github.com/JackieZheng/Github1s/issues
  9. // @icon https://github1s.com/favicon.ico
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. GM_addStyle("anchored-position{display: none !important}}");
  14. GM_addStyle("anchored-position[class$=popover-open] {display: block !important}}");
  15.  
  16. (function() {
  17. 'use strict';
  18. var github1sBtn = document.createElement("li");
  19. github1sBtn.innerHTML ='Github1s';
  20. github1sBtn.className='open-on-sourcegraph btn btn-sm tooltipped tooltipped-s';
  21. github1sBtn.style.color='var(--color-btn-primary-text)';
  22. github1sBtn.style.backgroundColor='var(--color-btn-primary-bg)';
  23. var li=document.getElementsByClassName('pagehead-actions flex-shrink-0 d-none d-md-inline').item(0)?.getElementsByTagName('li')[0]
  24. document.getElementsByClassName('pagehead-actions flex-shrink-0 d-none d-md-inline').item(0)?.insertBefore(github1sBtn,li)
  25. github1sBtn.onclick=function()
  26. {
  27. var href=top.location.href.replace('github.com','github1s.com')
  28. top.location.href=href;
  29. }
  30. })();

QingJ © 2025

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