Showing posts with label extensions. Show all posts
Showing posts with label extensions. Show all posts

Sunday, April 5, 2009

Yo dawg...

So on the extensions project, I've been working on what I think is the somewhat novel idea of API non-design.

To be more specific, I'm using the CRUD pattern as a starting point for all the major sub-systems' APIs. My hope is that this will have a number of positive effects:
  • Minimize API design hand-wringing
  • Provide a large base of functionality quickly
  • Make it easy for Chromium developers to add new APIs
  • Make it easy for extension developers to learn new APIs
We decided to use JSON heavily in the implementation. For example, the createTab() API looks like this:
chromium.tabs.createTab({
"url": "http://www.google.com/",
"selected": true,
"tabIndex": 3
});
So I got this all working for a few methods, and then I got to writing the validation code. I could write the code by hand, but that's so much work. And why bother when somebody has gone and invented JSON Schema.

That's right, it's a schema language for JSON. And of course it has a schema, written in JSON schema. Whee!

So we should be able to just declare the expected structure for our API parameters and push the validate() button. Probably there will have to be extra stuff around the edges, but this should get rid of a majority of the grunt work.

Saturday, November 29, 2008

Extensions in Chromium

For the past few weeks, myself and a few others have been looking into how extensions might work in Chromium. Last Wednesday, we published a design doc with the beginning of our plan.

If you're an extension developer or user, we'd love to hear your feedback. You can reach us at #chromium on irc.freenode.org or chromium-dev@googlegroups.com.