Story Details

  • A bookmarklet to kill sticky headers (2013)

    Posted: 2025-02-01 21:12:37

    This blog post presents a simple bookmarklet designed to remove fixed position headers on websites. The author, frustrated by obstructive sticky headers, created a JavaScript snippet that can be saved as a bookmark. When clicked, this bookmarklet iterates through all elements on the current page, identifies those with a fixed position (typically headers), and sets their position to static, effectively removing the sticky behavior. The post highlights the bookmarklet's effectiveness in reclaiming screen real estate and improving the browsing experience. It also includes the code snippet for easy copying and implementation.

    Summary of Comments ( 83 )
    https://news.ycombinator.com/item?id=42902395

    Hacker News users generally praised the bookmarklet for its simplicity and effectiveness in removing annoying sticky headers. Some users expressed concerns about potential website breakage, while others offered alternative solutions like browser extensions (e.g., uBlock Origin) or Stylish. A few commenters suggested improvements to the bookmarklet's code, such as handling elements with position: fixed differently or providing an option to restore the original header. The discussion also touched upon the broader issue of intrusive web design and the ongoing battle between users and websites trying to maximize ad revenue. One commenter even shared a personal anecdote about creating a similar tool years prior, highlighting the long-standing frustration with sticky headers.