Skip to content

Instantly share code, notes, and snippets.

@jhackett1
Last active April 7, 2019 09:45
Show Gist options
  • Save jhackett1/19bbf6abdac1c8cf65d19448c676a2c0 to your computer and use it in GitHub Desktop.
Save jhackett1/19bbf6abdac1c8cf65d19448c676a2c0 to your computer and use it in GitHub Desktop.
Hide popups and make the page scrollable again
var elements = document.querySelectorAll('body *')
for (i = 0; i < elements.length; i++) {
if (getComputedStyle(elements[i]).position === 'fixed') elements[i].parentNode.removeChild(elements[i])
}
document.querySelector('body').setAttribute('style', 'overflow-y:scroll !important');
document.querySelector('html').setAttribute('style', 'overflow-y:scroll !important');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment