[Webkit-unassigned] [Bug 154916] WKWebView needs feature to allow file:// subresources
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 25 09:59:28 PDT 2018
https://bugs.webkit.org/show_bug.cgi?id=154916
--- Comment #31 from ae at seven.systems ---
(In reply to Guillaume Ripoche from comment #30)
> (In reply to ae from comment #28)
> We are working on it, and were wondering if you used
> WKWebViewConfiguration.setURLSchemeHandler method. If so, you don't support
> iOS 10 and below anymore?
Yes indeed, we only support iOS 11 and up now. The gist of it all is, in case it's helpful for you:
[configuration setURLSchemeHandler:self forURLScheme:@"sevenapp"];
- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)task {
NSURL* url = task.request.URL;
NSString* path = /* get requested file path here */;
NSData* data = [NSData dataWithContentsOfFile: path];
NSURLResponse* response = [[NSURLResponse alloc] initWithURL:url MIMEType:MIMEType expectedContentLength:[data length] textEncodingName:nil];
[task didReceiveResponse:response];
[task didReceiveData:data];
[task didFinish];
}
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180925/5d2e1ec0/attachment.html>
More information about the webkit-unassigned
mailing list