This page looks best with JavaScript enabled

Bookmark keywords, again

 ·  ☕ 7 min read

Given Mozilla’s recent development push to remove support for bookmark keywords & bookmarklets, I wanted to discuss how I use these features of Firefox and why, in a hope that the new system will support important use cases.

Note, I have previously written on this subject three times before:

What are these features?

There are two tightly-linked features in question here:

  1. “Vanilla” bookmark keywords - this is a mechanism for aliasing websites so that you type a keyword in the URL bar and then are taken directly there. For example, if I type happy then the resulting page is https://hojamaka.com/games/mamono_sweeper (excellent game btw).
  2. Bookmarklets/search bookmarks with keywords - this is a mechanism for turning your normal URL bar into a search bar with JavaScript support for search patterns significantly more advanced than the simple substitution of %s.

Vanilla bookmark keywords on their own are super helpful; with thousands of websites bookmarked over the years, it takes an epic journey to find any single website I vaguely remember. But my memory of single-word aliases is much better than my memory of “where did I put that shit,” so I can easily navigate to a lot of sites that otherwise would probably be lost in the miscellaneous bookmark folder of despair.

Also, as a user who generally prefers keyboard navigation where possible, I greatly appreciate the ability to Ctrl+L - type keyword - enter, to access my bookmarks. In the past, I’ve written extensively about some of my particular bookmarked locations, and my usage pattern hasn’t changed much since then (though now I am usually going to wiki.gg wikis of course).

When you add dynamic functionality is when this system really gets powerful. Unlike search engines, which only support a single %s substitution, with bookmarklets you can do multiple substitutions. For example, gg terraria Moon Lord will search on terraria.wiki.gg for Moon Lord and take you to that page. If you often use Wikipedia in multiple languages, you could do wp de Berlin - wp for wikipedia, de to add the subdomain, and then search Berlin. This is also extremely powerful for reddit searches - rs fantasy Sea of Stars to go to this search result (rs = reddit search).

Here is the URL for that last one:

javascript:%20%20var%20s='%s';%20url='https://old.reddit.com/r/%s/search?q=%s&restrict_sr=on&include_over_18=on&sort=relevance&t=all';%20tt=[''];%20j=0;%20qc=0;%20chunks=url.split('%s');%20for(i=0;%20i<s.length;%20i++){%20if(s.charAt(i)=='%22')qc=qc^1;%20if%20(s.charAt(i)=='%20'&&(qc||j>=chunks.length-2))%20{%20tt[j]+=('^');%20}%20else%20if%20(s.charAt(i)=='%20'){%20j++;%20tt.push('%20');%20}%20else%20{%20tt[j]+=(s.charAt(i));%20}%20}%20t%20=%20tt.join('');%20args=t.split(/\s/);%20nurl='';%20for(i=0;%20i<chunks.length;%20i++){%20nurl+=chunks[i];%20%20if(args[i]!=undefined)%20{%20args[i]=args[i].replace(/\^/g,'%20');%20nurl+=args[i];%20}%20}%20location.replace(nurl,'<\%20BR>');

If you don’t still use old reddit, you can edit the URL string https://old.reddit.com/r/%s/search?q=%s&restrict_sr=on&include_over_18=on&sort=relevance&t=all to have whichever parameters you prefer, just note the two uses of %s to specify subreddit and then search string.

You can also do some more “advanced” functionality than simple substitution; as I wrote about here, any time a website uses numeric IDs for something that you know as strings, and there’s a consistent 1:1 lookup, you can put that lookup into your javascript and “search” for the string to get redirected to the integer. What I use this for the most is MediaWiki’s Special:AllPages interface, for example:

