w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
594 stars 55 forks source link

[DNR] in contrast to `webRequestBlocking`, `declarativeNetRequest` rules are not applied if the request is redirected #694

Open derjanb opened 2 hours ago

derjanb commented 2 hours ago

If a header is added to a request via webRequest then the redirected request also sends this header. This does not apply to declarativeNetRequest modifyHeaders rules.

Please specify the correct behavior. You can test both behaviors by loading the unpacked extensions attached and investigating the background contexts. Using webRequest the request to https://httpbin.org/headers sends a aaa header while using declarativeNetRequest the request does not send a bbb header.

From my point of view a redirect means to send the very same request to another URL, which includes extension based modifications which even might have caused the redirect.

t.zip

derjanb commented 2 hours ago

Firefox never sends the added header at the second request.

mv2.zip mv3-ff.zip

b-weinstein commented 1 hour ago

It appears Safari sends the added header to the second request with DNR.

b-weinstein commented 1 hour ago

But the included test case doesn't reproduce that issue - because we limit the headers that can be modified, and that bbb isn't one of them.