Open Bug 1724754 Opened 4 years ago Updated 9 days ago

Implement StorageArea.setAccessLevel to separate extension storage for privileged extension principals and unprivileged content scripts

Categories

(WebExtensions :: Storage, enhancement, P3)

enhancement
Points:
5

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [mv3-future])

The storage extension API (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage) is allows extensions to store and retrieve data as key-value pairs.

Unlike most extension APIs, this API is also available to content scripts. This has two downsides:

  • Security: The extension storage API is not exclusive to privileged extension contexts; unprivileged contexts can access and modify the data too.
  • Performance: Any changes to the storage need to be broadcast to all (content) processes, since content scripts can potentially run everywhere.

We should look into a way to separate the storage by default, with an opt-in for reverting to the current behavior. This would be a breaking change, which we could do as part of manifest V3.

Chromium is investigating a similar feature: https://bugs.chromium.org/p/chromium/issues/detail?id=1227410

Severity: -- → N/A
Priority: -- → P3
Whiteboard: [mv3-future]
Points: --- → 5

The storage.session API is supposedly restricted to extension processes (not content scripts) by default (https://developer.chrome.com/docs/extensions/reference/storage/#storage-areas)

When storage.session (bug 1687778) is implemented, we should at least implement the storage.session.setAccessLevel API, which should be documented as StorageArea.setAccessLevel .

Summary: Separate extension storage for privileged extension principals and unprivileged content scripts → Separate extension storage for privileged extension principals and unprivileged content scripts (including storage.session.setAccessLevel)
Summary: Separate extension storage for privileged extension principals and unprivileged content scripts (including storage.session.setAccessLevel) → Implement StorageArea.setAccessLevel to separate extension storage for privileged extension principals and unprivileged content scripts
See Also: → 2018494
You need to log in before you can comment on or make changes to this bug.