| Index: chrome/common/extensions/docs/static/browsingData.html
|
| diff --git a/chrome/common/extensions/docs/static/browsingData.html b/chrome/common/extensions/docs/static/browsingData.html
|
| index bd815266c89e0b1c46f207ad7afaa2300fa42bb6..829c81827e26b8a321d3d19f80937d8648ec42ce 100644
|
| --- a/chrome/common/extensions/docs/static/browsingData.html
|
| +++ b/chrome/common/extensions/docs/static/browsingData.html
|
| @@ -86,6 +86,73 @@ chrome.browsingData.removeCookies({
|
| to keep your users up to date on the removal's status.
|
| </p>
|
|
|
| +<h2 id="origin_types">Origin Types</h2>
|
| +
|
| +<p>
|
| + Adding an <code>originType</code> property to the API's options object allows
|
| + you to specify which types of origins ought to be effected. Currently, origins
|
| + are divided into three categories:
|
| +</p>
|
| +<ul>
|
| + <li>
|
| + <code>unprotectedWeb</code> covers the general case of websites that users
|
| + visit without taking any special action. If you don't specify an
|
| + <code>originType</code>, the API defaults to removing data from unprotected
|
| + web origins.
|
| + </li>
|
| + <li>
|
| + <code>protectedWeb</code> covers those web origins that have been installed
|
| + as hosted applications. Installing <a href="https://chrome.google.com/webstore/detail/aknpkdffaafgjchaibgeefbgmgeghloj">
|
| + Angry Birds</a>, for example, protects the origin
|
| + <code>http://chrome.angrybirds.com</code>, and removes it from the
|
| + <code>unprotectedWeb</code> category. Please do be careful when triggering
|
| + deletion of data for these origins: make sure your users know what they're
|
| + getting, as this will irrevocably remove their game data. No one wants to
|
| + knock tiny pig houses over more often than necessary.
|
| + </li>
|
| + <li>
|
| + <code>extension</code> covers origins under the
|
| + <code>chrome-extensions:</code> scheme. Removing extension data is, again,
|
| + something you should be very careful about.
|
| + </li>
|
| +</ul>
|
| +<p>
|
| + We could adjust the previous example to remove only data from protected
|
| + websites as follows:
|
| +</p>
|
| +<pre>var callback = function () {
|
| + // Do something clever here once data has been removed.
|
| +};
|
| +
|
| +var millisecondsPerWeek = 1000 * 60 * 60 * 24 * 7;
|
| +var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek;
|
| +chrome.browsingData.remove({
|
| + "since": oneWeekAgo,
|
| + <b>"originType": {
|
| + "protectedWeb": true
|
| + }</b>
|
| +}, {
|
| + "appcache": true,
|
| + "cache": true,
|
| + "cookies": true,
|
| + "downloads": true,
|
| + "fileSystems": true,
|
| + "formData": true,
|
| + "history": true,
|
| + "indexedDB": true,
|
| + "localStorage": true,
|
| + "pluginData": true,
|
| + "passwords": true,
|
| + "webSQL": true
|
| +}, callback);</pre>
|
| +
|
| +<p class="caution">
|
| + <strong>Seriously</strong>: Be careful with <code>protectedWeb</code> and
|
| + <code>extension</code>. These are destructive operations that your users
|
| + will write angry email about if they're not well-informed about what to
|
| + expect when your extension removes data on their behalf.
|
| +</p>
|
| +
|
| <h2 id="samples">Examples</h2>
|
| <p>
|
| Samples for the <code>browsingData</code> API are available
|
|
|