diff --git a/App/iOS/Delegates/AppState.swift b/App/iOS/Delegates/AppState.swift index 27b5acdbfb1..275dff5f08c 100644 --- a/App/iOS/Delegates/AppState.swift +++ b/App/iOS/Delegates/AppState.swift @@ -192,7 +192,7 @@ public class AppState { (ReaderModeHandler.path, ReaderModeHandler(profile: profile)), (IPFSSchemeHandler.path, IPFSSchemeHandler()), (Web3DomainHandler.path, Web3DomainHandler()), - (InternalURL.Path.blocked.rawValue, BlockedDomainHandler()) + (BlockedDomainHandler.path, BlockedDomainHandler()) ] responders.forEach { (path, responder) in diff --git a/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+WKNavigationDelegate.swift b/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+WKNavigationDelegate.swift index 43367f37088..bd2520edc5f 100644 --- a/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+WKNavigationDelegate.swift +++ b/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController+WKNavigationDelegate.swift @@ -357,10 +357,10 @@ extension BrowserViewController: WKNavigationDelegate { isAggressiveMode: domain.blockAdsAndTrackingLevel.isAggressive ) - if shouldBlock { + if shouldBlock, let escapingURL = requestURL.absoluteString.escape() { var components = URLComponents(string: InternalURL.baseUrl) components?.path = "/\(InternalURL.Path.blocked.rawValue)" - components?.queryItems = [URLQueryItem(name: "url", value: requestURL.absoluteString.escape()!)] + components?.queryItems = [URLQueryItem(name: "url", value: escapingURL)] if let url = components?.url { let request = PrivilegedRequest(url: url) as URLRequest diff --git a/Sources/Brave/Frontend/Browser/Handlers/BlockedDomainHandler.swift b/Sources/Brave/Frontend/Browser/Handlers/BlockedDomainHandler.swift index 279318659cd..643fe254de0 100644 --- a/Sources/Brave/Frontend/Browser/Handlers/BlockedDomainHandler.swift +++ b/Sources/Brave/Frontend/Browser/Handlers/BlockedDomainHandler.swift @@ -24,11 +24,11 @@ public class BlockedDomainHandler: InternalSchemeResponse { } var html = try? String(contentsOfFile: asset) - .replacingOccurrences(of: "%page_title%", with: Strings.Shields.domianBlockedTitle) - .replacingOccurrences(of: "%blocked_title%", with: Strings.Shields.domianBlockedPageTitle) - .replacingOccurrences(of: "%blocked_subtitle%", with: Strings.Shields.domianBlockedPageMessage) + .replacingOccurrences(of: "%page_title%", with: Strings.Shields.domainBlockedTitle) + .replacingOccurrences(of: "%blocked_title%", with: Strings.Shields.domainBlockedPageTitle) + .replacingOccurrences(of: "%blocked_subtitle%", with: Strings.Shields.domainBlockedPageMessage) .replacingOccurrences(of: "%blocked_domain%", with: originalURL.domainURL.absoluteDisplayString) - .replacingOccurrences(of: "%blocked_description%", with: Strings.Shields.domianBlockedPageDescription) + .replacingOccurrences(of: "%blocked_description%", with: Strings.Shields.domainBlockedPageDescription) if #available(iOS 16.0, *) { html = html?.replacingOccurrences(of: "", with: "") diff --git a/Sources/BraveShields/ShieldStrings.swift b/Sources/BraveShields/ShieldStrings.swift index a3cdb055619..923eeeb05a3 100644 --- a/Sources/BraveShields/ShieldStrings.swift +++ b/Sources/BraveShields/ShieldStrings.swift @@ -151,29 +151,29 @@ public extension Strings.Shields { public extension Strings.Shields { /// A tab title that appears when a page was blocked - static let domianBlockedTitle = NSLocalizedString( + static let domainBlockedTitle = NSLocalizedString( "DomainBlockedTitle", tableName: "BraveShared", bundle: .module, value: "Domain Blocked", comment: "A tab title for the warning page that appears when a page was blocked" ) /// A title in the warning page that appears when a page was blocked - static let domianBlockedPageTitle = NSLocalizedString( - "DomianBlockedPageTitle", tableName: "BraveShared", bundle: .module, + static let domainBlockedPageTitle = NSLocalizedString( + "DomainBlockedPageTitle", tableName: "BraveShared", bundle: .module, value: "This Site May Attempt to Track You Across Other Sites", comment: "A title in the warning page that appears when a page was blocked" ) /// A title in the warning page that appears when a page was blocked - static let domianBlockedPageMessage = NSLocalizedString( - "DomianBlockedPageMessage", tableName: "BraveShared", bundle: .module, + static let domainBlockedPageMessage = NSLocalizedString( + "DomainBlockedPageMessage", tableName: "BraveShared", bundle: .module, value: "Brave has prevented the following site from loading:", comment: "A message in the warning page that appears when a page was blocked" ) /// A description in the warning page that appears when a page was blocked - static let domianBlockedPageDescription = NSLocalizedString( - "DomianBlockedPageDescription", tableName: "BraveShared", bundle: .module, + static let domainBlockedPageDescription = NSLocalizedString( + "DomainBlockedPageDescription", tableName: "BraveShared", bundle: .module, value: "Because you requested to aggressively block trackers and ads, Brave is blocking this site before the first network connection.", comment: "A description in the warning page that appears when a page was blocked" )