Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into alex/add-bookmark-pop…
Browse files Browse the repository at this point in the history
…over-swiftui
  • Loading branch information
mallexxx committed Jan 16, 2024
2 parents 90960ed + 2a7d10d commit 999aef3
Show file tree
Hide file tree
Showing 31 changed files with 351 additions and 231 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 103
CURRENT_PROJECT_VERSION = 104
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.70.0
MARKETING_VERSION = 1.71.0
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13159,7 +13159,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 101.1.0;
version = 101.1.1;
};
};
AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "851187f38974b87889b21259eb442e95aedffafe",
"version" : "101.1.0"
"revision" : "202dc0540c214e21b89395370177873e090a7633",
"version" : "101.1.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Location-16-Solid.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ struct UserText {
static let showDownloadsShortcut = NSLocalizedString("pinning.show-downloads-shortcut", value: "Show Downloads Shortcut", comment: "Menu item for showing the downloads shortcut")
static let hideDownloadsShortcut = NSLocalizedString("pinning.hide-downloads-shortcut", value: "Hide Downloads Shortcut", comment: "Menu item for hiding the downloads shortcut")

static let showNetworkProtectionShortcut = NSLocalizedString("pinning.show-netp-shortcut", value: "Show Network Protection", comment: "Menu item for showing the NetP shortcut")
static let hideNetworkProtectionShortcut = NSLocalizedString("pinning.hide-netp-shortcut", value: "Hide Network Protection", comment: "Menu item for hiding the NetP shortcut")
static let showNetworkProtectionShortcut = NSLocalizedString("pinning.show-netp-shortcut", value: "Show VPN Shortcut", comment: "Menu item for showing the NetP shortcut")
static let hideNetworkProtectionShortcut = NSLocalizedString("pinning.hide-netp-shortcut", value: "Hide VPN Shortcut", comment: "Menu item for hiding the NetP shortcut")

static let showHomeShortcut = NSLocalizedString("pinning.show-home-shortcut", value: "Show Home Button", comment: "Menu item for showing the Home shortcut")
static let hideHomeShortcut = NSLocalizedString("pinning.hide-home-shortcut", value: "Hide Home Button", comment: "Menu item for hiding the Home shortcut")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import BrowserServicesKit
final class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"fec0af5a7d1e3ce584a6bc6243dd673c\""
public static let embeddedDataSHA = "59b87e458e17fbd898d1b53d74b06bc0a32913143fa5e6ab91644a980a5dc661"
public static let embeddedDataETag = "\"f554a2ba0d10bb67736bfd05e231bd46\""
public static let embeddedDataSHA = "eb8ef392f3bf3aec4c8784982808cf623d7fb65f606099a532647ed83347b0a5"
}

