     }
     
     func webView(_ webView: WKWebView, didFinish navigation: WKNavigation) {
+        Swift.print("webView:didFinish:")
         if let pageTitle = webView.title {
-            let hwc = self.view.window?.windowController as! HeliumPanelController
-            let doc = hwc.document as! Document
-            var title = pageTitle;
-            if title.isEmpty { title = doc.displayName }
-            let notif = Notification(name: Notification.Name(rawValue: "HeliumUpdateTitle"),
-                                     object: title, userInfo: ["hwc":hwc]);
-            NotificationCenter.default.post(notif)
+            if let hwc = self.view.window?.windowController {
+                let doc = hwc.document as! Document
+                var title = pageTitle;
+                if title.isEmpty { title = doc.displayName }
+                let notif = Notification(name: Notification.Name(rawValue: "HeliumUpdateTitle"),
+                                         object: title, userInfo: ["hwc":hwc]);
+                NotificationCenter.default.post(notif)
+            }
         }
     }
     
     func webView(_ webView: WKWebView, didFinishLoad navigation: WKNavigation) {
+        Swift.print("webView:didFinishLoad:")
     }
     
     var videoFileReferencedURL = false

                    // Remember for later restoration
                    if let doc = self.view.window?.windowController?.document {
                        self.view.window?.representedURL = url
                        (doc as! Document).updateURL(to: url!, ofType: "Any")
                        
                        let notif = Notification(name: Notification.Name(rawValue: "HeliumDidUpdateURL"), object: url);
                        NotificationCenter.default.post(notif)

    }
    
    var appDelegate: AppDelegate = NSApp.delegate as! AppDelegate
    
    func updateTrackingAreas() {
        if let tag = trackingTag {
            view.removeTrackingRect(tag)
        }
        
        trackingTag = view.addTrackingRect(view.bounds, owner: self, userData: nil, assumeInside: false)
    }
    override func viewDidLayout() {
        super.viewDidLayout()

