     }
 }
 
-class WebViewController: NSViewController, WKNavigationDelegate, WKUIDelegate, WKScriptMessageHandler, NSMenuDelegate, NSTabViewDelegate, WKHTTPCookieStoreObserver {
+class WebViewController: NSViewController, WKNavigationDelegate, WKUIDelegate, WKScriptMessageHandler, NSMenuDelegate, NSTabViewDelegate, WKHTTPCookieStoreObserver, QLPreviewPanelDataSource, QLPreviewPanelDelegate, URLSessionDelegate,URLSessionTaskDelegate,URLSessionDownloadDelegate {
 
     @available(OSX 10.13, *)
     public func cookiesDidChange(in cookieStore: WKHTTPCookieStore) {

        Swift.print(String(format: "3DT: webViewWebContentProcessDidTerminate: %p", webView))
    }
    
    //  MARK: UI Delegate
    
    func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration,
                 for navigationAction: WKNavigationAction,

                        for playitem in playitems {
                            Swift.print("item: \(playitem)")
                            if viewOptions.contains(.t_view) {
                                items += appDelegate.openURLInNewWindow(playitem.link, attachTo: window) ? 1 : 0
                            }
                            else
                            if viewOptions.contains(.w_view) {
                                items += appDelegate.openURLInNewWindow(playitem.link) ? 1 : 0
                            }
                            else
                            {
