No Sticky Bookmarklet
14 June 2024 Web
A few years ago I came across this bookmarklet that removes sticky elements from a webpage. If youβre bothered by sticky headers/footers/sidebars taking up screen space and following you down the page, you click the bookmarklet to remove them and restore some calm π§ββοΈ
If that sounds appealing, drag the link below to your bookmarks bar:
Hereβs the JavaScript it runs when you click it:
javascript:(function()%7B(function()%20%7Bvar%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7Bvar%20pos%20%3D%20getComputedStyle(elements%5Bi%5D).position%3Bif%20(pos%20%3D%3D%3D%20'fixed'%20%7C%7C%20pos%20%3D%3D%3D%20'sticky')%20%7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)();
If you sync your bookmarks across devices, you can use this bookmarklet on your phone too!