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

Confusing message from firefox.com/pair on iOS #18061

Open
joewalker opened this issue Nov 23, 2024 · 3 comments
Open

Confusing message from firefox.com/pair on iOS #18061

joewalker opened this issue Nov 23, 2024 · 3 comments

Comments

@joewalker
Copy link
Member

joewalker commented Nov 23, 2024

Description

When signing up a new phone and linking it to an existing account, you're told to visit firefox.com/pair to link your account. If you do this on Firefox iOS on iPad you don't get the helpful message "use a computer" message.

Steps to reproduce

With Firefox on iPadOS, visit firefox.com/pair and observe the message.

Expected result

On Firefox on an iPhone you get the following message:

Connecting your mobile device with your Mozilla account
Open Firefox on your computer, visit firefox.com/pair, and follow the on-screen instructions to connect your mobile device.

Actual result

On Firefox on iPadOS you get this message:

Oops! It looks like you’re not using Firefox.
Switch to Firefox and open this page to connect another device.

Environment

Firefox 132.1 (47104)
iPadOS 18.1.1

┆Issue is synchronized with this Jira Task

@janbrasna
Copy link

On Firefox on iPadOS you get this message:

Oops! It looks like you’re not using Firefox.
Switch to Firefox and open this page to connect another device.

Basically Firefox on iPad pretends to be desktop Safari — so my guess is that's what's being detected.

A good countermeasure is to additionally look for coarse pointer or touch/drag events, that can tell the UA is only "pretending" to be desktop Safari, in which case a mobile device can be inferred and the same "Open Firefox on your computer" message served.

@janbrasna
Copy link

According to comments in the code used to detect the devices, it's a known issue:

* This does not work for latest iPad, see note above isDesktopFirefoxOnIpad.
*
* @returns {Boolean}
*/
isMobile() {
return this.isIos() || this.isAndroid();
},
/**
* iPads using FF iOS 13+ send a desktop UA.
* The OS shows as a Mac, but 'Firefox iOS' in the UA family.
*
* NOTE, as of at least Sept 2024, this is no longer reliable.
* The UA for iPad Safari exactly matches the UA for iPad Firefox
* except for "Version" which is unreliable.
*
* @returns {Boolean}
*/
isDesktopFirefoxOnIpad() {
return /Mac/.test(this.os.name) && /FxiOS/.test(this.ua);
},

@janbrasna
Copy link

janbrasna commented Jan 6, 2025

The culprit might be in outdated ua-parser-js used:

"ua-parser-js": "1.0.35",

According to faisalman/ua-parser-js@5ea9f0e this should work as of v2.0.0 — however there are a few breaking changes regarding mobile UAs: https://github.com/faisalman/ua-parser-js/releases/tag/2.0.0-alpha.2

EDIT: v2 changed licensing so its AGPL might be incompatible here.

In that case additional feature checks exist even in v1.0.x that help identify iPad by touch/drag capability: https://docs.uaparser.dev/api/main/idata/with-feature-check.html

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

2 participants