FastGitCode

fast show git ccode!

  1. // ==UserScript==
  2. // @name FastGitCode
  3. // @namespace https://github.com/holleworldabc/browser-tools
  4. // @version 1.0.4
  5. // @description fast show git ccode!
  6. // @author wm
  7. // @match https://github.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. const version = '1.0';
  13. const updateDate = '20200311';
  14. //-------------------------------------------
  15. const fileNav = document.getElementsByClassName('file-navigation')[0];
  16. const btn = document.createElement("span");
  17. btn.className = "btn btn-sm btn-blue";
  18. btn.innerText = "Source Graph";
  19. btn.style.marginLeft = '8px';
  20. btn.onclick = function () {
  21. const url = window.location.href;
  22. const sourceGraph = 'https://sourcegraph.com/'
  23. const last = url.split('://')[1];
  24. window.open(sourceGraph + last);
  25. }
  26. fileNav.appendChild(btn);
  27. //------------------------------------
  28. console.log("load FastGitCode ok!");
  29. console.log("version:" + version);
  30. console.log("lastUpdateDate:" + updateDate);
  31. })()