Update Hide sticky elements to 1.1.1

- Fix position: absolute elements not being hidden (example:
https://popular.info/p/florida-school-district-orders-librarians)
This commit is contained in:
blankie 2023-09-28 20:11:27 +10:00
parent 467b1b818c
commit 728e07e816
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@
// @grant GM_registerMenuCommand // @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand // @grant GM_unregisterMenuCommand
// @grant GM_addStyle // @grant GM_addStyle
// @version 1.1.0 // @version 1.1.1
// @author blankie // @author blankie
// @description Adds a button to the monkey menu to hide sticky elements // @description Adds a button to the monkey menu to hide sticky elements
// @inject-into content // @inject-into content
@ -36,7 +36,7 @@ function handleOneNode(node, removed = false) {
} }
let computedStyle = getComputedStyle(node); let computedStyle = getComputedStyle(node);
let isSticky = computedStyle.position === "sticky" || computedStyle.position === "fixed"; let isSticky = /^(sticky|fixed|absolute)$/.test(computedStyle.position);
if (!stickyElements.has(node) && isSticky && !removed) { if (!stickyElements.has(node) && isSticky && !removed) {
node.classList.add("hseSticky"); node.classList.add("hseSticky");
stickyElements.add(node); stickyElements.add(node);