Changes

Jump to: navigation, search

NPAPI:ClearSiteData

131 bytes added, 16:03, 7 December 2010
Proposal
*Authors: Julian Reschke (greenbytes), Dan Witte <dwitte@mozilla.com>, Bernhard Bauer <bauerb@chromium.org>, Rajesh Gwalani <rgwalani@adobe.com>
The current proposal is 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 add a new call this method, providing the new functionality: . <pre>NPError NPP_ClearSiteData(
PRUint64 flags, // what type of data to clear
const char* origin, // limit to origin
PRUInt64 maxAge // max. age of information in seconds
);</pre> New [https://developer.mozilla.org/en/NPAPI/Constants#Error_Codes NPError codes]: <pre>// can't clear by time range#define NPERR_TIMERANGE_NOT_SUPPORTED (NPERR_BASE + 14)// can't clear by origin#define NPERR_LIMITBYORIGIN_NOT_SUPPORTED (NPERR_BASE + 15)// malformed 'origin' string#define NPERR_MALFORMED_ORIGIN (NPERR_BASE + 16)</pre> Semantics:
*The <code>flags</code> argument is a bitset bit mask representing which the type(s) of data to clear.<pre>#define NP_CLEAR_ALL 0 /* Clear All data */
#define NP_CLEAR_COOKIES 1 << 0 /* Clear cookies */
#define NP_CLEAR_SITE_PREFS 1 << 1 /* Clear site preferences */
#define NP_CLEAR_PLUGIN_STORAGE 1 << 8 /* Clear plugin local storage */
</pre>
*The <code>origin</code> argument is interpreted as follows: **if If a hostname of the form "foo.com", data in the "foo.com" domain and all subdomains should be cleared. In this form, <code>domain</code> domains must be a in lowercase normalized ACE-encoded hostnameform, lowercased; they must not contain a trailing dot; , must not contain a scheme, port, or other such fields; , and must contain at least one embedded dot; .**if If an IP address (either IPv4 or IPv6), data for that IP should be cleared; .**if If <code>NULL</code>, all site-specific data and more generic data on browsing history (for instance, number of sites visited) should be cleared. *The <code>maxAge</code> argument is the maximum age in seconds of data to clear, inclusive, in seconds. 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 NPError values will be available for return from 'NPP_ClearSiteData'. <pre>// can't clear by time range#define NPERR_TIMERANGE_NOT_SUPPORTED (NPERR_BASE + 14)// can't clear by origin#define NPERR_LIMITBYORIGIN_NOT_SUPPORTED (NPERR_BASE + 15)// malformed 'origin' string#define NPERR_MALFORMED_ORIGIN (NPERR_BASE + 16)</pre>
= Open Issues =
Confirm, emeritus
1,680
edits

Navigation menu