Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
This file contains 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
const elements = document.querySelectorAll('body *'); | |
const containers = document.querySelectorAll('html, body'); | |
containers.forEach(el => { | |
if (getComputedStyle(el).overflow === 'hidden') { | |
el.style.setProperty ('overflow', 'unset', 'important'); | |
} | |
}); | |
elements.forEach(function (element) { | |
if (["-webkit-sticky", "sticky"].includes(getComputedStyle(element).position)) { | |
element.style.position = "unset"; | |
} | |
else if(["fixed"].includes(getComputedStyle(element).position)) { | |
element.parentNode.removeChild(element); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment