Bug 1885565 - Part 1: Add mozac_ic_avatar_circle_24 to ui-icons r=android-reviewers...
[gecko.git] / toolkit / components / antitracking / nsIURLQueryStrippingListService.idl
blobf746126c133455123414316e696a377d68a13c70
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 /**
8 * Observer for query stripping list updates.
9 */
10 [scriptable, uuid(ef56ae12-b1bb-43e6-b1d8-16459cb98dfd)]
11 interface nsIURLQueryStrippingListObserver : nsISupports
13 /**
14 * Called by nsIQueryStrippingListService when the list of query stripping
15 * changes and when the observer is first registered. Note that the lists
16 * could have duplicate entries because we would combine the lists from the
17 * pref and remote settings.
19 * @param aStripList
20 * A space-separated list of query parameters that will be stripped.
21 * @param aAllowList
22 * A comma-separated list of hosts (eTLD+1) that are exempt from query
23 * stripping.
25 void onQueryStrippingListUpdate(in AString aStripList, in ACString aAllowList);
27 /**
28 * Called by nsIQueryStrippingListService when the list of query stripping
29 * parameters for strip-on-share feature is updated and when the observer is first registered.
31 * @param aStripRules
32 * An Array of stringified strip rules.
33 * A stringified rule has the form of:
34 * "'queryParams': ['param1', 'param2', ...], 'topLevelSites': ['www.site.com', 'www.site.de', ...]"
36 [implicit_jscontext]
37 void onStripOnShareUpdate(in Array<AString> aStripRules);
40 /**
41 * A service that monitors updates to the query stripping list from sources such
42 * as a local pref and remote settings updates.
44 [scriptable, uuid(afff16f0-3fd2-4153-9ccd-c6d9abd879e4)]
45 interface nsIURLQueryStrippingListService : nsISupports
47 /**
48 * Register a new observer to query stripping list updates. When the observer
49 * is registered it is called immediately once. Afterwards it will be called
50 * whenever the specified pref changes or when remote settings for
51 * partitioning updates.
53 * @param aObserver
54 * An nsIURLQueryStrippingListObserver object or function that
55 * will receive updates to the strip list and the allow list. Will be
56 * called immediately with the current list value.
58 void registerAndRunObserver(in nsIURLQueryStrippingListObserver aObserver);
61 /**
62 * Register a new observer to strip-on-share stripping list updates
63 * (this is the strip-on-share list combined with the QPS list).
64 * When the observer is registered it is called immediately once. Afterwards it will be called
65 * when there is an remote settings update to the QPS strip list.
67 * @param aObserver
68 * An nsIURLQueryStrippingListObserver object or function that
69 * will receive updates to the strip list and the allow list. Will be
70 * called immediately with the current list value.
72 void registerAndRunObserverStripOnShare(in nsIURLQueryStrippingListObserver aObserver);
74 /**
75 * Unregister an observer.
77 * @param aObserver
78 * The nsIURLQueryStrippingListObserver object to unregister.
80 void unregisterObserver(in nsIURLQueryStrippingListObserver aObserver);
82 /**
83 * Unregister an observer for strip-on-share.
85 * @param aObserver
86 * The nsIURLQueryStrippingListObserver object to unregister.
88 void unregisterStripOnShareObserver(in nsIURLQueryStrippingListObserver aObserver);
90 /**
91 * Clear all Lists.
93 * Note that this is for testing purpose.
95 void clearLists();
97 /**
98 * Test-only method used to wait for the list service to initialize fully.
99 * Resolves once the service has reached a fully disabled (false) or fully
100 * enabled state (true).
101 * May also be called when the service is already fully initialized or
102 * disabled, in this case it will resolve immediately.
104 Promise testWaitForInit();
108 * Add new lists with different params
110 * Note that this is for testing purpose.
112 Promise testSetList(in jsval testFile);
116 * Check if Strip on Share observers are unregistered
118 * Note that this is for testing purpose.
120 boolean testHasStripOnShareObservers();
123 * Check if QPS observers are unregistered
125 * Note that this is for testing purpose.
127 boolean testHasQPSObservers();