Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: extensions/common/api/declarative_net_request.idl

Issue 2881453002: DNR Prototype: With flatbuffers
Patch Set: -- Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/api/_permission_features.json ('k') | extensions/common/api/declarative_net_request/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ };
+};
« no previous file with comments | « extensions/common/api/_permission_features.json ('k') | extensions/common/api/declarative_net_request/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698