javascript alert and confirm popups not working with Webkit in IOS 9
<p>Javascript popups are not working for me with WebKit.</p>

<p>In Safari (on OSX) this document will create the expected alert and confirm popups.  But with my WebKit instance running on IOS simulator or device the popups are not displayed and the confirm function returns false.</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;

    &lt;p id="check3"&gt;&lt;/p&gt;

    &lt;script&gt;
        alert("alert 1");

        function check3() {
            return(confirm("Confirm?"));
        }
    &lt;/script&gt;

    &lt;button type="button"
        onclick="document.getElementById('check3').innerHTML = check3()"&gt;
        Check 3&lt;/button&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I am using Xcode 7.3, compiling for IOS 9.3.  The <code>info.plist</code> has <code>"AppTransportSecurity"</code> to <code>"Allow arbitrary HTML"</code>.</p>

<p>This is the code view controller code where I instantiate the web view:</p>

<pre><code>import UIKit
import WebKit

class ViewController: UIViewController, WKNavigationDelegate {

  @IBOutlet weak var wv: UIView!

  var webView : WKWebView?

  override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(true)

    let webViewCfg = WKWebViewConfiguration()
    webViewCfg.preferences.javaScriptEnabled = true;
    webViewCfg.preferences.javaScriptCanOpenWindowsAutomatically = true
    webView = WKWebView.init(frame:wv.bounds, configuration: webViewCfg)

    self.wv.addSubview(webView!)

    webView!.navigationDelegate = self

    let path = getBundlePath("js1.html")
    let targetFileURL = NSURL(fileURLWithPath: path!, isDirectory: false)
    webView!.loadFileURL(targetFileURL, allowingReadAccessToURL: targetFileURL)

  }
}
</code></pre>