Bug 197096 - AX: Cannot load local file after loaded online page with a wkWebView on iOS12.2
Summary: AX: Cannot load local file after loaded online page with a wkWebView on iOS12.2
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 12
Hardware: iPhone / iPad iOS 12
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-19 00:18 PDT by qianyangbiao
Modified: 2019-04-19 22:06 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qianyangbiao 2019-04-19 00:18:33 PDT
Reproduce on iOS 12.2 device:

1.Create a wkwebView like :
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, size.width, (size.height - 100)/2) configuration:[WKWebViewConfiguration new]];

2.Load online page like :
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.baidu.com"]]];

3.After webView finish load, load a local file like:
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"test.html"];
[webView loadFileURL:fileURL allowingReadAccessToURL:fileURL];

Then you can see error like:
2019-04-19 15:17:11.107165+0800 TestWKWebView[10686:386533] [ProcessSwapping] 0x1035382c0 - ProvisionalPageProxy::didFailProvisionalLoadForFrame: pageID = 1, frameID = 1, navigationID = 2
2019-04-19 15:17:11.109566+0800 TestWKWebView[10686:386533] didFailProvisionalNavigation = Error Domain=kCFErrorDomainCFNetwork Code=1 "(null)" UserInfo={_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <644E6D87-CC60-4D8D-8B89-3898D4899027>.<31>, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x283c87440>}
Comment 1 Radar WebKit Bug Importer 2019-04-19 00:18:49 PDT
<rdar://problem/50041855>