WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
221659
WKWebView needs to provide NSURLRequest interception like WebViewResourceLoadDelegate's -webView:resource:willSendRequest:redirectResponse:fromDataSource:
https://bugs.webkit.org/show_bug.cgi?id=221659
Summary
WKWebView needs to provide NSURLRequest interception like WebViewResourceLoad...
Jonathan Deutsch
Reported
2021-02-09 23:25:47 PST
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
Comment 1
2021-02-16 23:26:14 PST
<
rdar://problem/74423352
>
Smoley
Comment 2
2021-02-18 10:44:02 PST
Apple Internal see also
rdar://20545691
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug