             }
         }
         
-         #52    0x00007fff2bd86ac8 in NSApplicationMain ()
         let newDidAddSubviewImplementation = imp_implementationWithBlock(unsafeBitCast(newDidAddSubviewImplementationBlock, to: AnyObject.self))
         method_setImplementation(originalDidAddSubviewMethod!, newDidAddSubviewImplementation)*/
         
-        //  load developer panel if asked - initially no
-        self.webView.configuration.preferences.setValue(UserSettings.DeveloperExtrasEnabled.value, forKey: "developerExtrasEnabled")
-    }
-    /*
-    @objc func avPlayerView(_ note: NSNotification) {
-        print("AV Player \(String(describing: note.object)) will be opened now")
-        guard let view = note.object as? NSView else { return }
-        
-        Swift.print("player is \(view.className)")
-    }
-    
-    @objc func wkFlippedView(_ note: NSNotification) {
-        print("A Player \(String(describing: note.object)) will be opened now")
-        guard let view = note.object as? NSView, let scrollView = view.enclosingScrollView else { return }
-        
-        if scrollView.hasHorizontalScroller {
-            scrollView.horizontalScroller?.isHidden = true
-        }
-        if scrollView.hasVerticalScroller {
-            scrollView.verticalScroller?.isHidden = true
-        }
-    }
-    
-    @objc func wkScrollView(_ note: NSNotification) {
-        print("WK Scroll View \(String(describing: note.object)) will be opened now")
-        if let scrollView : NSScrollView = note.object as? NSScrollView {
-            scrollView.autohidesScrollers = true
-        }
-    }*/
-    
-    override func viewWillAppear() {
-        
-        if let document = self.document, let url = document.fileURL {
-            _ = loadURL(url: url)
-        }
-        else
-        {
-            clear()
-        }
-    }
-    
-    override func viewWillLayout() {
-        //  the autolayout is complete only when the view has appeared.
-        webView.autoresizingMask = [.height,.width]
-        if 0 == webView.constraints.count { webView.fit(webView.superview!) }
-         
-        borderView.autoresizingMask = [.height,.width]
-        if 0 == borderView.constraints.count { borderView.fit(borderView.superview!) }
-    }
-    
-    override func viewDidAppear() {
-        super.viewDidAppear()
-        
-        guard let doc = self.document, doc.docGroup == .helium else { return }
-        
-        //  https://stackoverflow.com/questions/32056874/programmatically-wkwebview-inside-an-uiview-with-auto-layout
- 
-        //  the autolayout is complete only when the view has appeared.
-        webView.autoresizingMask = [.height,.width]
-        webView.fit(webView.superview!)
-        
-        borderView.autoresizingMask = [.height,.width]
-        borderView.fit(borderView.superview!)
-        
-        loadingIndicator.center(loadingIndicator.superview!)
-        loadingIndicator.bind(NSBindingName(rawValue: "animate"), to: webView, withKeyPath: "loading", options: nil)
-        
-        let config = webView.configuration
-        
-        // Allow plug-ins such as silverlight
-        config.preferences.plugInsEnabled = true
-        
-        // Custom user agent string for Netflix HTML5 support
-        webView.customUserAgent = UserSettings.UserAgent.value
-        
-        // Allow zooming
-        webView.allowsMagnification = true
-        
-        // Alow back and forth
-        webView.allowsBackForwardNavigationGestures = true
-        
-        // Allow look ahead views
-        webView.allowsLinkPreview = true
-        
-        //  ditch loading indicator background
-        loadingIndicator.appearance = NSAppearance.init(named: NSAppearance.Name.aqua)
-        
-        //  Fetch, synchronize and observe data store for cookie changes
-        if #available(OSX 10.13, *) {
-            let websiteDataStore = WKWebsiteDataStore.nonPersistent()
-            config.websiteDataStore = websiteDataStore
-            
-            config.processPool = WKProcessPool()
-            let cookies = HTTPCookieStorage.shared.cookies ?? [HTTPCookie]()
-            
-            cookies.forEach({ config.websiteDataStore.httpCookieStore.setCookie($0, completionHandler: nil) })
-            WKWebsiteDataStore.default().httpCookieStore.add(self)
-        }
-        
-        // Listen for load progress
-        webView.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
-        webView.addObserver(self, forKeyPath: "loading", options: .new, context: nil)
-        webView.addObserver(self, forKeyPath: "title", options: .new, context: nil)
-        observing = true
-        
-        //    Watch command key changes
-        NotificationCenter.default.addObserver(
-            self,
-            selector: #selector(WebViewController.commandKeyDown(_:)),
-            name: NSNotification.Name(rawValue: "commandKeyDown"),
-            object: nil)
-
-        //    Watch option + command key changes
-        NotificationCenter.default.addObserver(
-            self,
-            selector: #selector(WebViewController.optionAndCommandKeysDown(_:)),
-            name: NSNotification.Name(rawValue: "optionAndCommandKeysDown"),
-            object: nil)
-
+        // WebView KVO - load progress, title
+        webView.addObserver(self, forKeyPath: #keyPath(WKWebView.estimatedProgress), options: .new, context: nil)
+        webView.addObserver(self, forKeyPath: #keyPath(WKWebView.loading), options: .new, context: nil)
+        webView.addObserver(self, forKeyPath: #keyPath(WKWebView.title), options: .new, context: nil)
+    
         //  Intercept drags
         webView.registerForDraggedTypes(NSFilePromiseReceiver.readableDraggedTypes.map { NSPasteboard.PasteboardType($0)})
         webView.registerForDraggedTypes([NSPasteboard.PasteboardType.fileURL])
         webView.registerForDraggedTypes(Array(webView.acceptableTypes))
-
+        observing = true
+        
         //  Watch javascript selection messages unless already done
-        let controller = config.userContentController
-        if controller.userScripts.count > 0 { return }
+        let controller = webView.configuration.userContentController
+        guard controller.userScripts.count == 0 else { return }
         
         controller.add(self, name: "newWindowWithUrlDetected")
         controller.add(self, name: "newSelectionDetected")

                                     title: "Web Search",
                                     acceptHandler: { (newWindow: Bool, searchURL: URL) in
                                        if viewOptions.contains(.t_view) {
                                            _ = self.appDelegate.openURLInNewWindow(searchURL, attachTo: window)
                                        }
                                        else
                                        if viewOptions.contains(.w_view) {
                                            _ = self.appDelegate.openURLInNewWindow(searchURL)
                                        }
                                        else
                                        {

            openPanel.begin() { (result) -> Void in
                if (result == .OK) {
                    desktop = openPanel.url!
                    _ = appDelegate.storeBookmark(url: desktop, options: appDelegate.rwOptions)
                    appDelegate.desktopData = appDelegate.bookmarks[desktop]
                    UserSettings.SnapshotsURL.value = desktop.absoluteString
                    DispatchQueue.main.async {
                        if !appDelegate.saveBookmarks() {
                            Swift.print("Yoink, unable to save desktop booksmark(s)")
                        }
                    }
