1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
9 interface nsIDomainSet
;
12 * When a domain policy is instantiated by invoking activateDomainPolicy() on
13 * nsIScriptSecurityManager, these domain sets are consulted when each new
14 * global is created (they have no effect on already-created globals).
15 * If javascript is globally enabled with |javascript.enabled|, the blacklists
16 * are consulted. If globally disabled, the whitelists are consulted. Lookups
17 * on blacklist and whitelist happen with contains(), and lookups on
18 * superBlacklist and superWhitelist happen with containsSuperDomain().
20 * When deactivate() is invoked, the domain sets are emptied, and the
21 * nsIDomainPolicy ceases to have any effect on the system.
23 [scriptable
, builtinclass
, uuid(27b10f54
-f34b
-42b7
-8594-4348d3ad7953
)]
24 interface nsIDomainPolicy
: nsISupports
26 readonly attribute nsIDomainSet blacklist
;
27 readonly attribute nsIDomainSet superBlacklist
;
28 readonly attribute nsIDomainSet whitelist
;
29 readonly attribute nsIDomainSet superWhitelist
;
34 [scriptable
, builtinclass
, uuid(946a01ff
-6525-4007-a2c2
-447ebe1875d3
)]
35 interface nsIDomainSet
: nsISupports
38 * Add a domain to the set. No-op if it already exists.
40 void add
(in nsIURI aDomain
);
43 * Remove a domain from the set. No-op if it doesn't exist.
45 void remove
(in nsIURI aDomain
);
48 * Remove all entries from the set.
53 * Returns true if a given domain is in the set.
55 bool contains
(in nsIURI aDomain
);
58 * Returns true if a given domain is a subdomain of one of the entries in
61 bool containsSuperDomain
(in nsIURI aDomain
);