Floating Menu Bar (GitHub)

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

As of 2016-01-30. See the latest version.

  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.0
  7. // @grant none
  8. // @locale en
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. console.log('begin');
  13. var menu = document.getElementsByClassName('header header-logged-in true');
  14. if (menu.length) {
  15. console.log('menu');
  16. menu[0].style.position = 'fixed';
  17. menu[0].style.z-index = '10000';
  18. menu[0].style.width = '100%';
  19. var content = document.getElementsByClassName('main-content');
  20. if (content.length) {
  21. console.log('content');
  22. menu[0].style.position = 'relative';
  23. menu[0].style.top = '50px';
  24. }
  25. }
  26. })();