web-bugs icon indicating copy to clipboard operation
web-bugs copied to clipboard

www.nhk.or.jp - desktop site instead of mobile site

Open miketaylr opened this issue 11 years ago • 12 comments

URL: http://www.nhk.or.jp Browser / Version: Firefox Mobile 40.0 Operating System: Android Problem type: Desktop site instead of mobile site

Steps to Reproduce

  1. Navigate to: http://www.nhk.or.jp
  2. …

Expected Behavior: redirected to smartphone site

Actual Behavior: stuck on desktop site

country: jp

miketaylr avatar Apr 22 '15 22:04 miketaylr

In http://www.nhk.or.jp/topmenu/1403_js/20150326/onlinetop.js:

if( g_ua.SmartPhone ){//UAがスマホ
    if(nol.data.smp==undefined||nol.data.smp=='1'){
        location.href='http://www.nhk.or.jp/sp/';
    }
    document.write('<p class="smInfo"><a id="h26" class="beacon" href="#" onclick="return chgSmaphoMode(1);">スマートフォン版はこちら</a></p>');
}
function chgSmaphoMode(md){
    nol.data.smp=md;
    nol.save();
    location.href='http://www.nhk.or.jp/sp/';
    return false;
}

g_ua.Smartphone is defined in http://www.nhk.or.jp/topmenu/1403_js/20150326/common.js:

//browser
var g_ua=(function(){
    var o={};
    var ua=navigator.userAgent;
    var apn=navigator.appName;
    var apv=navigator.appVersion;
    o.Win9X = (apv.search(/windows 98/i)>-1);
    o.IE = (apn.search(/internet explorer/i)>-1);
    o.Opera = (ua.search(/opera/i)>-1);
    if(o.Opera)o.IE=false;
    o.Safari = (apv.search(/safari/i)>-1);
    o.iPhone = (apv.search(/iphone/i)>-1);
    o.iPod = (apv.search(/ipod/i)>-1);
    o.iPad = (apv.search(/ipad/i)>-1);
    o.Android = (apv.search(/android/i)>-1);
    o.BlackBerry = (ua.search(/blackberry/i)>-1);
    o.SmartPhone = (ua.search(/webkit/i)>-1&&ua.search(/mobile/i)>-1);
    if(o.iPad)o.SmartPhone=false;
    o.iev=-1;
    if(o.IE){
        var re=new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})');
        if(re.exec(ua)!=null)o.iev=parseFloat(RegExp.$1);
    }
    return o;
})();

So there's clientside code here controlling the redirect to the smartphone site. The minimal UA token needed to get here is "webkit". We should recommend they send anyone that matches on /mobile/i to the smartphone site, like so:

o.SmartPhone = (ua.search(/mobile/i)>-1;
if(o.iPad)o.SmartPhone=false;

miketaylr avatar Apr 22 '15 22:04 miketaylr

See also https://bugzilla.mozilla.org/show_bug.cgi?id=905627

karlcow avatar Apr 23 '15 00:04 karlcow

And #950 ;)

karlcow avatar Apr 23 '15 00:04 karlcow

Mozilla Japan has contact, will contact them. #951 is also NHK related issue.

kudodo avatar May 13 '15 09:05 kudodo

For the status, if I understood, As of today, NHK is not interested in fixing the site. Their target is Safari and Chrome.

Mozilla could fix the issue that doing UA override, so Firefox users can access the site. Then the issues will be the one shown in #951 which also could be fixed on Firefox side through Unprefixing service.

So we might want to add this site to the whitelist. https://bugzilla.mozilla.org/show_bug.cgi?id=1162245

karlcow avatar Jun 15 '15 07:06 karlcow

FYI, NHK is working on their new mobile website and you can try it out here www.nhk.or.jp/sp/top-trial/

just tested with Firefox Mobile (Beta) on my Nexus 5 it looks fine (no rendering issues).

myakura avatar Nov 29 '15 07:11 myakura

The trial page given by @myakura is now dead. It proposes a couple of links.

Screenshot of the site issue

  1. http://www.nhk.or.jp/
  2. http://k.nhk.jp/
  3. http://www3.nhk.or.jp/nhkworld/

which are the major entry points on NHK site.

http://www.nhk.or.jp/ is still sending the desktop site to Firefox on Android.

Screenshot of the site issue

When faking Chrome UA, we get

Screenshot of the site issue

And when we add layout.css.prefixes.webkit; true

Screenshot of the site issue

karlcow avatar Apr 20 '16 00:04 karlcow

@miketaylr given that they don't want to move their finger, maybe UA override.

karlcow avatar Apr 20 '16 00:04 karlcow

Just a side note that

  • NHK World works perfectly on Firefox Android. http://www3.nhk.or.jp/nhkworld/
  • http://k.nhk.jp/ too, but this is obviously for feature phones.

karlcow avatar Apr 20 '16 00:04 karlcow

@miketaylr given that they don't want to move their finger, maybe UA override.

OK, once we ship layout.css.prefixes.webkit; true to release, let's do an override.

miketaylr avatar Apr 26 '16 21:04 miketaylr

Linking to Go Faster addon for UA override. https://bugzilla.mozilla.org/show_bug.cgi?id=1287966#c6

karlcow avatar Nov 01 '16 05:11 karlcow

This issue is no longer reproducible. Verified on:

  • www.nhk.or.jp/sp/
  • http://www.nhk.or.jp
  • www.nhk.or.jp/sp/top-trial/
  • http://k.nhk.jp/
  • http://www3.nhk.or.jp/nhkworld/

Tested with: Browser / Version: Firefox Mobile Nightly 58.0a1 (2017-10-24) Operating System: Huawei P10 (Android 7.0) - Resolution 1080 x 1920 pixels (~432 ppi pixel density)

screenshot-1508924865128

softvision-oana-arbuzov avatar Oct 25 '17 09:10 softvision-oana-arbuzov