Changes

Jump to: navigation, search

NPAPI:ClearSiteData

398 bytes added, 20:59, 25 December 2010
no edit summary
= Contributors =
* Last modified: December 2325, 2010 * Authors: Julian Reschke (greenbytes), Dan Witte (Mozilla), Bernhard Bauer (Chromium), Rajesh Gwalani (Adobe), Josh Aas (Mozilla), Maciej Stachowiak (Apple)
= Overview =
Allows browsers to request that plugins discover and clear locally stored plugin private data.
= Specification =
 
== Discovering Data ==
 
The following method will allow browsers to discover which sites a plugin has data for. Note that plugins (but no instances) must be initialized and function tables retrieved in order to call this method.
 
<pre>
char** NPP_GetSitesWithData();
</pre>
 
This function returns a <code>NULL</code>-terminated list of sites with data. Each site string is a domain per the domain portion of the URI specification but with a requirement for NFKC-normalized UTF-8 encoding. No other encoding is allowed. Memory for site strings must be allocated with <code>NPN_MemAlloc</code> and the browser will be responsible for freeing the memory with <code>NPN_MemFree</code>.
 
== Clearing Data ==
The following method will allow browsers to request that plugins clear data. Note that plugins (but no instances) must be initialized and function tables retrieved in order to call this method.
</pre>
* The <code>site</code> argument is interpreted as follows:
** If <code>NULL</code>, all site-specific data and more generic data on browsing history (for instance, number of sites visited) should be cleared.
** If <code>!NULL</code>, argument is a site string from the discovery API (an exact copy or the original). The browser is responsible for allocating and freeing the memory used for this argument. The plugin must copy the string in order to retain it outside the scope of the call.
* The <code>flags</code> argument is a bit mask representing the type(s) of data to clear.
<pre>
#define NP_CLEAR_ALL 0 /* NP_CLEAR_ALL: Clear all private data */#define NP_CLEAR_ALL NP_CLEAR_CACHE 1 << 0 /* NP_CLEAR_CACHE: Clear cached data which can simply be retrieved again as requested. To be used out of concern for space and not necessarily privacy. */#define NP_CLEAR_CACHE 1 << 0 
/* More flags may be defined later, this spec will be updated. */
</pre>
* The <code>site</code> argument is interpreted as follows:
** If <code>NULL</code>, all site-specific data and more generic data on browsing history (for instance, number of sites visited) should be cleared.
** If <code>!NULL</code>, argument is a domain per the domain portion of the URI specification but with a requirement for NFKC-normalized UTF-8 encoding. No other encoding is allowed. All sub-domains of the specified domain are to be cleared as well. If a sub-domain is specified only it and its sub-domains are to be cleared. For example, if a browser specifies "b.a.com" then data for "b.a.com" and "c.b.a.com" is to be cleared but data for "a.com" is not to be cleared.
* The <code>maxAge</code> argument is the maximum age in seconds of data to clear, inclusive. If <code>maxAge</code> is <code>0</code>, no data is cleared. If <code>maxAge</code> is the maximum unsigned 64-bit integer, all data is cleared.
The following new <code>NPError </code> values will be available for return from <code>NPP_ClearSiteData</code>.:
<pre>
// can't clear by time range
#define NPERR_TIMERANGE_NOT_SUPPORTED NPERR_TIME_RANGE_NOT_SUPPORTED (NPERR_BASE + 14)// can't clear by origin#define NPERR_LIMITBYORIGIN_NOT_SUPPORTED (NPERR_BASE + 15)// malformed 'originsite' string#define NPERR_MALFORMED_ORIGIN NPERR_MALFORMED_SITE (NPERR_BASE + 1615)
</pre>
= Open Issues =
* Do we need a method for discovering what site data the plugin has? Mozilla and Apple have expressed a strong desire for thisNone.
= Notes =
Confirm, emeritus
1,680
edits

Navigation menu