webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
749 stars 68 forks source link

www.xataka.com - Unable to view comments #48650

Closed webcompat-bot closed 4 years ago

webcompat-bot commented 4 years ago

URL: https://www.xataka.com/legislacion-y-derechos/microsoft-crea-electionguard-sistema-voto-electronico-indiferente-al-hackeo#

Browser / Version: Firefox Mobile 75.0 Operating System: Android Tested Another Browser: Yes

Problem type: Something else Description: comments function doesnt Work, just reload the page and doesnt show Steps to Reproduce: Just clicks on comments

Browser Configuration
  • None

From webcompat.com with ❤️

softvision-oana-arbuzov commented 4 years ago

Thanks for the report, I was able to reproduce the issue. image

Note:

  1. The issue is not reproducible on Chrome.
  2. The issue is reproducible on Firefox Preview Nightly regardless if TP is enabled or not.

Tested with: Browser / Version: Firefox Nightly Preview 200220 (🦎: 75.0a1-20200219095352), Firefox Beta 68.6b2 Operating System: Huawei P20 Lite (Android 8.0.0) - 1080 x 2280 pixels, 19:9 ratio (~432 ppi density), Samsung Galaxy S6 Edge (Android 7.0) - 1440 x 2560 pixels (~577 ppi pixel density)

Reporter could you try clearing cache/data/cookies, disable Ad-blocker (if available), or use a clean profile, and check again?

ksy36 commented 4 years ago

I get the following error in the console: TypeError: can't access property 0, /Opera\/[\.\d]+/.exec(...) is null

This is breaking because of incorrect UA detection in this function:

function(e, t) {
    var n, i, s, o, r, a, l, c;
    l = window.navigator.userAgent,
    c = window.navigator.platform,
    /MSIE/.test(l) ? (n = "ie",
    /IEMobile/.test(l) && (s = 1),
    i = /MSIE \d+[.]\d+/.exec(l)[0].split(" ")[1]) : /Chrome/.test(l) ? (/CrOS/.test(l) && (c = "CrOS"),
    n = "chrome",
    i = /Chrome\/[\d\.]+/.exec(l)[0].split("/")[1]) : /Opera/.test(l) ? (n = "opera",
    (/mini/.test(l) || /Mobile/.test(l)) && (s = 1)) : /Android/.test(l) ? (n = "android_webkit_browser",
    s = 1,
    o = /Android\s[\.\d]+/.exec(l)[0]) : /Firefox/.test(l) ? (n = "firefox",
    /Fennec/.test(l) && (s = 1),
    i = /Firefox\/[\.\d]+/.exec(l)[0].split("/")[1]) : /Safari/.test(l) ? (n = "safari",
    (/iPhone/.test(l) || /iPad/.test(l) || /iPod/.test(l)) && (o = "iOS",
    s = 1)) : /Trident/.test(l) && (n = "ie",
    /IEMobile/.test(l) && (s = 1),
    i = /rv:\d+\.\d+/.exec(l)[0].split(":")[1]),
    i || (i = (i = /Version\/[\.\d]+/.exec(l)) ? i[0].split("/")[1] : /Opera\/[\.\d]+/.exec(l)[0].split("/")[1]),
    "MacIntel" === c || "MacPPC" === c ? (o = "mac",
    r = '/10[\.\_\d]+/.exec(l)[0]',
    /[\_]/.test(r) && (r = r.split("_").join("."))) : "CrOS" === c ? o = "chrome_os" : "Win32" === c || "Win64" == c ? (o = "windows",
    a = c.replace(/[^0-9]+/, "")) : !o && /Android/.test(l) ? o = "android" : !o && /Linux/.test(c) ? o = "linux" : !o && /Windows/.test(l) && (o = "windows"),
    window.ui = {
        browser: n,
        version: i,
        mobile: s,
        os: o,
        osversion: r,
        bit: a
    }
}

Firefox for Android is detected as android_webkit_browser because the check for Android happens before the check for Firefox. To fix this the site could put the check for Firefox before the check for Android (in this case /Fennec/.test(d) should be just replaced with /Mobile/.test(d)).

Also this seems similar to https://github.com/webcompat/web-bugs/issues/47107 I'll move this to needscontact

lock[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue at https://webcompat.com/issues/new if you are experiencing a similar problem.