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 jobs moved into native browser features or browser extensions.

Still, they remain the fastest way to extend a browser for one task. You skip the work of finding, checking, and adding an extension. They also work the same way across all major browsers — Safari, Firefox, and any Chromium-based browser. You install nothing.

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, make a new bookmark in your browser. Set the name to whatever you want. Then paste the JavaScript code — starting with javascript: — into the URL field.

Sharing a bookmarklet

An analytics dashboard on a screen

You can share bookmarklets in two ways:

  • Manual copy-paste: share the javascript: code directly. Tell the other person to make a bookmark by hand.
  • Drag-and-drop link: put the code in an HTML anchor tag. Users can drag the link straight into their bookmarks bar:
<a href="javascript:(/** your code **/)()">Bookmarklet</a>

Bookmarklets meant to be shared are usually packed into a single line of code first. Then you embed that line.

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 can do more now, and they get checked more closely. Manifest V3 limits in Chromium have cut what extensions can do. That shift also changed the ad-blocking scene we cover in our privacy browsers comparison. On top of that, browser vendors now lock down permissions for extension side-loading. None of this touches bookmarklets. They run as first-party JavaScript in the page. They need no permissions, and a browser vendor policy cannot take them away. That same page-level JavaScript access is what makes browser fingerprinting work. See our browser fingerprinting state of the art 2026 for the full picture of which APIs expose device identity. For a wider view, see our state of browser privacy 2026 report.

On iOS, Safari extension support stays limited. And if you turn on Lockdown Mode, several web APIs are switched off. Bookmarklets work right inside Safari on iPhone and iPad, with no limits. That makes them one of the handiest 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. Its URL holds JavaScript code that starts with the javascript: scheme. When you click it, the code runs on the current page.
Do bookmarklets work in Safari?
Yes. Bookmarklets work in all major browsers: Safari, Firefox, Chrome, and any Chromium-based browser. They are one of the few ways to extend a browser that need no install.
Are bookmarklets still useful in 2026?
Yes. They are great for quick, single tasks where a full extension is too much. This is true above all on iOS, where extensions are limited. There, bookmarklets stay a handy tool.