2013-11-13 04:43:35 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIDomainSet;
|
|
|
|
|
2015-03-24 17:29:16 +03:00
|
|
|
%{ C++
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class DomainPolicyClone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
%}
|
|
|
|
|
|
|
|
[ptr] native DomainPolicyClonePtr(mozilla::dom::DomainPolicyClone);
|
2017-02-05 08:52:38 +03:00
|
|
|
[ptr] native DomainPolicyCloneConstPtr(const mozilla::dom::DomainPolicyClone);
|
2015-03-24 17:29:16 +03:00
|
|
|
|
2013-11-13 04:43:35 +04:00
|
|
|
/*
|
|
|
|
* When a domain policy is instantiated by invoking activateDomainPolicy() on
|
|
|
|
* nsIScriptSecurityManager, these domain sets are consulted when each new
|
|
|
|
* global is created (they have no effect on already-created globals).
|
2018-10-31 20:56:43 +03:00
|
|
|
* If javascript is globally enabled with |javascript.enabled|, the blocklists
|
|
|
|
* are consulted. If globally disabled, the allowlists are consulted. Lookups
|
|
|
|
* on blocklist and allowlist happen with contains(), and lookups on
|
|
|
|
* superBlocklist and superAllowlist happen with containsSuperDomain().
|
2013-11-13 04:43:35 +04:00
|
|
|
*
|
|
|
|
* When deactivate() is invoked, the domain sets are emptied, and the
|
|
|
|
* nsIDomainPolicy ceases to have any effect on the system.
|
|
|
|
*/
|
2015-03-24 17:29:16 +03:00
|
|
|
[scriptable, builtinclass, uuid(82b24a20-6701-4d40-a0f9-f5dc7321b555)]
|
2013-11-13 04:43:35 +04:00
|
|
|
interface nsIDomainPolicy : nsISupports
|
|
|
|
{
|
2018-10-31 20:56:43 +03:00
|
|
|
readonly attribute nsIDomainSet blocklist;
|
|
|
|
readonly attribute nsIDomainSet superBlocklist;
|
|
|
|
readonly attribute nsIDomainSet allowlist;
|
|
|
|
readonly attribute nsIDomainSet superAllowlist;
|
2013-11-13 04:43:35 +04:00
|
|
|
|
|
|
|
void deactivate();
|
2015-03-24 17:29:16 +03:00
|
|
|
|
|
|
|
[noscript, notxpcom] void cloneDomainPolicy(in DomainPolicyClonePtr aClone);
|
2017-02-05 08:52:38 +03:00
|
|
|
[noscript, notxpcom] void applyClone(in DomainPolicyCloneConstPtr aClone);
|
2013-11-13 04:43:35 +04:00
|
|
|
};
|
|
|
|
|
2015-03-24 17:29:16 +03:00
|
|
|
[scriptable, builtinclass, uuid(665c981b-0a0f-4229-ac06-a826e02d4f69)]
|
2013-11-13 04:43:35 +04:00
|
|
|
interface nsIDomainSet : nsISupports
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Add a domain to the set. No-op if it already exists.
|
|
|
|
*/
|
|
|
|
void add(in nsIURI aDomain);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Remove a domain from the set. No-op if it doesn't exist.
|
|
|
|
*/
|
|
|
|
void remove(in nsIURI aDomain);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Remove all entries from the set.
|
|
|
|
*/
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns true if a given domain is in the set.
|
|
|
|
*/
|
Bug 1881863 - Part 1: Standardize on boolean over bool in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,extension-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,search-reviewers,anti-tracking-reviewers,places-reviewers,nalexander,emilio,zombie,sgalich,karlt,lina,Standard8
Previously the `boolean` type was also declared using a `bool` typedef in
xpidl, meaning that both were used in various places. This patch standardizes
on the built-in `boolean` type, removing the typedef.
Differential Revision: https://phabricator.services.mozilla.com/D206382
2024-04-04 21:45:21 +03:00
|
|
|
boolean contains(in nsIURI aDomain);
|
2013-11-13 04:43:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns true if a given domain is a subdomain of one of the entries in
|
|
|
|
* the set.
|
|
|
|
*/
|
Bug 1881863 - Part 1: Standardize on boolean over bool in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,extension-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,search-reviewers,anti-tracking-reviewers,places-reviewers,nalexander,emilio,zombie,sgalich,karlt,lina,Standard8
Previously the `boolean` type was also declared using a `bool` typedef in
xpidl, meaning that both were used in various places. This patch standardizes
on the built-in `boolean` type, removing the typedef.
Differential Revision: https://phabricator.services.mozilla.com/D206382
2024-04-04 21:45:21 +03:00
|
|
|
boolean containsSuperDomain(in nsIURI aDomain);
|
2013-11-13 04:43:35 +04:00
|
|
|
};
|