From 48bdc9d8e55e412a8f9501a0b403e5bf44f56bd1 Mon Sep 17 00:00:00 2001 From: Alessandro Boron Date: Mon, 2 Sep 2024 11:58:40 +1000 Subject: [PATCH] Fix site owned by major network (#3286) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task/Issue URL: https://app.asana.com/0/1176956903599313/1208164650000833/f **Description**: There’s an existing [issue](https://app.asana.com/0/0/1207970856546695/1208097565947206/f) that causes showing the wrong education dialog for websites that are owned by a major network like Facebook and Google. In addition, the Privacy Dashboard [does not reflect weather an entity is owned by a major tracker](https://app.asana.com/0/0/1207970856546695/1208114308033513/f) This PR exposes the field “ownedBy” with the purpose of identifying when a tracker is owned by another entity. e.g. Instagram is ownedBy is Facebook --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 8 ++++---- DuckDuckGo/DaxDialogs.swift | 2 +- DuckDuckGo/TabViewController.swift | 3 ++- DuckDuckGoTests/ContentBlockingUpdatingTests.swift | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d563f45b8e..0fe4efe90d 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10678,7 +10678,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 190.0.2; + version = 191.0.0; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 63dfe15758..7195c709c9 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "2e9282d79f4a36ad851e9e130ffd936a5c8e74c7", - "version" : "190.0.2" + "revision" : "bbfd3f12ffbc958a7f97f2ccb4779025a44380b5", + "version" : "191.0.0" } }, { @@ -185,8 +185,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/TrackerRadarKit", "state" : { - "revision" : "1403e17eeeb8493b92fb9d11eb8c846bb9776581", - "version" : "2.1.2" + "revision" : "5de0a610a7927b638a5fd463a53032c9934a2c3b", + "version" : "3.0.0" } }, { diff --git a/DuckDuckGo/DaxDialogs.swift b/DuckDuckGo/DaxDialogs.swift index 649ccbeb7c..b90447f3c2 100644 --- a/DuckDuckGo/DaxDialogs.swift +++ b/DuckDuckGo/DaxDialogs.swift @@ -54,7 +54,7 @@ protocol ContextualOnboardingLogic { extension ContentBlockerRulesManager: EntityProviding { func entity(forHost host: String) -> Entity? { - currentMainRules?.trackerData.findEntity(forHost: host) + currentMainRules?.trackerData.findParentEntityOrFallback(forHost: host) } } diff --git a/DuckDuckGo/TabViewController.swift b/DuckDuckGo/TabViewController.swift index 0dc640db46..b1c50c6d1f 100644 --- a/DuckDuckGo/TabViewController.swift +++ b/DuckDuckGo/TabViewController.swift @@ -993,8 +993,9 @@ class TabViewController: UIViewController { public func makePrivacyInfo(url: URL) -> PrivacyInfo? { guard let host = url.host else { return nil } + + let entity = ContentBlocking.shared.trackerDataManager.trackerData.findParentEntityOrFallback(forHost: host) - let entity = ContentBlocking.shared.trackerDataManager.trackerData.findEntity(forHost: host) let privacyInfo = PrivacyInfo(url: url, parentEntity: entity, protectionStatus: makeProtectionStatus(for: host)) diff --git a/DuckDuckGoTests/ContentBlockingUpdatingTests.swift b/DuckDuckGoTests/ContentBlockingUpdatingTests.swift index 6d9456d1b4..b57c10b1b3 100644 --- a/DuckDuckGoTests/ContentBlockingUpdatingTests.swift +++ b/DuckDuckGoTests/ContentBlockingUpdatingTests.swift @@ -278,7 +278,7 @@ final class ContentBlockingUpdatingTests: XCTestCase { static let tracker = KnownTracker(domain: "tracker.com", defaultAction: .block, - owner: KnownTracker.Owner(name: "Tracker Inc", displayName: "Tracker Inc company"), + owner: KnownTracker.Owner(name: "Tracker Inc", displayName: "Tracker Inc company", ownedBy: nil), prevalence: 0.1, subdomains: nil, categories: nil,