RESOLVED FIXED 216977
Add -[WKWebView _loadRequest:shouldOpenExternalURLsPolicy:] to provide a way to allow app link
https://bugs.webkit.org/show_bug.cgi?id=216977
Summary Add -[WKWebView _loadRequest:shouldOpenExternalURLsPolicy:] to provide a way ...
Hoa Dinh
Reported 2020-09-25 09:11:58 PDT
We need to add an additional parameter to WKPageLoadURLRequestReturningNavigation() to control whether app link is allowed to be used.
Attachments
Patch (3.43 KB, patch)
2020-09-25 09:19 PDT, Hoa Dinh
no flags
Patch (4.75 KB, patch)
2020-09-25 22:43 PDT, Hoa Dinh
no flags
Hoa Dinh
Comment 1 2020-09-25 09:19:23 PDT
Alex Christensen
Comment 2 2020-09-25 11:06:41 PDT
Comment on attachment 409699 [details] Patch WKPageLoadURLRequestReturningNavigation should not be changed, to keep binary compatibility. This should be new SPI, and it should be ObjC in WKWebViewPrivate.h
Alex Christensen
Comment 3 2020-09-25 11:40:29 PDT
It looks like what we need is something similar to _loadRequest:shouldOpenExternalURLs: but that uses ShouldAllowExternalSchemesButNotAppLinks
Hoa Dinh
Comment 4 2020-09-25 22:43:30 PDT
EWS
Comment 5 2020-09-25 23:48:37 PDT
Committed r267619: <https://trac.webkit.org/changeset/267619> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409770 [details].
Radar WebKit Bug Importer
Comment 6 2020-09-25 23:49:18 PDT
Darin Adler
Comment 7 2020-09-26 15:09:37 PDT
Comment on attachment 409770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409770&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:157 > - (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL; > - (WKNavigation *)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType characterEncodingName:(NSString *)characterEncodingName baseURL:(NSURL *)baseURL userData:(id)userData WK_API_AVAILABLE(macos(10.12), ios(10.0)); > - (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLs:(BOOL)shouldOpenExternalURLs WK_API_AVAILABLE(macos(10.13), ios(11.0)); > +- (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLsPolicy:(_WKShouldOpenExternalURLsPolicy)shouldOpenExternalURLsPolicy WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); Why is all of this SPI instead of API? Don’t we want some of this as API?
Alex Christensen
Comment 8 2020-10-24 09:11:51 PDT
This control has been requested, but I don't think this location is where it should go in public API. I think it should be a WKNavigationDelegate callback asking whether we should open a particular link.
Note You need to log in before you can comment on or make changes to this bug.