Fix several issues in webext storage docs#43924
Conversation
storage/onchanged: - Mention storage.StorageArea.onChanged in storage.onChanged. - Change "return" terminology to "listener" / "receive" in onChanged. - Add missing "session" to storage.onChanged's areaName parameter. - Include mention of `storage.managed` behavior that was already mentioned in the storage.StorageArea.onChanged docs. storage/storagearea: - Clarify that `StorageArea` is an abstract type and explicitly mention the concrete APIs it applies to. storage/onchanged: - Change "return" terminology to "listener" / "receive" in onChanged. - Fix very confusing description of managed storage. storage/setaccesslevel: - Drop mention of it supporting session only. It expanded to all storage areas in Chrome 140 (https://issues.chromium.org/issues/40949182). storage/storagechange: - Mention the events this type relates to.
|
Preview URLs (5 pages)
External URLs (4)URL:
URL:
(comment last updated: 2026-04-29 23:29:44) |
| Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. This `setAccessLevel` method is used to expose the session storage area to content scripts too. | ||
|
|
||
| Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. This `setAccessLevel` method is used to expose the session storage area to content scripts too. By default, all other storage areas are exposed to all extension contexts, including content scripts. | ||
| By default, all other storage areas are exposed to all extension contexts, including content scripts. This `setAccessLevel` method can be used to restrict access of these storage areas in content scripts. |
There was a problem hiding this comment.
| Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. This `setAccessLevel` method is used to expose the session storage area to content scripts too. | |
| Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. This `setAccessLevel` method is used to expose the session storage area to content scripts too. By default, all other storage areas are exposed to all extension contexts, including content scripts. | |
| By default, all other storage areas are exposed to all extension contexts, including content scripts. This `setAccessLevel` method can be used to restrict access of these storage areas in content scripts. | |
| Use this method to: | |
| - Expose the `session` storage area to content scripts. Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. | |
| - Restrict content scripts' access to `local`, `managed`, and `sync` storage areas. By default, these storage areas are exposed to all extension contexts, including content scripts. |
There was a problem hiding this comment.
Added "by default" to your suggested description for session.
| Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. This `setAccessLevel` method is used to expose the session storage area to content scripts too. | |
| Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts. This `setAccessLevel` method is used to expose the session storage area to content scripts too. By default, all other storage areas are exposed to all extension contexts, including content scripts. | |
| By default, all other storage areas are exposed to all extension contexts, including content scripts. This `setAccessLevel` method can be used to restrict access of these storage areas in content scripts. | |
| Use this method to: | |
| - Expose the `session` storage area to content scripts. Unlike other storage areas, `storage.session` is only available to privileged (trusted) extension contexts by default. | |
| - Restrict content scripts' access to `local`, `managed`, and `sync` storage areas. By default, these storage areas are exposed to all extension contexts, including content scripts. |
Co-authored-by: rebloor <git@sherpa.co.nz>
…d/index.md Co-authored-by: rebloor <git@sherpa.co.nz>
Rob--W
left a comment
There was a problem hiding this comment.
I thumbed up the remaining review comments. The one remaining question is what to do with "line 13". To duplicate it in the other doc, or to remove it altogether?
Co-authored-by: rebloor <git@sherpa.co.nz> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: rebloor <git@sherpa.co.nz>
| Fires when one or more items in any of the {{WebExtAPIRef('storage.StorageArea', 'storage areas'}} changes. | ||
| If you only need to listen for changes in one storage area, use {{WebExtAPIRef('storage.StorageArea.onChanged')}} instead. | ||
|
|
||
| Fired when {{WebExtAPIRef('storage.StorageArea.set','storageArea.set')}}, {{WebExtAPIRef('storage.StorageArea.remove','storageArea.remove')}}, or {{WebExtAPIRef('storage.StorageArea.clear','storageArea.clear')}} executes against any of the {{WebExtAPIRef('storage.StorageArea', 'storage areas'}}. |
There was a problem hiding this comment.
@rebloor I did not see the edit you described in #43924 (review) . This is what you intended, right?
| Fired when {{WebExtAPIRef('storage.StorageArea.set','storageArea.set')}}, {{WebExtAPIRef('storage.StorageArea.remove','storageArea.remove')}}, or {{WebExtAPIRef('storage.StorageArea.clear','storageArea.clear')}} executes against any of the {{WebExtAPIRef('storage.StorageArea', 'storage areas'}}. |
There was a problem hiding this comment.
As discussed elsewhere, the deleted line is b8ddbd3#diff-290285c0b842409595fc422eb75c72a432c324f46b53c9550c5b3f6cf18f7da6L13
Description
storage/onchanged:
storage.managedbehavior that was already mentioned in the storage.StorageArea.onChanged docs.storage/storagearea:
StorageAreais an abstract type and explicitly mention the concrete APIs it applies to.storage/onchanged:
storage/setaccesslevel:
storage/storagechange:
Motivation
Documentation was inaccurate, misleading or confusing.
Additional details
Related issues and pull requests