| Index: lib/requestBlocker.js |
| =================================================================== |
| --- a/lib/requestBlocker.js |
| +++ b/lib/requestBlocker.js |
| @@ -193,21 +193,24 @@ |
| let result; |
| let rewrittenUrl; |
| if (filter instanceof BlockingFilter) |
| { |
| if (typeof filter.rewrite == "string") |
| { |
| - rewrittenUrl = filter.rewriteUrl(details.url); |
| - // If no rewrite happened (error, different origin), we'll |
| - // return undefined in order to avoid an "infinite" loop. |
| - if (rewrittenUrl != details.url) |
| - result = {redirectUrl: rewrittenUrl}; |
| + if (details.method == "GET") |
|
Sebastian Noack
2019/02/08 22:07:59
Nit: Any reason for introducing another block? Can
a.giammarchi
2019/02/09 13:27:20
I think if we go for `if (details.method == "OPTIO
|
| + { |
| + rewrittenUrl = filter.rewriteUrl(details.url); |
| + // If no rewrite happened (error, different origin), we'll |
| + // return undefined in order to avoid an "infinite" loop. |
| + if (rewrittenUrl != details.url) |
| + result = {redirectUrl: rewrittenUrl}; |
|
a.giammarchi
2019/02/08 12:10:27
Minor aesthetic improvement: how about we rename `
hub
2019/02/08 17:05:26
it is named this way because it is the $rewrite op
|
| + } |
| } |
| else |
| result = {cancel: true}; |
| } |
| getRelatedTabIds(details).then(tabIds => |
| { |
| logRequest( |