www.nhk.or.jp - desktop site instead of mobile site
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
- Navigate to: http://www.nhk.or.jp
- …
Expected Behavior: redirected to smartphone site
Actual Behavior: stuck on desktop site
country: jp
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;
See also https://bugzilla.mozilla.org/show_bug.cgi?id=905627
And #950 ;)
Mozilla Japan has contact, will contact them. #951 is also NHK related issue.
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
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).
The trial page given by @myakura is now dead. It proposes a couple of links.

- http://www.nhk.or.jp/
- http://k.nhk.jp/
- 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.

When faking Chrome UA, we get

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

@miketaylr given that they don't want to move their finger, maybe UA override.
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.
@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.
Linking to Go Faster addon for UA override. https://bugzilla.mozilla.org/show_bug.cgi?id=1287966#c6
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)
