title: alert() not working in WKWebview evaluateJavaScript()
body: <p>I don't why my question is marked as duplicate of <strong><a href="https://stackoverflow.com/questions/26898941/ios-wkwebview-not-showing-javascript-alert-dialog">this one</a></strong>, first I execute javascript code with evaluateJavaScript as the question title shows which it's apparently different from that quesiton. What's more I've noted that I've try the answer in that question without no success at the end of my question body.</p>
  
  <p>I use <code>wkwebview.evaluateJavaScript()</code> funciton to execute javascript in the wkwebview of swift3. But the <code>alert()</code> didnot open the alert dialog. And there is no errors and issues shows. While I can use <code>evaluateJavaScript()</code> to execute javascript code to modify the page content.</p>
  
  <pre><code>class WebViewController: UIViewController, WKScriptMessageHandler, WKNavigationDelegate, WKUIDelegate, UIScrollViewDelegate {
      var wk:WKWebView!
      self.wk.navigationDelegate = self
      self.wk.uiDelegate = self
      self.wk.scrollView.delegate = self
      self.wk.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0"
  
      ...
      override func viewDidLoad() {
          super.viewDidLoad()
          ...
          let config = WKWebViewConfiguration()
          self.wk = WKWebView(frame: CGRect(x: frame.minX, y: frame.minY+20, width: frame.width, height: frame.height-70), configuration: config)
          self.wk.navigationDelegate = self
          ...
      }
  
  
      ...
      func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
          print("Finished navigation to url \(String(describing: webView.url))")
          //self.wk.evaluateJavaScript("document.getElementById('test').innerHTML = 'sssssssssssssss';", completionHandler: nil)          //this works well
          self.wk.evaluateJavaScript("alert('aaaaaaa');", completionHandler: nil)     //this not show the alert dialog
      }
      ...
  }
  </code></pre>
  
  <p>I also refer to this <a href="https://stackoverflow.com/questions/26898941/ios-wkwebview-not-showing-javascript-alert-dialog">post</a> and <a href="https://stackoverflow.com/a/27067168/6521116">answer</a>, while that question is not on evaluateJavaScript. I add <code>WKUIDelegate</code> for my <code>WebViewController</code> and add <code>self.wk.uiDelegate = self</code> to my <code>viewDidLoad()</code>, but nothing changes.</p>
  
  <p>added, below the console.log() put the log in the console, while alert() not pop up the dialog.  And the UIAlertController also works.</p>
  
  <pre><code>self.wk.evaluateJavaScript("alert('aa');console.log('1234');var rect = document.getElementById('liveMovie').getBoundingClientRect();[rect.left, rect.top];") {
      (result, error) -&gt; Void in
      if((result) != nil)
      {
          self.player?.view?.frame.origin.x = (result as! Array)[0]
          self.player?.view?.frame.origin.y = (result as! Array)[1]
      }
  }
  
  let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
  alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in
       if(true)
       {
       }
  }))
  </code></pre>