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
"nsIContentPolicy.idl"
6 #include
"nsISupports.idl"
10 interface nsIObserver
;
12 [scriptable
, uuid(9b0353a7
-ab46
-4914-9178-2215ee221e4e
)]
13 interface nsIUrlClassifierBlockedChannel
: nsISupports
16 const unsigned long TRACKING_PROTECTION
= 0;
17 const unsigned long SOCIAL_TRACKING_PROTECTION
= 1;
18 const unsigned long FINGERPRINTING_PROTECTION
= 2;
19 const unsigned long CRYPTOMINING_PROTECTION
= 3;
21 // Feature that blocks this channel.
22 readonly attribute uint8_t reason
;
24 // Comma separated list of tables that find a match for the channel's url.
25 readonly attribute ACString tables
;
27 readonly attribute AString url
;
29 readonly attribute uint64_t tabId
;
31 readonly attribute uint64_t channelId
;
33 readonly attribute
boolean isPrivateBrowsing
;
35 readonly attribute AString topLevelUrl
;
37 // Unblock the load, but inform the UI that the tracking content will be
38 // replaced with a shim. The unblocked channel is still considered as a
39 // tracking channel. The only difference to allow() is the event sent to the
40 // UI. Calls to replace will only unblock the channel. Callers are responsible
41 // for replacing the tracking content.
44 // Unblock the load and inform the UI that the channel has been allowed to
45 // load. The unblocked channel is still considered as a tracking channel.
49 [scriptable
, uuid(9411409c
-5dac
-40b9
-ba36
-2738a7237a4c
)]
50 interface nsIChannelClassifierService
: nsISupports
52 // when a channel is blocked, the observer should receive
53 // "urlclassifier-before-block-channel" callback an alternative way is to
54 // use a custom callback instead of using nsIObserver
55 void addListener
(in nsIObserver aObserver
);
57 void removeListener
(in nsIObserver aObserver
);