diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-24 13:20:17 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-24 13:20:17 +0000 |
commit | 006236a292a8dec7b134b3db35bc1d9ea7767513 (patch) | |
tree | eda27d1b15be6996cfd39c3f319edc3efbdf55a4 /chrome/common/extensions/docs/static | |
parent | d597999963e1cf2a90986c5d7b074894efaace41 (diff) | |
download | chromium_src-006236a292a8dec7b134b3db35bc1d9ea7767513.zip chromium_src-006236a292a8dec7b134b3db35bc1d9ea7767513.tar.gz chromium_src-006236a292a8dec7b134b3db35bc1d9ea7767513.tar.bz2 |
Move `browsingData` extension API out of experimental.
As a drive-by, this CL also moves the files out of `.../browser/extensions` and
into `.../browser/extensions/api/browsingdata`.
BUG=115002,101244
TEST=browser_test (ExtensionBrowsingDataTest.*)
Review URL: http://codereview.chromium.org/9424036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/static')
-rw-r--r-- | chrome/common/extensions/docs/static/browsingData.html | 95 | ||||
-rw-r--r-- | chrome/common/extensions/docs/static/experimental.browsingData.html | 101 |
2 files changed, 101 insertions, 95 deletions
diff --git a/chrome/common/extensions/docs/static/browsingData.html b/chrome/common/extensions/docs/static/browsingData.html new file mode 100644 index 0000000..27ed66b --- /dev/null +++ b/chrome/common/extensions/docs/static/browsingData.html @@ -0,0 +1,95 @@ +<div id="pageData-name" class="pageData">BrowsingData API</div> + +<!-- BEGIN AUTHORED CONTENT --> +<p id="classSummary"> + Use the <code>chrome.browsingData</code> module to remove browsing data from a + user's local profile. +</p> + +<h2 id="manifest">Manifest</h2> + +<p> + You must declare the "clear" permission in the + <a href="manifest.html">extension manifest</a> to use this API. +</p> + +<pre>{ + "name": "My extension", + ... + <b>"permissions": [ + "browsingData", + ]</b>, + ... +}</pre> + +<h2 id="usage">Usage</h2> + +<p> + The simplest use-case for this API is a a time-based mechanism for clearing a + user's browsing data. Your code should provide a timestamp which indicates the + historical date after which the user's browsing data should be removed. This + timestamp is formatted as the number of milliseconds since the Unix epoch + (which can be retrieved from a JavaScript <code>Date</code> object via the + <code>getTime</code> method). +</p> + +<p> + For example, to clear all of a user's browsing data from the last week, you + might write code 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 +}, { + "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> + The <code>chrome.browsingData.remove</code> method allows you to remove + various types of browsing data with a single call, and will be much faster + than calling multiple more specific methods. If, however, you only want to + clear one specific type of browsing data (cookies, for example), the more + granular methods offer a readable alternative to a call filled with JSON. +</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.removeCookies({ + "since": oneWeekAgo +}, callback);</pre> + +<p class="caution"> + <strong>Important</strong>: Removing browsing data involves a good deal of + heavy lifting in the background, and can take <em>tens of seconds</em> to + complete, depending on a user's profile. You should use the callback mechanism + to keep your users up to date on the removal's status. +</p> + +<h2 id="samples">Examples</h2> +<p> + Samples for the <code>browsingData</code> API are available + <a href="http://code.google.com/chrome/extensions/trunk/samples.html#chrome.browsingData">on the samples page</a>. +</p> + +<!-- END AUTHORED CONTENT --> diff --git a/chrome/common/extensions/docs/static/experimental.browsingData.html b/chrome/common/extensions/docs/static/experimental.browsingData.html index 86e0fc2..40bc114 100644 --- a/chrome/common/extensions/docs/static/experimental.browsingData.html +++ b/chrome/common/extensions/docs/static/experimental.browsingData.html @@ -1,99 +1,10 @@ -<div id="pageData-name" class="pageData">BrowsingData API</div> +<div id="pageData-name" class="pageData">experimental.browsingData</div> -<!-- BEGIN AUTHORED CONTENT --> -<p id="classSummary"> - Use the <code>chrome.experimental.browsingData</code> module to remove - browsing data from a user's local profile. This module is still experimental. - For more information regarding the usage of experimental APIs, see the - <a href="experimental.html">chrome.experimental.* APIs</a> page. -</p> - -<h2 id="manifest">Manifest</h2> - -<p> - You must declare the "clear" permission in the - <a href="manifest.html">extension manifest</a> to use this API. As the API is - still experimental, you must declare the "experimental" permisson as well. -</p> - -<pre>{ - "name": "My extension", - ... - <b>"permissions": [ - "browsingData", - "experimental" - ]</b>, - ... -}</pre> - -<h2 id="usage">Usage</h2> - -<p> - The simplest use-case for this API is a a time-based mechanism for clearing a - user's browsing data. Your code should provide a timestamp which indicates the - historical date after which the user's browsing data should be removed. This - timestamp is formatted as the number of milliseconds since the Unix epoch - (which can be retrieved from a JavaScript <code>Date</code> object via the - <code>getTime</code> method). -</p> - -<p> - For example, to clear all of a user's browsing data from the last week, you - might write code 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.experimental.browsingData.remove({ - "since": oneWeekAgo -}, { - "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> - The <code>chrome.experimental.browsingData.remove</code> method allows you to - remove various types of browsing data with a single call, and will be much - faster than calling multiple more specific methods. If, however, you only - want to clear one specific type of browsing data (cookies, for example), the - more granular methods offer a readable alternative to a call filled with JSON. -</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.experimental.browsingData.removeCookies({ - "since": oneWeekAgo -}, callback);</pre> - -<p class="caution"> - <strong>Important</strong>: Removing browsing data involves a good deal of - heavy lifting in the background, and can take <em>tens of seconds</em> to - complete, depending on a user's profile. You should use the callback mechanism - to keep your users up to date on the removal's status. -</p> - -<h2 id="samples">Examples</h2> <p> - Samples for the <code>browsingData</code> API are available - <a href="http://code.google.com/chrome/extensions/trunk/samples.html#chrome.experimental.browsingData">on the samples page</a>. +The <code>BrowsingData</code> API is no longer experimental; +it's supported! You can read all about it at its new home: </p> -<!-- END AUTHORED CONTENT --> +<blockquote> +<a href="browsingData.html">chrome.browsingData</a> +</blockquote> |