     func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration,
                  for navigationAction: WKNavigationAction,
                  windowFeatures: WKWindowFeatures) -> WKWebView? {
-        
-        let newWindows = UserSettings.createNewWindows.value
+
+        if navigationAction.targetFrame == nil {
+            appDelegate.openURLInNewWindow(navigationAction.request.url!)
+            return nil
+        }
+        
+        //  We really want to use the supplied config, so use custom setup
         var newWebView : WKWebView?
         Swift.print("createWebViewWith")
         
         if let newURL = navigationAction.request.url {
-            UserSettings.createNewWindows.value = false
             do {
                 let doc = try NSDocumentController.shared().makeDocument(withContentsOf: newURL, ofType: "Custom")
                 if let hpc = doc.windowControllers.first as? HeliumPanelController,

    func webView(_ webView: WKWebView,
                 decidePolicyFor navigationAction: WKNavigationAction,
                 decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
        
        guard navigationAction.buttonNumber <= 1 else {
            if let url = navigationAction.request.url {
                Swift.print("newWindow with url:\(String(describing: url))")
                self.appDelegate.openURLInNewWindow(url)
            }
            decisionHandler(WKNavigationActionPolicy.cancel)
            return
        }
        
        guard !UserSettings.disabledMagicURLs.value,
            let url = navigationAction.request.url,
            !((navigationAction.request.url?.absoluteString.hasPrefix("file://"))!) else {
                if let myWebView: MyWebView = webView as? MyWebView, NSApp.currentEvent?.buttonNumber == 2, let url = myWebView.selectedURL {
                    Swift.print("newWindow with url:\(url)")
                    appDelegate.openURLInNewWindow(url)
 //                   webView.goBack()
                    decisionHandler(WKNavigationActionPolicy.cancel)
                }
                else
                {
                    decisionHandler(WKNavigationActionPolicy.allow)
                }
                return
        }

        if let newUrl = UrlHelpers.doMagic(url) {
            decisionHandler(WKNavigationActionPolicy.cancel)
            loadURL(url: newUrl)
        } else {
            decisionHandler(WKNavigationActionPolicy.allow)
        }

                    
                    hpc.webViewController.webView = newView
                    contentView.addSubview(newView)

                    hpc.webViewController.loadURL(text: newURL.absoluteString)
                    newView.navigationDelegate = wvc
                    newView.uiDelegate = wvc
                    newWebView = hpc.webView
                    wvc.viewDidLoad()

                    //  Setups all done, make us visible
                    window.makeKeyAndOrderFront(self)
                }
            } catch let error {
                NSApp.presentError(error)
            }
        }

        return newWebView
