[Webkit-unassigned] [Bug 13065] REGRESSION: Can't watch episodes of 24 with TOT WebKit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 14 07:03:01 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=13065


bdash at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bdash at webkit.org




------- Comment #5 from bdash at webkit.org  2007-03-14 07:03 PDT -------
The bug is in their Safari version detection JavaScript.  A block of their JS
looks as follows (with reasonable formatting):

if (QI.allowMacSafari && ua.indexOf("safari") != -1) {
    QI.browser = "safari";
    var _5 = parseInt(ua.substring(ua.indexOf("safari/") + 12));
    if (_5 < 312)
        return;
    QI.browserIsGood = true;
}

As the user agent string takes the form "5.0 (Macintosh; U; Intel Mac OS X; en)
AppleWebKit/522 (KHTML, like Gecko) Safari/522", the "+ 12" portion of the
parseInt expression is *skipping past* the version number.  As a result, _5 is
set toNaN and it bails out as NaN < 312 == true.

The corrected code would have "+ 7" in the place of "+ 12".  A more flexible
approach would eliminate the manual counting and use a regexp or similar to
extract the version number. 
<http://trac.webkit.org/projects/webkit/wiki/DetectingWebKit> has suggestions
on how to go about that.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list