var embeddedDataEtag: String {
Expand Down
80 changes: 24 additions & 56 deletions DuckDuckGo/ContentBlocker/macos-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"readme": "https://github.com/duckduckgo/privacy-configuration",
"version": 1705078221022,
"version": 1705334213687,
"features": {
"adClickAttribution": {
"readme": "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/#3rd-party-tracker-loading-protection",
Expand Down Expand Up @@ -260,6 +260,9 @@
{
"domain": "forbes.com"
},
{
"domain": "tuc.org.uk"
},
{
"domain": "earth.google.com"
},
Expand All @@ -280,7 +283,7 @@
]
},
"state": "enabled",
"hash": "8749a4d02730a39a663091b7ce31ee1a"
"hash": "0e798c688c53c17c989fa3a41b8c9f65"
},
"autofill": {
"exceptions": [
Expand Down Expand Up @@ -4635,7 +4638,7 @@
"hash": "5e792dd491428702bc0104240fbce0ce"
},
"sync": {
"state": "internal",
"state": "enabled",
"features": {
"level0ShowSync": {
"state": "enabled"
Expand All @@ -4651,7 +4654,8 @@
}
},
"exceptions": [],
"hash": "4e4382e6a69f7cc99222fd924168e80f"
"minSupportedVersion": "1.70.0",
"hash": "0a35f748d63fc61a777ea5e712728fa3"
},
"trackerAllowlist": {
"state": "enabled",
Expand Down Expand Up @@ -4882,39 +4886,9 @@
{
"rule": "c.amazon-adsystem.com/aax2/apstag.js",
"domains": [
"4029tv.com",
"applesfera.com",
"cnn.com",
"corriere.it",
"eurogamer.net",
"foxweather.com",
"kcci.com",
"kcra.com",
"ketv.com",
"kmbc.com",
"koat.com",
"koco.com",
"ksbw.com",
"mynbc5.com",
"seattletimes.com",
"thesurfersview.com",
"wapt.com",
"wbaltv.com",
"wcvb.com",
"wdsu.com",
"wesh.com",
"wgal.com",
"wildrivers.lostcoastoutpost.com",
"wisn.com",
"wlky.com",
"wlwt.com",
"wmtw.com",
"wmur.com",
"wpbf.com",
"wtae.com",
"wvtm13.com",
"wxii12.com",
"wyff4.com"
"wildrivers.lostcoastoutpost.com"
]
},
{
Expand Down Expand Up @@ -5781,12 +5755,6 @@
},
"gemius.pl": {
"rules": [
{
"rule": "gapl.hit.gemius.pl/gplayer.js",
"domains": [
"tvp.pl"
]
},
{
"rule": "pro.hit.gemius.pl/gstream.js",
"domains": [
Expand Down Expand Up @@ -6214,16 +6182,6 @@
}
]
},
"htlbid.com": {
"rules": [
{
"rule": "htlbid.com/v3/dangerousminds.net/htlbid.js",
"domains": [
"dangerousminds.net"
]
}
]
},
"hubspot.com": {
"rules": [
{
Expand Down Expand Up @@ -7325,18 +7283,28 @@
},
"trustpilot.com": {
"rules": [
{
"rule": "widget.trustpilot.com/trustboxes/",
"domains": [
"<all>"
]
},
{
"rule": "widget.trustpilot.com/trustbox-data/",
"domains": [
"<all>"
]
},
{
"rule": "widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js",
"domains": [
"azurestandard.com",
"domesticandgeneral.com",
"www.hotpoint.co.uk"
"<all>"
]
},
{
"rule": "widget.trustpilot.com/bootstrap/v5/tp.widget.sync.bootstrap.min.js",
"domains": [
"www.hotpoint.co.uk"
"<all>"
]
}
]
Expand Down Expand Up @@ -7627,7 +7595,7 @@
"domain": "sundancecatalog.com"
}
],
"hash": "103d48713e9ec9b7e0fe23a1a8af6dd4"
"hash": "64bacd744ef069efd7206f48c684a102"
},
"trackingCookies1p": {
"settings": {
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -6480,7 +6480,7 @@
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Hide Network Protection"
"value" : "Hide VPN Shortcut"
}
}
}
Expand Down Expand Up @@ -6540,7 +6540,7 @@
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Show Network Protection"
"value" : "Show VPN Shortcut"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ enum NetworkProtectionPixelEvent: PixelKitEvent {
case networkProtectionClientInvalidInviteCode
case networkProtectionClientFailedToRedeemInviteCode(error: Error?)
case networkProtectionClientFailedToParseRedeemResponse(error: Error)
case networkProtectionClientFailedToFetchLocations(error: Error?)
case networkProtectionClientFailedToParseLocationsResponse(error: Error?)
case networkProtectionClientInvalidAuthToken

case networkProtectionServerListStoreFailedToEncodeServerList
Expand Down Expand Up @@ -158,6 +160,12 @@ enum NetworkProtectionPixelEvent: PixelKitEvent {
case .networkProtectionClientFailedToParseRedeemResponse:
return "m_mac_netp_backend_api_error_parsing_redeem_response_failed"

case .networkProtectionClientFailedToFetchLocations:
return "m_mac_netp_backend_api_error_failed_to_fetch_location_list"

case .networkProtectionClientFailedToParseLocationsResponse:
return "m_mac_netp_backend_api_error_parsing_location_list_response_failed"

case .networkProtectionClientInvalidAuthToken:
return "m_mac_netp_backend_api_error_invalid_auth_token"

Expand Down Expand Up @@ -251,6 +259,12 @@ enum NetworkProtectionPixelEvent: PixelKitEvent {
case .networkProtectionClientFailedToRedeemInviteCode(error: let error):
return error?.pixelParameters

case .networkProtectionClientFailedToFetchLocations(error: let error):
return error?.pixelParameters

case .networkProtectionClientFailedToParseLocationsResponse(error: let error):
return error?.pixelParameters

case .networkProtectionUnhandledError(let function, let line, let error):
var parameters = error.pixelParameters
parameters[PixelKit.Parameters.function] = function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,45 @@ import PixelKit
extension EventMapping where Event == NetworkProtectionError {
static var networkProtectionAppDebugEvents: EventMapping<NetworkProtectionError> = .init { event, _, _, _ in
let domainEvent: NetworkProtectionPixelEvent
let frequency: PixelKit.Frequency

switch event {
case .failedToEncodeRedeemRequest:
domainEvent = .networkProtectionClientFailedToEncodeRedeemRequest
frequency = .standard
case .invalidInviteCode:
domainEvent = .networkProtectionClientInvalidInviteCode
frequency = .standard
case .failedToRedeemInviteCode(let error):
domainEvent = .networkProtectionClientFailedToRedeemInviteCode(error: error)
frequency = .standard
case .failedToParseRedeemResponse(let error):
domainEvent = .networkProtectionClientFailedToParseRedeemResponse(error: error)
frequency = .standard
case .invalidAuthToken:
domainEvent = .networkProtectionClientInvalidAuthToken
frequency = .standard
case .failedToCastKeychainValueToData(field: let field):
domainEvent = .networkProtectionKeychainErrorFailedToCastKeychainValueToData(field: field)
frequency = .standard
case .keychainReadError(field: let field, status: let status):
domainEvent = .networkProtectionKeychainReadError(field: field, status: status)
frequency = .standard
case .keychainWriteError(field: let field, status: let status):
domainEvent = .networkProtectionKeychainWriteError(field: field, status: status)
frequency = .standard
case .keychainDeleteError(status: let status):
domainEvent = .networkProtectionKeychainDeleteError(status: status)
frequency = .standard
case .noAuthTokenFound:
domainEvent = .networkProtectionNoAuthTokenFoundError
frequency = .standard
case .failedToFetchLocationList(let error):
domainEvent = .networkProtectionClientFailedToFetchLocations(error: error)
frequency = .dailyAndContinuous
case .failedToParseLocationListResponse(let error):
domainEvent = .networkProtectionClientFailedToParseLocationsResponse(error: error)
frequency = .dailyAndContinuous
case .noServerRegistrationInfo,
.couldNotSelectClosestServer,
.couldNotGetPeerPublicKey,
Expand All @@ -70,14 +87,13 @@ extension EventMapping where Event == NetworkProtectionError {
.wireGuardDnsResolution,
.wireGuardSetNetworkSettings,
.startWireGuardBackend,
.failedToRetrieveAuthToken,
.failedToFetchLocationList,
.failedToParseLocationListResponse:
.failedToRetrieveAuthToken:
domainEvent = .networkProtectionUnhandledError(function: #function, line: #line, error: event)
frequency = .standard
return
case .unhandledError(function: let function, line: let line, error: let error):
domainEvent = .networkProtectionUnhandledError(function: function, line: line, error: error)

frequency = .standard
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,15 @@ final class NetworkProtectionNavBarButtonModel: NSObject, ObservableObject {
}

guard !isPinned,
!popoverManager.isShown else {
!popoverManager.isShown,
!isHavingConnectivityIssues else {

pinNetworkProtectionToNavBarIfNeverPinnedBefore()
showButton = true
return
}

Task {
guard !isHavingConnectivityIssues else {
showButton = true
return
}

showButton = false
}
showButton = false
}

// MARK: - Pinning
Expand All @@ -245,10 +241,8 @@ final class NetworkProtectionNavBarButtonModel: NSObject, ObservableObject {
/// if the user hasn't toggled it manually before.
///
private func pinNetworkProtectionToNavBarIfNeverPinnedBefore() {
assert(showButton)

guard !pinningManager.wasManuallyToggled(.networkProtection),
!pinningManager.isPinned(.networkProtection) else {
guard !pinningManager.isPinned(.networkProtection),
!pinningManager.wasManuallyToggled(.networkProtection) else {
return
}

Expand Down
Loading

0 comments on commit 999aef3

Please sign in to comment.