tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 34ede80bb52f4465edbee27cbb0a39aafa17834f
parent 568e69b41af5f6ae53f4d8424762cc62aedd5725
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date:   Fri, 21 Nov 2025 21:57:54 +0000

Bug 1998361 - add a webcompat intervention for www.doctolib.de; r=ksenia,webcompat-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D273641

Diffstat:
Mbrowser/extensions/webcompat/data/interventions.json | 18++++++++++++++++++
Abrowser/extensions/webcompat/injections/css/1998361_doctolib.de-hide-app-recommendation.css | 15+++++++++++++++
Atesting/webcompat/interventions/tests/test_1998361_doctolib_de.py | 31+++++++++++++++++++++++++++++++
3 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json @@ -6011,5 +6011,23 @@ } } ] + }, + "1998361": { + "label": "doctolib.de", + "bugs": { + "1998361": { + "issue": "firefox-blocked-completely", + "matches": ["*://*.doctolib.de/*"] + } + }, + "interventions": [ + { + "platforms": ["android"], + "content_scripts": { + "css": ["1998361_doctolib.de-hide-app-recommendation.css"] + }, + "ua_string": ["Chrome", "add_Firefox_as_Gecko"] + } + ] } } diff --git a/browser/extensions/webcompat/injections/css/1998361_doctolib.de-hide-app-recommendation.css b/browser/extensions/webcompat/injections/css/1998361_doctolib.de-hide-app-recommendation.css @@ -0,0 +1,15 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * www.doctolib.de - site blocks Firefox for Android + * Bug #1998361 - https://bugzilla.mozilla.org/show_bug.cgi?id=1998361 + * WebCompat issue #186920 - https://github.com/webcompat/web-bugs/issues/186920 + * + * The site blocks Firefox on Android, and if we bypass the block they show a + * "use the app, or use Chrome" button. We might as well hide that, too. + */ +.MuiDrawer-root:has(#app_description) { + display: none !important; +} diff --git a/testing/webcompat/interventions/tests/test_1998361_doctolib_de.py b/testing/webcompat/interventions/tests/test_1998361_doctolib_de.py @@ -0,0 +1,31 @@ +import pytest + +URL = "https://www.doctolib.de/appointments/eyJfcmFpbHMiOnsibWVzc2FnZSI6Ik56TXdNRFV3TlRFeU1RPT0iLCJleHAiOm51bGwsInB1ciI6ImFwcG9pbnRtZW50In19--8828380aa4726a4c5e5f887a55ae459629f24c25e979d14373b22c722b2de264/telehealth_diagnostic" +COOKIES_CSS = "#didomi-notice-agree-button" +APP_RECOMMENDATION_CSS = "[aria-label='Weiter mit Firefox']" +ENTRY_BUTTON_CSS = ".dl-button-primary" +SUPPORTED_TEXT = "Mikrofon" +UNSUPPORTED_TEXT = "Inkompatibler Browser" + + +@pytest.mark.only_platforms("android") +@pytest.mark.asyncio +@pytest.mark.with_interventions +async def test_enabled(client): + await client.navigate(URL, wait="none") + client.await_css(COOKIES_CSS, is_displayed=True).click() + client.await_css(ENTRY_BUTTON_CSS, is_displayed=True).click() + assert client.await_text(SUPPORTED_TEXT, is_displayed=True) + assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True) + + +@pytest.mark.only_platforms("android") +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_disabled(client): + await client.navigate(URL, wait="none") + client.await_css(COOKIES_CSS, is_displayed=True).click() + client.await_css(APP_RECOMMENDATION_CSS, is_displayed=True).click() + client.await_css(ENTRY_BUTTON_CSS, is_displayed=True).click() + assert client.await_text(UNSUPPORTED_TEXT, is_displayed=True) + assert not client.find_text(SUPPORTED_TEXT, is_displayed=True)