Closed Bug 976956 Opened 8 years ago Closed 7 years ago

m.juegos.com fails to load in Firefox on Android because JavaScript assumes Android version number is in UA string

Categories

(Web Compatibility :: Mobile, defect)

Other
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hsteen, Assigned: karlcow)

References

()

Details

(Whiteboard: [clientsniff][androidversion][sitewait][country-ar])

m.juegos.com hangs while loading, saying "cargando...".

The reason is a JavaScript error: "TypeError: k[q].version.exec(...) is null" that happens during the load process. Last part of stack is:

n@http://m.juegos.com/js/core-min.js:1
h@http://m.juegos.com/js/core-min.js:1
FeatureDetection/f.start@http://m.juegos.com/js/core-min.js:1

The version property is defined earlier:

      {
            os: /(android)/i,
            version: /android\s+([0-9]+(\D{1}[0-9]+(\D{1}[0-9])?)?)/i
        }

and this code will throw:
return k[q].version.exec(l)[1]
when there is no version number after the string "Android" in the navigator.userAgent string, because exec() returns null and taking the 1st property of null throws.
A suitable fix would be to add a check to make sure that exec() returns something - for example like this:

if(k[q].version.exec(l)){
    return k[q].version.exec(l)[1];
}
return '';

There may be other code elsewhere that relies on the return value though, so follow-up fixes may be required.
This Web site is part of a much bigger company. They own many Web sites across the world.
http://www.spilgames.com/about-us/game-sites/

The funny thing is that the address on their Web site doesn't mention the country. 
Arendstraat 23
1223 RE Hilversum

So it's The Netherlands.

Their email address is info@spilgames.com
They are also on twitter. https://twitter.com/spilgames Let's try a human contact on twitter first.

1st attempt
http://twitter.com/MozWebCompat/status/491811482649108482
Assignee: nobody → kdubost
Status: NEW → ASSIGNED
Whiteboard: [clientsniff][androidversion][contactready][country-ar] → [clientsniff][androidversion][sitwait][country-ar]
Whiteboard: [clientsniff][androidversion][sitwait][country-ar] → [clientsniff][androidversion][sitewait][country-ar]
This is fixed. The site now redirects for *all devices* to www.juegos.com which hosts a responsive Web site.
Status: ASSIGNED → RESOLVED
Closed: 7 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.