| OLD | NEW |
| 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: |
| 2 1) The <head> information in this page is significant, should be uniform | 2 1) The <head> information in this page is significant, should be uniform |
| 3 across api docs and should be edited only with knowledge of the | 3 across api docs and should be edited only with knowledge of the |
| 4 templating mechanism. | 4 templating mechanism. |
| 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a |
| 6 browser, it will be re-generated from the template, json schema and | 6 browser, it will be re-generated from the template, json schema and |
| 7 authored overview content. | 7 authored overview content. |
| 8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
| 9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
| 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 <ol> | 193 <ol> |
| 194 <li> | 194 <li> |
| 195 <a href="#manifest">Manifest</a> | 195 <a href="#manifest">Manifest</a> |
| 196 <ol> | 196 <ol> |
| 197 </ol> | 197 </ol> |
| 198 </li><li> | 198 </li><li> |
| 199 <a href="#usage">Usage</a> | 199 <a href="#usage">Usage</a> |
| 200 <ol> | 200 <ol> |
| 201 </ol> | 201 </ol> |
| 202 </li><li> | 202 </li><li> |
| 203 <a href="#origin_types">Origin Types</a> |
| 204 <ol> |
| 205 </ol> |
| 206 </li><li> |
| 203 <a href="#samples">Examples</a> | 207 <a href="#samples">Examples</a> |
| 204 <ol> | 208 <ol> |
| 205 </ol> | 209 </ol> |
| 206 </li> | 210 </li> |
| 207 <li> | 211 <li> |
| 208 <a href="#apiReference">API reference: chrome.browsingData</a> | 212 <a href="#apiReference">API reference: chrome.browsingData</a> |
| 209 <ol> | 213 <ol> |
| 210 <li> | 214 <li> |
| 211 <a href="#global-methods">Methods</a> | 215 <a href="#global-methods">Methods</a> |
| 212 <ol> | 216 <ol> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek; | 327 var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek; |
| 324 chrome.browsingData.removeCookies({ | 328 chrome.browsingData.removeCookies({ |
| 325 "since": oneWeekAgo | 329 "since": oneWeekAgo |
| 326 }, callback);</pre> | 330 }, callback);</pre> |
| 327 <p class="caution"> | 331 <p class="caution"> |
| 328 <strong>Important</strong>: Removing browsing data involves a good deal of | 332 <strong>Important</strong>: Removing browsing data involves a good deal of |
| 329 heavy lifting in the background, and can take <em>tens of seconds</em> to | 333 heavy lifting in the background, and can take <em>tens of seconds</em> to |
| 330 complete, depending on a user's profile. You should use the callback mechanism | 334 complete, depending on a user's profile. You should use the callback mechanism |
| 331 to keep your users up to date on the removal's status. | 335 to keep your users up to date on the removal's status. |
| 332 </p> | 336 </p> |
| 337 <h2 id="origin_types">Origin Types</h2> |
| 338 <p> |
| 339 Adding an <code>originType</code> property to the API's options object allows |
| 340 you to specify which types of origins ought to be effected. Currently, origins |
| 341 are divided into three categories: |
| 342 </p> |
| 343 <ul> |
| 344 <li> |
| 345 <code>unprotectedWeb</code> covers the general case of websites that users |
| 346 visit without taking any special action. If you don't specify an |
| 347 <code>originType</code>, the API defaults to removing data from unprotected |
| 348 web origins. |
| 349 </li> |
| 350 <li> |
| 351 <code>protectedWeb</code> covers those web origins that have been installed |
| 352 as hosted applications. Installing <a href="https://chrome.google.com/websto
re/detail/aknpkdffaafgjchaibgeefbgmgeghloj"> |
| 353 Angry Birds</a>, for example, protects the origin |
| 354 <code>http://chrome.angrybirds.com</code>, and removes it from the |
| 355 <code>unprotectedWeb</code> category. Please do be careful when triggering |
| 356 deletion of data for these origins: make sure your users know what they're |
| 357 getting, as this will irrevocably remove their game data. No one wants to |
| 358 knock tiny pig houses over more often than necessary. |
| 359 </li> |
| 360 <li> |
| 361 <code>extension</code> covers origins under the |
| 362 <code>chrome-extensions:</code> scheme. Removing extension data is, again, |
| 363 something you should be very careful about. |
| 364 </li> |
| 365 </ul> |
| 366 <p> |
| 367 We could adjust the previous example to remove only data from protected |
| 368 websites as follows: |
| 369 </p> |
| 370 <pre>var callback = function () { |
| 371 // Do something clever here once data has been removed. |
| 372 }; |
| 373 var millisecondsPerWeek = 1000 * 60 * 60 * 24 * 7; |
| 374 var oneWeekAgo = (new Date()).getTime() - millisecondsPerWeek; |
| 375 chrome.browsingData.remove({ |
| 376 "since": oneWeekAgo, |
| 377 <b>"originType": { |
| 378 "protectedWeb": true |
| 379 }</b> |
| 380 }, { |
| 381 "appcache": true, |
| 382 "cache": true, |
| 383 "cookies": true, |
| 384 "downloads": true, |
| 385 "fileSystems": true, |
| 386 "formData": true, |
| 387 "history": true, |
| 388 "indexedDB": true, |
| 389 "localStorage": true, |
| 390 "pluginData": true, |
| 391 "passwords": true, |
| 392 "webSQL": true |
| 393 }, callback);</pre> |
| 394 <p class="caution"> |
| 395 <strong>Seriously</strong>: Be careful with <code>protectedWeb</code> and |
| 396 <code>extension</code>. These are destructive operations that your users |
| 397 will write angry email about if they're not well-informed about what to |
| 398 expect when your extension removes data on their behalf. |
| 399 </p> |
| 333 <h2 id="samples">Examples</h2> | 400 <h2 id="samples">Examples</h2> |
| 334 <p> | 401 <p> |
| 335 Samples for the <code>browsingData</code> API are available | 402 Samples for the <code>browsingData</code> API are available |
| 336 <a href="http://code.google.com/chrome/extensions/trunk/samples.html#chrome.br
owsingData">on the samples page</a>. | 403 <a href="http://code.google.com/chrome/extensions/trunk/samples.html#chrome.br
owsingData">on the samples page</a>. |
| 337 </p> | 404 </p> |
| 338 <!-- END AUTHORED CONTENT --> | 405 <!-- END AUTHORED CONTENT --> |
| 339 </div> | 406 </div> |
| 340 <!-- API PAGE --> | 407 <!-- API PAGE --> |
| 341 <div class="apiPage"> | 408 <div class="apiPage"> |
| 342 <a name="apiReference"></a> | 409 <a name="apiReference"></a> |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 ) | 1883 ) |
| 1817 </div> | 1884 </div> |
| 1818 </em> | 1885 </em> |
| 1819 </dt> | 1886 </dt> |
| 1820 <dd>Remove data accumulated on or after this date, represented in mill
iseconds since the epoch (accessible via the <code>getTime</code> method of the
JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remo
ve all browsing data).</dd> | 1887 <dd>Remove data accumulated on or after this date, represented in mill
iseconds since the epoch (accessible via the <code>getTime</code> method of the
JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remo
ve all browsing data).</dd> |
| 1821 <!-- OBJECT PROPERTIES --> | 1888 <!-- OBJECT PROPERTIES --> |
| 1822 <!-- OBJECT METHODS --> | 1889 <!-- OBJECT METHODS --> |
| 1823 <!-- OBJECT EVENT FIELDS --> | 1890 <!-- OBJECT EVENT FIELDS --> |
| 1824 <!-- FUNCTION PARAMETERS --> | 1891 <!-- FUNCTION PARAMETERS --> |
| 1825 </div> | 1892 </div> |
| 1893 </div><div> |
| 1894 <div> |
| 1895 <dt> |
| 1896 <var>originTypes</var> |
| 1897 <em> |
| 1898 <!-- TYPE --> |
| 1899 <div style="display:inline"> |
| 1900 ( |
| 1901 <span class="optional">optional</span> |
| 1902 <span id="typeTemplate"> |
| 1903 <span> |
| 1904 <span>object</span> |
| 1905 </span> |
| 1906 </span> |
| 1907 ) |
| 1908 </div> |
| 1909 </em> |
| 1910 </dt> |
| 1911 <dd>An object whose properties specify which origin types ought to be
cleared. If this object isn't specified, it defaults to clearing only "unprotect
ed" origins. Please ensure that you <em>really</em> want to remove application d
ata before adding 'protectedWeb' or 'extensions'.</dd> |
| 1912 <!-- OBJECT PROPERTIES --> |
| 1913 <dd> |
| 1914 <dl> |
| 1915 <div> |
| 1916 <div> |
| 1917 <dt> |
| 1918 <var>unprotectedWeb</var> |
| 1919 <em> |
| 1920 <!-- TYPE --> |
| 1921 <div style="display:inline"> |
| 1922 ( |
| 1923 <span class="optional">optional</span> |
| 1924 <span id="typeTemplate"> |
| 1925 <span> |
| 1926 <span>boolean</span> |
| 1927 </span> |
| 1928 </span> |
| 1929 ) |
| 1930 </div> |
| 1931 </em> |
| 1932 </dt> |
| 1933 <dd>Normal websites.</dd> |
| 1934 <!-- OBJECT PROPERTIES --> |
| 1935 <!-- OBJECT METHODS --> |
| 1936 <!-- OBJECT EVENT FIELDS --> |
| 1937 <!-- FUNCTION PARAMETERS --> |
| 1938 </div> |
| 1939 </div><div> |
| 1940 <div> |
| 1941 <dt> |
| 1942 <var>protectedWeb</var> |
| 1943 <em> |
| 1944 <!-- TYPE --> |
| 1945 <div style="display:inline"> |
| 1946 ( |
| 1947 <span class="optional">optional</span> |
| 1948 <span id="typeTemplate"> |
| 1949 <span> |
| 1950 <span>boolean</span> |
| 1951 </span> |
| 1952 </span> |
| 1953 ) |
| 1954 </div> |
| 1955 </em> |
| 1956 </dt> |
| 1957 <dd>Websites that have been installed as hosted applications (be caref
ul!).</dd> |
| 1958 <!-- OBJECT PROPERTIES --> |
| 1959 <!-- OBJECT METHODS --> |
| 1960 <!-- OBJECT EVENT FIELDS --> |
| 1961 <!-- FUNCTION PARAMETERS --> |
| 1962 </div> |
| 1963 </div><div> |
| 1964 <div> |
| 1965 <dt> |
| 1966 <var>extension</var> |
| 1967 <em> |
| 1968 <!-- TYPE --> |
| 1969 <div style="display:inline"> |
| 1970 ( |
| 1971 <span class="optional">optional</span> |
| 1972 <span id="typeTemplate"> |
| 1973 <span> |
| 1974 <span>boolean</span> |
| 1975 </span> |
| 1976 </span> |
| 1977 ) |
| 1978 </div> |
| 1979 </em> |
| 1980 </dt> |
| 1981 <dd>Extensions and packaged applications a user has installed (be _rea
lly_ careful!).</dd> |
| 1982 <!-- OBJECT PROPERTIES --> |
| 1983 <!-- OBJECT METHODS --> |
| 1984 <!-- OBJECT EVENT FIELDS --> |
| 1985 <!-- FUNCTION PARAMETERS --> |
| 1986 </div> |
| 1826 </div> | 1987 </div> |
| 1827 </dl> | 1988 </dl> |
| 1828 </dd> | 1989 </dd> |
| 1990 <!-- OBJECT METHODS --> |
| 1991 <!-- OBJECT EVENT FIELDS --> |
| 1992 <!-- FUNCTION PARAMETERS --> |
| 1993 </div> |
| 1994 </div> |
| 1995 </dl> |
| 1996 </dd> |
| 1829 <!-- OBJECT METHODS --> | 1997 <!-- OBJECT METHODS --> |
| 1830 <!-- OBJECT EVENT FIELDS --> | 1998 <!-- OBJECT EVENT FIELDS --> |
| 1831 <!-- FUNCTION PARAMETERS --> | 1999 <!-- FUNCTION PARAMETERS --> |
| 1832 </div> | 2000 </div> |
| 1833 </div> <!-- /apiItem --> | 2001 </div> <!-- /apiItem --> |
| 1834 </div> <!-- /apiGroup --> | 2002 </div> <!-- /apiGroup --> |
| 1835 </div> <!-- /apiPage --> | 2003 </div> <!-- /apiPage --> |
| 1836 </div> <!-- /gc-pagecontent --> | 2004 </div> <!-- /gc-pagecontent --> |
| 1837 </div> <!-- /g-section --> | 2005 </div> <!-- /g-section --> |
| 1838 </div> <!-- /codesiteContent --> | 2006 </div> <!-- /codesiteContent --> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1863 _uff=0; | 2031 _uff=0; |
| 1864 urchinTracker(); | 2032 urchinTracker(); |
| 1865 } | 2033 } |
| 1866 catch(e) {/* urchinTracker not available. */} | 2034 catch(e) {/* urchinTracker not available. */} |
| 1867 </script> | 2035 </script> |
| 1868 <!-- end analytics --> | 2036 <!-- end analytics --> |
| 1869 </div> | 2037 </div> |
| 1870 </div> <!-- /gc-footer --> | 2038 </div> <!-- /gc-footer --> |
| 1871 </div> <!-- /gc-container --> | 2039 </div> <!-- /gc-container --> |
| 1872 </body></html> | 2040 </body></html> |
| OLD | NEW |