Created
May 17, 2024 06:42
-
-
Save kymokleo/5b9aaccd987adac9e761b60a6c2f1a75 to your computer and use it in GitHub Desktop.
Run as a bookmarklet to remove annoying sticky elements on webpages, such as cookie notifications and floating widgets.
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 killStickyElements = () => { | |
document.querySelectorAll("body *").forEach(function (node) { | |
if (["fixed", "sticky"].includes(getComputedStyle(node).position)) { | |
node.parentNode.removeChild(node); | |
} | |
}); | |
document.querySelectorAll("html *").forEach(function (node) { | |
var s = getComputedStyle(node); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment