Hi extensions team,
I've been working (for quite some time) on improving the handling of User-Agents in chromium, with a view to closing out some super-old standards incompliant behaviour --
https://issues.chromium.org/issues/40450316. As user-agents are used basically everywhere for basically everything, I'm now at a stage where I'm seeking advice from extensions expert(s) about a few failing test cases and what I can realistically do to fix them.
I have a CL here:
https://chromium-review.googlesource.com/c/chromium/src/+/5273743 -- in
order to pass ExtensionWebRequestApiPrerenderingTest.Load and
ExtensionWebRequestApiPrerenderingTest.LoadIntoNewTab, the easiest way I
can see is to just make an API change and no longer guarantee that `OnBeforeSendHeaders` will see a User-Agent (It would still appear in `OnSendHeaders`, as usual). This approach is currently implemented in the CL.
Making this API change would be in line with similar changes made to DevTools, where the inspector-protocol `RequestWillBeSent` no longer sees a User-Agent in all cases, but the final User-Agent is present on `RequestWillBeSentExtraInfo` later on.
However, API changes, especially an API this notable and a header as common as User-Agent, are big and annoying, so I'd like to avoid that if possible. The changes as I made to WebRequestProxyingURLLoaderFactory::InProgressRequest::
ContinueToSendHeaders can't easily be applied to the relevant backend for `OnBeforeSendHeaders`, unless I've missed something (very likely).
Any advice, thoughts, queries, concerns, etc. are welcome.
- Andrew