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

Firefox on iPad detected incorrectly, again #401

Closed
neckro opened this issue Mar 6, 2020 · 9 comments
Closed

Firefox on iPad detected incorrectly, again #401

neckro opened this issue Mar 6, 2020 · 9 comments

Comments

@neckro
Copy link
Contributor

neckro commented Mar 6, 2020

Previous issue: #378

It looks like those maniacs have done it again, and the UA string for Firefox/iPad was changed in the next version after the fix I did. Here are the UAs.

Firefox on iPad (current version):

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/22.0 Safari/605.1.15

Firefox on iPad (previous version; test was already added, Bowser detects correctly):

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/21.0 Version/13.0.3 Safari/605.1.15

Firefox on iPhone (current version; this is significantly different from the string in the tests but Bowser detects it correctly):

Mozilla/5.0 (iPhone; CPU OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/22.0 Mobile/13E238 Safari/605.1.15

Notably the Version/<iOS version> part of the UA has disappeared, which I was using in my previous fix to disambiguate the iPad version.

I can't come up with a fix for this, unfortunately. If I remove the Version/ part from the parser-os regex...

   /* Firefox on iPad */
   {
-    test: [/Macintosh(.*?) FxiOS(.*?) Version\//],
+    test: [/Macintosh(.*?) FxiOS/],

... Bowser handles the OS part correctly with the new UA, and only misses the platform (which is empty). However, if I also make a similar change to parser-platforms:

   /* Firefox on iPad */
   {
-    test: [/Macintosh(.*?) FxiOS(.*?) Version\//],
+    test: [/Macintosh(.*?) FxiOS/],

... it suddenly starts getting the OS part wrong too:

  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/22.0 Safari/605.1.15

  Difference:

    {
      browser: Object { … },
      engine: Object { … },
      os: {
  -     name: 'macOS',
  +     name: 'iOS',
  -     version: '10.15',
  +     version: '',
  -     versionName: 'Catalina',
      },
      platform: {
  +     model: 'iPad',
  -     type: 'desktop',
  +     type: 'tablet',
        vendor: 'Apple',
      },
    }

... so I'm not sure where to proceed from here, because I thought Bowser was detecting the platform after the OS.

@NikolaySolodukhin
Copy link

the same problem on ipad.

UserAgent: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15’

bowser output:

browser: { name: 'Safari', version: '13.0.4' },
os: { name: 'macOS', version: '10.15' },
platform: { type: 'desktop', vendor: 'Apple' },
engine: { name: 'WebKit', version: '605.1.15' } }

@lancedikson
Copy link
Collaborator

The fix has been released as 2.10.0. Check it out, please :)

@VesnaVojinovic
Copy link

I have tested with the library vesrions 2.10.0 as well 2.11.0, on the iPadOS 13.4.1 and Firefox Version 28.1 (19225) but the bug is still present:

browser: { name: 'Safari', version: '13.1' },
os: { name: 'macOS', version: '10.15.4' , versionsname: 'Catalina'},
platform: { type: 'desktop', vendor: 'Apple', model: 'undefined' },
engine: { name: 'WebKit', version: '605.1.15' } }

@lancedikson
Copy link
Collaborator

@VesnaVojinovic, could you please provide the UserAgent string of the browser?

@VesnaVojinovic
Copy link

iPadFirefoxUserAgent

so please...

@lancedikson
Copy link
Collaborator

Wait, is it Firefox? There's no way to get it from the UserAgent string.

@lancedikson
Copy link
Collaborator

It would be possible if it had FxiOS/22.0 or smth in the UserAgent string. Otherwise, bowser can't solve this for you as it's only intended to parse the browser's UA string.

@VesnaVojinovic
Copy link

believe it or not, but that was really Firefox

@dbeniamine
Copy link

I am testing a webapp on an IPAD and have the exact same agent as @VesnaVojinovic .
The version installed of firefox is : Firefox Daylight 38.1 (6216)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants