 Chromium Code Reviews
 Chromium Code Reviews Issue 2739323003:
   DevTools protocol interception, blocking & modification of requests  (Closed)
    
  
    Issue 2739323003:
   DevTools protocol interception, blocking & modification of requests  (Closed) 
  | 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 a88f4d115fdb2a70fdaf014da78fa7c45c2d4951..8c2c712ab027a48491a5f23c83059f66ec86e871 100644 | 
| --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json | 
| +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json | 
| @@ -1112,6 +1112,17 @@ | 
| "description": "Unique request identifier." | 
| }, | 
| { | 
| + "id": "InterceptionId", | 
| + "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." | 
| @@ -1495,6 +1506,27 @@ | 
| { "name": "tableNames", "type": "array", "items": { "type": "string" } } | 
| ], | 
| "experimental": true | 
| + }, | 
| + { | 
| + "name": "enableFetchInterception", | 
| 
dgozman
2017/05/25 21:29:36
Sorry for bikeshedding, but let's normalize the na
 
alex clarke (OOO till 29th)
2017/05/26 19:37:03
Done.
 | 
| + "parameters": [ | 
| + { "name": "enabled", "type": "boolean", "description": "Whether or not HTTP requests should be intercepted and Network.requestIntercepted events sent." } | 
| + ], | 
| + "experimental": true | 
| + }, | 
| + { | 
| + "name": "continueRequest", | 
| + "description": "Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes.", | 
| + "parameters": [ | 
| + { "name": "interceptionId", "$ref": "InterceptionId" }, | 
| + { "name": "errorReason", "$ref": "ErrorReason", "optional": true, "description": "If set this causes the request to fail with the given reason." }, | 
| + { "name": "rawResponse", "type": "string", "optional": true, "description": "Id set this makes the request complete with the provided base64 encoded mock response." }, | 
| 
dgozman
2017/05/25 21:29:36
- typo: Id set
- nit: remove "mock"
- Let's mentio
 
alex clarke (OOO till 29th)
2017/05/26 19:37:03
I can see that might be useful.  Let do that in a
 | 
| + { "name": "url", "type": "string", "optional": true, "description": "If set the request url will be modified in a way that's not directly visible to blink." }, | 
| 
dgozman
2017/05/25 21:29:36
not observable by page
 
alex clarke (OOO till 29th)
2017/05/26 19:37:03
Done.
 | 
| + { "name": "method", "type": "string", "optional": true, "description": "If set this allows the request method to be overridden."}, | 
| + { "name": "postData", "type": "string", "optional": true, "description": "If set this allows postData to be set."}, | 
| + { "name": "headers", "$ref": "Headers", "optional": true, "description": "If set this allows the request headers to be changed."} | 
| + ], | 
| + "experimental": true | 
| } | 
| ], | 
| "events": [ | 
| @@ -1655,6 +1687,18 @@ | 
| { "name": "data", "type": "string", "description": "Message content." } | 
| ], | 
| "experimental": true | 
| + }, | 
| + { | 
| + "name": "requestIntercepted", | 
| + "description": "Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked.", | 
| 
dgozman
2017/05/25 21:29:36
Let's mention that redirected request gets additio
 
alex clarke (OOO till 29th)
2017/05/26 19:37:03
Done.
 | 
| + "parameters": [ | 
| + { "name": "InterceptionId", "$ref": "InterceptionId" }, | 
| + { "name": "request", "$ref": "Request" }, | 
| + { "name": "redirectHeaders", "$ref": "Headers", "optional": true, "description": "HTTP response headers." }, | 
| + { "name": "redirectStatusCode", "type": "integer", "optional": true, "description": "HTTP response code."}, | 
| + { "name": "redirectUrl", "optional": true, "type": "string"} | 
| + ], | 
| + "experimental": true | 
| } | 
| ] | 
| }, |