RESOLVED FIXED 172460
Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPolicy::ShouldAllow.
https://bugs.webkit.org/show_bug.cgi?id=172460
Summary Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPoli...
Yongjun Zhang
Reported 2017-05-22 12:03:03 PDT
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.
Attachments
Patch. (3.00 KB, patch)
2017-05-22 12:11 PDT, Yongjun Zhang
no flags
Patch, add this SPI for both iOS and macOS. (3.29 KB, patch)
2017-05-22 14:37 PDT, Yongjun Zhang
no flags
Yongjun Zhang
Comment 1 2017-05-22 12:03:30 PDT
Yongjun Zhang
Comment 2 2017-05-22 12:11:04 PDT
Alex Christensen
Comment 3 2017-05-22 12:53:21 PDT
Comment on attachment 310898 [details] Patch. Sure, but I see no reason why this SPI should be iOS-only.
Yongjun Zhang
Comment 4 2017-05-22 13:40:33 PDT
(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.
Tim Horton
Comment 5 2017-05-22 13:42:00 PDT
(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.
Yongjun Zhang
Comment 6 2017-05-22 14:37:05 PDT
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.
WebKit Commit Bot
Comment 7 2017-05-22 15:41:05 PDT
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>
WebKit Commit Bot
Comment 8 2017-05-22 15:41:07 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.