title: WKWebView not opening custom URL scheme (js opens custom scheme link in new window)
body: <p>I have a <strong>WKWebView</strong> in my application. I don't use <strong>UIWebView</strong>, because for some strange reason it doesn't open properly a web page with a lot of JS code in it.</p>
  
  <p>When I tap on the link with <strong>custom url scheme "scm://"</strong>, it does <strong>nothing</strong>...</p>
  
  <p>My code:</p>
  
  <pre><code>- (void)viewDidLoad {
      // ...
  
      WKWebViewConfiguration *configuration = [WKWebViewConfiguration new];
      if ([configuration respondsToSelector:@selector(setDataDetectorTypes:)])
          [configuration setDataDetectorTypes:WKDataDetectorTypeLink];
  
      myWebView = [[WKWebView alloc] initWithFrame:webFrame configuration:configuration];
      myWebView.navigationDelegate = self;
  
      [self.view addSubview:myWebView];
  }
  
  #pragma mark - WKNavigationDelegate
  
  - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
  {
      NSURL *requestURL = navigationAction.request.URL;
      UIApplication *app = [UIApplication sharedApplication];
      if ([requestURL.scheme.lowercaseString isEqualToString:@"scm"] &amp;&amp; [app canOpenURL:requestURL]) {
          [app openURL:requestURL];
          decisionHandler(WKNavigationActionPolicyCancel);
      }
      else
          decisionHandler(WKNavigationActionPolicyAllow);
  }
  
  - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
  {
      [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
  }
  
  - (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error
  {
      [self handleError:error];
  }
  
  - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error
  {
      [self handleError:error];
  }
  
  #pragma mark - Handle web view errors.
  
  - (void)handleError:(NSError *)error
  {
      UIApplication *app = [UIApplication sharedApplication];
      app.networkActivityIndicatorVisible = NO;
  
      NSURL *failedUrl = error.userInfo[NSURLErrorFailingURLErrorKey];
  
      if ([failedUrl.scheme.lowercaseString isEqualToString:@"scm"]) {
          [app openURL:failedUrl];
      }
  }
  </code></pre>
  
  <p>When I click custom url, handleError() is never called, neither decidePolicyForNavigationAction().</p>