Bug 13065 - REGRESSION: Can't watch episodes of 24 with TOT WebKit
Summary: REGRESSION: Can't watch episodes of 24 with TOT WebKit
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Evangelism (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.myspace.com/24
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-03-14 00:43 PDT by Justin Garcia
Modified: 2008-02-12 14:31 PST (History)
3 users (show)

See Also:


Attachments
Console spew (r20150) (32.82 KB, text/plain)
2007-03-14 02:50 PDT, David Kilzer (:ddkilzer)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Garcia 2007-03-14 00:43:28 PDT
With a recent nightly goto: http://www.myspace.com/24

"We're sorry, but only the following browsers are supported on your operating system at this time:
Safari 1.3.2 (build 312.5) or later
Firefox 1.5 or later
Please check back soon for support for other browsers."

Works with Tiger WebKit.
Comment 1 Justin Garcia 2007-03-14 00:49:01 PDT
<rdar://problem/5062030>
Comment 2 David Kilzer (:ddkilzer) 2007-03-14 02:48:35 PDT
I was able to start watching the most recent episode of "24" with a local debug build of WebKit r20150 with Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8L127).  (NOTE: I have not upgraded to 10.4.9 yet!)

It loaded some kind of Java applet to view the episode, and there was a ton of console spew while it was loading.

Comment 3 David Kilzer (:ddkilzer) 2007-03-14 02:50:10 PDT
Created attachment 13630 [details]
Console spew (r20150)

(In reply to comment #2)
> It loaded some kind of Java applet to view the episode, and there was a ton of
> console spew while it was loading.

The console output.
Comment 4 David Kilzer (:ddkilzer) 2007-03-14 02:50:53 PDT
(In reply to comment #2)
> I was able to start watching the most recent episode of "24" with a local debug
> build of WebKit r20150 with Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8L127). 
> (NOTE: I have not upgraded to 10.4.9 yet!)

Also note this was on a PowerPC-based PowerBook G4 system.

Comment 5 Mark Rowe (bdash) 2007-03-14 07:03:01 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.
Comment 6 Mark Rowe (bdash) 2007-03-14 07:05:00 PDT
I'm not sure why the code works with Tiger WebKit.  The format of the UA string hasn't changed, only the version numbers.  That said, I'm confident my suggested change will work with both Tiger + ToT WebKit.
Comment 7 Mark Rowe (bdash) 2007-03-14 07:08:38 PDT
It's probably useful to know that the code I mentioned is in <http://mvnet.xlontech.net/qm/fox/07010902/qmpinstall.js>, line 90.
Comment 8 Robert Blaut 2008-02-11 02:54:33 PST
http://www.myspace.com/24 redirects me to http://www.myspace.com/ 

Is the issue still replicable? 
Comment 9 Justin Garcia 2008-02-12 14:31:01 PST
(In reply to comment #8)
> http://www.myspace.com/24 redirects me to http://www.myspace.com/ 

Not for me.

> Is the issue still replicable? 

At this point there are no videos (as far as I can tell) at http://www.myspace.com/24, just a wall and links to fox.com, where videos seem to play OK in Safari.  As this was an evanglism issue I think it's safe to close now.

>