githubwidth

resizes github repos for smaller window widths.

  1. // ==UserScript==
  2. // @name githubwidth
  3. // @version 0.3
  4. // @description resizes github repos for smaller window widths.
  5. // @match http://github.com/*
  6. // @match https://github.com/*
  7. // @match http://*.github.com/*
  8. // @match https://*.github.com/*
  9. // @namespace https://gf.qytechs.cn/users/217495-eric-toombs
  10. // @run-at document-idle
  11. // @require https://code.jquery.com/jquery-latest.min.js
  12. // ==/UserScript==
  13.  
  14. $("nav.mt-0").map(function(i, node) {
  15. node.hidden = true;
  16. });
  17. $(".Header-link").map(function(i, node) {
  18. for (l of ["https://github.com/marketplace",
  19. "https://github.com/explore"]) {
  20. if (node.href === l) {
  21. node.hidden = true;
  22. }
  23. }
  24. });
  25.  
  26. $("table.files").map(function(n, t) {
  27. t.style.tableLayout = "fixed";
  28. // table>thead>tr>th
  29. ths = t.children[0].children[0].children;
  30. ths[0].style.width = "32px"; // icon
  31. ths[1].style.width = "192px"; // filename
  32. ths[3].style.width = "128px"; // mtime
  33. });
  34.  
  35. for (t of [".min-width-lg", ".header-search", "body"]) {
  36. $(t).map(function(i, node) {
  37. node.style.minWidth = "0";
  38. });
  39. }

QingJ © 2025

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