Bug 221659
Summary: | WKWebView needs to provide NSURLRequest interception like WebViewResourceLoadDelegate's -webView:resource:willSendRequest:redirectResponse:fromDataSource: | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jonathan Deutsch <jonathan> |
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | achristensen, beidson, ggaren, jonathan, smoley, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 14 | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 11 |
Jonathan Deutsch
WKWebView does not allow adequate control over the data coming in and out to achieve some feature goals.
As a specific example, TypeKit fonts allow for previewing, but only if the HTTP header Referer [sic] field is set to "http://localhost/". Tumult Hype uses WebViewResourceLoadDelegate's -webView:resource:willSendRequest:redirectResponse:fromDataSource: to change this header for its HTML5 editor to allow these fonts to display. Without a WKWebView equivalent, there's no way to do this (to my knowledge, anyways).
Another example is that in Tumult Whisk [https://tumult.com/whisk/], the editor will live preview content. If there is the content in an unsaved buffer in the app, it will use that instead. It took implementing our own web server to provide this functionality, but it could have otherwise been easily accomplished by redirecting the NSURLRequest to return local data.
I'm sure there are plenty other innovative use cases where one would want to override outbound NSURLRequests from a web view. Without this API, you are restricting creative possibilities.
I am surprised WebView was deprecated without providing this.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/74423352>
Smoley
Apple Internal see also rdar://20545691.