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 exception list updates.
10 [scriptable
, function
, uuid(f7c918e5
-94bf
-4b6e
-9758
-ef7bdab6af7e
)]
11 interface nsIUrlClassifierExceptionListObserver
: nsISupports
14 * Called by nsIUrlClassifierExceptionListService when the exception list
15 * for a designated feature changes and when the observer is first registered.
18 * A comma-separated list of url patterns, intended to be parsed
19 * by nsContentUtils::IsURIInList.
21 void onExceptionListUpdate
(in ACString aList
);
25 * A service that monitors updates to the exception list of url-classifier
26 * feature from sources such as a local pref and remote settings updates.
28 [scriptable
, uuid(75c3d1a3
-e977
-4079-9e27
-b3b56bdb76ea
)]
29 interface nsIUrlClassifierExceptionListService
: nsISupports
32 * Register a new observer to exception list updates. When the observer is
33 * registered it is called immediately once. Afterwards it will be called
34 * whenever the specified pref changes or when remote settings for
35 * url-classifier features updates.
38 * The feature for which to observe the exception list.
41 * (Optional) A pref name to monitor. The pref must be of string
42 * type and contain a comma-separated list of URL patterns.
45 * An nsIUrlClassifierExceptionListObserver object or function that
46 * will receive updates to the exception list as a comma-separated
47 * string. Will be called immediately with the current exception
50 void registerAndRunExceptionListObserver
(in ACString aFeature
,
51 in ACString aPrefName
,
52 in nsIUrlClassifierExceptionListObserver aObserver
);
55 * Unregister an observer.
58 * The feature for which to stop observing.
61 * The nsIUrlClassifierExceptionListObserver object to unregister.
63 void unregisterExceptionListObserver
(in ACString aFeature
,
64 in nsIUrlClassifierExceptionListObserver aObserver
);
67 * Clear all data in the service.
68 * This API is for testing only.