We got a problem when we use wkwebview. We use WKWebView to load webpage in our app,but sometimes we found that when the page is loading, JS resources are always in the pending state, resulting in page loading blocking. As long as we reset WKProcessPool, the problem is solved. But it will come back after a while.
We set a singleton object to WKWebview's processpool :
WKWebViewConfiguration* configuration = [WKWebViewConfiguration alloc] init];
configuration.processPool = self.processPool;
WKWebView* webView = [[WKWebView alloc] initWithFrame:self.bounds configuration:configuration];
(WKProcessPool *)processPool {
if (!_processPool) {
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
_processPool = [[WKProcessPool alloc] init];
});
}
return _processPool;
}
Is there any problem that we use processpool as a singleton object ?
what may case js resource requests are always pending ?
We set a singleton object to WKWebview's processpool :
WKWebViewConfiguration* configuration = [WKWebViewConfiguration alloc] init];
configuration.processPool = self.processPool;
WKWebView* webView = [[WKWebView alloc] initWithFrame:self.bounds configuration:configuration];
(WKProcessPool *)processPool {
if (!_processPool) {
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
_processPool = [[WKProcessPool alloc] init];
});
}
return _processPool;
}
Is there any problem that we use processpool as a singleton object ?
what may case js resource requests are always pending ?