Skip to content

Commit

Permalink
Updates from feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rebloor committed Sep 2, 2024
1 parent 4b90cce commit f785e27
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ browser-compat: webextensions.api.storage.session.QUOTA_BYTES

{{AddonSidebar}}

The maximum amount of data (in bytes) that can be stored in session storage. The amount of data in session storage is the sum of the size of every value (as measured by the StructuredCloneHolder) plus the sum of every key's length.
The maximum amount of data (in bytes) that can be stored in session storage. Use {{WebExtAPIRef("storage.StorageArea.getBytesInUse()", "storage.session.getBytesInUse()")}} to determine the amount of stored data.

Its value is `10485760`.

Expand All @@ -16,33 +16,3 @@ Its value is `10485760`.
## Browser compatibility

{{Compat}}

<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/Java
let clearing = browser.storage.<storageType>.clear()
```

`<storageType>` is one of the writable storage types — {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, or {{WebExtAPIRef("storage.sync")}}
Where `<storageType>` is one of the writable storage types — {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, or {{WebExtAPIRef("storage.sync")}}

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let results = browser.storage.<storageType>.get(
)
```

`<storageType>` will be one of the writable storage types — {{WebExtAPIRef("storage.sync", "sync")}}, {{WebExtAPIRef("storage.local", "local")}}, or {{WebExtAPIRef("storage.managed", "managed")}}.
Where `<storageType>` is one of the storage types — {{WebExtAPIRef("storage.sync", "sync")}}, {{WebExtAPIRef("storage.local", "local")}}, {{WebExtAPIRef("storage.session", "session")}}, or {{WebExtAPIRef("storage.managed", "managed")}}.

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ browser-compat: webextensions.api.storage.StorageArea.getBytesInUse

Gets the amount of storage space, in bytes, used by one or more items stored in the storage area.

This method is supported in {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, and {{WebExtAPIRef("storage.sync")}}. It's not supported in {{WebExtAPIRef("storage.managed")}}.

> [!NOTE]
> Firefox only provided support in {{WebExtAPIRef("storage.session")}} from Firefox 131. Firefox doesn't provide this method in {{WebExtAPIRef("storage.sync")}}, see [Firefox bug 1385832](https://bugzil.la/1385832).
> Firefox only provided support in {{WebExtAPIRef("storage.session")}} from Firefox 131. Firefox doesn't provide this method in {{WebExtAPIRef("storage.sync")}}, see [Firefox bug 1385832](https://bugzil.la/1385832). Firefox doesn't provide this method in {{WebExtAPIRef("storage.managed")}}.
This is an asynchronous method that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Expand All @@ -24,6 +22,10 @@ let gettingSpace = browser.storage.<storageType>.getBytesInUse(
)
```

Where `<storageType>` is one of the storage types — {{WebExtAPIRef("storage.sync", "sync")}}, {{WebExtAPIRef("storage.local", "local")}}, {{WebExtAPIRef("storage.session", "session")}}, or {{WebExtAPIRef("storage.managed", "managed")}}.

In Firefox, `<storageType>` can't be {{WebExtAPIRef("storage.local")}}, because of [bug 1385832](https://bugzil.la/1385832), and {{WebExtAPIRef("storage.managed")}} isn't supported.

### Parameters

- `keys`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let removingItem = browser.storage.<storageType>.remove(
)
```

`<storageType>` is one of the writable storage types — {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, or {{WebExtAPIRef("storage.sync")}}.
Where `<storageType>` is one of the writable storage types — {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, or {{WebExtAPIRef("storage.sync")}}.

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let settingItem = browser.storage.<storageType>.set(
)
```

`<storageType>` is one of the writable storage types — {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, or {{WebExtAPIRef("storage.sync")}}.
Where `<storageType>` is one of the writable storage types — {{WebExtAPIRef("storage.local")}}, {{WebExtAPIRef("storage.session")}}, or {{WebExtAPIRef("storage.sync")}}.

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ await browser.storage.<storageType>.setAccessLevel(
)
```

`<storageType>` can be the {{WebExtAPIRef("storage.session")}} storage type.
Where `<storageType>` is the {{WebExtAPIRef("storage.session")}} storage type.

### Parameters

Expand Down

0 comments on commit f785e27

Please sign in to comment.