For Developers‎ > ‎Design Documents‎ > ‎

Web Resources

DRAFT

Web resources are data feeds (in formats like JSON or RSS) which are available over the web.  The Chrome team is experimenting with harvesting data from web resources that provide tips or recommendations for interesting new features such as links, extensions, web apps or themes, in order to create a set of "suggested links" for the new tab page.  Web resources are currently available only in a rudimentary form, to be used for testing purposes.

Web Resource Feed Format

The format currently expected in the JSON feed is a list of dictionaries, like that from Google's Popgadget server (whose JSON feed should be active starting June 22, 2009):

[
  { 
     "url":"http://lifehacker.com",
     "title":"Top 10 How-to Cooking Videos",
     "timestamp":"2009-06-15T09:31:12Z",
     "pops":"12",
     "snippet":"Cooking isn't a skill you can pick up through reading alone. Watch chefs, ...",
     "thumbnail":"http:\/\/www.gstatic.com\/popgadget\/images\/MTU3ZjBhNDYzMDcyNTI0NA.jpg",
     "source":"Lifehacker"
  },
 {
    "url": ...

Updating and Storing Web Resource Data

The browser periodically (currently, every four hours) pulls data from a web resource feed (currently set to the JSON data attached to this page, as a test pattern), and stores it in the user's preferences.  The browser also stores the time of the last web resource cache update and last server used in the preferences file. 

Enabling Web Resources

To enable web resources, run Chrome with the --enable-web-resources switch.

Accessing Web Resources

A web page accesses the web resources feed with the Javascript call:

    chrome.send('getCachedWebResources');

Chrome delivers the most recently cached web resource item as a list of dictionaries using the callback:

    nextWebResource(data);

To access cached web resource data, implement nextWebResource, and process the data as you wish.

Format of Web Resource Data Passed to Client

The format of data mimics the format of the popgadget data above, but currently only delivers data for url, title, snippet, thumbnail, and source.




Č
ċ
ď
popgadget_test.json
(2k)
Miranda Callahan,
Jun 16, 2009, 12:25 PM
Comments