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 #950

Closed
karlcow opened this issue Apr 21, 2015 · 1 comment
Closed

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

karlcow opened this issue Apr 21, 2015 · 1 comment

Comments

@karlcow
Copy link
Member

karlcow commented Apr 21, 2015

URL: http://www.nhk.or.jp/
Browser / Version: Firefox 39.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:
get the mobile site at http://www.nhk.or.jp/sp/

Actual Behavior:
receive the desktop site

This one is a bit new. They have a UA detection script, which says:
Android: true but Smartphone: false because it doesn't contain Webkit

//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;
})();

which means that later on in the onlinetop.js script we get at

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>');
}

which we never get redirected to.

country: jp

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

2 participants