Closed Bug 913633 Opened 9 years ago Closed 8 years ago

platform.js miscategorizes FF for Android and Firefox OS browsers

Categories

(Web Compatibility :: Mobile, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: miketaylr, Assigned: miketaylr)

References

()

Details

(Whiteboard: [clientsniff] [lib-js] [country-all][sitewait])

> platform.parse("Mozilla/5.0 (Android; Mobile; rv:23.0) Gecko/23.0 Firefox/23.0")
{ version: '23.0',
  name: 'Android Browser',
  os: 
   { architecture: 32,
     family: 'Android',
     version: null,
     toString: [Function] },
  description: 'Android Browser 23.0 (Gecko)',
  layout: 'Gecko',
  manufacturer: null,
  prerelease: null,
  product: null,
  ua: 'Mozilla/5.0 (Android; Mobile; rv:23.0) Gecko/23.0 Firefox/23.0',
  parse: [Function: parse],
  toString: [Function: toStringPlatform] }
> platform.parse("Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0")
{ version: '18.0',
  name: 'Firefox Mobile',
  os: 
   { architecture: null,
     family: null,
     version: null,
     toString: [Function] },
  description: 'Firefox Mobile 18.0',
  layout: 'Gecko',
  manufacturer: null,
  prerelease: null,
  product: null,
  ua: 'Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0',
  parse: [Function: parse],
  toString: [Function: toStringPlatform] }
Blocks: 915706
Took a while to digest the code, but here's a PR for Firefox for Android, https://github.com/bestiejs/platform.js/pull/28

Firefox OS shouldn't be too much work to add, will work on that tomorrow.
Whiteboard: [clientsniff] [lib-js] [country-all]
For some reason those two bugs on Github seem closed but the pull requests seem like they are not taken..? Pinging him on github.
Yeah I bug John David Dalton (the maintainer) every once in a while on IRC. I guess he'll find the time at some point...
I think [sitewait] would be appropriate - if only to get it out of my todo-list ;)
Whiteboard: [clientsniff] [lib-js] [country-all] → [clientsniff] [lib-js] [country-all][sitewait]
> f.parse('Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1')
{ version: '18.1',
  name: 'LG Browser',
  os: 
   { architecture: null,
     family: null,
     version: null,
     toString: [Function] },
  description: 'LG Browser 18.1 (Gecko) on LG',
  layout: 'Gecko',
  manufacturer: 'LG',
  prerelease: null,
  product: 'LG',
  ua: 'Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1',
  parse: [Function: parse],
  toString: [Function: toStringPlatform] }

That needs to be fixed as well.

Similar results for tablet uas:

> f.parse('Mozilla/5.0 (Android; Tablet; rv:26.0) Gecko/26.0 Firefox/26.0')
{ version: '26.0',
  name: 'Android Browser',
  os: 
   { architecture: 32,
     family: 'Android',
     version: null,
     toString: [Function] },
  description: 'Android Browser 26.0 (Gecko)',
  layout: 'Gecko',
  manufacturer: null,
  prerelease: null,
  product: null,
  ua: 'Mozilla/5.0 (Android; Tablet; rv:26.0) Gecko/26.0 Firefox/26.0',
  parse: [Function: parse],
  toString: [Function: toStringPlatform] }
> f.parse('Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0')
{ version: '26.0',
  name: 'Firefox',
  os: 
   { architecture: null,
     family: null,
     version: null,
     toString: [Function] },
  description: 'Firefox 26.0',
  layout: 'Gecko',
  manufacturer: null,
  prerelease: null,
  product: null,
  ua: 'Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0',
  parse: [Function: parse],
  toString: [Function: toStringPlatform] }
(I need to revisit my patch.)
Both PRs merged. Thanks!
Status: NEW → RESOLVED
Closed: 8 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.