I’m updating a Chrome extension from manifest 2 to manifest 3.
I have some troubles with sending dynamic httpRequestHeaders.
It’s possible to send these dynamic headers but some headers are blocked ie. “cookies”
So it’s possible to send for example:
$.ajax({
type: "POST",
url: "SOMEURL",
data: {
"id": idValue,
},
headers: {
"blabla": "HARDVALUE"+dynamicValue
},
success: ...
and it’s not possible to send
$.ajax({
type: "POST",
url: "SOMEURL",
data: {
"id": idValue,
},
headers: {
"cookie": "HARDVALUE"+dynamicValue
},
success: ...
I tried to use a declarativeNetRequest with the rules.json-file but it’s hard-coded and not possible to use a dynamic value
[
{
"id" : 1,
"priority": 1,
"action" : { "type" : "modifyHeaders",
"responseHeaders": [
{ "header": "Cookie", "operation": "set", "value": "hardCodedValue" }
]
},
"condition" : {
"urlFilter" : "SOMEURL",
"resourceTypes" : ["xmlhttprequest"]
}
}
]
This last one is sending the header but I can’t use a dynamic custom variable or something. Has anybody a solution for this?