https://bugzilla.wikimedia.org/show_bug.cgi?id=42604

       Web browser: Opera
             Bug #: 42604
           Summary: JavaScript on all Wikimedia sites fails on Opera due
                    to faulty browser detection code in $.client
           Product: MediaWiki
           Version: 1.21-git
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: JavaScript
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: matma....@gmail.com
                CC: krinklem...@gmail.com, tpars...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---


JavaScript on all Wikimedia sites currently fails on Opera due to faulty
browser detection code. I've pinpointed the error to the following lines in
jquery.client.js:

                // Expose Opera 10's lies about being Opera 9.8
                if ( name === 'opera' && version >= 9.8) {
                    version = ua.match( /version\/([0-9\.]*)/i )[1] || 10;
                }

Unfortunately, for me, `ua` (== `navigator.userAgent`) at this point is
"Opera/9.80 (Windows NT 5.1)", so the match fails and attempting to retrieve
the first matching groups throws an error such as "Uncaught exception:
TypeError: Cannot convert 'ua.match( /version\/([0-9\.]*)/i )' to object".

To detect Opera's version properly, we should use `window.opera.version()`,
which returns version number like "12.11". However, it looks like $.client
doesn't take this into account at all, relying on User-Agent strings; I'm
making a stopgap patch right now.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to