alexi.sh
tech-utilities

Using bookmarklets to extend your browser (2026 guide)

PrivSec Lab··Updated on June 8, 2026·2 min read
Developer monitor displaying code with dark theme

Bookmarklets are JavaScript snippets saved as browser bookmarks. This guide covers how to create, share, and use them across Safari, Firefox, and Chromium-based browsers.

Table of Contents

A few years ago, bookmarklets (also called favlets) were far more common than they are today. Most of their typical use cases were absorbed either into native browser features or browser extensions.

That said, they remain the fastest way to extend a browser's functionality for a specific task without sourcing, vetting, and installing an extension. They also work uniformly across all major browsers — Safari, Firefox, and any Chromium-based browser — with no installation required.

Creating a bookmarklet

A bookmarklet is JavaScript code whose URL begins with the javascript: scheme.

There are three ways to structure one:

1. Using an Immediately Invoked Function Expression (IIFE):

javascript: (function() {
    // your code
})();

// using arrow functions
javascript: (() => {
    // your code
})();

2. Using the void operator:

javascript: void function() {
    // your code
}();

3. Directly calling a native function:

javascript: window.open("https://example.com");

To save it as a bookmarklet: create a new bookmark in your browser, set the name to whatever you want, and paste the JavaScript code — starting with javascript: — into the URL field.

Sharing a bookmarklet

Bookmarklets can be distributed in two ways:

  • Manual copy-paste: share the javascript: code directly and instruct the recipient to create a bookmark manually.
  • Drag-and-drop link: embed the code in an HTML anchor tag. Users can drag the link directly into their bookmarks bar:
<a href="javascript:(/** your code **/)()">Bookmarklet</a>

Bookmarklets intended for distribution are typically minified into a single line of code before embedding.

Examples of bookmarklets

Open the current page in archive.ph (bypass paywalls or create a snapshot):

javascript:window.open("https://archive.ph/" + location.href, '_blank')

Open the current page in the Wayback Machine:

javascript:window.open("https://web.archive.org/web/*/" + location.href, "_blank")

Scroll to the top of the page:

javascript:window.scrollTo({top: 0, behavior: "smooth"})

Toggle edit mode on the current page (useful for quick text copy from a page that blocks selection):

javascript:(() => {
    document.body.contentEditable !== "true" ?
    document.body.contentEditable = "true" :
    document.body.contentEditable = "false"
})()

Note: still relevant in 2026

Browser extensions have become more capable and more scrutinized. Manifest V3 restrictions in Chromium have reduced what extensions can do, and browser vendors are tightening permissions for extension side-loading. Bookmarklets are unaffected by any of this: they run as first-party JavaScript in the page context, require no permissions, and cannot be removed by browser vendor policy.

On iOS specifically, Safari extension support remains limited. Bookmarklets work natively in Safari on iPhone and iPad with no restrictions — making them one of the most practical lightweight automation tools on the platform in 2026.

Photo: Ilya Pavlov — Unsplash (source)

Also available in