From a75e09ff6bfff0709e6a457f1c3478326cbb3dc5 Mon Sep 17 00:00:00 2001 From: Rendijs Smukulis Date: Wed, 18 Dec 2024 11:39:12 +0200 Subject: [PATCH] Validate 'isFirstParty' logic for tracker that only has eTLD+2 domain defined (#132) * Added a test that validates that, when Tracker is defined for a eTLD+2 domain (e.g. bad.etld-plus-two.site), tracker requests are correctly Ignored * Fixed whitespaces --- .../domain_matching_tests.json | 7 ++++++ .../tracker_radar_reference.json | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tracker-radar-tests/TR-domain-matching/domain_matching_tests.json b/tracker-radar-tests/TR-domain-matching/domain_matching_tests.json index 6186e11..22b32af 100644 --- a/tracker-radar-tests/TR-domain-matching/domain_matching_tests.json +++ b/tracker-radar-tests/TR-domain-matching/domain_matching_tests.json @@ -34,6 +34,13 @@ "requestType": "script", "expectAction": "ignore" }, + { + "name": "same party ignore with deeper subdomain", + "siteURL": "https://bad.etld-plus-two.site/", + "requestURL": "https://bad.etld-plus-two.site/script.js", + "requestType": "script", + "expectAction": "ignore" + }, { "name": "tracker loads ignore", "siteURL": "https://bad.third-party.site/", diff --git a/tracker-radar-tests/TR-domain-matching/tracker_radar_reference.json b/tracker-radar-tests/TR-domain-matching/tracker_radar_reference.json index 9a831c9..aff7c77 100644 --- a/tracker-radar-tests/TR-domain-matching/tracker_radar_reference.json +++ b/tracker-radar-tests/TR-domain-matching/tracker_radar_reference.json @@ -255,6 +255,21 @@ "rules": [], "default": "ignore" }, + "bad.etld-plus-two.site": { + "domain": "bad.etld-plus-two.site", + "owner": { + "name": "Test Site for Tracker Blocking With eTLD+2", + "displayName": "Bad Third Party Site eTLD+2", + "privacyPolicy": "", + "url": "http://bad.etld-plus-two.site" + }, + "prevalence": 0.1, + "fingerprinting": 3, + "cookies": 0.1, + "categories": [], + "default": "block", + "rules": [] + }, "tracker.test": { "domain": "tracker.test", "owner": { @@ -819,6 +834,13 @@ "prevalence": 0.1, "displayName": "Test Site for Tracker Blocking" }, + "Test Site for Tracker Blocking With eTLD+2": { + "domains": [ + "bad.etld-plus-two.site" + ], + "prevalence": 0.1, + "displayName": "Bad Third Party Site eTLD+2" + }, "Tests for formatting": { "domains": [ "format.test" @@ -876,6 +898,7 @@ "bad.third-party.site": "Test Site for Tracker Blocking", "sometimes-bad.third-party.site": "Test Site for Tracker Blocking", "broken.third-party.site": "Test Site for Tracker Blocking", + "bad.etld-plus-two.site": "Test Site for Tracker Blocking With eTLD+2", "format.test": "Tests for formatting", "third-party.site": "Test Site for Tracker Blocking", "tracker.test": "Test Site for Tracker Blocking",