W3C home > Mailing lists > Public > public-device-apis@w3.org > January 2011

Re: Contacts API updates

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Wed, 12 Jan 2011 17:03:06 +0200
CC: "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <10E1AC67-1F65-44A0-B1BE-F9F10B977DB7@nokia.com>
To: ext Rich Tibbett <rich.tibbett@gmail.com>

On 6.1.2011, at 18.35, ext Rich Tibbett wrote:

> On Thu, Jan 6, 2011 at 4:30 PM, Rich Tibbett <rich.tibbett@gmail.com> wrote:
> I've updated the Contacts draft in line with recent discussions.
> As usual, the CVS log is available at [1] and changes from the previous version can be viewed via the diff log at [2].
> Please let me know if there are any outstanding changes to be made and thanks for all your input to date.

Looks great! It would be cool if we could also use data URIs for adding/updating contacts (or calendar entries/...) as an alternative to the File Writer-based mechanism described here:


Actually, the following works in Chrome already:

<a id="vcard">Save Contact</a>

var vcard = 'BEGIN:VCARD\n' +
            'VERSION:3.0\n' +
            'N:Doe;John;;;\n' +
            'FN:John Doe\n' +
            'TEL;type=CELL:123456\n' +

document.getElementById('vcard').href = 'data:text/x-vcard;charset=utf-8,' + encodeURIComponent(vcard);

It seems Chrome acts solely based on provided MIME-type (text/x-vcard), and does not require Content-Disposition header in order to trigger the Open/Save As dialog.

I found a thread on this exact case but it seems it did not go anywhere:


Received on Wednesday, 12 January 2011 15:05:10 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:47 UTC