Closed mrhodd closed 6 years ago
The header feature is not yet implemented for the Chrome backend unfortunately.
I will try to implement it soon. In the meantime, as an alternative, you can use
await tab.driver.client.Network.setExtraHTTPHeaders({
headers: {
"Header key": "Header value",
}
})
Do this before your open()
call.
This makes use of the underlying CDP (chrome-remote-interface) client which implements the Chrome DevTools Protocol (see doc for the Network namespace)
Awesome!! Thank you for the response!
This has resolved my issue!
Side note, is it possible to set the order of this header? I noticed it doesn't appear in the same order as a request from my browser does (and unfortunately I do think that header order matters here...).
I'm not aware of any way to control the order of headers, sorry
I'm using NickJs browser emulation and am attempting to add a header when opening a page. I'm monitoring the request in Fiddler and see that the header is not being added.
How do I add the header?
Here's my current code:
await tab.open("https://www.google.com/", {headers: {"Accept-Language": "en-US,en;q=0.9"}})