I find elements on a web page that have been positioned fixed to be in my way frequently. I'd like to find a way to disable position: fixed
CSS rules in any web site that I visit.
I wrote a userscript (Firefox, Greasemonkey) that scans every node in the document and figures out if it has a computed style position fixed, then overrides that to be static.
Is there a better way to accomplish my goal?
This is the script I wrote, I've narrowed it to just divs for now:
Array.forEach(
document.querySelectorAll("div")
,function(el) {
if (window.getComputedStyle(el).position === 'fixed') {
el.style.position = 'static';
}
}
);