Open Bug 1919153 Opened 1 year ago Updated 1 year ago

Implement cookies.getPartitionKey

Categories

(WebExtensions :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

Details

(Whiteboard: [wecg])

When I introduced partitionKey to the cookies API, I anticipated that we might need a cookies.getPartitionKey method to enable extensions to query the relevant partitionKey for a given document / request context (comment in privacycg/CHIPS#8).

With the increased complexity in the shape of partitionKey, the cookies.getPartitionKey got specified in the WECG, at https://github.com/w3c/webextensions/pull/581, resulting in the proposal at https://github.com/w3c/webextensions/blob/main/proposals/hasCrossSiteAncestor.md#cookiesgetpartitionkey

Part 1 of the spec (partitionKey.hasCrossSiteAncestor) is implemented in bug 1873418.
Part 2 of the spec, cookies.getPartitionKey should be implemented as part of this bug.

During the design phase in WECG PR 581, the MVP converged towards a way to retrieve the partition key for a given document/tab/frame. To determine whether storage is actually partitioned, a content script could call document.hasStorageAccess (this was also mentioned in a thread in WECG PR 581). In Chrome, this makes sense because by default storage is nor partitioned. In Firefox, defaults include partitioned storage, so it would be nice if there is an option that enables extensions to query the active storage partition, without requiring content scripts.

See Also: → 1698863
Severity: -- → N/A
Priority: -- → P3

FYI Chrome has implemented this in Chrome 132 (https://issuetracker.google.com/issues/373361899). I'd like to implement this soon too.

You need to log in before you can comment on or make changes to this bug.