Skip to content

Commit

Permalink
Safari 16 UA for github.com
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstrba committed Sep 29, 2023
1 parent 5782e9b commit b64f338
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion DuckDuckGo/UserAgent/Model/UserAgent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ enum UserAgent {
"AppleWebKit/\(webKitVersion) (KHTML, like Gecko) " +
"Version/\(safariVersion) " +
"Safari/\(webKitVersion)"
static let safari16 = "Mozilla/5.0 " +
"(Macintosh; Intel Mac OS X 10_15_7) " +
"AppleWebKit/605.1.15 (KHTML, like Gecko) " +
"Version/16.5 " +
"Safari/605.1.15"
static let chrome = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " +
"AppleWebKit/537.36 (KHTML, like Gecko) " +
"Chrome/91.0.4472.101 " +
Expand All @@ -65,7 +70,9 @@ enum UserAgent {
regex("https://duckduckgo\\.com/[^?]*\\.pdf"): UserAgent.safari,

// use default WKWebView user agent for duckduckgo domain to remove CTA
regex("https://duckduckgo\\.com/.*"): UserAgent.webViewDefault
regex("https://duckduckgo\\.com/.*"): UserAgent.webViewDefault,

regex("https://github\\.com/.*"): UserAgent.safari16
]

static func duckDuckGoUserAgent(appVersion: String = AppVersion.shared.versionNumber,
Expand Down

0 comments on commit b64f338

Please sign in to comment.