Since the beginning of this week, we have CookieSettings in our codebase.
CookieSettings is a snapshot of cookie policy and cookie permissions in a
precise moment of time. This object is used by top-level documents to have
a consistent cookie configuration also in case the user changes it. New
cookie configurations will apply only to new top-level documents.

I wrote a long comment describing how this object is created, used and
propagated:
https://searchfox.org/mozilla-central/rev/8ff2cd0a27e3764d9540abdc5a66b2fb1e4e9644/netwerk/cookie/CookieSettings.h#20-100

CookieSettings has been introduced by bug 1525245 after the discussion
about "Cookie policy/permission in live documents". See
https://groups.google.com/d/msg/mozilla.dev.platform/qO6MserGVmk/vYHcDMdPCgAJ

Please, don't check the cookie behavior pref or cookie permissions directly
but use CookieSettings instead. This is available from Document,
WorkerPrivate and nsILoadInfo.

An interesting aspect of CookieSettings is that is propagated and used
everywhere (as I said, documents, workers and network channels). This makes
it a good candidate to bring more prefs and more permissions into it and,
maybe, change them for specific contexts.  Below I shortly describe 2 ideas:

- change the network settings when the URL-Classifier flags a document's
channel. This would allow us, for instance, to have custom network proxy
configuration for trackers. I have a proof of concept for this idea.
- custom audio settings: origin A is muted by default, origin B has volume
set to 0.5. See:
https://searchfox.org/mozilla-central/rev/8ff2cd0a27e3764d9540abdc5a66b2fb1e4e9644/dom/interfaces/base/nsIDOMWindowUtils.idl#1746-1757

b
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to