Bug 238838 - [iOS] Need API on NavigationAction to detect a simulated request
Summary: [iOS] Need API on NavigationAction to detect a simulated request
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-05 14:45 PDT by Ali Juma
Modified: 2022-04-06 08:41 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2022-04-05 14:45:53 PDT
Chrome for iOS is using WKWebView’s loadSimulatedRequest API to display error pages for failed navigations. One reason for a navigation failing is when a URL is blocked by enterprise policy.

In this case, Chrome tries to load a simulated request with an error message, using the URL of the blocked page.

However, in decidePolicyForNavigationAction, the URL blocking logic cannot distinguish a real load of the blocked page vs a simulated request using that URL, since there's no information in the WKNavigationAction to tell us that this is a simulated request.

One way to fix this would be to promote the _mainFrameNavigation SPI in WKNavigationAction to API, so that we can compare that WKNavigation* to the one returned by loadSimulatedRequest.

I've also filed FB9974496 for this request.
Comment 1 Alexey Proskuryakov 2022-04-06 08:41:40 PDT
rdar://91316525