Skip to content

Commit

Permalink
Fix brave/brave-ios#8393: Update the progress & url correctly when ca…
Browse files Browse the repository at this point in the history
…ncelling a load (brave/brave-ios#8432)

If you return `cancel` in one of the `decidePolicy*` methods the progress bar gets stuck at 10%. When that load happens on NTP, the url shown also gets stuck showing the cancelled url.
  • Loading branch information
kylehickinson authored Nov 17, 2023
1 parent a24622d commit c3276d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,10 @@ public class BrowserViewController: UIViewController {
case .loading:
if tab === tabManager.selectedTab {
topToolbar.locationView.loading = tab.loading
// There is a bug in WebKit where if you cancel a load on a request the progress can stick to 0.1
if !tab.loading, webView.estimatedProgress != 1 {
topToolbar.updateProgressBar(1)
}
}
case .URL:
guard let tab = tabManager[webView] else { break }
Expand All @@ -1720,6 +1724,8 @@ public class BrowserViewController: UIViewController {
// Catch history pushState navigation, but ONLY for same origin navigation,
// for reasons above about URL spoofing risk.
navigateInTab(tab: tab)
} else {
updateURLBar()
}

// Rewards reporting
Expand Down

0 comments on commit c3276d8

Please sign in to comment.