Incorrect user agent in Windows 10

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.

Incorrect user agent in Windows 10

Postby JasonLP » Tue Jan 19, 2021 1:10 pm

I am looking at a bug report where a customer has noticed that the operating system is being misidentified because of a mistake in the user agent string.

I'm able to reproduce this, using my app build with CEF-32 bit for Windows, running on Windows 10. The user agent string looks like this:

Code: Select all
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36


On the same machine, running Chrome 64-bit, the user agent string looks like this:

Code: Select all
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36


Why does my CEF application running on Windows 10 think it's running on Windows 8.1 (i.e. Windows NT 6.3)

Thanks,
-Jason-
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Incorrect user agent in Windows 10

Postby magreenblatt » Tue Jan 19, 2021 1:32 pm

How does it behave in the cefclient sample application?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Incorrect user agent in Windows 10

Postby JasonLP » Tue Jan 19, 2021 1:42 pm

magreenblatt wrote:How does it behave in the cefclient sample application?

Correctly:

Code: Select all
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Incorrect user agent in Windows 10

Postby amaitland » Tue Jan 19, 2021 2:05 pm

Does your app have an app.manifest with the relevant compatibility entries?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Incorrect user agent in Windows 10

Postby JasonLP » Tue Jan 19, 2021 2:24 pm

amaitland wrote:Does your app have an app.manifest with the relevant compatibility entries?


Ah, no. This is very likely the culprit. Thank you!
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Incorrect user agent in Windows 10

Postby rjxray » Mon Feb 15, 2021 8:21 am

I have the same issue.
How exactly did you resolve it?
I tried copying the cefclient compatibility.manifest over the existing one in my app's win folder but that made no difference.
rjxray
Expert
 
Posts: 115
Joined: Wed Jun 07, 2017 4:31 am

Re: Incorrect user agent in Windows 10

Postby amaitland » Mon Feb 15, 2021 3:06 pm

Add an application manifest to your project using Visual Studio.

Then add the compatibility entries (they're usually included in the default just commented out)
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Incorrect user agent in Windows 10

Postby rjxray » Tue Feb 16, 2021 10:59 am

Thanks, I ended up adding this to my cmake post build events
mt.exe -nologo -manifest "$(ProjectDir)bin/win/$(ProjectName)$(TargetExt).manifest" "$(ProjectDir)/bin/win/compatibility.manifest" -outputresource:"$(OutDir)$(TargetName)$(TargetExt)"\\;1
rjxray
Expert
 
Posts: 115
Joined: Wed Jun 07, 2017 4:31 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 46 guests