Fix command-line override of the User-Agent product component (see issue #2622).

When the NetworkService is enabled the U-A string is configured via
SystemNetworkContextManager::CreateDefaultNetworkContextParams, which calls
chrome_content_browser_client.cc GetUserAgent(). This change modifies the Chrome
implementation to match CEF, so that the U-A product component can still be
overridden via the `--product-version` command-line flag.

To test: Verify that chrome://version, navigator.userAgent (JS executed from
DevTools console) and network requests (headers shown in DevTools Network tab)
show the expected User-Agent value in the following cases:
- Running `cefclient --enable-network-service --user-agent="<value>"`
- Running `cefclient --enable-network-service --product-version="<value>"`
This commit is contained in:
Marshall Greenblatt
2019-05-02 14:06:48 -04:00
parent b1018ad64b
commit 4592cba19f
3 changed files with 51 additions and 15 deletions

View File

@@ -244,6 +244,12 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2613
'name': 'chrome_browser_net_export',
},
{
# Support override of the User-Agent product component when NetworkService
# is enabled.
# https://bitbucket.org/chromiumembedded/cef/issues/2622
'name': 'chrome_browser_product_override',
},
{
# Allow CEF to share Chrome plugin loading code.
'name': 'chrome_plugins',