otsukare Thoughts after a day of work

When iOS will allow other browsers

User agent sniffing is doomed to fail. It has this thick layer of opacity and logic, where you are never sure that you will really get in the end.

Stuffed animal through the opaque glass of a window.

This happens all the time and will happen again. It's often not only technical, but business related and just human. But let's focus on the detection of Firefox on iOS. Currently, on iOS, every browsers are using the same rendering engine. The one which is mandated by Apple. Be Chrome, Firefox, etc, they all use WKWebView.

One of the patterns of user agent detections goes like this:

  1. Which browsers? Firefox, Chrome, Safari, etc.
  2. Which device type? Mobile, Desktop, Tablet
  3. Which browser version?

You have 30s to guess what is missing in this scenario?

Yes, the OS. Is it iOS or Android? The current logic for some developers is that

As of today, Firefox

So if the site has minimum version support grid

function l() {
  var t = window.navigator.userAgent,
    e = {
      action: "none",
    },
    n = c.warn,
    o = c.block;
  Object.keys(s).forEach(function (n) {
    t.match(n) && (e = c[s[n]]);
  });
  var r = a.detect(t);
  return (r.msie && r.version <= 11) ||
    (r.safari && r.version <= 8) ||
    (r.firefox && r.version <= 49)
    ? o
    : (r.chrome && r.version <= 21) ||
      (r.firefox && r.version <= 26 && !r.mobile && !r.tablet) ||
      (r.safari && r.version <= 4 && r.mobile) ||
      (r.safari && r.version <= 6) ||
      (r.android && r.version <= 4)
    ? n
    : e;
}

Here the site sees Firefox… so it must be Android, so it must be Gecko. They have set their minimum support for version 49. Firefox is then considered outdated. Safari minimum version on their grid is 8. So Firefox iOS (WebKitView) would have no issues!

Fast Forward To The Future.

When Apple authorizes different rendering engines on iOS (yes, I'm on the optimistic side, because I'm patient), I already foresee a huge webcompat issue. The web developers (who are currently right) will infer in some ways that Firefox on iOS can only be WebKitWebView. So the day Gecko is authorized on iOS, we can expect more breakages and ironically some of the webcompat bugs, we currently have will go away.