Thursday, July 30, 2026

Better Than Bookmarklets

The earliest web browsers didn't allow users to create custom search engines. Instead, you had to navigate to a website before searching. Or, you could use the browser's search engine to search for selected text.

That's when I started using a bookmarklet to search my public library's catalog for selected text. Before then I had to...

  • Select the text
  • Copy it to the clipboard
  • Open a new browser tab or window
  • Navigate to the library website
  • Paste the text into the search field
  • Press Enter

The bookmarklet reduced six steps to two. The process shrank to just:

  • Select text
  • Click the bookmarklet

And it preserved the clipboard.

So is the bookmarklet outdated like the dial-up modem? I think it is for most applications.

You might argue, "Bookmarklets can do more than pass selected text to a website's search tool. They can execute code."

True. For example, suppose you came across a website that announced the date of the next EmacsConf.1 How many days away is that? A bookmarklet can tell you. All you'd have to do is to select that date (December 12) and then click the bookmarklet. Of course, you'd first have to write the code, but that's the really fun part.

But my counterargument is that you don't need code. You could create a custom search engine that asks an online AI chat tool to calculate the time span with the following three-part URL:

  1. The AI chat tool's query URL2
  2. The question "How+many+days+away+is+"
  3. The search-term placeholder (usually %s)

Putting it all together gives you: https://lumo.proton.me/?q=How+many+days+away+is+%s3

To test this, I'll substitute "December 12" for %s and navigate to that URL: https://lumo.proton.me/?q=How+many+days+away+is+December%2012. Lumo inferred the missing year, chose the upcoming December 12 (2026), and calculated that it was 135 days away.

A bookmarklet could certainly do the same thing, but it would need code to infer the missing year or present multiple results. An AI already understands the ambiguity.

But what if your bookmarklet isn't provided with a date? What if it's given the name of an obscure holiday, such as "Talk Like a Pirate Day?" 4 AI can do this! Substituting "Talk Like a Pirate Day" for %s would make the URL https://lumo.proton.me/?q=How+many+days+away+is+Talk+Like+a+Pirate+Day. The response is, "Talk Like a Pirate Day is 51 days away! 🏴‍☠️" The pirate flag is a nice embellishment, isn't it?

Combined with an AI chat tool, a custom search engine can replace many bookmarklets while requiring little or no custom code.


1 https://emacsconf.org/2026/

2 I've chosen Proton's online AI tool because it's the first tool I found that submits the query immediately, without waiting for the user to press Enter or click the upload button.

3 Notice that I've replaced space characters in the question with "+" and encoded the space in the selected text with the percent-encoded value %20.

4 September 19, https://en.wikipedia.org/wiki/International_Talk_Like_a_Pirate_Day

No comments:

Post a Comment

Thank you for taking time to comment. Please note that comments may be deleted if they:

* Contain link(s) to a domain outside USA or Canada or to a commercial enterprise.
* Include non-English words or characters.
* Are irrelevant to the subject matter of the post.

For posts older than 14 days, comments are moderated and require approval.