5

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

I'm getting this message regularly in iOS when I try to load HTML in WKWebView. Also it's repeating when I open a WKWebView page.

WKWebViewConfiguration *conf = [[WKWebViewConfiguration alloc] init];
_articleWebView = [[WKWebView alloc] initWithFrame:_mainView.containterViiew.bounds configuration:conf];
_articleWebView.navigationDelegate = self;
_articleWebView.scrollView.scrollEnabled = NO;
[_mainView.containterViiew addSubview:_articleWebView];
[_articleWebView loadHTMLString:_articleDesc.pageContent baseURL:nil];

Also I'm trying to get the content height of the WKWebView in finish method. When the above error occurs, I am getting different height values.

- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation {
    [webView evaluateJavaScript:@"document.readyState"
              completionHandler:^(id complete, NSError * _Nullable error) {
        if (complete != nil) {
            NSString *javascriptString = @"var body = document.body;var html = document.documentElement;Math.max(html.offsetHeight);";

            [webView evaluateJavaScript:javascriptString
              completionHandler:^(id _Nullable result, NSError * _Nullable error) {
                if (!error) {
                    NSNumber *height = result;
                    NSLog(@"height ----------->>>%@", height);
            });
        }
    }];
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Have a look at the answers form here: https://stackoverflow.com/questions/44585980/com-apple-webkit-webcontent-drops-113-error-could-not-find-specified-service – Vall0n May 14 '18 at 11:47
  • Possible duplicate of [com.apple.WebKit.WebContent drops 113 error: Could not find specified service](https://stackoverflow.com/questions/44585980/com-apple-webkit-webcontent-drops-113-error-could-not-find-specified-service) – Vall0n May 14 '18 at 11:47

0 Answers0