Identifying CEF apps as "not Chrome"

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

Identifying CEF apps as "not Chrome"

Postby starkos » Sun Aug 03, 2014 6:43 am

Some websites are identifying my CEF3 app as Chrome and trying to use Chrome-specific features, like packaged apps, and failing. I tried to "fix" this by removing Chrome/33.0.#.# from the user agent string and replacing it with my own product name (via CefSettings.product_name), but this seems to confuse other sites, which then stop working properly.

It would be nice if sites would test for features instead of user agents (looking at you, Google) but since I can't do anything about that: has anyone run into this before? Is there a better way to address it than user agent strings (or is there a better way to hack the agent string)?

I'm digging through the Chromium docs now looking for ideas; I will post back if I find anything.
starkos
Techie
 
Posts: 18
Joined: Mon Jun 24, 2013 12:35 pm

Re: Identifying CEF apps as "not Chrome"

Postby HarmlessDave » Mon Aug 04, 2014 11:56 am

We've run into this with the IE web control and with Webkit on OS X, but not yet with CEF.

For sites that look at the user-agent you might need to try using agent strings for other "known" browsers, just not the default. For example, an older Chrome, or Firefox, or a generic Webkit.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Identifying CEF apps as "not Chrome"

Postby starkos » Thu Aug 07, 2014 7:42 am

Thanks Harmless, good to know someone else has looked into it. I will play around with some alternate user agents and see what I can make of it.
starkos
Techie
 
Posts: 18
Joined: Mon Jun 24, 2013 12:35 pm

Re: Identifying CEF apps as "not Chrome"

Postby starkos » Mon Sep 15, 2014 4:59 pm

In case someone else encounters this, I found a solution in Chromium's Content Shell example:

Code: Select all
   // From Chromium Content Shell example: "The "19" is so that sites that
   // sniff for version think that this is something reasonably current; the
   // "77.34.5" is a hint that this isn't a standard Chrome.

   CefString(&settings.product_version) = "Chrome/19.77.34.5";
starkos
Techie
 
Posts: 18
Joined: Mon Jun 24, 2013 12:35 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 30 guests