开发者

NSURLErrorDomain -999 breaks Flash

开发者 https://www.devze.com 2023-01-14 09:33 出处:网络
I have a WebView which works great except in one i开发者_Go百科nstance. When it loads a page with a SWF that loads another SWF, the load delegate gets \"The operation couldn’t be completed. (NSURLErr

I have a WebView which works great except in one i开发者_Go百科nstance. When it loads a page with a SWF that loads another SWF, the load delegate gets "The operation couldn’t be completed. (NSURLErrorDomain error -999.)"

From what I gather, this error happens when a second request is made before the first has completed (1, 2, 3, 4). I am not expressly doing so, but the SWF is indeed making another request.

Ignoring the error is not a solution--I'm essentially ignoring it as is, and the entire page loads fine except for the Flash content. What can I do to make Flash work?


I'm not sure if not implementing the delegate call is the same as ignoring it; WebKit might be trying to handle the error under the hood and causing problems.

In my WebKit/Flash application, I have this in my WebFrameLoadDelegate:

- (void) webView:(WebView*)sender 
         didFailProvisionalLoadWithError:(NSError*)error 
         forFrame:(WebFrame*)frame 
{   
    // If the user clicks a link while something is loading this error will
    // be reported. It can be safely ignored (NSURLErrorCancelled -999)
    if ([error code] == NSURLErrorCancelled) return;

    // Real error handling here...
}

And everything works fine. If I take this out I start getting weird failures and even crashes when Flash content is displayed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号