Un-sticky toolbars and kill fixed elements bookmarklet, and possibly re-enable scrolling of the page
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); | |
} | |
}); |
This comment has been minimized.
This comment has been minimized.
What would I do without you, @jlowgren? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.