Interface nsICookieBannerServiceType

Service singleton which owns the cookie banner feature. This service owns the cookie banner handling rules. It initializes both the component for importing rules (nsICookieBannerListService) and injecting cookies (nsICookieInjector).

Hierarchy

Properties

isEnabled: boolean

Whether the feature / service is enabled.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Get the domain preference of the given top-level URI. It will return the service mode if there is a site preference for the given URI. Otherwise, it will return MODE_UNSET.

    Parameters

    • aTopLevelURI: nsIURI
    • aIsPrivate: boolean

    Returns nsICookieBannerService_Modes

  • Computes whether we have a rule for the given browsing context or any of its children. This takes the current cookie banner service mode into consideration and whether the BC is in private browsing mode.

    This method only takes the global service mode into account. It will ignore any per-site mode overrides. It is meant for callers to find out whether an applicable rule exists, even if users have disabled the feature for the given site.

    Parameters

    • aBrowsingContext: BrowsingContext

    Returns boolean

  • Insert a cookie banner rule for a domain. If there was previously a rule stored with the same domain it will be overwritten.

    Parameters

    • aRule: nsICookieBannerRule

    Returns void

  • Remove all domain preferences.

    Parameters

    • aIsPrivate: boolean

    Returns void

  • Remove the domain preference of the given top-level URI.

    Parameters

    • aTopLevelURI: nsIURI
    • aIsPrivate: boolean

    Returns void

  • Remove a cookie banner rule.

    Parameters

    • aRule: nsICookieBannerRule

    Returns void

  • Clears the in-memory set that we use to maintain the domains that we have reported telemetry. This function will clear the entry for the given domain. If the domain was not given, it will clear all set.

    Parameters

    • aDomain: string

    Returns void

  • Clears all imported rules. They will be imported again on startup and when enabling the service. This is currently only used for testing.

    doImport - Whether to import initial rule list after reset. Passing false will result in an empty rule list.

    Parameters

    • doImport: boolean

    Returns void

  • Set the domain preference of the given top-level URI.

    Parameters

    • aTopLevelURI: nsIURI
    • aMode: nsICookieBannerService_Modes
    • aIsPrivate: boolean

    Returns void

  • Set the domain preference of the given top-level URI. It will persist the domain preference for private browsing.

    WARNING: setting permanent domain preference will leak data in private browsing. Only use if you understand the consequences and trade-offs. If you are unsure, |setDomainPref| is very likely what you want to use instead.

    Parameters

    • aTopLevelURI: nsIURI
    • aMode: nsICookieBannerService_Modes

    Returns void

Generated using TypeDoc