Detecting CEFSharp vs Google Chrome

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Detecting CEFSharp vs Google Chrome

Postby mkmorse » Wed Mar 25, 2015 10:46 am

Hi, I'm new to web develop and using CEFSharp, so I apologize if is a noob question or I'm in the wrong area.

I have a web page that is viewed in CEFSharp in a WPF application, an iOS application and Google Chrome.

I'm using Detectizr to determine the device, but CEFSharp and Google Chrome are the same.
I know that I can use the version of the browser to determine the difference (CEFSharp = 37 vs Google Chrome = 41), but this doesn't feel like a good comparison.

Was wondering if anyone had any other suggestions?
mkmorse
Newbie
 
Posts: 2
Joined: Wed Mar 25, 2015 10:31 am

Re: Detecting CEFSharp vs Google Chrome

Postby magreenblatt » Wed Mar 25, 2015 11:57 am

You can customize the product version or user agent string in your particular application to differentiate it from Google Chrome. I'm not sure how that's done in CEFSharp but in C++ you can set CefSettings.product_version or CefSettings.user_agent.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Detecting CEFSharp vs Google Chrome

Postby mkmorse » Thu Mar 26, 2015 8:33 am

Thanks for the info, I am able to make either of those settings in CEFSharp.
I was double check this with loading this page: https://www.cyscape.com/showbrow.asp.

What I don't understand those is that if I set the User Agent to "MyEmbeddedChrome", the Browser is then recognized as "Default" and it looks like all of the settings aren't correct on the aforementioned browser test settings page.
Again this might be expected and due to my inexperience with web programming, because it seems like the CEFSharp browser is still properly rendering other pages (specifically the page we started using CEFSharp in the first place).
mkmorse
Newbie
 
Posts: 2
Joined: Wed Mar 25, 2015 10:31 am

Re: Detecting CEFSharp vs Google Chrome

Postby magreenblatt » Thu Mar 26, 2015 11:32 am

mkmorse wrote:What I don't understand those is that if I set the User Agent to "MyEmbeddedChrome", the Browser is then recognized as "Default" and it looks like all of the settings aren't correct on the aforementioned browser test settings page.

Right, that's because many websites use the User-Agent string to customize the returned Web content. For best compatibility with existing websites you should change only the product component of the User-Agent string.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 21 guests