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 iOS is not marked as a modern brower #13126

Open
ToyboxZach opened this issue May 7, 2024 · 5 comments
Open

Firefox iOS is not marked as a modern brower #13126

ToyboxZach opened this issue May 7, 2024 · 5 comments
Labels
good first issue Good first issue or something that should is nice to do. Severity:has-workaround

Comments

@ToyboxZach
Copy link
Contributor

Firefox ios gets parsed as firefoxIOS which is not in any of the aliases or anything in the modern browser:

const browser = WebAppInternals.identifyBrowser(
  "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/125.3  Mobile/15E148 Safari/605.1.15"
);
console.log("Minimum browser versions", browser, isModern(browser));

This is something that does keep happening when a new browser starts existing or becomes more popular, is there a good way to get notified or log when some completely unexpected browser starts using our site?

For some other reason our legacy bundle is broken, so this lead to a subset of users being completely broken.

@rj-david
Copy link
Contributor

rj-david commented May 9, 2024

Unfortunately, meteor is using a 6-year-old unmaintained package: https://www.npmjs.com/package/useragent

This means that the database of existing user agents is not updated during the last 6 years :(

There is a fork that pulls from an updated database
Fork: https://www.npmjs.com/package/useragent-ng
Updated database of useragents: https://github.com/ua-parser/uap-core

I have not looked at the families of useragents but this might require a change in modern-browsers package to handle new browsers

@ToyboxZach
Copy link
Contributor Author

The package is actually able to identify it as firefoxIos but meteor just doesn't map it to anything so it's always legacy.

@rj-david
Copy link
Contributor

rj-david commented May 9, 2024

In that case, seems the fix should be adding an alias to the correct family of useragents

@ToyboxZach
Copy link
Contributor Author

Yeah I'm able to fix it locally with this on my server:

setMinimumBrowserVersions(
    {
      "mobileSafariUI/WKWebView": 8,
      appleMail: 500,
      ios: 8,
      firefoxIOS: 100,
    },
    "classes"
  );

This is not the first time I've had problems with a new browser being marked as legacy, so I feel like this experience is somewhat lacking as a developer.

At this point, a new browser is more likely than not modern, so it's weird that be default every browser is defaulting to legacy instead of assuming modern. I also just happen to never want to server a legacy bundle anymore, but couldn't figure out how to do that. At a minimum it would be helpful to be able to log any browsers types that we don't have a mapping for, so I can react a bit quicker than I did with this one.

@KoenLav
Copy link
Contributor

KoenLav commented May 9, 2024

#12177

@StorytellerCZ StorytellerCZ added Severity:has-workaround good first issue Good first issue or something that should is nice to do. labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good first issue or something that should is nice to do. Severity:has-workaround
Projects
None yet
Development

No branches or pull requests

4 participants