 
     required init?(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
+    }
+
+    override func viewDidDisappear(_ animated: Bool) {
+        super.viewDidDisappear(animated)
+        webView?.navigationDelegate = nil
+        self.webView = nil
     }
 
     override func viewDidLoad() {

        }

        clonedWebView.navigationDelegate = self

        clonedWebView.load(URLRequest(url: url))
    }


        let urlIsTooLongToSave = self.tab?.urlIsTooLong ?? false
        if !self.ignoreURL && !urlIsTooLongToSave {
            if !self.isInReadingList {
                actions.append(UIPreviewAction(title: TabPeekViewController.PreviewActionAddToReadingList, style: .default) { [weak self] previewAction, viewController in
                    guard let wself = self, let tab = wself.tab else { return }
                    _ = wself.delegate?.tabPeekDidAddToReadingList(tab)
                })
            }

            if !self.isBookmarked {
                actions.append(UIPreviewAction(title: TabPeekViewController.PreviewActionAddToBookmarks, style: .default) { [weak self] previewAction, viewController in
                    guard let wself = self, let tab = wself.tab else { return }
                    wself.delegate?.tabPeekDidAddBookmark(tab)
                    })
            }
            if self.hasRemoteClients {
                actions.append(UIPreviewAction(title: Strings.SendToDeviceTitle, style: .default) { [weak self] previewAction, viewController in
                    guard let wself = self, let clientPicker = wself.clientPicker else { return }
                    wself.delegate?.tabPeekRequestsPresentationOf(clientPicker)
                    })
            }
            // only add the copy URL action if we don't already have 3 items in our list
            // as we are only allowed 4 in total and we always want to display close tab
            if actions.count < 3 {
                actions.append(UIPreviewAction(title: TabPeekViewController.PreviewActionCopyURL, style: .default) {[weak self] previewAction, viewController in
                    guard let wself = self, let url = wself.tab?.canonicalURL else { return }
                    UIPasteboard.general.url = url
                    SimpleToast().showAlertWithText(Strings.AppMenuCopyURLConfirmMessage, bottomContainer: wself.view)
                })
            }
        }
        actions.append(UIPreviewAction(title: TabPeekViewController.PreviewActionCloseTab, style: .destructive) { [weak self] previewAction, viewController in
            guard let wself = self, let tab = wself.tab else { return }
            wself.delegate?.tabPeekDidCloseTab(tab)
            })

        return actions
