ndtv.com sends desktop version to Firefox OS

RESOLVED FIXED

Status

Tech Evangelism
Mobile
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: hallvors, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mobile-compat-form][serversniff][clientsniff][contactready][video], URL)

(Reporter)

Description

4 years ago
Site: http://www.ndtv.com
ndtv.com sends desktop version to Firefox OS

:: Steps To Reproduce

The site redirects mobile browsers to m.ndtv.com. They do handle some Fx OS user-agents (depending on version number) and redirect to m.ndtv.com with backend sniffing - however, then there's JS sniffing that takes us back to www.ndtv ...


GET / HTTP/1.1
Host: www.ndtv.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0
Accept: */*
Accept-Language: nb-no,nb;q=0.9,no-no;q=0.8,no;q=0.6,nn-no;q=0.5,nn;q=0.4,en-us;q=0.3,en;q=0.1
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 302 Moved Temporarily
Server: AkamaiGHost
Content-Length: 0
Location: http://m.ndtv.com/
Date: Mon, 03 Feb 2014 17:34:16 GMT
Connection: keep-alive
Cache-Control: no-cache

------------------------------------------------------------------
GET / HTTP/1.1
Host: www.ndtv.com
Accept-Encoding: gzip, deflate, compress
Accept: */*
User-Agent: Mozilla/5.0 (Mobile; rv:27) Gecko/27 Firefox/27
Pragma: no-cache

HTTP/1.1 200 OK
Server: Apache
ETag: "3eb8837816a83dbd0ba840d78c04cf32:1391449105"
Last-Modified: Mon, 03 Feb 2014 17:38:23 GMT
Accept-Ranges: bytes
Content-Type: text/html
Vary: Accept-Encoding
Content-Length: 71681
Date: Mon, 03 Feb 2014 17:39:20 GMT
Connection: keep-alive
Cache-Control: no-cache

------------------------------------------------------------------


           function redirectToClassicSite() {
                if (window.innerWidth > 700) {
                    var canonical = "";
                    var links = document.getElementsByTagName("link");
                    for (var i = 0; i < links.length; i ++) {
                        if (links[i].getAttribute("rel") === "canonical") {
                            canonical = links[i].getAttribute("href");
                            break;
                        }
                    }
                    
                    if (canonical!="") {
                        var n = canonical.indexOf("?"); 
                        canonical += (n >= 0) ? '&' : '?';
                        canonical += 'site=classic';
                        
                        window.location.href = canonical;
                    }
                }
            }
            redirectToClassicSite();


:: Expected Result

mobile content and video

:: Actual Result

Desktop site

:: Additional Information

Software Version: 1.1
Reporter's User Agent: Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1
(Reporter)

Updated

4 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [mobile-compat-form] → [mobile-compat-form][serversniff][clientsniff][contactready][video]
(Reporter)

Updated

4 years ago
Duplicate of this bug: 974790
(Reporter)

Comment 2

4 years ago
suggestedfix
The ndtv.com site recognises only smartphones running certain versions of Firefox OS. For example, devices running Firefox OS 1.0 will send this User-Agent string:

Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

and ndtv.com will correctly detect those as smartphones. However, later versions like Firefox OS 1.2, 1.3 and 1.4 are not correctly detected. This is an example of a User-Agent string that will not trigger mobile content:

Mozilla/5.0 (Mobile; rv:20) Gecko/20 Firefox/20

In general, we recommend just detecting the string "Mobi" and serve smartphone-targeted content in response.
(Reporter)

Comment 3

4 years ago
both automated and manual testing indicates this is fixed now :)
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.