-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Labels
implemented: chromeImplemented in ChromeImplemented in Chromeimplemented: firefoxImplemented in FirefoxImplemented in FirefoxinconsistencyInconsistent behavior across browsersInconsistent behavior across browserssupportive: safariSupportive from SafariSupportive from Safaritopic: dnrRelated to declarativeNetRequestRelated to declarativeNetRequest
Description
The DNR modifyHeaders
rule action allows for request headers to be added, removed or modified. The current Chrome docs do not specify any limitation on which headers these rules can modify.
In fact, in Chrome and Firefox arbitrary header names are supported (apart from a list of forbidden header names) and can be modified by these rules. However, in Safari, only 'recognized' headers can specified in these rules. For example, take the following rule:
{
id: 1,
priority: 1,
action: {
type: "modifyHeaders",
requestHeaders: [
{ header: "Sec-GPC", operation: "set", value: "1" },
],
},
condition: {
urlFilter: "||global-privacy-control.glitch.me/",
resourceTypes: ["main_frame", "sub_frame"],
},
}
This rule is accepted and works as expected in Firefox and Chrome. However, in Safari, the following exception is thrown:
Invalid call to declarativeNetRequest.updateDynamicRules(). Error with rule at index 0: Rule with id 1 is invalid. The header `Sec-GPC` is not recognized.
This issue has also been submitted to Safari as Radar #FB12074761
erosman
Metadata
Metadata
Assignees
Labels
implemented: chromeImplemented in ChromeImplemented in Chromeimplemented: firefoxImplemented in FirefoxImplemented in FirefoxinconsistencyInconsistent behavior across browsersInconsistent behavior across browserssupportive: safariSupportive from SafariSupportive from Safaritopic: dnrRelated to declarativeNetRequestRelated to declarativeNetRequest