Currently, by default, [WKWebView loadRequest:] will set ShouldOpenExternalURLsPolicy to be ShouldNotAllow. It would be nice if a WebKit client can ask WKWebView to load request with ShouldOpenExternalURLsPolicy being ShouldAllow.
rdar://problem/30741139
Created attachment 310898 [details] Patch.
Comment on attachment 310898 [details] Patch. Sure, but I see no reason why this SPI should be iOS-only.
(In reply to Alex Christensen from comment #3) > Comment on attachment 310898 [details] > Patch. > > Sure, but I see no reason why this SPI should be iOS-only. Currently, this is only needed for iOS. We can certainly expand this to macOS if needed in the future. We did have the C SPI version in WKPagePrivate.h WKPageLoadURLWithShouldOpenExternalURLsPolicy, and it seems like no one is using it right now.
(In reply to Yongjun Zhang from comment #4) > (In reply to Alex Christensen from comment #3) > > Comment on attachment 310898 [details] > > Patch. > > > > Sure, but I see no reason why this SPI should be iOS-only. > > Currently, this is only needed for iOS. We can certainly expand this to > macOS if needed in the future. This isn't how we should add things to a cross-platform framework. We should add to both platforms unless we have a good reason *not* to. > We did have the C SPI version in WKPagePrivate.h > WKPageLoadURLWithShouldOpenExternalURLsPolicy, and it seems like no one is > using it right now.
Created attachment 310922 [details] Patch, add this SPI for both iOS and macOS. Address review comment, adding _loadRequest:shouldOpenExternalURLs: as an SPI for both iOS and macOS.
Comment on attachment 310922 [details] Patch, add this SPI for both iOS and macOS. Clearing flags on attachment: 310922 Committed r217252: <http://trac.webkit.org/changeset/217252>
All reviewed patches have been landed. Closing bug.