| Index: extensions/common/api/declarative_net_request.idl
|
| diff --git a/extensions/common/api/declarative_net_request.idl b/extensions/common/api/declarative_net_request.idl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7041002f7f02f16cf427e5e9a2a5de66fe0c5716
|
| --- /dev/null
|
| +++ b/extensions/common/api/declarative_net_request.idl
|
| @@ -0,0 +1,64 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// The <code>chrome.declarativeNetRequest</code> API is used to intercept and
|
| +// perform actions on a network request by specifying declarative rules.
|
| +namespace declarativeNetRequest {
|
| + enum ResourceType {
|
| + // TODO add main frame, csp.
|
| + sub_frame,
|
| + stylesheet,
|
| + script,
|
| + image,
|
| + font,
|
| + object,
|
| + xmlhttprequest,
|
| + ping,
|
| + media,
|
| + websocket,
|
| + other
|
| + };
|
| +
|
| + enum DomainType {
|
| + first_party,
|
| + third_party,
|
| + any
|
| + };
|
| +
|
| + enum RuleActionType {
|
| + // TODO add whitelist_recursive.
|
| + block,
|
| + redirect,
|
| + whitelist
|
| + };
|
| +
|
| + // TODO ensure meaningful. (All fields are optional.)
|
| + dictionary RuleCondition {
|
| + DOMString? urlFilter;
|
| + // It seems we dont support default values.
|
| + boolean? urlFilterIsCaseSensitive;
|
| + DOMString[]? domains;
|
| + DOMString[]? excludedDomains;
|
| + ResourceType[]? resourceTypes;
|
| + // TODO change to excluded
|
| + ResourceType[]? excludeResourceTypes;
|
| + DomainType? domainType;
|
| + };
|
| +
|
| + dictionary RuleAction {
|
| + RuleActionType type;
|
| + DOMString? redirectUrl;
|
| + };
|
| +
|
| + dictionary Rule {
|
| + // Default is required actually.
|
| + // Unsigned don't seem to be supported.
|
| + // TODO ensure unsigned.
|
| + long id;
|
| + // TODO ensure provided for redirect rules.
|
| + long? priority;
|
| + RuleCondition condition;
|
| + RuleAction action;
|
| + };
|
| +};
|
|
|