by hotwire · 8y ago · 0 comments
I'm clicking it more and more these days - even those damn fixed navs that take up a stupid percentage of the screen give me the shits.
If clicking the bookmarklet doesn't get rid of your stupid modal newsletter sign up or annoying sticky nav, I'm just closing the tab.
Here's the bookmarklet btw:
javascript:(function()%7B(function () %7Bvar i%2C elements %3D document.querySelectorAll('body *')%3Bfor (i %3D 0%3B i < elements.length%3B i%2B%2B) %7Bif (getComputedStyle(elements%5Bi%5D).position %3D%3D%3D 'fixed') %7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)()
Ironically, though, this will probably limit severely the quantity and quality of data I can feed back to this Mozilla project via this add-on...
if this is as awesome as it looks, i'm actually excited.
thank you.
its funny, suddenly i don't even have to think about it, which is what this is all about - reducing cognitive load.
re inclusion on ublock and the like: it should probably be an option that people can enable/disable; ublock is more about blocking ads/trackers, but i would wager that most people are annoyed with sticky stuff too.
ready for the next challenge?.... getting rid of sites that fuck with the default scroll behaviour ;)
thanks again :)
(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
[1] https://alisdair.mcdiarmid.org/kill-sticky-headers/ [].foreach.call(a, b) -> a.forEach(b)
... since the value returned by `querySelectorAll` has a `forEach` method. And 5 more if you replace: 'body *' -> '*'thanks.
It even works well on iOS/Safari !