<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:garvankeeley@gmail.com" title="Garvan Keeley <garvankeeley@gmail.com>"> <span class="fn">Garvan Keeley</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - WKWebView does not fully support custom NSURLProtocol"
href="https://bugs.webkit.org/show_bug.cgi?id=138169">bug 138169</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>garvankeeley@gmail.com
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - WKWebView does not fully support custom NSURLProtocol"
href="https://bugs.webkit.org/show_bug.cgi?id=138169#c25">Comment # 25</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - WKWebView does not fully support custom NSURLProtocol"
href="https://bugs.webkit.org/show_bug.cgi?id=138169">bug 138169</a>
from <span class="vcard"><a class="email" href="mailto:garvankeeley@gmail.com" title="Garvan Keeley <garvankeeley@gmail.com>"> <span class="fn">Garvan Keeley</span></a>
</span></b>
<pre>NSURLProtocol interception of WKWebView http/https is theoretically possible:
Class cls = [[[WKWebView new] valueForKey:@"browsingContextController"] class];
SEL sel = NSSelectorFromString(@"registerSchemeForCustomProtocol:");
[(id)cls performSelector:sel withObject:@"http"];
[(id)cls performSelector:sel withObject:@"https"];
Followed by an NSURLProtocol registration will intercept all calls.
Credit to this github user who also has a demo project <a href="https://github.com/WildDylan/WKWebViewWithURLProtocol">https://github.com/WildDylan/WKWebViewWithURLProtocol</a>
Given that this already works, perhaps Apple can consider exposing it officially.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>