Introduction

I’m finally getting around to writing up my experience writing a Chrome Extension (that I actually wrote a few months ago).

I wanted to be able to quickly jump to any subreddit using the omnibar, with autocompletion for any subreddits that I’ve visited before. So, I made a Chrome Extension, triggered by r <tab>, that opens up a menu to quickly jump to a subreddit.

Any subreddit that you jump to using the extension is saved unless the subreddit doesn’t exist. The extension checks the returned headers for the HTTP code and ignores 404s and 302s (missing subreddits and the subreddit search page).

When typing in a subreddit name, the extension uses substring matching to search for similarly named subreddits that you’ve visited before. It then sorts those subreddits by the number of times that you’ve visited each one.

Finally, there is an options menu to clear the stored data, and an option to clear only certain saved subreddits.

Overall it was a fun program to write and maybe I’ll get around to adding more features to it later. There’s a to-do list in the git repository of possible modifications that I can do.

Experience

I’ve had a bit of Javascript experience (my first internship was my introduction to Javascript in 2014), so writing a small Chrome Extension was a fairly easy process.

Google had decent documentation for the functionality I needed and the “getting started” tutorials were great. Debugging an extension in Chrome was just as easy as debugging normal Javascript in Chrome, except I had to open a separate Developer Tools window because my extension isn’t the kind of extension that is directly embedded into the page. Instead, it waits in the background for certain events to occur.

Source Code and Download

It is open sourced under the MIT license here and available to download here.