diff --git a/Client/Frontend/Browser/BrowserViewController.swift b/Client/Frontend/Browser/BrowserViewController.swift index 6d169433ea1..e669ec7fa3a 100644 --- a/Client/Frontend/Browser/BrowserViewController.swift +++ b/Client/Frontend/Browser/BrowserViewController.swift @@ -2511,11 +2511,21 @@ extension BrowserViewController: WKUIDelegate { return UIMenu(title: url.absoluteString, children: actions) } - let config = UIContextMenuConfiguration(identifier: nil, previewProvider: nil, actionProvider: actionProvider) + let linkPreview: UIContextMenuContentPreviewProvider = { + return SFSafariViewController(url: url) + } + + let config = UIContextMenuConfiguration(identifier: nil, previewProvider: linkPreview, actionProvider: actionProvider) completionHandler(config) } + @available(iOS 13.0, *) + func webView(_ webView: WKWebView, contextMenuForElement elementInfo: WKContextMenuElementInfo, willCommitWithAnimator animator: UIContextMenuInteractionCommitAnimating) { + guard let url = elementInfo.linkURL else { return } + webView.load(URLRequest(url: url)) + } + fileprivate func addTab(url: URL, inPrivateMode: Bool, currentTab: Tab) { let tab = self.tabManager.addTab(URLRequest(url: url), afterTab: currentTab, isPrivate: inPrivateMode) if inPrivateMode && !PrivateBrowsingManager.shared.isPrivateBrowsing {