loading...
Cover image for A Chrome Omnibox Extension to Search Oracle's Javadoc

A Chrome Omnibox Extension to Search Oracle's Javadoc

awwsmm profile image Andrew (he/him) ・2 min read

There used to be a really nice Chrome extension for searching Oracle's Javadoc (Java documentation) directly from the "Omnibox" (the search bar at the top of the Google Chrome browser).

But that extension hasn't been maintained since about Java 7 (pre-2014) and as a result was very out of date.

My new extension can be used to search the documentation of any JDK (Java Development Kit) version 9 through 13, inclusive.

Developing an Omnibox extension is a bit of work (especially if you're not very familiar with JavaScript callbacks, like me), but the end result is pretty cool:

Screenshot of a browser using the Javadoc Omnibox extension

Screenshot of a browser using the Javadoc Omnibox extension, just before hitting "return" to see the search result

Screenshot of a browser showing the search result, a page in the Oracle Javadoc

I've never done anything like this before, so my solution is definitely suboptimal (for instance, I simulate a search entry in an input field with key events, rather than interfacing with the search code itself). If anyone who knows a bit of JavaScript would be willing to help out, feel free to submit a pull request!

If you're interested in creating your own Omnibox extensions, there are some examples online. If you know a bit of JavaScript, it's really easy -- just a single function that gets called when the user uses a keyword in the Omnibox. Not very spoopy, but that's my Hacktoberfest contribution to the world!


If you enjoyed this post, please consider supporting my work by buying me a coffee!

Posted on by:

awwsmm profile

Andrew (he/him)

@awwsmm

Got a Ph.D. looking for dark matter, but not finding any. Now I code full-time. Je parle un peu français. dogs > cats

Discussion

markdown guide