Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
miketaylr opened this issue Apr 22, 2015 · 12 comments
Closed

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

miketaylr opened this issue Apr 22, 2015 · 12 comments
Milestone

Comments

@miketaylr
Copy link
Member

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

Expected Behavior: redirected to smartphone site

Actual Behavior: stuck on desktop site

country: jp

@miketaylr
Copy link
Member Author

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;

@karlcow
Copy link
Member

karlcow commented Apr 23, 2015

@karlcow
Copy link
Member

karlcow commented Apr 23, 2015

And #950 ;)

@kudodo
Copy link

kudodo commented May 13, 2015

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

@karlcow
Copy link
Member

karlcow commented Jun 15, 2015

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

@myakura
Copy link

myakura commented Nov 29, 2015

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).

@karlcow
Copy link
Member

karlcow commented Apr 20, 2016

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
Copy link
Member

karlcow commented Apr 20, 2016

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

@karlcow
Copy link
Member

karlcow commented Apr 20, 2016

Just a side note that

@miketaylr
Copy link
Member Author

@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.

@karlcow
Copy link
Member

karlcow commented Nov 1, 2016

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

@softvision-oana-arbuzov
Copy link
Member

This issue is no longer reproducible. Verified on:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants