alexi.sh
All articlesBrowser securityNetwork privacyPrivacy toolingThreat modelingAI codingDev tooling

alexi.shResearch

tech-utilities

Using bookmarklets to extend your browser (2026 guide)

PrivSec LabUpdated on June 8, 20263 min read
A laptop on a desk showing code in an editor

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

An analytics dashboard on a screen

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 — a shift that also reshaped the ad-blocking landscape covered in our privacy browsers comparison — 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. Page-context JavaScript access is also the mechanism behind browser fingerprinting — see our browser fingerprinting state of the art 2026 for the full picture of which APIs expose device identity. For a broader overview, see our state of browser privacy 2026 report.

On iOS specifically, Safari extension support remains limited — and if you enable Lockdown Mode, several web APIs are disabled outright. 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

FAQ

What is a bookmarklet?
A bookmarklet is a browser bookmark whose URL contains JavaScript code starting with the javascript: scheme. Clicking it executes the code in the context of the current page.
Do bookmarklets work in Safari?
Yes. Bookmarklets work across all major browsers: Safari, Firefox, Chrome, and any Chromium-based browser. They are one of the few cross-browser extension mechanisms that require no installation.
Are bookmarklets still useful in 2026?
Yes. For quick, single-purpose tasks that do not warrant installing a full extension — and especially on iOS where extensions are limited — bookmarklets remain a practical tool.