Make GitHub Pull Request, Commit, and Blob pages full width

Makes the GitHub Pull Request, Commit, and Blob pages span the full width of the browser, rather than maxing out at the default ~900 pixels.

Verze ze dne 10. 01. 2020. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Make GitHub Pull Request, Commit, and Blob pages full width
  3. // @namespace https://bitbucket.org/deadlydog/greasemonkeyscripts
  4. // @description Makes the GitHub Pull Request, Commit, and Blob pages span the full width of the browser, rather than maxing out at the default ~900 pixels.
  5. // @include https://github.com/*/pull/*
  6. // @include https://github.com/*/commit/*
  7. // @include https://github.com/*/blob/*
  8. // @grant none
  9. // @version 1.1.0
  10. // ==/UserScript==
  11.  
  12. function large() {
  13. elements = document.getElementsByClassName('container-lg');
  14. for (index = 0; index < elements.length; index++)
  15. {
  16. elements[index].style.maxWidth="95%"; // Only 95% to leave room for the "add comment" tooltip icon.
  17. }
  18. }
  19. large();
  20.  
  21. var observer = new MutationObserver(large);
  22.  
  23. observer.observe(document.body, {
  24. childList: true
  25. });