Closed Bug 1610003 Opened 6 years ago Closed 4 years ago

Add a UA override for www.sbs.com.au

Categories

(Web Compatibility :: Interventions, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ksenia, Assigned: ksenia)

References

()

Details

A site is using the following function for UA detection:

detect: function() {
        embeddedPlayer.debugOutput("EmbeddedPlayer: platform detection");
        var e,
          t,
          a,
          d = window.navigator.userAgent,
          n = window.navigator.platform;
        /MSIE/.test(d)
          ? ((e = "Internet Explorer"),
            /IEMobile/.test(d) && (e += " Mobile"),
            (a = /MSIE \d+[.]\d+/.exec(d)[0].split(" ")[1]))
          : /Trident/.test(d)
          ? ((e = "Internet Explorer"),
            /IEMobile/.test(d) && (e += " Mobile"),
            (a = /rv:\d+[.]\d+/.exec(d)[0].split(":")[1]))
          : /Chrome/.test(d)
          ? ((e = "Chrome"), (a = /Chrome\/[\d\.]+/.exec(d)[0].split("/")[1]))
          : /Opera/.test(d)
          ? ((e = "Opera"),
            /mini/.test(d)
              ? (e += " Mini")
              : /Mobile/.test(d) && (e += " Mobile"))
          : /Android/.test(d)
          ? ((e = "Android Webkit Browser"),
            (mobile = !0),
            (t = /Android\s[\.\d]+/.exec(d)))
          : /Firefox/.test(d)
          ? ((e = "Firefox"),
            /Fennec/.test(d) && (e += " Mobile"),
            (a = /Firefox\/[\.\d]+/.exec(d)[0].split("/")[1]))
          : /Safari/.test(d)
          ? ((e = "Safari"),
            /CriOS/.test(d)
              ? ((t = "iOS"),
                (e = "Chrome"),
                (a = /CriOS\/[\.\d]+/.exec(d)[0].split("/")[1]))
              : (/iPhone/.test(d) || /iPad/.test(d) || /iPod/.test(d)) &&
                (t = "iOS"))
          : (/iPhone/.test(d) ||
              /iPad/.test(d) ||
              /iOS/.test(d) ||
              /CFNetwork.*Darwin/.test(d)) &&
            ((e = "Safari"),
            (t = "iOS"),
            (a = /Darwin/.test(d)
              ? /Darwin\/[\.\d]+/.exec(d)[0].split("/")[1]
              : /FBAV/.test(d)
              ? /FBAV\/[\.\d]+/.exec(d)[0].split("/")[1]
              : "1.0")),
          a ||
            (a = (a = /Version\/[\.\d]+/.exec(d))
              ? a[0].split("/")[1]
              : /Opera\/[\.\d]+/.exec(d)[0].split("/")[1]),
          void 0 !== t || ("MacIntel" !== n && "MacPPC" !== n)
            ? "Win32" === n
              ? (t = "Windows 32 bit")
              : "Win64" == n
              ? (t = "Windows 64 bit")
              : !t && /Linux/.test(n)
              ? (t = "Linux")
              : !t && /Windows/.test(d) && (t = "Windows")
            : /10[\.\_\d]+/.exec(d) &&
              ((t = "Mac OS X " + /10[\.\_\d]+/.exec(d)[0]),
              /[\_]/.test(t) && (t = t.split("_").join("."))),
          void 0 === t && (t = "");
        var r = window.MediaSource || window.WebKitMediaSource;
        window.ui = {
            browser: e,
            version: a,
            os: t,
            userAgent: d,
            mse: !!r
        }
    }

It results in an error at this point:

          a ||
            (a = (a = /Version\/[\.\d]+/.exec(d))
              ? a[0].split("/")[1]
              : /Opera\/[\.\d]+/.exec(d)[0].split("/")[1]),

For an override we'd need to come up with an UA string that would not result in this function erroring out. This should only happen for mobile

Blocks: 1625222
Priority: -- → P2
No longer blocks: 1625222

This needs some more diagnosis since even if the UA is spoofed, the player doesn't seem to work

According to https://github.com/webcompat/web-bugs/issues/47107#issuecomment-688644048, the player is fixed and we don't need this anymore.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.