Custom tab-to-search

Right-click the address bar and select "Manage search engines". Find the section "Other search engines", ponder for a moment the sheer amount of websites accumulated in there (why do I have 35 duplicates of the same website?), then click "Add" and enter the details you want.

The URL of a search engine is a printf-style template that accepts exactly one %s in place of your input. So in the Python example you could configure it like this:

  • Search engine: Python library
  • Keyword: py
  • URL: https://docs.python.org/3/library/%s.html

But for the Java website, you will most likely need to use a custom redirector, i.e. write a tiny 1-page webapp that accepts ?q=%s and turns your space-separated input into the proper Java docs URL.

(Alternatively, copy a Google URL and turn it into %s site:docs.oracle.com/en/java/javase/16. Sadly, Google's "I'm Feeling Lucky" no longer works due to them adding a CSRF thing, but the trick might work with other search engines.)

By default, Chrome uses the website's domain as the "keyword" for all automatically detected search engines. However, if you use a custom keyword short enough that you can type it in full (1–3 letters) then you can input a regular space instead of Tab and not worry about tabbing to the wrong thing. For example, if the keyword is "py" then py itertoolsEnter will activate the search.

(This is how the search feature worked originally; Tab-to-search was a later addition. For example, in Firefox or Netscape, you can achieve the same thing by adding a bookmark with a keyword and a %s URL.)