Closed Bug 827627 Opened 9 years ago Closed 6 years ago

bol.uol.com.br doesn't recognize Fennec and B2G UAs as mobile

Categories

(Web Compatibility :: Mobile, defect)

ARM
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lmandel, Assigned: karlcow)

References

()

Details

(Whiteboard: [country-br][serversniff][sitewait])

bol.uol.com.br serves a desktop site to B2G. Bug 819210 added an UA override for this domain. The override should be removed once the domain serves mobile content to B2G. This bug tracks the evangelism for the site to recognize the B2G UA and the removal of the override at that time.
Whiteboard: [uaoverride]
OS: Gonk (Firefox OS) → All
Summary: bol.uol.com.br doesn't recognize B2G UA as mobile → bol.uol.com.br doesn't recognize Fennec and B2G UAs as mobile
Whiteboard: [uaoverride] → [uaoverride] [country-br]
https://twitter.com/MozWebCompat/status/371964729985470464 - also submitted a comment to a "report error" feature on the bol.uol.com.br main page.
Assignee: nobody → hsteen
Status: NEW → ASSIGNED
Whiteboard: [uaoverride] [country-br] → [uaoverride] [country-br][serversniff]
Whiteboard: [uaoverride] [country-br][serversniff] → [uaoverride] [country-br][serversniff][sitewait]
On Firefox OS ZTEOpen getting the mobile site.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Blocks: 923442
On Firefox OS it seems to go into some sort of reload loop now. Karl, can you re-test on your devices? We should reopen?
Flags: needinfo?(kdubost)
Requesting with:

GET / HTTP/1.1
Host: bol.uol.com.br
User-Agent: Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Connection: keep-alive

we get 

HTTP/1.1 301 Moved Permanently
Date: Mon, 14 Sep 2015 02:47:37 GMT
Server: Apache/2.0.63 (Unix) Ganesh/2.2.0
Location: http://www.bol.uol.com.br
Content-Length: 233
Connection: close
Content-Type: text/html; charset=iso-8859-1

which after the redirects trigger

HTTP/1.1 200 OK
Date: Mon, 14 Sep 2015 02:47:38 GMT
Server: marrakesh 1.9.9
Last-Modified: Mon, 14 Sep 2015 02:47:22 GMT
Content-Type: text/html; charset=ISO-8859-15
Cache-Control: max-age=30, private, proxy-revalidate
Etag: 66bc6a74d1bc240b85beee6af0b9afa2
Expires: Mon, 14 Sep 2015 02:48:08 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 31641
Connection: close

It starts to parse all the resources, specifically home.css and home.js
then bol.js and uoltm.js

and then restart for a round of the www.bol.uol.com.br "/"

Love it, when requesting 

https://www.bol.uol.com.br/home.js it creates an infinite loop 
https://www.bol.uol.com.br/#404

The beginning of the script at home.js is

/*! @source javascript/override-wurfl.js */
(function () {
  var overrideWurfl = {
  },
  availableOverride = true,
  listSize = 0,
  marrakeshCookie = '',
  testUA = null,
  theUA,
  de = '',
  _debug = (window.debugWurfl) ? window.debugWurfl.active : false;
  overrideWurfl = {
    list: [
      'Opera/d{0,1}.d{0,3}(.*)(; Opera Mobi/)(.*)(Presto/)',
      '(Android 4.)',
      '(BB10)',
      '(Lumia)',
      '(Mobile)',
      '(iPhone)',
      '(Windows Phone)'
    ],
    blackList: [
      'iPad',
      'Xoom',
      'MZ604',
      'GT-P5100',
      'GT-P1000'
    ],
    init: function () {
      marrakeshCookie = new RegExp('.*?x-user-agent-class=(.*?)(;.*?$|$)', 'g');
      theUA = navigator.userAgent.toString();
      listSize = overrideWurfl.list.length;
      blackListSize = overrideWurfl.blackList.length;
      while (blackListSize--) {
        if (theUA.match(overrideWurfl.blackList[blackListSize])) {
          if (_debug) {
            window.debugWurfl._data.blacklistMatchs.push(overrideWurfl.blackList[blackListSize]);
          }
          availableOverride = false;
        }
      }
      if (availableOverride) {
        while (listSize--) {
          testUA = theUA.match(overrideWurfl.list[listSize]);
          if (testUA !== null) {
            if (_debug) {
              window.debugWurfl._data.listMatchs.push(overrideWurfl.list[listSize]);
            }
            var uaCookie = unescape(document.cookie.replace(marrakeshCookie, '$1'));
            if (uaCookie !== 'WEB') {
              de = new Date();
              de.setDate(de.getDate() + 4);
              if (!_debug) {
                document.cookie = 'x-user-agent-class=SMART; expires=' + de.toUTCString() + '; path=/;domain=bol.uol.com.br';
                window.location.reload();
              }
            }
          }
        }
      }
    }
  };
  if (location.href.indexOf('seeHome') > - 1) {
    document.cookie = 'seeHome' + '=' + '1; path=/';
  } else {
    overrideWurfl.init();
  }
}());



For iOS, it goes from www. -> to wap. -> to m. 
If I enter directly m. or wap. I get the right site in Firefox OS.
Status: RESOLVED → REOPENED
Flags: needinfo?(kdubost)
Resolution: FIXED → ---
Whiteboard: [uaoverride] [country-br][serversniff][sitewait] → [country-br][serversniff][sitewait]
sent an email to someone from UOL.
Assignee: hsteen → kdubost
Status: REOPENED → ASSIGNED
This is fixed.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago6 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.