webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
735 stars 63 forks source link

sports.163.com - desktop site instead of mobile site #3118

Open MDTsai opened 8 years ago

MDTsai commented 8 years ago

URL: http://sports.163.com Browser / Version: Firefox Mobile 51.0 Operating System: Android 5.0.2 Problem type: Desktop site instead of mobile site

Steps to Reproduce 1) Navigate to: http://sports.163.com

Expected Behavior: redirect to http://3g.163.com/touch/sports/subchannel/all?nav=2&version=v_standard as Chrome mobile and UCMobile

Actual Behavior: Show desktop site http://sports.163.com

Other sites under domain 163.com redirect to mobile site (or a responsive design): http://ent.163.com http://mail.163.com http://news.163.com http://163.com http://money.163.com

From webcompat.com with ❤️

MDTsai commented 8 years ago

After diagnosis, update subdomains list with the same issue: http://news.163.com http://ent.163.com

MDTsai commented 7 years ago

Looks like user agent detection is done in client side. Different user agents get same content.

Firefox mobile user agent:

http -h GET http://sports.163.com/  User-Agent:'Mozilla/5.0 (Android 6.0.1; Mobile; rv:49.0) Gecko/49.0 Firefox/49.0'
HTTP/1.1 200 OK
Age: 52
Cache-Control: max-age=80
Content-Encoding: gzip
Content-Length: 50595

Chrome mobile user agent:

http -h GET http://sports.163.com/  User-Agent:'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6 Build/MOB31E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Mobile Safari/537.36'
HTTP/1.1 200 OK
Age: 62
Cache-Control: max-age=80
Content-Encoding: gzip
Content-Length: 50595
MDTsai commented 7 years ago

Use charles proxy to monitor the sequence of network request when spoof to Chrome mobile user agent:

  1. sports.163.com/
  2. img2.cache.netbase.com/f2e/common/css/sports.lUxzeWcW7D4G.31.css
  3. img1.cache.netbase.com/cnews/js/ntes_jslib_1.x.js
  4. img1.cache.netbase.com/f2e/lib/js/ne.js
  5. 3g.163.com/touch/sports

Possible redirect should be in 1, 3 or 4.

Then find the following javascript in 1

<script type="text/javascript">
(function() {
    if(/s=noRedirect/i.test(location.search)) return; 
    if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
        try {
            if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
                window.location.href = "http://3g.163.com/touch/sports/";
            } else if(/iPad/i.test(navigator.userAgent)) {
            }
        } catch(e) {}
    }   
})();
</script>

Similar with https://webcompat.com/issues/3102#issuecomment-243867863

MDTsai commented 7 years ago

Fill feedback form, wait for response.

MDTsai commented 7 years ago

Ping @NetEase @bingohuang , is it possible to help us find the right person for fixing this front-end issue.

MDTsai commented 7 years ago

ping @xpol if we can have connection to 163.com

softvision-oana-arbuzov commented 5 years ago

The issue is partually fixed.

Check all domains:

Tested with: Browser / Version: Firefox Nightly 68.0a1 (2019-08-20), Fenix 1.3.0 (Build #12321503) 📦: 8.0.0, 78354bc12 🦎: 69.0-20190812090043 Operating System: LG G5 (Android 8.0.0) - 1440 x 2560 pixels (~554 ppi pixel density), Samsung Galaxy S7 Edge (Android 8.0.0) - Resolution 1440 x 2560 pixels (~534 ppi pixel density)