[Webkit-unassigned] [Bug 221659] New: WKWebView needs to provide NSURLRequest interception like WebViewResourceLoadDelegate's -webView:resource:willSendRequest:redirectResponse:fromDataSource:

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 9 23:25:47 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=221659

            Bug ID: 221659
           Summary: WKWebView needs to provide NSURLRequest interception
                    like WebViewResourceLoadDelegate's
                    -webView:resource:willSendRequest:redirectResponse:fro
                    mDataSource:
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Apple Silicon)
                OS: macOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jonathan at tumult.com

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.

-- 
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/20210210/d696789b/attachment.htm>


More information about the webkit-unassigned mailing list