javascript:(function  ()  {  let  s='%s';  let  url='https://%s.wiki.gg/Special:AllPages?namespace=%s';  let  r=1;  let  l={  main:'0',  talk:'1',  user:'2',  project:'4',  file:'6',  mediawiki:'8',  template:'10',  help:'12',  category:'14',  form:'106',  widget:'274'  };  tt=[''];  j=0;  qc=0;  chunks=url.split('%s');  for(i=0;  i<s.length;  i++){  if(s.charAt(i)=='%22')qc=qc^1;  if  (s.charAt(i)=='  '&&(qc||j>=chunks.length-2))  {  tt[j]+=('^');  }  else  if  (s.charAt(i)==' '){  j++;  tt.push(' ');  }  else  {  tt[j]+=(s.charAt(i));  }  }  t  =  tt.join('');  let  args=t.split(/\s/);  let  nurl='';  for  (i=0;i<chunks.length;i++){  nurl+=chunks[i];  if  (args[i]!=undefined){  if  (i==r)  {  args[i]=l[args[i].toLowerCase()]||args[i];  }  args[i]=args[i].replace(/\^/g,'  ');  nurl+=args[i];  }  }  location.replace(nurl,'<  BR>');})();

Additional functionality that currently exists

Mass editing

As I described previously, I tend to maintain my search bookmarks using regex. Since the vast majority of my keywords are various MediaWiki-related searches, it’s quite convenient to be able to run a small regex and add a new wiki or to add a new page+keyword to all my existing wikis. Clearly a GUI tool would be a better user experience overall, but the point is that right now, mass editing is possible. I do not believe there is any planned mechanism for mass editing when Firefox migrates to search managed through preferences.

Typical changes that I will do:

  • I have types of folders of bookmarks, e.g. every MediaWiki site that I’m regularly editing has a folder dedicated to its alias, and that folder has all of the MediaWiki-type bookmarks in it
  • I may want to duplicate a folder to add another MediaWiki domain that I want to be able to navigate easily
  • I may want to modify every existing MediaWiki folder to add another type of page that I want to navigate to easily - for example, recently a MediaWiki patch added a special page called Namespace information, and now I want keywords like supni, arkni, confni, etc, to take me there. This is easily done with a regex currently.

Aiding history autocomplete

A keyword for a substitution/search bookmark functions ridiculously effectively to filter your history autocompletes. For example, if I want to make a page on wiki.gg’s support wiki show up in my history suggestions, I have a few options:

  • Type some characters from the name of the page and hope
  • Type support.wiki.gg followed by some characters from the name of the page
  • Type sup which is my bookmark keyword for searching the support wiki, and then a couple characters from the name of the page

Notably, that third option is exactly the same as the actions I would take if I were to search for the page!! So I can be pretty sure I can grab a page from history with a couple down arrow presses and then Enter, but if I’m wrong, I don’t have to start my process over; I can just finish typing the page name and then execute a search.

And it works even if your keyword isn’t a substring of the site’s domain - for example, I use sb (for “sandbox”) as my keyword for our test wiki. And the autocomplete works just as well after I type sb!

Because this works so well, I’d say about 30-50% of the time that I’m about to make a search, I’m able to turn it into a history prompt instead. This is such an invaluable advantage to my overall workflow that I’m not really sure how to quantify it, and I can’t imagine that it will persist when Firefox makes the migration away from bookmark keywords.

Things I don’t want

I’ve spoken with Firefox developers a few times about this issue, and every single time they say “then just write an extension.” I do not want to write an extension. I don’t want to have to type an extra character prior to every single search I ever do, and for security reasons, any solution involving an extension would require that. I also don’t think that the history autocomplete would work the same way, but mostly I really, really, really just don’t want to type an extra character. This is how I’ve been navigating the internet since 2010, that’s 15 years of muscle memory that would just be killed in an instant if I had to switch to an extension.

I also don’t want any loss of functionality. I want to continue having mass editing enabled, and history autocomplete, and bookmarklets with keywords.

The current system is pretty much perfect. I can’t imagine anything different being better in any way (Admittedly something nicer than regex for mass updates might be nice, but it’s honestly not that big a deal and I would not bother feature-requesting that, nor would I want to sacrifice any functionality just to get that).

Purpose of this post

I wrote this post for a couple reasons:

  1. In the hopes of consolidating my use cases in an easily-digestible format as a reference for Mozilla engineers
  2. To inform the community that these features are going away, because I don’t think most people have any idea what’s at risk - maybe Mozilla can be made to reconsider if enough people care about this
  3. Hoping for a recommendation of a Firefox fork that is definitely planning NOT to make these changes to bookmark keywords so that I can switch to that browser instead. If you know of one please let me know!!
Share on

river
WRITTEN BY
River
River is a developer most at home in MediaWiki and known for building Leaguepedia. She likes cats.

What's on this Page