Skip to content

Commit

Permalink
Fix site owned by major network (#3286)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alessandroboron authored Sep 2, 2024
1 parent 496f43b commit 48bdc9d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -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"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/DaxDialogs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
Expand Down
3 changes: 2 additions & 1 deletion DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGoTests/ContentBlockingUpdatingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 48bdc9d

Please sign in to comment.