
A normal bookmark stores an address such as https://example.org/. A bookmarklet stores an address that begins with javascript: followed by a short program. When you click it, the browser does not navigate; it runs the program on the page currently open. That is the whole trick. Because it is only a bookmark, a bookmarklet needs no installation, no permissions, no store approval and no account, and it works in every desktop browser made in the last twenty years.
How a bookmarklet works
- You drag a link from a page like our bookmarklet page onto your bookmarks bar. The browser saves its
javascript:address as a bookmark. - Later, on any page, you click the bookmark. The browser runs the script in the context of that page, as if the page itself had included it.
- The script does one job: reads your selection, changes the page, opens a small panel, copies something to the clipboard. When you reload the page, all of it is gone.
Because the script runs inside the page, it can see and change what the page shows, exactly like an extension would while you are on that page. Unlike an extension, it runs only when you click it and only on that page; it has no presence otherwise. This is why bookmarklets are the right tool for occasional tasks and why they survive on locked-down school and library computers where extensions are forbidden.
Installing a bookmarklet on each browser
| Browser | How |
|---|---|
| Chrome, Edge, Brave (desktop) | Show the bookmarks bar (Ctrl or Command + Shift + B), then drag the bookmarklet link onto it |
| Firefox (desktop) | Show the bookmarks toolbar (right-click the toolbar area, Bookmarks Toolbar, Always Show), then drag the link onto it |
| Safari (Mac) | Show the Favourites bar (View, Show Favourites Bar), then drag the link onto it |
| Any desktop browser, without dragging | Bookmark any page, edit the bookmark, and paste the bookmarklet code into the address field |
| iPhone, iPad, Android | Bookmark any page, then edit the bookmark and replace its address with the bookmarklet code; on iPhone you then open it from the bookmarks menu while on a page. Clumsy but it works |
Is a bookmarklet safe? How to read one
A bookmarklet is exactly as safe as its code, and unlike an extension the code is right there in the address. Before you install one from anywhere, read it. You do not need to be a programmer to apply three tests:
- Does it load anything from another server? Look for
createElement('script')with asrc, orfetch(, orXMLHttpRequest. A bookmarklet that pulls code from elsewhere can change its behaviour later without you knowing. Prefer bookmarklets that are self-contained. - Does it send anything anywhere? Look for
location.href=,window.open(,fetch(or animgwith a remotesrc. Ours copies a link to your clipboard and opens nothing. - Does it read more than it needs? A highlighter needs
getSelection()and the page address. It has no business withdocument.cookie, form fields orlocalStorage.
The Awesome Highlighter bookmarklet passes all three: it is self-contained, sends nothing, and reads only your selection and the page address. Its full code is printed on the bookmarklet page above the drag link so you can check it.
What bookmarklets cannot do
- They cannot remember anything between visits unless they use the page's own storage, which is scoped to that site. They are not for building a library of highlights; an extension or annotation service is.
- Some sites block inline scripts with a strict content security policy, and on those pages a bookmarklet does nothing. Reader mode sometimes helps.
- On phones they are awkward to run, because there is no bookmarks bar to click while a page is open.
- Very long scripts make unwieldy bookmarks; good bookmarklets are small and do one thing.
A short history
The term was coined around 1998, and by the mid 2000s bookmarklets were how most "web 2.0" services let you save, share or annotate any page: bookmarking sites, read-later services, translators and highlighters all shipped one. The Awesome Highlighter launched in 2008 as a bookmarklet plus a Firefox add-on, and the bookmarklet was the more popular of the two because it worked everywhere. Extensions later took over for tools that needed memory or background access, but for one-click, no-permission tasks the bookmarklet never had a better replacement. Ours is on its third generation; see the site history.
A bookmarklet is one option among several in the web highlighter tools overview. If you need highlights that persist, compare highlighter extensions for Chrome, Firefox and Safari; if you want to understand the links the bookmarklet produces, read the text fragment explainer.
Common questions
What is a bookmarklet?
A bookmark whose address starts with javascript: and contains a small program. Clicking it runs the program on the page you are viewing instead of opening a new page.
Are bookmarklets safe?
As safe as their code, which you can read in the bookmark itself. Avoid bookmarklets that load scripts from other servers or send data anywhere. A self-contained one that only reads your selection is safe.
Do bookmarklets work on Chrome?
Yes, in every desktop version. Show the bookmarks bar and drag the bookmarklet onto it. They also work in Edge, Brave, Firefox and Safari.
Can I use a bookmarklet on my iPhone?
Yes, with a workaround: bookmark any page, edit it, and replace the address with the bookmarklet code. Run it from the bookmarks menu while viewing a page.
Why does the bookmarklet do nothing on some sites?
The site's content security policy blocks inline scripts, or the page is inside a frame. Try reader mode, or use the highlight link generator with the page address instead.
Bookmarklet or extension: which should I use?
Bookmarklet for occasional, one-page tasks with no permissions. Extension when you need highlights saved and re-applied across visits.
Sources
- MDN Web Docs: javascript: URLs and Content Security Policy
- Browser help pages: show the bookmarks bar (Chrome, Firefox, Safari, Edge)