Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Dont use unknown secure content state for internal urls/reader mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson committed Nov 17, 2023
1 parent b82c45d commit 58739f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,9 @@ public class BrowserViewController: UIViewController {
}

if tab.secureContentState == .secure && !webView.hasOnlySecureContent {
if let url = tab.webView?.url, url.isReaderModeURL {
break
}
tab.secureContentState = .mixedContent
}

Expand Down Expand Up @@ -1813,9 +1816,9 @@ public class BrowserViewController: UIViewController {
}

if url.isReaderModeURL || InternalURL.isValid(url: url) {
tab.secureContentState = .unknown
tab.secureContentState = .localhost
if tabManager.selectedTab === tab {
updateToolbarSecureContentState(.unknown)
updateToolbarSecureContentState(.localhost)
}
break
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ extension BrowserViewController: WKNavigationDelegate {
if let selectedTab = tabManager.selectedTab,
selectedTab.url?.origin != webView.url?.origin {
// reset secure content state to unknown until page can be evaluated
selectedTab.secureContentState = .unknown
updateToolbarSecureContentState(.unknown)
if let url = webView.url, !InternalURL.isValid(url: url) {
selectedTab.secureContentState = .unknown
updateToolbarSecureContentState(.unknown)
}
// new site has a different origin, hide wallet icon.
tabManager.selectedTab?.isWalletIconVisible = false
// new site, reset connected addresses
Expand Down

0 comments on commit 58739f5

Please sign in to comment.