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

Unified Diff: chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html

Issue 154473002: Support redirectUrl at onHeadersReceived in WebRequest / DWR API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address reviewer's comments, change 307 to 302 redirect Created 6 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: chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html
diff --git a/chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html b/chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html
index 505c6be1c4b848d9656596b5f1b494ebe536bf4b..a38d33facd4243f2eccd0dd591780f93a4cab54b 100644
--- a/chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html
+++ b/chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html
@@ -180,10 +180,10 @@ request stages that are compatible with conditions and actions.
<tr><td>EditRequestCookie<td><td>✓<td><td>
<tr><td>EditResponseCookie<td><td><td>✓<td>
<tr><td>IgnoreRules<td>✓<td>✓<td>✓<td>✓
- <tr><td>RedirectByRegEx<td>✓<td><td><td>
- <tr><td>RedirectRequest<td>✓<td><td><td>
- <tr><td>RedirectToEmptyDocument<td>✓<td><td><td>
- <tr><td>RedirectToTransparentImage<td>✓<td><td><td>
+ <tr><td>RedirectByRegEx<td>✓<td><td>✓<td>
+ <tr><td>RedirectRequest<td>✓<td><td>✓<td>
+ <tr><td>RedirectToEmptyDocument<td>✓<td><td>✓<td>
+ <tr><td>RedirectToTransparentImage<td>✓<td><td>✓<td>
<tr><td>RemoveRequestCookie<td><td>✓<td><td>
<tr><td>RemoveRequestHeader<td><td>✓<td><td>
<tr><td>RemoveResponseCookie<td><td><td>✓<td>
@@ -198,14 +198,18 @@ request stages that are compatible with conditions and actions.
"stages" attribute.
</p>
<p>
+<strong>Note:</strong> If a redirect action is declared at the onHeadersReceived
+stage, then POST requests will be redirected using the GET method. In other cases
battre 2014/03/25 00:47:30 nit: 80 characters
robwu 2014/03/25 10:08:14 Done.
+the HTTP method is preserved.
battre 2014/03/25 00:47:30 Why is this?
robwu 2014/03/25 10:08:14 onBeforeRequest = 307 redirect, which doesn't chan
+</p>
+<p>
<strong>Example:</strong> It is possible to combine a
<code>new chrome.declarativeWebRequest.RequestMatcher({contentType: ["image/jpeg"]})</code>
condition with a <code>new chrome.declarativeWebRequest.CancelRequest()</code>
action because both of them can be evaluated in the onHeadersReceived stage.
It is, however, impossible to combine the request matcher with a
-<code>new chrome.declarativeWebRequest.RedirectToTransparentImage()</code>
-because redirects cannot be executed any more by the time the content
-type has been determined.
+<code>new chrome.declarativeWebRequest.SetRequestHeader()</code>
+because request headers cannot be set any more by the time the content type has been terminated.
</p>
<h2 id="precedences">Using priorities to override rules</h2>

Powered by Google App Engine
This is Rietveld 408576698