iOS UiWebView “Frame load interrupted”

匆匆过客 提交于 2019-12-01 14:42:08

I think you will need to handle the file:// protocol in a UIWebView delegate method. eg.

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
   // Intercept the external http requests and forward to Safari.app
    // Otherwise forward to the PhoneGap WebView
    if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    else {
        return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
    }
}

In your case, tell the delegate method what to do with your url scheme. eg.

if ([url.scheme isEqualToString:@"file"]) {
    NSLog(@"Open start page");
    [[UIApplication sharedApplication] openURL:url];
    return NO;
}

Not sure if this will work for you, but hopefully it will provide a path to the solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!