Open Bug 1900427 Opened 4 months ago Updated 3 months ago

Expose CookieJarSettings on nsIGlobalObject for current anti-tracking partitioning idiom in relation to StorageAccess checks

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: asuth, Assigned: asuth, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently we have an idiom in storage access checks like in ServiceWorkerContainer where we do a StorageAccess check and then need to pass CookieJarSettings to mozilla::StoragePartitioningEnabled to be able to determine what to do with that value:

auto storageAllowed = StorageAllowedForWindow(window);
if (NS_WARN_IF(storageAllowed != StorageAccess::eAllow &&
               (!StaticPrefs::privacy_partition_serviceWorkers() ||
                !StoragePartitioningEnabled(storageAllowed,
                                            doc->CookieJarSettings())))) {

While the proposed StorageKey abstraction in bug 1776271 should help us clean up the idiom, in the meantime it's desirable to expose the value on nsIGlobalObject so that we can use the same logic path for windows and workers via nsIGlobalObject like for bug 1131324 that will expose ServiceWorkerContainer on workers. This should help simplify any future cleanups like bug 1776271.

While the change is small, I think it's probably likely useful for this change to have its own bug number and place for discussion. I do currently plan to land this as part of a larger stack, however.

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:asuth, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(smaug)
Flags: needinfo?(bugmail)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: