Get the latest tech news

Linking to text fragments with a bookmarklet


I've written a bookmarklet that helps me link to specific text on a web page.

But I don’t find the syntax especially intuitive – I can never remember exactly what mix of colons and tildes to add to a URL. Update, 16 September 2025: Smoljaguar on Mastodon pointed out that Firefox, Chrome, and Safari all have menu items for “Copy Link with Highlight” which does something very similar. One reason I like bookmarklets is that they become items in the Bookmarks menu, and then it’s easy for me to assign keyboard shortcuts.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of bookmarklet

bookmarklet

Photo of text fragments

text fragments

Related news:

News photo

A bookmarklet to kill sticky headers (2013)

News photo

Show HN: Instant HTML Preview Bookmarklet