tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIChannelClassifierService.idl (2125B)


      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/. */
      4 
      5 #include "nsIContentPolicy.idl"
      6 #include "nsISupports.idl"
      7 
      8 interface nsIChannel;
      9 interface nsIURI;
     10 interface nsIObserver;
     11 
     12 [scriptable, uuid(9b0353a7-ab46-4914-9178-2215ee221e4e)]
     13 interface nsIUrlClassifierBlockedChannel: nsISupports
     14 {
     15  // blocked reason
     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;
     20 
     21  // Feature that blocks this channel.
     22  readonly attribute uint8_t reason;
     23 
     24  // Comma separated list of tables that find a match for the channel's url.
     25  readonly attribute ACString tables;
     26 
     27  readonly attribute AString url;
     28 
     29  readonly attribute uint64_t tabId;
     30 
     31  readonly attribute uint64_t channelId;
     32 
     33  readonly attribute boolean isPrivateBrowsing;
     34 
     35  readonly attribute AString topLevelUrl;
     36 
     37  // ID of the top level browser associated with the blocked channel.
     38  readonly attribute uint64_t browserId;
     39 
     40  // Unblock the load, but inform the UI that the tracking content will be
     41  // replaced with a shim. The unblocked channel is still considered as a
     42  // tracking channel. The only difference to allow() is the event sent to the
     43  // UI. Calls to replace will only unblock the channel. Callers are responsible
     44  // for replacing the tracking content.
     45  void replace();
     46 
     47  // Unblock the load and inform the UI that the channel has been allowed to
     48  // load. The unblocked channel is still considered as a tracking channel.
     49  void allow();
     50 };
     51 
     52 [scriptable, uuid(9411409c-5dac-40b9-ba36-2738a7237a4c)]
     53 interface nsIChannelClassifierService : nsISupports
     54 {
     55  // when a channel is blocked, the observer should receive
     56  // "urlclassifier-before-block-channel" callback an alternative way is to
     57  // use a custom callback instead of using nsIObserver
     58  void addListener(in nsIObserver aObserver);
     59 
     60  void removeListener(in nsIObserver aObserver);
     61 };