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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           Make GitHub Pull Request, Commit, and Blob pages full width
// @namespace      https://bitbucket.org/deadlydog/greasemonkeyscripts
// @description    Makes the GitHub Pull Request, Commit, and Blob pages span the full width of the browser, rather than maxing out at the default.
// @include        https://github.com/*/pull/*
// @include        https://github.com/*/commit/*
// @include        https://github.com/*/blob/*
// @grant          none
// @version        1.2.0
// ==/UserScript==

function large() {
    elements = document.getElementsByClassName('container-lg');
    for (index = 0; index < elements.length; index++)
    {
    	elements[index].style.maxWidth="95%";	// Only 95% to leave room for the "add comment" tooltip icon.
    }

    elements = document.getElementsByClassName('container-xl');
    for (index = 0; index < elements.length; index++)
    {
    	elements[index].style.maxWidth="95%";	// Only 95% to leave room for the "add comment" tooltip icon.
    }
}
large();

var observer = new MutationObserver(large);

observer.observe(document.body, {
  childList: true
});