Bookmarklets are browser bookmarks that execute JavaScript code instead of navigating to a website. They are usually used to make changes to the visual appearance of the page or to add a small feature to the page. They are intended to be used as bookmarks, hence the name. You bookmark them like regular websites - just drag and drop the hyperlink to the bookmark bar or press CTRL + D on Windows / CMD + D on Mac - and when you activate them they execute code instead of navigating to a new page.

The trick in how they work lies in the href attribute value, which begins with javascript: telling browser that instead of navigating to a page it should execute some JavaScript code. What code it executes is up to the author :). To view the bookmarklet source code just inspect the hyperlink href attribute in browser developer tools.

Below are bookmarklets I use, some that I've written and some written by others. Enjoy!

Toggle scrollbar

Toggle scrollbar - thanks to Stanko for inspiration.

Temporarily hide selected element

Temporarily hide selected element - Unfortunately you can't bring back the element you previously hid. To get the element to show again you'll need to reload the page.

Expand Hacker News comments

Expand Hacker News comments Expands all previously collapsed comments on Hacker News article

Reload without query string

Remove query string - Works for localhost/ and file:// as well

Reload without hash

Remove hash - Works for localhost/ and file:// as well

Find out technologies used to build the webpage you're viewing

Wappalyzer - Go to this page to grab the latest version of the bookmarklet. Just drag and drop their bookmarklet to your bookmark bar.