Web Intents

This page is a high-level overview of the project and provides guidence on how to implement the intents in your applications without the need for the you to understand the entire spec.

Introduction

Users use many different services on the web to handle their day to day tasks, such as sharing images, editing documents and listening to music. They expect their applications to be connected and to work together seamlessly.

It is impossible for developers to anticipate every new service and to integrate with every existing external service that their users prefer, and thus they must choose to integrate with a few select APIs at great expense to the developer.

Web Intents solves this. Web Intents is a framework for client-side service discovery and inter-application communication. Services register their intention to be able to handle an action on the user's behalf. Applications request to start an Action of a certain verb (share, edit, view, pick etc.) and the system will find the appropriate Services for the user to use based on the user's preference.

Web Intents puts the user in control of service integrations and makes the developer's life simple.

Specification

The Web Intents specification is currently being developed in a Web Intents taskforce in combination with the public-webapps and DAP group.

The specification is currently in Editors DRAFT and is being discussed on the public-intents list.

API

Client
An application that requests features and functionality from Services.
Service
An application that provides it services to other applications.

The Web Intent API is simple to use. Service developers define the intent they intend to support and what to do with the data they receive. Client applications simply initiate a new action with the given parameters.

Intent Registration

The proposed method of intent registration is via the intent tag.

<intent
  action="http://webintents.org/share" 
  type="image/*" 
  href="share.html"
  disposition="window|inline"
 />
action
Required. A verb describing the action to be performed
type
Optional. Types are a filter. The infered value is "*" when undefined.
href
Optional. If specified, it will point to the action that is loaded when the user chooses the service. If undefined, use the current page.
disposition
Optional. If specified, it will be either "window" or "inline". If not specified "window" will be the default. When "inline" is provided the service page will be opened in the same context as the picker. A value of "window" will open the service in a new context.

The current mechanism for intent registration in Chrome is via manifest.

Invocation

var intent = new Intent("http://webintents.org/share", 
  "text/uri-list", 
  "http://news.bbc.co.uk");

window.navigator.startActivity(intent);

Try it now:

Intents

We are collating a suite of intents that we believe the majority of applications and services will use. The schema URL used to define an intent is designed to be self documenting.

Browser Support

JavaScript Shim

This is a fundamentally new platform feature, and as such has not been implemented in any browser. To compensate and to allow you to build rich applications today, we have built an API compatible JavaScript shim.

It is simple to start, just drop the code following code in to your site and now you will be able to get your users who use IE 8 and 9, FF 3 upwards, Chrome 5 upwards and Safari to use the functionality in Web Intents.

<script src="http://webintents.org/webintents.min.js"></script>

The shim is not 100% compatible with the native API. The native API uses Blob's to transfer data between applications and this feature is not directly supported on IE and earlier versions of Firefox.

Contributing

More information about contributing to the shim and this site can be found on http://webintents.org/updating.html

If you want to particpate in the discussion please join our Google Group.

If you want to particpate in the specification please join the public-web-intents group.

Extending

Intents are matched based on their action and data type, neither of which are hard-coded into the system. This makes extension and customization simple. For example, an action verb could be an activity-stream "post" and the data-type can be an activity-stream object of type "audio".