Skip to content

Instantly share code, notes, and snippets.

@vbuaraujo
Last active August 29, 2015 14:15
Show Gist options
  • Save vbuaraujo/f137ac13fb011e0bd900 to your computer and use it in GitHub Desktop.
Save vbuaraujo/f137ac13fb011e0bd900 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name unfix-all-the-toolbars
// @namespace http://inf.ufrgs.br/~vbuaraujo/
// @include *
// @version 1
// @grant none
// ==/UserScript==
// Based on https://stackoverflow.com/questions/13696100/greasemonkey-script-to-make-fixed-positioned-elements-static
function unfixAll(){
Array.forEach(
document.querySelectorAll("h1, h2, ul, ol, li, div, nav"),
function (el) {
console.log("unfixAllTheToolbars: visited one");
if (window.getComputedStyle(el).position === "fixed") {
el.style.position = "absolute";
console.log("unfixAllTheTollbars: replaced one")
}
});
}
window.addEventListener("load", unfixAll);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment