Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For third party requests differentiate if they are affiliated with first party #1003

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

miasma13
Copy link
Contributor

@miasma13 miasma13 commented Sep 24, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/414709148257752/1208376794617030/f
iOS PR: duckduckgo/iOS#3386
macOS PR: duckduckgo/macos-browser#3343
What kind of version bump will this require?: Minor

Description:
When loading a website and some of the allowed third party requests may not be recognized as trackers but by their URL they may belong to the same entity as the website. For that cases we should mark their state as .allowed(reason: .ownedByFirstParty) (instead of .allowed(reason: .otherThirdPartyRequest)).

Steps to test this PR:
See parent task for testing steps.

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

let thirdPartyRequest = DetectedRequest(url: trackerUrlString,
eTLDplus1: requestETLDp1,
knownTracker: nil,
entity: entity,
state: .allowed(reason: .otherThirdPartyRequest),
state: .allowed(reason: isAffiliated ? .ownedByFirstParty : .otherThirdPartyRequest),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a test for this? I think TrackerResolver is pretty well tested so it would be good to include this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mind that the update is not in TrackerResolver (as the request is not matching any tracker definition, and essentially we have a non-tracker third party request that came from affiliated domain).
I will try to extend the ContentBlockerRulesUserScript test where the change is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bwaresiak I have updated the tests to cover this case

Copy link
Collaborator

@bwaresiak bwaresiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @miasma13 that's great :)

@miasma13 miasma13 merged commit 20469bb into main Sep 27, 2024
7 checks passed
@miasma13 miasma13 deleted the michal/fix-owned-by-first-party branch September 27, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants