Closed yun1129 closed 8 years ago
Could you post an example user agent string?
You are using Chrome 44 on Windows 10
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 UBrowser/5.5.9936.1231 Safari/537.36
I can't reproduce UC Browser being detected as the mobile browser. But I can see that UC Browser does not use the same user agent string internally and externally.
Internal by using Javascript:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 UBrowser/5.5.9936.1231 Safari/537.36
External headers:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Notice the missing UBrowser token from the external headers. That is why UC Browser for desktop can not be detected by just looking at the browsers. It literally says it's Chrome 44.
Because WhichBrowser can also look at the user agent string from JavaScript, I've added a special check for this. Will be included in the next release.
We really did a workaround fix by sending UA without UBrowser for getting WhichBrowser finds the right kernel version(Yes, we ONLY did this from external perspective mentioned above). Once this issue gets fixed my team will get rid of the workaround fix.
OK, is there a version of UC Browser still available for download that did not include the workaround, so I can reproduce it?
Technically, we do this control via a config file on our server. Next Monday the team will release a config without the workaround. Will post here to let you know.
Rightnow, if access html5test.com via UCBrowser it seems the HTML5 score isn't the same with the one of Chrome M44, but the website really says "you are using UC Browser 5.6 on Windows 7", did you do any change on WhichBrowser and it leads to this result? I'm really not sure if this question is proper for you. If not please let me know and any clue would be apprecited.
I think I know what causes this.
If for some reason feature detection is broken in the browser, the browser will report back that it supports a certain feature - even if you don't. That causes HTML5test.com to count extra points, that are not really deserved. HTML5test.com uses a blacklist to correct this.
Older versions of UC Browser for Mobile are on this blacklist for a number of features. For example form fields are block on UC Browser < 8.6 and the range element and getUserMedia are blocked on UC Browser < 9.8. These problems were confirmed to be in older versions of UC Browser for Mobile, and confirmed to be fixed in later versions.
But the check is just for UC Browser. Not for UC Browser on mobile. And UC Browser for Windows uses a lower version number than mobile. That causes UC Browser for Windows to trigger that blacklist by mistake. And this will causes points to drop.
And yes, I've updated WhichBrowser yesterday to include a workaround for the missing Browser token from the headers causing UC Browser to be properly detected again. So before it didn't trigger the blacklist because it thought it was Chrome. And now it does because it thinks it is UC Browser mobile.
I'll update the blacklist on HTML5test.com.
Great, you really hit the point! My team released a new config to remove the workaround mentioned in this thread. If you have any question or need help frome me please let me know.
Appreciate your quick response!
This change has now been implemented on the upcoming version of HTML5test.com
The UA of Desktop UCBrowser is UBrowser but WhichBrowser detects it as Mobile UCBrowser which is with UA of UCBrowser. The Desktop UCBrowser is available at http://pc.uc.cn (Chinese version) or http://pc.ucweb.com (Internationalization version).