When navigating to an unsafe site by clicking on a link, WKWebView's URL property is the old URL (the URL we're coming from), not the unsafe URL, while the SafeBrowsing interstitial is displayed. Also, WKWebView's isLoading property is false while the interstitial is displayed. This makes it harder for an embedder to display the unsafe URL in the embedder's UI (so that the user can make an informed decision when presented with the warning interstitial). This also happens for client-side redirects to unsafe destinations -- the URL is the redirecting page's URL and isLoading is false. This is different from what happens when navigating to an unsafe site using back/forward navigation or using loadRequest, where WKWebView's URL is the unsafe URL and isLoading is true while the interstitial is displayed.
<rdar://problem/46778097>
Created attachment 357544 [details] Patch
Comment on attachment 357544 [details] Patch r=me
http://trac.webkit.org/r239339
The API test added with this change is failing on iOS bots: TestWebKitAPI.SafeBrowsing.URLObservation /Volumes/Data/slave/ios-simulator-12-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:206 Expected equality of these values: [button attributedTitleForState:UIControlStateNormal].string.UTF8String Which is: NULL expectedTitle Which is: "Go Back" /Volumes/Data/slave/ios-simulator-12-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:218 Expected equality of these values: [webView _safeBrowsingWarning] Which is: 0x7fa0a780a000 nullptr Which is: (nullptr) /Volumes/Data/slave/ios-simulator-12-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:333 Expected equality of these values: urls.size() Which is: 2 expected.size() Which is: 3
Looking...
http://trac.webkit.org/r239356