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

Unified Diff: third_party/WebKit/Source/core/inspector/browser_protocol.json

Issue 2739323003: DevTools protocol interception, blocking & modification of requests (Closed)
Patch Set: Add missing expects plus tweak test output of Network.interceptedRedirect for clarity Created 3 years, 9 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
Index: third_party/WebKit/Source/core/inspector/browser_protocol.json
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json
index 6527abc46147dfce17a799ed161709ebaff09425..ced5f57caf4d5197642904bb65d640bf95ca33d8 100644
--- a/third_party/WebKit/Source/core/inspector/browser_protocol.json
+++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -953,6 +953,17 @@
"description": "Unique request identifier."
},
{
+ "id": "InterceptId",
+ "type": "string",
+ "description": "Unique intercepted request identifier."
+ },
+ {
+ "id": "ErrorReason",
+ "type": "string",
+ "enum": ["Failed", "Aborted", "TimedOut", "AccessDenied", "ConnectionClosed", "ConnectionReset", "ConnectionRefused", "ConnectionAborted", "ConnectionFailed", "NameNotResolved", "InternetDisconnected", "AddressUnreachable"],
+ "description": "Network level fetch failure reason."
+ },
+ {
"id": "Timestamp",
"type": "number",
"description": "Number of seconds since epoch."
@@ -1343,6 +1354,51 @@
{ "name": "tableNames", "type": "array", "items": { "type": "string" } }
],
"experimental": true
+ },
+ {
+ "name": "enableFetchInterception",
+ "parameters": [
+ { "name": "enabled", "type": "boolean", "description": "Whether or not HTTP requests should be intercepted and Network.interceptedRequest events sent." }
Sami 2017/03/22 17:00:46 Did we decide if this can be disabled after being
+ ],
+ "experimental": true
+ },
+ {
+ "name": "allowRequest",
+ "description": "Response to Network.interceptedRequest which allows the request to proceed unchanged.",
+ "parameters": [
+ { "name": "id", "$ref": "InterceptId" }
+ ],
+ "experimental": true
+ },
+ {
+ "name": "blockRequest",
+ "description": "Response to Network.interceptedRequest which causes the request to fail.",
+ "parameters": [
+ { "name": "id", "$ref": "InterceptId" },
+ { "name": "errorReason", "$ref": "ErrorReason" }
+ ],
+ "experimental": true
+ },
+ {
+ "name": "modifyRequest",
+ "description": "Response to Network.interceptedRequest which modifies any or all fetch parameters before allowing the request to proceed.",
+ "parameters": [
+ { "name": "id", "$ref": "InterceptId" },
+ { "name": "url", "type": "string", "optional": true },
+ { "name": "method", "type": "string", "optional": true },
+ { "name": "postData", "type": "string", "optional": true },
+ { "name": "headers", "$ref": "Headers", "optional": true }
+ ],
+ "experimental": true
+ },
+ {
+ "name": "mockResponse",
+ "description": "Response to Network.interceptedRequest which makes the request complete with the provided mock response.",
+ "parameters": [
+ { "name": "id", "$ref": "InterceptId" },
+ { "name": "rawResponse", "type": "string" }
Sami 2017/03/22 17:00:46 Might be worth mentioning that this should contain
+ ],
+ "experimental": true
}
],
"events": [
@@ -1388,7 +1444,8 @@
{ "name": "loaderId", "$ref": "LoaderId", "description": "Loader identifier." },
{ "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
{ "name": "type", "$ref": "Page.ResourceType", "description": "Resource type." },
- { "name": "response", "$ref": "Response", "description": "Response data." }
+ { "name": "response", "$ref": "Response", "description": "Response data." },
+ { "name": "interceptId", "$ref": "InterceptId", "optional": true, "experimental": true }
]
},
{
@@ -1503,6 +1560,26 @@
{ "name": "data", "type": "string", "description": "Message content." }
],
"experimental": true
+ },
+ {
+ "name": "interceptedRequest",
+ "description": "Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked.",
+ "parameters": [
+ { "name": "id", "$ref": "InterceptId", "description": "Description unless part of a redirect chain, this id will be unique." },
+ { "name": "request", "$ref": "Request" }
+ ],
+ "experimental": true
+ },
+ {
+ "name": "interceptedRedirect",
+ "description": "Details of an intercepted HTTP redirect, which must be either allowed, blocked, modified or mocked.",
+ "parameters": [
+ { "name": "id", "$ref": "InterceptId" },
+ { "name": "responseHeaders", "$ref": "Headers", "description": "HTTP response headers." },
+ { "name": "responseStatusCode", "type": "integer", "description": "HTTP response code."},
+ { "name": "redirectUrl", "type": "string" }
+ ],
+ "experimental": true
}
]
},

Powered by Google App Engine
This is Rietveld 408576698