From 8f6a7c5422e4d850792e42df8a3bc13c908faccb Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Fri, 17 Nov 2023 11:41:25 -0500 Subject: [PATCH] Check for origin mismatch before displaying mixed content warning This fixes a bug where navigating back/forward between NTP & web pages may show 'not secure' on NTP for a brief moment --- Sources/Brave/Frontend/Browser/BrowserViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Brave/Frontend/Browser/BrowserViewController.swift b/Sources/Brave/Frontend/Browser/BrowserViewController.swift index 0c3b9aa8100..43036445cec 100644 --- a/Sources/Brave/Frontend/Browser/BrowserViewController.swift +++ b/Sources/Brave/Frontend/Browser/BrowserViewController.swift @@ -1770,7 +1770,8 @@ public class BrowserViewController: UIViewController { break } - if tab.secureContentState == .secure && !webView.hasOnlySecureContent { + if tab.secureContentState == .secure, !webView.hasOnlySecureContent, + tab.url?.origin == tab.webView?.url?.origin { if let url = tab.webView?.url, url.isReaderModeURL { break }