diff --git a/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift b/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift index 9dacdbc77bd1..3dd001f37a84 100644 --- a/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift +++ b/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift @@ -446,8 +446,11 @@ extension BrowserViewController: TopToolbarDelegate { shields.showSubmitReportView = { [weak self] shieldsViewController in shieldsViewController.dismiss(animated: true) { - guard let url = shieldsViewController.tab.url else { return } - self?.showSubmitReportView(for: url) + if let internalURL = InternalURL(url), let displayURL = internalURL.displayURL { + self?.showSubmitReportView(for: displayURL) + } else { + self?.showSubmitReportView(for: url) + } } } diff --git a/Sources/Shared/Extensions/URLExtensions.swift b/Sources/Shared/Extensions/URLExtensions.swift index 08f99e5ff96c..f327d64864a0 100644 --- a/Sources/Shared/Extensions/URLExtensions.swift +++ b/Sources/Shared/Extensions/URLExtensions.swift @@ -638,4 +638,13 @@ public struct InternalURL { } return nil } + + public var displayURL: URL? { + if isErrorPage { + return originalURLFromErrorPage + } else if isReaderModePage { + return extractedUrlParam + } + return nil + } }