nsICookieJarSettings.idl (3042B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: ft=cpp tw=78 sw=2 et ts=2 sts=2 cin 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "nsISupports.idl" 8 #include "nsISerializable.idl" 9 10 interface nsIPrincipal; 11 interface nsIURI; 12 13 /** 14 * Cookie jar settings for top-level documents. Please see CookieJarSettings.h 15 * for more details. 16 */ 17 [scriptable, builtinclass, uuid(3ec40331-7cf0-4b71-ba2a-2265aab8f6bc)] 18 interface nsICookieJarSettings : nsISerializable 19 { 20 /** 21 * CookieBehavior at the loading of the document. Any other loadInfo 22 * inherits it from its document's loadInfo. If there is not a document 23 * involved, cookieBehavior is reject. 24 */ 25 [infallible] readonly attribute unsigned long cookieBehavior; 26 27 /** 28 * First-Party Isolation state at the loading of the document. 29 */ 30 [infallible] readonly attribute boolean isFirstPartyIsolated; 31 32 /** 33 * Resist Fingerprinting state at the loading of the document. 34 */ 35 [infallible] readonly attribute boolean shouldResistFingerprinting; 36 37 /** 38 * Whether our cookie behavior mandates rejecting third-party contexts. 39 */ 40 [infallible] readonly attribute boolean rejectThirdPartyContexts; 41 42 [infallible] readonly attribute boolean limitForeignContexts; 43 44 [infallible] readonly attribute boolean blockingAllThirdPartyContexts; 45 46 [infallible] readonly attribute boolean blockingAllContexts; 47 /** 48 * Whether our cookie behavior mandates partitioning third-party content. 49 */ 50 [infallible] attribute boolean partitionForeign; 51 52 /** 53 * Whether the top-level document is on the content blocking allow list. 54 */ 55 [infallible] readonly attribute boolean isOnContentBlockingAllowList; 56 57 /** 58 * The key used for partitioning. 59 */ 60 readonly attribute AString partitionKey; 61 62 /** 63 * The key used for fingerprinting randomization. 64 */ 65 readonly attribute Array<uint8_t> fingerprintingRandomizationKey; 66 67 /** 68 * CookiePermission at the loading of the document for a particular 69 * principal. It returns the same cookiePermission also in case it changes 70 * during the life-time of the top document. 71 */ 72 unsigned long cookiePermission(in nsIPrincipal aPrincipal); 73 74 /** 75 * Initiate the cookieJarSettings with a URI. The aURI will be used to build 76 * the partition key for this cookieJarSettings. This function is added for 77 * js code to be able to set the partitionKey from a first-party URI. 78 * 79 * The aIsPrivate indicates if this cookieJarSettings is initiated for the 80 * private browsing mode or not. If aIsPrivate was true, it will get 81 * cookieBehavior from the pref "network.cookie.cookieBehavior" which is for 82 * the regular browsing mode. Otherwise, it will get from the pref 83 * "network.cookie.cookieBehavior.pbmode" for the private browsing mode. 84 */ 85 void initWithURI(in nsIURI aURI, in boolean aIsPrivate); 86 };