[DNR] Implement modifyHeaders action
Categories
(WebExtensions :: Request Handling, enhancement, P2)
Tracking
(firefox109 fixed)
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
Details
(Whiteboard: [addons-jira])
Attachments
(2 files)
Implement the following DNR action: modifyHeaders
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Note, the current modifyHeaders
action does not permit the "append" operation for request headers.
This is because it was documented to not be allowed at https://source.chromium.org/chromium/chromium/src/+/main:extensions/common/api/declarative_net_request.idl;l=54-55;drc=60039d4d4bd70512e21a2dfe586602aca1d9d35e:
// This describes the possible operations for a "modifyHeaders" rule.
enum HeaderOperation {
// Adds a new entry for the specified header. This operation is not
// supported for request headers.
append,
While most of Chromium's IDL is usually rendered in auto-generated documentation, the comments in that highlighted section are not.
It is not clear why it is unsupported, so if feasible we should just support "append" (along with "set" and "remove").
There is demand for this feature, e.g. as seen at https://crbug.com/1270273
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Comment 4•2 years ago
|
||
I just checked again, and it looks like Chrome does now support "append" for some headers (based on an allowlist). I linked the details from https://crbug.com/1117475#c7 . In the patch above I enabled "append" for any header, without restricting which headers can be appended to, since any limitation would be somewhat arbitrary.
Comment 5•2 years ago
|
||
(In reply to Rob Wu [:robwu] from comment #4)
I just checked again, and it looks like Chrome does now support "append" for some headers (based on an allowlist). I linked the details from https://crbug.com/1117475#c7 . In the patch above I enabled "append" for any header, without restricting which headers can be appended to, since any limitation would be somewhat arbitrary.
I see, that clarify a bit the possible motivation for not supporting it first and then supporting it only on specific headers, would you mind to file a bug to remind us to reconsider if we should do something similar (I'd like us to also confirm what happens for other vendors, e.g. if and in which form Safari supports or intend to support this particular corner case).
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7703f8e13f31
https://hg.mozilla.org/mozilla-central/rev/8d4ff6d7ca86
Description
•