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

Commit

Permalink
Fix #8393: Update the progress & url correctly when cancelling a load (
Browse files Browse the repository at this point in the history
…#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 c53b19b commit 3a05e20
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 3a05e20

Please sign in to comment.