     }
 
     func next(url: URL) -> Bool {
+        guard let doc = self.webViewController?.document else { return false }
 
         //  Resolve alias before sandbox bookmarking
         if let webloc = url.webloc { return next(url: webloc) }

            }
        }
        
        let newDidAddSubviewImplementation = imp_implementationWithBlock(unsafeBitCast(newDidAddSubviewImplementationBlock, to: AnyObject.self))
        method_setImplementation(originalDidAddSubviewMethod!, newDidAddSubviewImplementation)
    }
    
    @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 }

        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()
        }
    }
    
