Skip to content

Instantly share code, notes, and snippets.

@paulbaumgart
Created January 28, 2011 00:16
Show Gist options
  • Save paulbaumgart/799582 to your computer and use it in GitHub Desktop.
Save paulbaumgart/799582 to your computer and use it in GitHub Desktop.
(function() {
// ==UserScript==
// @name Google Code Search Improver
//
// @include http://google.com/codesearch/*
// @include http://www.google.com/codesearch/*
// @include https://google.com/codesearch/*
// @include https://www.google.com/codesearch/*
//
// ==/UserScript==
var top_bar = document.getElementsByClassName("GOYGFLXBJQ")[0],
content_div = top_bar.parentNode.nextSibling;
var toggle_top_bar = function(evt) {
if (evt.keyCode === 85) {
top_bar.style.display = (top_bar.style.display === "none" ? "" : "none");
content_div.style.top = (content_div.style.top === "0px" ? "85px" : "0px");
}
};
document.body.addEventListener("keydown", toggle_top_bar, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment