File: nsIBounceTrackingProtection.idl

package info (click to toggle)
firefox 142.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,591,884 kB
  • sloc: cpp: 7,451,570; javascript: 6,392,463; ansic: 3,712,584; python: 1,388,569; xml: 629,223; asm: 426,919; java: 184,857; sh: 63,439; makefile: 19,150; objc: 13,059; perl: 12,983; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,003; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 53; csh: 10
file content (114 lines) | stat: -rw-r--r-- 5,173 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "nsIBounceTrackingMapEntry.idl"

[scriptable, uuid(4866F748-29DA-4C10-8EAA-ED2F7851E6B1)]
interface nsIBounceTrackingProtection : nsISupports {
    /**
    *  Modes for Bounce Tracking Protection
    *
    *  MODE_DISABLED - Feature fully disabled and not initialized at startup. No
    *  user activation signals are collected. Requires a restart to apply.
    *  MODE_ENABLED - Feature fully enabled. This includes: collection of user
    *  activation signals, classification of bounce trackers, periodic purging
    *  of bounce trackers.
    *  MODE_ENABLED_STANDBY - Tracker classification and purging is disabled.
    *  User activation signals are still collected and stored.
    *  MODE_ENABLED_DRY_RUN - Dry-run mode: The feature is fully enabled, but
    *  tracker purging is simulated. No site data is purged. Purge telemetry
    *  still gets collected.  This mode is helpful for testing the feature
    *  without risking data loss.
    *
    *  For toggling the feature in privacy settings UI switch between
    *  MODE_ENABLED and MODE_ENABLED_DRY_RUN. This is important so that user
    *  activation signals and telemetry are still collected even if the feature
    *  is "turned off" for the user. In the future when we're done collecting
    *  telemetry we may switch this to MODE_ENABLED_STANDBY where we still
    *  collect user activation signals but do not simulate purging.
    *
    *  Fully enabling / disabling the feature (MODE_DISABLED -> x or x ->
    *  MODE_DISABLED) requires a restart to apply.
    */
    cenum Modes : 8 {
        MODE_DISABLED = 0,
        MODE_ENABLED = 1,
        MODE_ENABLED_STANDBY = 2,
        MODE_ENABLED_DRY_RUN = 3,
        // Not a valid mode, only used for pref validation.
        MAX_MODE_VALUE = 3,
    };

    // Reset the global bounce tracking state, including the maps for tracking
    // bounce tracker candidates and user activation.
    void clearAll();

    // Clear bounce tracking state for a specific site host and OriginAttributes pair.
    [implicit_jscontext]
    void clearBySiteHostAndOriginAttributes(in ACString aSiteHost, in jsval originAttributes);

    // Clear bounce tracking state for a specific site host and
    // OriginAttributesPattern.
    // aOriginAttributesPattern = {} clears for all OriginAttributes.
    [implicit_jscontext]
    void clearBySiteHostAndOriginAttributesPattern(in ACString aSiteHost, in jsval aOriginAttributesPattern);

    // Clear bounce tracking state for a specific time range.
    void clearByTimeRange(in PRTime aFrom, in PRTime aTo);

    // Clear bounce tracking state for the given origin attributes.
    void clearByOriginAttributesPattern(in AString aPattern);

    // Add a list of hosts to the global exception list. Hosts on the exception
    // list don't get purged. addSiteHostExceptions and removeSiteHostExceptions
    // are used by BTPRemoteExceptionList to populate entries coming from
    // RemoteSettings.
    void addSiteHostExceptions(in Array<ACString> aSiteHosts);

    // Remove a list of hosts from the global exception list.
    void removeSiteHostExceptions(in Array<ACString> aSiteHosts);

    // Checks whether a site has recently been purged by BTP. This check is done
    // across all OriginAttributes.
    boolean hasRecentlyPurgedSite(in ACString aSiteHost);

    // Test getter to inspect remote exception list state.
    Array<ACString> testGetSiteHostExceptions();

    // Trigger the bounce tracking timer algorithm that clears state for
    // classified bounce trackers.
    [implicit_jscontext]
    Promise testRunPurgeBounceTrackers();

    // Clear expired user activation flags. Expiry is set via pref
    // "privacy.bounceTrackingProtection.bounceTrackingActivationLifetimeSec".
    void testClearExpiredUserActivations();

    // Getters and setters for user activation and bounce tracker state.
    // These are used for testing purposes only.
    // State is keyed by OriginAttributes.

    [implicit_jscontext]
    Array<nsIBounceTrackingMapEntry> testGetBounceTrackerCandidateHosts(in jsval originAttributes);

    [implicit_jscontext]
    Array<nsIBounceTrackingMapEntry> testGetUserActivationHosts(in jsval originAttributes);

    [implicit_jscontext]
    void testAddBounceTrackerCandidate(in jsval originAttributes, in ACString aSiteHost, in PRTime aBounceTime);

    [implicit_jscontext]
    void testAddUserActivation(in jsval originAttributes, in ACString aSiteHost, in PRTime aActivationTime);

    // Get a list of recently purged bounce trackers.
    [implicit_jscontext]
    Array<nsIBounceTrackingPurgeEntry> testGetRecentlyPurgedTrackers(in jsval originAttributes);

    // Test helper to trigger user activation import from the permission
    // manager. Will only import if the pref
    // privacy.bounceTrackingProtection.hasMigratedUserActivationData is set to
    // false.
    void testMaybeMigrateUserInteractionPermissions();
};