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.

  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/*/files*
  6. // @include https://github.com/*/commit/*
  7. // @include https://github.com/*/blob/*
  8. // @grant none
  9. // @version 1.6.1
  10. // ==/UserScript==
  11.  
  12. elements = document.getElementsByClassName('container');
  13. for (index = 0; index < elements.length; index++)
  14. {
  15. elements[index].style.width="95%"; // Only 95% to leave room for the "add comment" tooltip icon.
  16. }
  17.  
  18. elements = document.getElementsByClassName('repository-content context-loader-container');
  19. for (index = 0; index < elements.length; index++)
  20. {
  21. elements[index].style.width="96%";
  22. }
  23.  
  24. // Remove the restriction that hides file names from view over a certain length, to use the available width of the element.
  25. elements = document.getElementsByClassName('css-truncate css-truncate-target');
  26. for (index = 0; index < elements.length; index++)
  27. {
  28. elements[index].style.maxWidth="100%";
  29. }