GetUserAgentMetadata support

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

GetUserAgentMetadata support

Postby ndesktop » Mon Oct 16, 2023 9:36 am

I have GetUserAgent overridden for certain cases (the most dreaded being the gmail login), but I kept the override mechanism (which returned the same string as the browser).
But I noticed, starting with 116 (probably maybe sooner) there are some websites malfunctioning, such as https://seb.se.
Code: Select all
cefclient --url=https://seb.se

works normally, while
Code: Select all
cefclient --url=https://seb.se --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36"

fires an error when attempting to click one of the cookies acceptance buttons.

I have narrowed down (at least for this case) to Sec-Ch-Ua-Platform and Sec-Ch-Ua, which are, respectively
Code: Select all
Sec-Ch-Ua:            "Not)A;Brand";v="24", "Chromium";v="116"
Sec-Ch-Ua-Platform:   "Windows"

and
Code: Select all
Sec-Ch-Ua:            <nothing>   
Sec-Ch-Ua-Platform:   ""

I did not manage to do a full debug, but I assume if --user-agent is passed, then this one is used as is and subsequently GetUserAgentMetadata is either not called, or does not function correctly.

So I guess the question is: at this time (read: starting with some versions back), if one implements GetUserAgent, also GetUserAgentMetadata should be implemented accordingly?
Or GetUserAgentMetadata is simply skipped alltogether if an explicit user agent is passed from either CefSettings or command line --user-agent ?
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: GetUserAgentMetadata support

Postby ndesktop » Tue Oct 17, 2023 11:33 am

Update: GetUserAgentMetadata is skipped. If fine tuning control is needed, both CEF and Chromium needs changes.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 194 guests