Skip to content

Commit b2685e3

Browse files
rebloorRob--W
andauthored
Bug 1886894 Clear sessionStorage in browsingData remove options (#41609)
* Bug 1886894 Clear sessionStorage in browsingData remove options * Apply suggestions from review Co-authored-by: Rob Wu <rob@robwu.nl> * Changes requested from feedback * Format fixed from feedback * Apply suggestions from review Co-authored-by: Rob Wu <rob@robwu.nl> --------- Co-authored-by: Rob Wu <rob@robwu.nl>
1 parent 8432c4c commit b2685e3

File tree

12 files changed

+50
-67
lines changed

12 files changed

+50
-67
lines changed

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/datatypeset/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ sidebar: addonsidebar
88

99
The **`browsingData.DataTypeSet`** type describes a set of data types.
1010

11-
It contains a number of boolean properties. The name of each property is the name of a particular type of browsing data: "downloads", "history" and so on. All properties are optional.
11+
It contains a number of boolean properties. The name of each property is the name of a particular type of browsing data: "downloads", "history", and so on. All properties are optional.
1212

1313
This type is used:
1414

15-
- in {{WebExtAPIRef("browsingData.remove()")}} to describe which data types to remove
16-
- in {{WebExtAPIRef("browsingData.settings()")}} to describe which data types are currently selected in the browser's "Clear History" feature.
15+
- in {{WebExtAPIRef("browsingData.remove()")}} to describe which data types to remove.
16+
- in {{WebExtAPIRef("browsingData.settings()")}} to describe which data types are selected in the browser's "Clear History" feature.
1717

1818
## Type
1919

20-
Values of this type are objects. They contain the following properties:
20+
Values of this type are objects. They contain these properties:
2121

2222
- `cache` {{optional_inline}}
2323
- : `boolean`. The browser's cache.
@@ -28,15 +28,15 @@ Values of this type are objects. They contain the following properties:
2828
- `fileSystems` {{optional_inline}}
2929
- : `boolean`. Website's file systems.
3030
- `formData` {{optional_inline}}
31-
- : `boolean`. Saved form data, for autocomplete.
31+
- : `boolean`. Saved form data for autocomplete.
3232
- `history` {{optional_inline}}
3333
- : `boolean`. The user's browsing history.
3434
- `indexedDB` {{optional_inline}}
3535
- : `boolean`. IndexedDB data.
3636
- `localStorage` {{optional_inline}}
37-
- : `boolean`. Local storage data.
37+
- : `boolean`. Local storage ([`localStorage`](/en-US/docs/Web/API/Window/localStorage)) and session storage ([`sessionStorage`](/en-US/docs/Web/API/Window/sessionStorage)) data.
3838
- `passwords` {{optional_inline}}
39-
- : `boolean`. Saved passwords, for autocomplete.
39+
- : `boolean`. Saved passwords for autocomplete.
4040
- `pluginData` {{optional_inline}}
4141
- : `boolean`. Stored data associated with plugins.
4242
- `serverBoundCertificates` {{optional_inline}}

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can use the {{WebExtAPIRef("browsingData.remove()")}} function to remove any
2424
All the `browsingData.remove[X]()` functions take a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which you can use to control two further aspects of data removal:
2525

2626
- how far back in time to remove data
27-
- whether to remove data only from normal web pages, or also from hosted web apps and add-ons. Note that this option is not yet supported in Firefox.
27+
- whether to remove data only from normal web pages, or also from add-ons. Note that this option is not yet supported in Firefox.
2828

2929
Finally, this API gives you a {{WebExtAPIRef("browsingData.settings()")}} function that gives you the current value of the settings for the browser's built-in "Clear History" feature.
3030

@@ -35,7 +35,7 @@ To use this API you must have the "browsingData" [API permission](/en-US/docs/Mo
3535
- {{WebExtAPIRef("browsingData.DataTypeSet")}}
3636
- : Object used to specify the type of data to remove: for example, history, downloads, passwords, and so on.
3737
- {{WebExtAPIRef("browsingData.RemovalOptions")}}
38-
- : Object used to specify how far back in time to remove data, and whether to remove data added through normal web browsing, by hosted apps, or by add-ons.
38+
- : Object used to specify how far back in time to remove data, and whether to remove data added through normal web browsing or by add-ons.
3939

4040
## Methods
4141

@@ -52,7 +52,7 @@ To use this API you must have the "browsingData" [API permission](/en-US/docs/Mo
5252
- {{WebExtAPIRef("browsingData.removeHistory()")}}
5353
- : Clears the browser's history.
5454
- {{WebExtAPIRef("browsingData.removeLocalStorage()")}}
55-
- : Clears any [local storage](/en-US/docs/Web/API/Window/localStorage) created by websites.
55+
- : Clears any [local storage](/en-US/docs/Web/API/Window/localStorage) and [session storage](/en-US/docs/Web/API/Window/sessionStorage) created by websites.
5656
- {{WebExtAPIRef("browsingData.removePasswords()")}}
5757
- : Clears saved passwords.
5858
- {{WebExtAPIRef("browsingData.removePluginData()")}}

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removaloptions/index.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ browser-compat: webextensions.api.browsingData.RemovalOptions
66
sidebar: addonsidebar
77
---
88

9-
The **`browsingData.RemovalOptions`** type contains options to control certain aspects of browsing data removal.
9+
The **`browsingData.RemovalOptions`** type contains options to control browsing data removal.
1010

1111
## Type
1212

13-
Values of this type are objects. They contain the following properties:
13+
Values of this type are objects. They contain these properties:
1414

1515
- `cookieStoreId` {{optional_inline}}
16-
- : `string`. This property only applies to cookies and indexedDB items. The removal is limited to items belonging to a specific [cookie store](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/CookieStore) as specified by the ID. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
17-
18-
> [!NOTE]
19-
> On Firefox Nightly removal of localStorage items by `cookieStoreId` is also supported.
16+
- : `string`. This property only applies to cookies, indexedDB, and local storage ([`localStorage`](/en-US/docs/Web/API/Window/localStorage)) items. The removal is limited to items belonging to a specific [cookie store](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/CookieStore) as specified by the ID. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information.
2017

2118
- `excludeOrigin` {{optional_inline}}
2219
- : `array` of `string`. List of origins to exclude from the removal process. Can't be used together with `origins`. Only supported for cookies, storage, and cache. Cookies are excluded for the entire registrable domain.
@@ -30,13 +27,13 @@ Values of this type are objects. They contain the following properties:
3027
- : `array` of `string`. List of origins to remove data for. Can't be used together with `excludeOrigins`. Only supported for cookies, storage, and cache. Cookies are cleared for the entire registrable domain.
3128

3229
- `originTypes` {{optional_inline}}
33-
- : `object`. Used to control whether to remove data only from normal web pages, or also from hosted web apps and extensions. If this option is omitted, only data from normal web pages (`unprotectedWeb`) is removed. Before removing data from web apps or extensions, be very careful to ensure that this is really what the user wants.
30+
- : `object`. Used to control whether to remove data only from normal web pages, or also from extensions. If this option is omitted, only data from normal web pages (`unprotectedWeb`) is removed. Before removing data from web apps or extensions, be very careful to ensure that this is really what the user wants.
3431

3532
This object may contain any of the following properties:
3633
- `unprotectedWeb` {{optional_inline}}
3734
- : `boolean`. If present and `true`, remove data from normal web pages.
3835
- `protectedWeb` {{optional_inline}}
39-
- : `boolean`. If present and `true`, remove data from websites that have been installed as hosted apps.
36+
- : `boolean`. If present and `true`, remove data from websites that have been installed as hosted apps. (This option is redundant, as hosted web apps are no longer supported.)
4037
- `extension` {{optional_inline}}
4138
- : `boolean`. If present and `true`, remove data from extensions.
4239

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/remove/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ Removes the specified browsing data.
1010

1111
The browsing data to be removed is specified in the `dataTypes` option, which is a {{WebExtAPIRef("browsingData.DataTypeSet")}} object.
1212

13-
You can use the `removalOptions` option, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to control how far back in time to remove data and whether to remove data only from normal web pages or to remove data from hosted apps and extensions as well.
14-
15-
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
13+
You can use the `removalOptions` option, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to control how far back in time to remove data and whether to remove data only from normal web pages or to remove data from extensions as well.
1614

1715
## Syntax
1816

@@ -26,13 +24,13 @@ let removing = browser.browsingData.remove(
2624
### Parameters
2725

2826
- `removalOptions`
29-
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to control how far back in time to remove data, and whether to remove data from hosted web apps and extensions, or just normal web pages.
27+
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which can be used to control how far back in time to remove data, and whether to remove data from extensions, or just normal web pages.
3028
- `dataTypes`
31-
- : `object`. A {{WebExtAPIRef("browsingData.DataTypeSet")}} object, describing the types of data to remove (e.g., history, downloads, ).
29+
- : `object`. A {{WebExtAPIRef("browsingData.DataTypeSet")}} object, describing the types of data to remove (e.g., history, downloads, etc.).
3230

3331
### Return value
3432

35-
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
33+
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with no arguments when the removal finishes. If an error occurs, the promise is rejected with an error message.
3634

3735
## Examples
3836

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ Clears the browser's cookies.
1010

1111
You can use the `removalOptions` parameter, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to:
1212

13-
- clear only cookies created after a given time
14-
- control whether to clear cookies only set from normal web pages or to clear cookies set from hosted apps and extensions as well.
15-
16-
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
13+
- clear cookies created after a given time.
14+
- control whether to clear cookies set from web pages or web pages and extensions.
1715

1816
## Syntax
1917

@@ -26,11 +24,11 @@ let removing = browser.browsingData.removeCookies(
2624
### Parameters
2725

2826
- `removalOptions`
29-
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only cookies created after a given time, and whether to clear cookies only set from normal web pages or to clear cookies set from hosted apps and extensions as well.
27+
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear cookies created after a given time, and control whether to clear cookies set from web pages or web pages and extensions.
3028

3129
### Return value
3230

33-
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
31+
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with no arguments when the removal has finished. If any error occurs, the promise is rejected with an error message.
3432

3533
## Examples
3634

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removedownloads/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ Clears the browser's download history. Note that this does not delete the downlo
1010

1111
You can use the `removalOptions` parameter, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to:
1212

13-
- clear records of items downloaded after a given time
14-
- control whether to clear only records of items downloaded from normal web pages or to clear records from hosted apps and extensions as well.
15-
16-
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
13+
- clear records of items downloaded after a given time.
14+
- control whether to clear records of items downloaded from web pages or web pages and extensions.
1715

1816
## Syntax
1917

@@ -26,11 +24,11 @@ let removing = browser.browsingData.removeDownloads(
2624
### Parameters
2725

2826
- `removalOptions`
29-
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only records created after a given time, and whether to clear only records of items downloaded from normal web pages or to clear records from hosted apps and extensions as well.
27+
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only records created after a given time, and control whether to clear records of items downloaded from web pages or web pages and extensions.
3028

3129
### Return value
3230

33-
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
31+
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with no arguments when the removal has finished. If any error occurs, the promise is rejected with an error message.
3432

3533
## Examples
3634

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removeformdata/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ Clears data that the browser has saved for autofilling forms.
1010

1111
You can use the `removalOptions` parameter, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to:
1212

13-
- clear only form data entered after a given time
14-
- control whether to clear only form data entered in normal web pages or to clear data entered in hosted apps and extensions as well.
15-
16-
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
13+
- clear form data entered after a given time.
14+
- control whether to clear form data entered in web pages or web pages and extensions.
1715

1816
## Syntax
1917

@@ -26,11 +24,11 @@ let removing = browser.browsingData.removeFormData(
2624
### Parameters
2725

2826
- `removalOptions`
29-
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only form data entered after a given time, and whether to clear only form data entered in normal web pages or to clear data entered in hosted apps and extensions as well.
27+
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only form data entered after a given time, and controi whether to clear form data entered in web pages or web pages and extensions.
3028

3129
### Return value
3230

33-
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
31+
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with no arguments when the removal has finished. If any error occurs, the promise is rejected with an error message.
3432

3533
## Examples
3634

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ Clears the record of web pages that the user has visited (browsing history).
1010

1111
You can use the `removalOptions` parameter, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to:
1212

13-
- clear only records of web pages visited after a given time
14-
- control whether to clear only records of normal web pages or to clear records of hosted apps and extensions as well.
15-
16-
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
13+
- clear records of web pages visited after a given time.
14+
- control whether to clear records of web pages, or web pages and extensions.
1715

1816
## Syntax
1917

@@ -26,11 +24,11 @@ let removing = browser.browsingData.removeHistory(
2624
### Parameters
2725

2826
- `removalOptions`
29-
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only records of web pages visited after a given time, and whether to clear only records of normal web pages or to clear records of hosted apps and extensions as well.
27+
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which can be used to clear records of web pages visited after a given time, and control whether to clear records of web pages or web pages and extensions.
3028

3129
### Return value
3230

33-
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
31+
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with no arguments when the removal has finished. If any error occurs, the promise is rejected with an error message.
3432

3533
## Examples
3634

files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removelocalstorage/index.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ browser-compat: webextensions.api.browsingData.removeLocalStorage
66
sidebar: addonsidebar
77
---
88

9-
Clears any [local storage](/en-US/docs/Web/API/Window/localStorage) created by websites.
9+
Clears any [local storage](/en-US/docs/Web/API/Window/localStorage) and [session storage](/en-US/docs/Web/API/Window/sessionStorage) created by websites and extensions.
1010

1111
You can use the `removalOptions` parameter, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}} object, to:
1212

13-
- clear only local storage objects created after a given time
14-
- control whether to clear only local storage objects created by normal web pages or to clear objects created by hosted apps and extensions as well.
15-
16-
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
13+
- clear local and session storage values created after a given time.
14+
- control whether to clear localStorage and sessionStorage values created by web pages or web pages extensions.
1715

1816
## Syntax
1917

@@ -26,11 +24,11 @@ let removing = browser.browsingData.removeLocalStorage(
2624
### Parameters
2725

2826
- `removalOptions`
29-
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which may be used to clear only local storage objects created by normal web pages or to clear objects created by hosted apps and extensions as well.
27+
- : `object`. A {{WebExtAPIRef("browsingData.RemovalOptions")}} object, which can be used to clear localStorage and sessionStorage values stored after a given time, and control whether to clear localStorage and sessionStorage objects created by web pages, or web pages and extensions.
3028

3129
### Return value
3230

33-
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.
31+
A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that is fulfilled with no arguments when the removal has finished. If any error occurs, the promise is rejected with an error message.
3432

3533
## Examples
3634

0 commit comments

Comments
 (0)