Tag Archives: greasemonkey

Fixing Github with Greasemonkey

Github is great, I really can’t say enough good things about them.  What’s not so great is their css, as it breaks badly if you change you dpi.  I finally found the root cause of this which is the search field gets squeezed vertically, and collides with the div under it, forcing that to the right, and forcing the right sidebar down.  I sent in some feedback, but am not sure if/when it might get applied.

So, in the short term I added the following greasemonkey script for github.com

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName(‘head’)[0];
    if (!head) { return; }
    style = document.createElement(‘style’);
    style.type = ‘text/css’;
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle(‘#header .topsearch {width: 25em}’);

And voila, the site is readable again.