Skip to content

Commit 9149e88

Browse files
authored
Merge branch 'main' into as/blocking-tracking-content
2 parents e90d8a9 + ab0f04b commit 9149e88

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

modules/data/about_prefs.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@
240240
"groups": []
241241
},
242242

243+
"cookies-second-menu-item": {
244+
"selectorData": "isolateCookiesSocialMedia",
245+
"strategy": "id",
246+
"groups": []
247+
},
248+
243249
"cookies-manage-data": {
244250
"selectorData": "siteDataSettings",
245251
"strategy": "id",

modules/data/tracker_panel.components.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,17 @@
6767
"selectorData": "protections-popup-trackersView",
6868
"strategy": "id",
6969
"groups": []
70-
}
70+
},
71+
72+
"social-media-tracker-content": {
73+
"selectorData": "protections-popup-category-socialblock",
74+
"strategy": "id",
75+
"groups": []
76+
},
77+
78+
"social-media-subview": {
79+
"selectorData": "protections-popup-socialblockView",
80+
"strategy": "id",
81+
"groups": []
82+
}
7183
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_navigation import Navigation
5+
from modules.browser_object_tracker_panel import TrackerPanel
6+
from modules.page_object_about_prefs import AboutPrefs
7+
8+
SOCIAL_MEDIA_TRACKERS_URL = "https://panopticlick.eff.org/"
9+
# SOCIAL_MEDIA_TRACKERS_URL = "https://www.facebook.com/" # alternative site
10+
11+
12+
@pytest.fixture()
13+
def add_prefs():
14+
return [
15+
("network.cookie.cookieBehavior", 0),
16+
("privacy.trackingprotection.pbmode.enabled", False),
17+
("privacy.trackingprotection.cryptomining.enabled", False),
18+
("privacy.trackingprotection.fingerprinting.enabled", False),
19+
("privacy.fingerprintingProtection.pbmode", False),
20+
]
21+
22+
23+
@pytest.mark.xfail # blocked by bug 1866005
24+
def test_blocking_social_media_trackers(driver: Firefox):
25+
"""
26+
C446406: Ensure that ETP Custom mode with the option "Cross-site tracking cookies, and isolate other
27+
cross-site cookies" set in the Cookies section blocks social media trackers.
28+
"""
29+
nav = Navigation(driver)
30+
tracker_panel = TrackerPanel(driver)
31+
about_prefs = AboutPrefs(driver, category="privacy").open()
32+
33+
about_prefs.get_element("cookies-checkbox")
34+
about_prefs.get_element("cookies-second-menu-item").click()
35+
36+
driver.get(SOCIAL_MEDIA_TRACKERS_URL)
37+
nav.open_tracker_panel()
38+
39+
driver.set_context(driver.CONTEXT_CHROME)
40+
41+
tracker_panel.get_element("social-media-tracker-content").click()
42+
social_media_subview_title = tracker_panel.get_element("social-media-subview")
43+
assert (
44+
social_media_subview_title.get_attribute("title")
45+
== "Social Media Trackers Blocked"
46+
)

tests/security_and_privacy/test_cookies_not_saved_private_browsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object import Navigation, PanelUi
5-
from modules.page_object import AboutPrefs, GenericPage, GoogleSearch
5+
from modules.page_object import AboutPrefs, GoogleSearch
66
from modules.util import BrowserActions
77

88

0 commit comments

Comments
 (0)