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:
parent
467b1b818c
commit
728e07e816
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue