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

Commit

Permalink
Fix for review
Browse files Browse the repository at this point in the history
  • Loading branch information
cuba committed Jan 3, 2024
1 parent 3aab681 commit d7a66d4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<html lang=\"en\">", with: "<html lang=\"\(Locale.current.language.minimalIdentifier)\">")
Expand Down
14 changes: 7 additions & 7 deletions Sources/BraveShields/ShieldStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit d7a66d4

Please sign in to comment.