Last active
August 29, 2015 14:15
-
-
Save vbuaraujo/f137ac13fb011e0bd900 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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