4 ms·
Came across this as well [0]→[1]. (Slightly modernized version could be:) javascript:void([].forEach.call(document.querySelectorAll('body *'),e=>/fixed|st
by myfonj 9y ago
Came across this as well [0]→[1].
(Slightly modernized version could be:)
javascript:void([].forEach.call(document.querySelectorAll('body *'),e=>/fixed|sticky/.test(getComputedStyle(e).position)&&e.parentNode.removeChild(e)))
[0] https://news.ycombinator.com/item?id=16516126 https://news.ycombinator.com/item?id=16516126
[1] https://alisdair.mcdiarmid.org/kill-sticky-headers/ https://alisdair.mcdiarmid.org/kill-sticky-headers/
- strkek 9y agoYou can golf away 8 characters by replacing [].foreach.call(a, b) -> a.forEach(b) ... since the value returned by `querySelectorAll` has a `forEach` method. And 5 more if you replace: 'body *' -> '*'
- myfonj 9y agoAh, thanks for headsup, I somewhat missed the moment NodeList got sufficiently widespread forEach support. Good to know. In fact my intention was just to add check for `sticky` value along the `fixed` one; the 'golfing' approach was just habitual laziness…
- hotwire 9y agothat one looks better than the one i pasted - i've noticed that some sites are using "sticky" instead of "fixed" and my bookmarklet (which I copied off someone else) doesn't remove them. thanks.