Live data from Hacker News

A bookmarklet to kill sticky headers (2013)

alisdair.mcdiarmid.org

81–90 of 91 posts

Re: A bookmarklet to kill sticky headers (2013)

#81

Is there a way to get this working on Firefox Android? The bluesky sticky header is annoying, and I haven't seen a way to just switch it off. EDIT: solved: drag kill sticky to bookmarks on desktop browser, then access bookmark from sync'd Firefox on Android.

There's another way! Instructions: https://paul.kinlan.me/use-bookmarklets-on-chrome-on-android... Summary:

  1. bookmark any page
  2. change the url to your code
  3. give it a title like !script
  4. to activate, tap the address bar and type !script
Works on Android Chrome and Firefox, and probably other browsers too. More people ought to know about mobile bookmarklets.

Re: A bookmarklet to kill sticky headers (2013)

#82

Love it! Since it's now 2025, we probably should search for "fixed" & "sticky" Here's a minified version with "sticky" added: javascript:(()=>[...document.querySelectorAll('body *')].map(el=>["fixed","sticky"].includes(getComputedStyle(el).position)&&el.remove()))();

even more minified. forEach doesn't return anything, so you don't need the IIFE.

  javascript:document.querySelectorAll('body *').forEach(el=>['fixed','sticky'].includes(getComputedStyle(el).position)&&el.remove())
or

  javascript:document.querySelectorAll('body *').forEach(el=>/^(fixed|sticky)$/.test(getComputedStyle(el).position)&&el.remove())

Re: A bookmarklet to kill sticky headers (2013)

#83

I've been using the Kill-Sticky Chrome extension for years: https://chromewebstore.google.com/detail/kill-sticky/lekjlgf... Because it has a configurable keyboard shortcut. Can't imagine browsing the web without it. At this point hitting Cmd+K when I visit an article is pure reflex. A bookmarklet would be more secure, but I don't know of a way to assign keyboard shortcuts to one.

> more secure

interesting. that extension's Support section has a link to https://github.com/eemeli/chrome-kill-sticky whose license is MIT, so you could make your own extension. That repo also has a newer version of the code, and that was deployed on the Firefox store, but not on the Chrome store.

Re: A bookmarklet to kill sticky headers (2013)

#84
post #24

These things are so annoying. Is there a website benchmark not for speed, not for security but for "annoyingness"? I guess there is some overlap with accessibility, but that's not exactly what I'm thinking of. I asked Copilot and searched Google but couldn't really come up with anything.

It is the inverse of what engagement is supposed to be measuring, but it turns out that optimizing for engagement takes you down a darker path...

My policy is "if it doesn't improve upon Reader Mode, don't add it".

Re: A bookmarklet to kill sticky headers (2013)

#85

Earlier quoted context omitted.

Fixed isn't the industry standard way of making sticky headers in 2025 What is? Flexbox? Or something else? (Not a FE dev, though I'm vaguely conversant in CSS, mostly by using it to fix site annoyances on my own via stylesheet management extensions such as Stylus.)

There's `position: sticky` now for headers. It has better ergonomics than fixed and it's nice than it's supported by all modern browsers. https://developer.mozilla.org/en-US/docs/Web/CSS/position

It's a huge improvement for sticky sidebars that are only scroll within their parent element. For example, it's what I use on this page: https://allaboutberlin.com/guides/public-transit

Re: A bookmarklet to kill sticky headers (2013)

#86
post #26

Anecdote: I was in charge of a complete rebuild for an e-commerce website a few years back, which included a new design. We were debating various layout options, as it was tricky to get the information hierarchy right and show everything necessary even on smaller screens. Then we had an internal review and the CEO complicated things considerably by insisting it was very important that the header be sticky --- to ensu…

It continues to amaze me how many companies believe that customer care about their brand. The brands people care the most about are yet those they actively attempt to avoid, or those who doesn't need to constantly remind people of their existence.

Brands matter a lot, but a CEO who believes the logo should always be visible on the website in pursuit of brand strength doesn't actually understand the first thing about brands.

Re: A bookmarklet to kill sticky headers (2013)

#87
post #21

So it works by removing elements with "position: fixed". But do all sticky headers work like that? In sites that I build, I tend to just have a normal div at the top, followed by a div for the main body with "overflow-y: scroll".

