Over the last couple weeks I’ve spent some time playing around with Chrome development and Google Hangout extensions. Nothing revolutionary by any means but there were a couple interesting things I came across that I figured I’d share out.
One thing I found slightly funny is that both Chrome extensions and Hangout extensions are JavaScript based but how they’re packaged is completely different. For a Chrome extension you only need a manifest file, which you can combine with your actual extension files to create a installation package within Chrome. For a hangout extension, your JavaScript is wrapped inside an XML file which you host on a server somewhere, then you need to have your extension listed inside their developer center and pointed at that XML file.
Because a Hangout extension has to be listed in Google’s systems, there’s no such thing as a private extension, something you share out only to certain people. For example, I was making an internal-only tool for my office’s telepresence setup. In development I could share that out to specific users that would be running it, but that forces the developer tool sidebar to be open in the Hangout. The only way to get rid of that bar is to make the extension public, which I don’t want to do.
On the Chrome side of things, I found some interesting stuff in the manifest validation. I was alternating on whether what I was building should be an extension or a packaged app for Chromebook. The two of those have differences in how the JSON manifest looks and there’s no block comment in JSON, so I couldn’t have both versions side-by-side and just switch back and forth. I decided to try a variation on the old “1 == 2” trick for block comments in VB Script, where you wrap your code in a bit of logic that always returns false. In this case, I renamed my “app” block to “_comment_app” and ran it through the compiler. It was allowed but I got an error saying that “_comment_app” was unknown. Okay, so the compiler does some validation, good to know. I then spent some time fighting with getting an AJAX call working in a different extension, and it turns out it’s because I had copied and pasted a “permissions” block in the wrong spot, which the validator didn’t catch. Some validation, yes, but not complete validation.
Again, nothing groundbreaking, just a little interesting to me.