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"
8 * Observer for query stripping list updates.
10 [scriptable
, uuid(ef56ae12
-b1bb
-43e6
-b1d8
-16459cb98dfd
)]
11 interface nsIURLQueryStrippingListObserver
: nsISupports
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.
20 * A space-separated list of query parameters that will be stripped.
22 * A comma-separated list of hosts (eTLD+1) that are exempt from query
25 void onQueryStrippingListUpdate
(in ACString aStripList
, in ACString aAllowList
);
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.
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', ...]"
37 void onStripOnShareUpdate
(in Array
<AString
> aStripRules
);
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
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.
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
);
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.
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
);
75 * Unregister an observer.
78 * The nsIURLQueryStrippingListObserver object to unregister.
80 void unregisterObserver
(in nsIURLQueryStrippingListObserver aObserver
);
83 * Unregister an observer for strip-on-share.
86 * The nsIURLQueryStrippingListObserver object to unregister.
88 void unregisterStripOnShareObserver
(in nsIURLQueryStrippingListObserver aObserver
);
93 * Note that this is for testing purpose.
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
();