Please don't implement things like that: among one or two other related problems, it breaks keyboard navigability, because the document then isn't scrollable. So users have to focus your div by clicking or tabbing to it before things like Space to go down one pageful will work. `position: sticky` or `fixed` are the only acceptable techniques to implement sticky headers for typical websites. (There are definitely app…

As a web developer, I'm well aware that pretty much every single thing I do has a better way of doing it. That's the world we live in.

Re: A bookmarklet to kill sticky headers (2013)

#88
post #87

Earlier quoted context omitted.

Please don't implement things like that: among one or two other related problems, it breaks keyboard navigability, because the document then isn't scrollable. So users have to focus your div by clicking or tabbing to it before things like Space to go down one pageful will work. `position: sticky` or `fixed` are the only acceptable techniques to implement sticky headers for typical websites. (There are definitely app…

As a web developer, I'm well aware that pretty much every single thing I do has a better way of doing it. That's the world we live in.

This might not be what you intended, but the impression I’m getting is that you’re dismissing my objections by saying “the world isn’t perfect so I won’t even try”. That’s a cop-out. Probably most of the thing you do don’t have an unqualifiedly better way of doing it.

This is a case where the solution you’re coming up with, which has never been the normal solution on the web but people definitely try it from time to time (perhaps because it is how you’d implement such a thing in almost every non-web GUI toolkit), causes certain very specific problems which render it unsuitable for general web content, particularly making life harder for quite a lot of desktop users (where Space/Shift+Space for scrolling is very common).

This is not a case of “well akshully” correctness, where the difference is immaterial. It’s a specific, concrete thing where it’s good to learn the behaviour of the platform, so that you work with it rather than against it, and not cause unnecessary difficulties to normal users.

Re: A bookmarklet to kill sticky headers (2013)

#89
post #87

Earlier quoted context omitted.

As a web developer, I'm well aware that pretty much every single thing I do has a better way of doing it. That's the world we live in.

This might not be what you intended, but the impression I’m getting is that you’re dismissing my objections by saying “the world isn’t perfect so I won’t even try”. That’s a cop-out. Probably most of the thing you do don’t have an unqualifiedly better way of doing it. This is a case where the solution you’re coming up with, which has never been the normal solution on the web but people definitely try it from time to…

>but the impression I’m getting is that you’re dismissing my objections by saying “the world isn’t perfect so I won’t even try”. That’s a cop-out. Probably most of the thing you do don’t have an unqualifiedly better way of doing it.

It would be truer to express my position as "my capacity for improving my practices is limited, and there are much higher priority areas than this one".

>causes certain very specific problems which render it unsuitable for general web content, particularly making life harder for quite a lot of desktop users (where Space/Shift+Space for scrolling is very common).

I'm skeptical that "a lot of desktop users" use keyboard for navigation. I'm a pretty keyboardy person, and I don't even know what this "shift+space" pattern is that you refer to. I don't think I've ever seen a person navigate a scrolling area with anything other than a mouse or touchpad.

>This is not a case of “well akshully” correctness, where the difference is immaterial. It’s a specific, concrete thing where it’s good to learn the behaviour of the platform, so that you work with it rather than against it, and not cause unnecessary difficulties to normal users.

I'm not very convinced that "normal users" are affected either way, but I appreciate your point and good-faith effort, nonetheless.

To be honest, when I think about it, I rarely implement sites that have a scrolling main body, so it doesn't come up much.

Re: A bookmarklet to kill sticky headers (2013)

#90

The whole entire internet is broken. Specifically what I mean is HTML is flawed. It should never have been a presentation format. It should've always been a DATA format, like JSON, or XML, from day one. The browser itself would then be able to display information (pages) in whatever style, colors, and format it wants. Probably 99.999% of developers agree with this, but we're stuck in a RUT it seems. I know what I'm s…

Almost nobody wants that though. Content providers want control over presentation. Users want pretty sites. None of this is unique to the web. It's the same reason every magazine has its own attractive layout and formatting, instead of just being a long manuscript in Courier. I like the fact that different sites have different typography. It's an identity that tells me where I am. I understand the appeal of "pure inf…

I think part of the data format could be visual related tho. Enough to make sites able to look distinctive, but not enough to allow the chaos we have today. For example, background image for a page, font for a page, whether something should be in a left panel, center panel, or right panel. They would be hints and very limited, and all in one place, in the data format. Unlike HTML where you have anything, anywhere, and total chaos.

I think you underestimate the value the world would place on the gains we could get from this kind of design, not to mention that AI would be able to reason about the pages much better. Just the AI angle along is enough to convince society to go along with the change.

But there will need to be some "Killer App" that does this, which everyone else copies.

Post reply on HN