On October 29th the local Google Technology User Group is hosting a Chrome Hackathon, in which I’ll participate. As a little warm up exercise I created a small extension for my favorite microblogging service Soup.io, which basically just wraps their bookmarklet.
The heart of every Chrome extension is a file called
manifest.json, which in the case of the Soup.io extension looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Here we define some general information, like the extension’s name, version and description, as well as icons in various sizes and needed permissions. The
browser_action section specifies the icon — including mouseover text — that will be displayed next to Chrome’s address bar, whereas the
background_page is a script that runs in the extension process.
1 2 3
content_script, which specifies a file that runs in the context of the web page you are looking at. Here I set up a listener for
1 2 3 4 5 6 7
When the user presses the right combination (Alt-Shift-S in this case), a request named
openPopUp gets sent, which we deal with in another listener in
1 2 3 4 5 6
And that’s it, a simple Chrome extension, including a keyboard shortcut. Hosting the extension is a piece of cacke if you use the developer dashboard of the Chrome web store, but there’s a one time registration fee of USD 5 for it. Here’s the current version:
This was a fun experience, I’m definitely looking forward to the hackathon!