Floating Menu Bar (GitHub)

Makes the menu bar in GitHub stay at the top of the page when scrolling

  1. // ==UserScript==
  2. // @name Floating Menu Bar (GitHub)
  3. // @namespace chriskim06
  4. // @description Makes the menu bar in GitHub stay at the top of the page when scrolling
  5. // @include https://github.com/*/*
  6. // @version 1.0.6
  7. // @grant none
  8. // @locale en
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. var content = document.querySelector('div.header.header-logged-in.true');
  13. if (content !== null) {
  14. content.style.position = 'fixed';
  15. content.style.zIndex = '10000';
  16. content.style.width = '100%';
  17. content = document.querySelector('#js-flash-container');
  18. if (content !== null) {
  19. content.style.position = 'relative';
  20. content.style.top = '50px';
  21. }
  22. content = document.querySelector('div[role="main"]');
  23. if (content !== null) {
  24. content.style.position = 'relative';
  25. content.style.top = '50px';
  26. }
  27. content = document.querySelector('div.container.site-footer-container');
  28. if (content !== null) {
  29. content.style.position = 'relative';
  30. content.style.top = '50px';
  31. }
  32. }
  33. })();