Google has announced a new set of APIs for its Chrome web browser, which are designed to connect applications and sites across the web. Web Intents, as Google is calling its new meta-website API, allows websites to pass data between each other — for example, to edit a photograph or share a URL with friends.
Developers at Mozilla have been working on a similar framework for Firefox, and now Google says it will work with Mozilla to develop a single API that works in both web browsers.
The Web Intents API was originally conceived by Paul Kinlan last year. Kinlan, who is a Chrome Developer Advocate at Google, borrowed the idea from the Android platform, which uses Android Intents to pass data between Android Apps.
Well, the easiest way to understand them is by example. Take the sometimes overwhelming proliferation of buttons on web pages that allow you to do something with the current page, whether it’s Like, Tweet, +1, Read Later, Add to Instapaper and so on. Rather than adding a dozen little badges to your site, Web Intents creates a bridge that connects your site to any website your visitor wants to use. Web Intents define an API for your site to use and another API for the receiving site to use. Plug them together and transferring data becomes a quick and easy process, both for users and developers.
That’s a huge step up from the situation today. Perhaps the biggest win is that Web Intents put your visitors in control — they can select which actions they’d like to perform and which external sites they’d like to handle those actions. Some might share your page on Facebook, others on Twitter, still others might save it to their Instapaper account and so on, all from the same three lines of code you added to your site.
That’s not, however, all that Web Intents can do. The broader goal of Web Intents is to provide a generic means of communication between websites for tasks as varied as editing photos, listening to music or shortening URLs.
The second half of the video below demonstrates Mozilla’s take on how Web Intents (“Web Activities” in Mozilla’s parlance) might work.
For some sample code and working examples, head over to the new WebIntents.org site and check out the examples (the image example is particularly good at showing off the potential power of Web Intents).
For some more background on Web Intents, check out Paul Kinlan’s blog, particularly his overview post on the brief history of Web Intents. Tantek Çelik, the creator of microformats, also has a nice post on what he calls Web Actions (same thing, better name). Çelik breaks down the idea behind Web Intents and how they benefit not just developers, but users as well.
As Çelik writes, “web actions have the potential to change our very notions of what a web application is from a single site to loosely coupled interactions across multiple, distributed sites…. In that regard, web actions have the potential to become a building block for distributed web applications.”