A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members) or send an e-mail to admin@wiki.whatwg.org with your desired username and an explanation of the first edit you'd like to make. (Do not use this e-mail address for any other inquiries, as they will be ignored or politely declined.)

Sharing/API

From WHATWG Wiki
Jump to: navigation, search

This is a proposal for user agent managed sharing on the web.

Introduction

A share endpoint, e.g. bookmarks.example, can register itself with a user agent through an API. Afterwards, when a user visits a site, they can activate user agent UI to share the current URL with a page on bookmarks.example presented in an overlay browsing context (typically shown on top of the current document within the top-level browsing context).

Think of it as exposing bookmark functionality to third-party services.

User agent

The user agent has a list of share endpoints. Each share endpoint consists of a URL, optionally an icon, optionally a title, and optionally a size.

Issue: Do we need a description for other parts of user agent UI? Issue: Ensure title cannot be abused for spoofing.

Share UI

The user agent exposes the ability to share the top-level browsing context's document's URL with a share endpoint picked by the user.

Share endpoint

A share endpoint can add itself to a user agent's list of share endpoints.

   Promise<boolean> addShareEndpoint(shareEndpointURL, {icon, title, size})
   Promise<boolean> deleteShareEndpoint(shareEndpointURL)
   Proimse<boolean> hasShareEndpoint(shareEndpointURL)

Issue: Allow one or multiple share endpoints per origin?

Overlay browsing context

Sized according to hints give by developer.

Can be dismissed through window.close().

Issue: Does this need the history API?