 Chromium Code Reviews
 Chromium Code Reviews Issue 2449913002:
  Support WebSocket in WebRequest API.  (Closed)
    
  
    Issue 2449913002:
  Support WebSocket in WebRequest API.  (Closed) 
  | Index: chrome/common/extensions/docs/templates/intros/webRequest.html | 
| diff --git a/chrome/common/extensions/docs/templates/intros/webRequest.html b/chrome/common/extensions/docs/templates/intros/webRequest.html | 
| index a59875ad577da4da5da2c167c704978f236dcd21..bab5638941f774a3c261997825ff01f234d630a5 100644 | 
| --- a/chrome/common/extensions/docs/templates/intros/webRequest.html | 
| +++ b/chrome/common/extensions/docs/templates/intros/webRequest.html | 
| @@ -124,7 +124,9 @@ Moreover, only the following schemes are accessible: | 
| <code>http://</code>, | 
| <code>https://</code>, | 
| <code>ftp://</code>, | 
| -<code>file://</code>, or | 
| +<code>file://</code>, | 
| +<code>ws://</code> (<span class="availability">since Chrome 58</span>), | 
| +<code>wss://</code> (<span class="availability">since Chrome 58</span>), or | 
| <code>chrome-extension://</code>. | 
| In addition, even certain requests with URLs using one of the above schemes | 
| are hidden, e.g., | 
| @@ -142,6 +144,17 @@ For example, for the <q>file:</q> scheme, only <code>onBeforeRequest</code>, | 
| <code>onErrorOccurred</code> may be dispatched. | 
| </p> | 
| +<p> | 
| +<span class="availability">Starting from Chrome 58</span>, webRequest API | 
| +supports intercepting WebSocket handshake request. Since the handshake is done | 
| 
Devlin
2017/02/14 01:21:38
nit:
intercepting *the* WebSocket handshake...
 
pkalinnikov
2017/02/14 13:49:51
Done.
 | 
| +by means of an HTTP upgrade request, its flow fits into HTTP-oriented | 
| +webRequest model. Note that the API does <b>not intercept</b>: | 
| +<ul> | 
| + <li>Individual messages sent over an established WebSocket connection.</li> | 
| + <li>WebSocket closing connection.</li> | 
| +</ul> | 
| +</p> | 
| + | 
| <h2 id="concepts">Concepts</h2> | 
| <p>As the following sections explain, events in the web request API use request |