Skip to content

Commit

Permalink
Bugfix FXIOS-10622 Do not reload from origin for homepage internal UR…
Browse files Browse the repository at this point in the history
…Ls (#23495)

* Do not reload from origin for homepage internal URLs

* Ensure restoring homepage is privileged

* Apply suggestions from code review

Co-authored-by: Isabella <[email protected]>

---------

Co-authored-by: Isabella <[email protected]>
  • Loading branch information
lmarceau and ih-codes authored Dec 3, 2024
1 parent 0eb21a5 commit ca81f81
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions firefox-ios/Client/TabManagement/Tab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,12 @@ class Tab: NSObject, ThemeApplicable, FeatureFlaggable, ShareTab {

func restore(_ webView: WKWebView, interactionState: Data? = nil) {
if let url = url {
webView.load(URLRequest(url: url))
if let internalURL = InternalURL(url),
internalURL.isAboutHomeURL {
webView.load(PrivilegedRequest(url: url) as URLRequest)
} else {
webView.load(URLRequest(url: url))
}
}

if let interactionState = interactionState {
Expand Down Expand Up @@ -705,7 +710,8 @@ class Tab: NSObject, ThemeApplicable, FeatureFlaggable, ShareTab {
}
}

if let webView, webView.url != nil {
// Do not reload from origin for homepage internal URLs
if let webView, webView.url != nil && !(InternalURL(webView.url)?.isAboutHomeURL ?? false) {
webView.reloadFromOrigin()
logger.log("Reloaded zombified tab from origin",
level: .debug,
Expand Down

0 comments on commit ca81f81

Please sign in to comment.