diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 1d862638df..f0bb59186e 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -14067,7 +14067,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 81.5.0; + version = 82.0.0; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 34f9f56ede..1ef0f69712 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "c427dc63421c4b394f54c245de8e5665bcd6966a", - "version" : "81.5.0" + "revision" : "dd595d952e0076a7a01d086ed2424838dcd985af", + "version" : "82.0.0" } }, { @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/privacy-dashboard", "state" : { - "revision" : "51e2b46f413bf3ef18afefad631ca70f2c25ef70", - "version" : "1.4.0" + "revision" : "b4ac92a444e79d5651930482623b9f6dc9265667", + "version" : "2.0.0" } }, { @@ -129,7 +129,7 @@ { "identity" : "trackerradarkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", + "location" : "https://github.com/duckduckgo/TrackerRadarKit", "state" : { "revision" : "4684440d03304e7638a2c8086895367e90987463", "version" : "1.2.1" diff --git a/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift b/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift index 538096a36e..93fa21b119 100644 --- a/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift +++ b/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift @@ -171,16 +171,18 @@ final class PrivacyDashboardViewController: NSViewController { extension PrivacyDashboardViewController: PrivacyDashboardControllerDelegate { - func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didChangeProtectionSwitch isEnabled: Bool) { + func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController, didChangeProtectionSwitch protectionState: ProtectionState) { guard let domain = privacyDashboardController.privacyInfo?.url.host else { return } let configuration = ContentBlocking.shared.privacyConfigurationManager.privacyConfig - if isEnabled && configuration.isUserUnprotected(domain: domain) { + if protectionState.isProtected && configuration.isUserUnprotected(domain: domain) { configuration.userEnabledProtection(forDomain: domain) + Pixel.fire(.dashboardProtectionAllowlistRemove(triggerOrigin: protectionState.eventOrigin.screen.rawValue), includeAppVersionParameter: false) } else { configuration.userDisabledProtection(forDomain: domain) + Pixel.fire(.dashboardProtectionAllowlistAdd(triggerOrigin: protectionState.eventOrigin.screen.rawValue), includeAppVersionParameter: false) } let completionToken = ContentBlocking.shared.contentBlockingManager.scheduleCompilation() diff --git a/DuckDuckGo/Statistics/PixelEvent.swift b/DuckDuckGo/Statistics/PixelEvent.swift index d0fb923493..fbd2e641b0 100644 --- a/DuckDuckGo/Statistics/PixelEvent.swift +++ b/DuckDuckGo/Statistics/PixelEvent.swift @@ -153,6 +153,10 @@ extension Pixel { case duckPlayerSettingNever case duckPlayerSettingBackToDefault + // Dashboard + case dashboardProtectionAllowlistAdd(triggerOrigin: String?) + case dashboardProtectionAllowlistRemove(triggerOrigin: String?) + // Network Protection Waitlist case networkProtectionWaitlistUserActive case networkProtectionWaitlistEntryPointMenuItemDisplayed @@ -430,6 +434,11 @@ extension Pixel.Event { case .duckPlayerSettingBackToDefault: return "m_mac_duck-player_setting_back-to-default" + case .dashboardProtectionAllowlistAdd(let triggerOrigin): + return "m_mac_mp_wla" + case .dashboardProtectionAllowlistRemove(let triggerOrigin): + return "m_mac_mp_wlr" + case .launchInitial: return "m.mac.first-launch" case .serpInitial: diff --git a/DuckDuckGo/Statistics/PixelParameters.swift b/DuckDuckGo/Statistics/PixelParameters.swift index 642a598223..323d167d9c 100644 --- a/DuckDuckGo/Statistics/PixelParameters.swift +++ b/DuckDuckGo/Statistics/PixelParameters.swift @@ -52,6 +52,14 @@ extension Pixel.Event { case .dailyPixel(let pixel, isFirst: _): return pixel.parameters + case .dashboardProtectionAllowlistAdd(let triggerOrigin): + guard let trigger = triggerOrigin else { return nil } + return [PixelKit.Parameters.dashboardTriggerOrigin: trigger] + + case .dashboardProtectionAllowlistRemove(let triggerOrigin): + guard let trigger = triggerOrigin else { return nil } + return [PixelKit.Parameters.dashboardTriggerOrigin: trigger] + // Don't use default to force new items to be thought about case .crash, .brokenSiteReport, diff --git a/LocalPackages/Account/Package.swift b/LocalPackages/Account/Package.swift index e27d552c00..7a4c46bace 100644 --- a/LocalPackages/Account/Package.swift +++ b/LocalPackages/Account/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["Account"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "81.5.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "82.0.0"), .package(path: "../Purchase") ], targets: [ diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 9b64c6775e..345b7ae606 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "81.5.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "82.0.0"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions") ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 5283f115be..301424ba96 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -31,7 +31,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "81.5.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "82.0.0"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions") ], diff --git a/LocalPackages/PixelKit/Sources/PixelKit/PixelKit+Parameters.swift b/LocalPackages/PixelKit/Sources/PixelKit/PixelKit+Parameters.swift index 6d5d65c57d..e3ab83f59d 100644 --- a/LocalPackages/PixelKit/Sources/PixelKit/PixelKit+Parameters.swift +++ b/LocalPackages/PixelKit/Sources/PixelKit/PixelKit+Parameters.swift @@ -53,6 +53,9 @@ public extension PixelKit { // Pixel experiments public static let experimentCohort = "cohort" + + // Dashboard + public static let dashboardTriggerOrigin = "trigger_origin" } enum Values {