Bug 209893

Summary: Add SPI to restrict loading to main resources or non-network loads
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, cdumez, ews-watchlist, japhet, thorton, toyoshim, webkit-bug-importer, yutak
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Alex Christensen 2020-04-01 22:05:15 PDT
Add SPI to restrict loading to main resources or non-network loads
Comment 1 Alex Christensen 2020-04-01 22:06:49 PDT
Created attachment 395242 [details]
Patch
Comment 2 Tim Horton 2020-04-01 22:13:36 PDT
Comment on attachment 395242 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=395242&action=review

Seems reasonable to me though I'd love a cdumez or bradee-oh review

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:921
> +- (BOOL)_loadsFromNetwork

Is this a good name? It really means "allowsLoadingFromHTTPFamilySchemes", right? (what about web sockets, WKURLSchemeHandlers that happen to hit the network, etc...)

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:931
> +- (BOOL)_loadsSubresources

Are we consistent in this capitalization of subresources?
Comment 3 Alex Christensen 2020-04-01 22:16:16 PDT
Created attachment 395243 [details]
Patch
Comment 4 Alex Christensen 2020-04-01 22:20:24 PDT
_loadsFromNetwork prevents http, https, ws, and wss loads.  This is to fix rdar://problem/19426383 which was fixed using bundle SPI that did not block web sockets.  This does block web sockets, as verified by the test, which counts the number of requests.  If it did not block web sockets, the server would see a "request" from the web socket.
We are quite consistent in our capitalization of Subresources.
Comment 5 Tim Horton 2020-04-01 22:23:53 PDT
Ah, I see the WebSocket change now.
Comment 6 EWS 2020-04-02 10:51:12 PDT
Committed r259392: <https://trac.webkit.org/changeset/259392>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395243 [details].
Comment 7 Radar WebKit Bug Importer 2020-04-02 10:52:14 PDT
<rdar://problem/61215964>